5 ms·
Rust has that built in, but managed to be a much more solid language (feature wise).
by MichaelGG 11y ago
Rust has that built in, but managed to be a much more solid language (feature wise).
- weberc2 11y agoI don't know, I want to like Rust, but every time I pick it up I feel like I'm relearning C++. It's learning curve is steep, the sorts of applications I write benefit more from solid development velocity and a good concurrency story. I might be wrong, but I get the feeling that Rust really only shines where performance and meticulous control are paramount. I want to like it, but it feels ill-suited to the applications that interest me. :(
- ntonozzi 11y agoI don't think there's anything wrong with that. Rust is designed for a specific market, and it sounds like you aren't part of it.
- weberc2 11y agoI agree; but I think I'm still allowed to be disappointed that my use cases aren't a good fit for so thoroughly-heralded a language. :)
- MichaelGG 11y agoDon't be disappointed. If you don't need the performance Rust offers, then use another ML-ish language. More expressiveness, none of the ownership issues (just GC).
- weberc2 11y agoWhich would you recommend for someone who prefers a C-like syntax, a good concurrency story, a comprehensive standard library, Java-esque speed, and dead-simple tooling (e.g., Go's tooling), and compilation to a static binary?
- MichaelGG 11y agoC# and F# can both compile to a static binary (Mono's AOT compiler), and meet your other requirements. I find it curious that "safety" wasn't one of the points. If you're looking for C-like though, you are probably not in any modern-featured language designer's aim.
- weberc2 11y ago> I find it curious that "safety" wasn't one of the points It was implied by the context of "ML" languages. That was my intention at least; I thought ML languages were characteristically safe. Regarding "C-like", I mostly mean syntax. I'm not too familiar with the ML family, but many FP languages have bizarre syntax which amplifies the difficulty of learning new concepts IMO.
- catnaroek 11y agoIt's not just about performance, but also (perhaps primarily!) correctness: making sure that resources (not just memory) are freed in the right places, that your code won't try to use resources that have already been freed, that the same object can't be mutated by two or more parties at any single point in time, etc.
- valarauca1 11y ago>I feel like I'm relearning C++ Because you are. You likely wrote widly unsafe things which are perfectly legal in C++. Rust is really just enforcing RAII which C++14 already has, and you've likely avoided.
- MereInterest 11y agoWait, people avoid RAII? With how useful it is in every circumstance, I can't imagine C++ without it.
- catnaroek 11y agoC++has had RAII for decades already. Actual Rust innovations are the borrow checker and dynamically sized types.
- pjmlp 11y agoYes, we were already using it on Windows to program COM in the mid-90's.
- cwzwarich 11y agoThe borrow checker is predated by Cyclone and other work on region systems. Rust added more polish, but none of the basic ideas are new.
- catnaroek 11y agoOf course, I'm aware that work on region systems dates back to the mid 90's, which is why I called Rust's borrow checker an “innovation” (the first time a product form factor or feature successfully makes it into a market) rather than an “invention” (coming up with a product concept that didn't exist before).
- weberc2 11y agoIt's not just the safety features; it's the syntax, the build system, the numerous kinds of strings, the difficulty of finding up-to-date documentation, etc. Rust just has a steeper learning curve than many newer languages. This is not to say that the learning curve is unjustified; only that it exists and is significant.
- MichaelGG 11y agoI don't know a whole lot about C++, but I've worked on projects using C. Seems to me Rust is straightforward and just enforces what you have to do in your mind otherwise. Once IDEs start coming around it should be quite competitive. I'll admit to thinking the same thing: I'll use Rust for the absolute critical parts, then F# for the rest. But more and more parts I'm writing are easy enough to do in Rust, and I get the perf as a bonus.
- takeda 11y agoRust really aims to be replacement for C. It allows you to program in low level, but you have much more powerful type checking and keeps track of ownership which reduces number of errors that plagued C language. Yes go also claims to be C replacement, but probably the only similarity is its simplicity, but unlike C it is not as expressive.
- BuckRogers 11y agoI haven't used Rust extensively, more Go for sure. But it seems to me that Go was aiming for simplicity more than being a true innovation. It's basically a compiled Python with type annotations and unfortunately a GC to spoil it all. Rust was aiming at innovating and advancing the PL space with meaning. I can't say looking back the time I invested with Go was well-spent. Rust is probably worth the effort if you have the need for what it offers. It just requires more out of you than Go does.
- deleted 11y ago[deleted]