4 ms·
The key is in another comment on this thread: > Lots of these things that look like syntax problems are in fact design problems surfaced by the compiler. A lo
by steveklabnik 7y ago
The key is in another comment on this thread:
> Lots of these things that look like syntax problems are in fact design problems surfaced by the compiler.
A lot of people are finding value in the rules Rust provides. This is irrespective of domain. The strict compiler helps you refactor code in ways that less strict languages don't. You still can do it, of course, you just have a lot less help.
The trick is, is the initial hit in productivity worth it, until you get up to speed?
That said, of course everything doesn't need to be in Rust. But there's a reason it's finding broader appeal than purely systems stuff.
- sdegutis 7y agoI think this is misplaced causation. Don’t discount the fact that a significant number of programmers just like novelty and like Rust because it’s new in the same way Haskell is new to a Java dev. That said, Rust’s domain does seem wider than just systems programming. It has the right abstractions to be suitable for (edit: some) higher level things like web apps. Personally Rust is turning into what I was assuming and hoping Go was going to turn into back in 2010: a static language that does most of what we all used dynamic languages for, without too much extra difficulty. (That is, after you get used to the borrow checker’s rules.)
- shepmaster 7y ago> because it’s new in the same way Haskell is new to a Java dev Do you have any hypotheses about why we don't see as much publicity for Haskell then?
- sdegutis 7y agoHey nice to see you here, your SO posts have tremendously helped me learn Rust. I think Haskell is just too abstract for most of us. I love Rust traits and see how it directly came from Haskell but I couldn’t learn Haskell even after like 3 serious tries. Maybe a good portion of the problem is in the documentation and not the language? That said, the extremist purity is simply impractical compared to Rust which gets 90% of the way there without forcing all the architectural dances Haskell does. Just my opinion.
- shepmaster 7y agoYou are quite welcome! I can't add much to the Haskell part as I've only ever used it sparingly. In many aspects, I view Rust as only having one or two small things that are new (or at least new in a non-research programming language). Its big strength is combining a lot of existing good ideas in a principled manner.
- sdegutis 7y agoI’d agree, basically Haskell is focused on academic purity and abstract experimentation while Rust is focused on being equally practical and innovative at the same time.
- vperez 7y agoHaskell is actually used by companies to solve practical problems, a non trivial example being Facebook: https://www.youtube.com/watch?v=mlTO510zO78 https://www.youtube.com/watch?v=mlTO510zO78 Not too bad for an abstract experimentation.
- zozbot234 7y agoHaskell is easier to learn than Rust because it's literally just math. There is no "dropping" variables and no need to side-step the lack of GC, because you never "drop" a variable that you've stopped using in a math proof. You just let the GC deal with all that stuff. And you don't have a "stack" vs. "heap" distinction, instead you work directly in terms of function arguments and the returned values. You have currying so you can work naturally with parameterized and partially-applied functions, just like in math, etc. Lazy evaluation for "infinite" sequences and objects. That kind of stuff.
- sdegutis 7y ago> Haskell is easier to learn than Rust because it's literally just math. That explains why it was so hard for me to learn: I'm awful at math. The most advanced math I could understand was high school algebra.
- marcosdumay 7y agoDon't we? I think I see more posts about Haskell than Rust here on HN. (What makes sense, since fits a larger set of applications.)
- discreteevent 7y agoWere you there when Haskell was new to the mainstream? For a few years there seemed to be nothing else on proggit.
- slx26 7y agosorry for the tangent, but what has Go turned into in your opinion? (I'd believe it fits quite well your definition)
- sdegutis 7y agoIt seems to have remained pretty much exactly as it arrived.
- crystaldev 7y ago> higher level things like web apps. Frankly any language that makes me write "some string".into(), and all of the other nonsense of Rust, is not suitable for writing string processing applications (as opposed to utilities, such as ripgrep). The business logic of any Rust application that deals mostly with strings is hopelessly obtuse and/or obscured. Languages like Perl, Python and Ruby, or even JavaScript and Java, are more suitable. Rust focuses on and succeeds at being an improved C++, no reason to use it for everything.
- sdegutis 7y agoWeb frameworks convert strings to business logic, web apps deal only in business logic. Fortunately the web framework is only written once to support multiple web apps.
- crystaldev 7y agoThat sounds nice, but practically a lot of web app development can't be perfectly modeled by a type system. There's a lot of string munging and bashing, because at the end of the day we deal with messy human inputs, and the required bookkeeping makes that tedious and inexpressive in Rust.
- iopq 7y agoIf "some string".into() is your #1 complaint you haven't used Rust enough
- throwaway894345 7y agoRust is great and I'm really glad it exists; however, I'm skeptical that anyone ever "gets up to Python speed" or "gets up to Go speed", at least provided "speed" means "time to an acceptable result" and not "time to perfect" or "time to pacifying rustc". It's a laudable aim, but I don't think we're close. There's still a lot that Rust makes you think about that Python/Go/etc don't, such as memory management and lifetimes. Even if you are very good at thinking about those things, the cost isn't zero. Of course, Rust gives you a lot in exchange for the reduced velocity--safety and performance; however, those are tradeoffs and we should talk about them as such. It feels dishonest to present Rust as "as productive as Python" even with the "(given enough experience)" caveat.
- steveklabnik 7y agoI feel like these days, provided there’s a library and I’m not writing stuff from scratch, I’m just as fast at Rust as I am with Ruby. I spent way more time debugging Ruby problems and fixing bugs than I pay upfront with Rust. It really depends on how you measure productivity. But also, I don’t think that “makes you think about memory” is that simple. I don’t have to think about memory in Rust very often at all: that’s what the compiler is for! When I make a mistake, it corrects me, and I’ve only thought about it for a few moments.
- crystaldev 7y ago> I pay upfront with Rust. But you do pay up front! That's a big deal if your design is not set in stone (which is not a synonym for "prototyping").
- steveklabnik 7y agoI also think this is not a simple question; Rust’s rules provide critical feedback during that early phase. It’s valuable when getting started too. The prototype phase may last slightly longer, but I end up much closer to the final design with its help. (Again, as always, YMMV.)
- throwaway894345 7y ago