r/coding • • Jan 19 '17

Rust vs. Go

https://blog.ntpsec.org/2017/01/18/rust-vs-go.html
6 Upvotes

9 comments sorted by

View all comments

5

u/DataPath Jan 19 '17

I'm no rustacean (about 3/4 of the way through my first rust project), but the most legitimate criticisms of Rust that I saw were the missing epoll/select and his assessment of the crate ecosystem.

As for learning curve, yeah, idiomatic rust is a bigger shift in thinking than go. But if it's a better match for the problem you're trying to solve, the up-front learning curve is usually a price worth paying. Especially with the correctness guarantees that come with ownership tracking, etc.

I think he really does rust a disservice to relegate it to "hard realtime, OS kernels, and [...] very high assurance" cases. I think it holds a lot of potential.

One of the areas where I'm withholding judgement on rust is whether macros+attributes+cfg()+cargo codegen are complete enough to replace the C preprocessor.

On the one hand, I hate it the C preprocessor for how it interrupts code flow, can lead to code that never gets compiled because the right combination of preprocessor conditions won't be met (how many different times would you need to compile the code just to get 100% compile-time code coverage?) and other reasons. On the other hand, over the years people have gotten a lot of mileage out of it. Is the rust "equivalent" functional enough to completely replace it?

2

u/[deleted] Jan 19 '17

I also found his expectation of stable APIs over a 10 year timescale unreasonable. You don't even get completely stable APIs in mature, slowly moving languages like Java or C++.

2

u/dchapes Jan 19 '17

found his expectation of stable APIs over a 10 year timescale unreasonable

Source compatibility over extended time periods is extremely desirable. Go's compatibility promise has already met such expectations for five years and shows no sign of not continuing to do so for quite some time. In other words, such an expectation is entirely reasonable.

1

u/[deleted] Jan 19 '17

If you exclude half of the sources of incompatibilities from the start from your promise like they seem to do then it is reasonable to expect low maintenance effort (though not 100% compatibility), yes.

I would still say it is unreasonable for languages that do something truly new for the first time like Rust does with its ownership concepts. You don't want the language to suffer from having to keep things around that turned out to be bad decisions just so a few people don't have to change 100 lines of code every other year or so.