3 ms·
In my tinkering with both Go and Rust, and liking the looks of both, I get vague feelings like Go is to Python as Rust is to Perl. This may be damning praise fo
by SwellJoe 12y ago
In my tinkering with both Go and Rust, and liking the looks of both, I get vague feelings like Go is to Python as Rust is to Perl. This may be damning praise for some folks, but it makes me lean slightly toward Rust more than Go (slightly). There seems to be almost an anti-library culture in Go (i.e. "use the standard library" is almost a mantra in Go) whereas in Rust, there's more than one way to do it (even this early in its existence).
That said, in many ways neither language is like the one I've compared it to, probably in enough ways that it's not a useful comparison for much other than this one metric (the TIMTOWDIness of the language). But, it's how my head is processing these two quite novel (to me) languages; which would make sense, as I've written more code in Python and Perl than probably anything else, so they're the known things I compare these unknown things to.
- thirsteh 12y agoYou could say that Go is Python and Rust is Haskell, because, well, Rust is basically Haskell cleverly disguised as a C-style language so as to not scare away imperative programmers.
- vezzy-fnord 12y agoCould you elaborate on that? Rust has a powerful static type system, HOFs, is expression-based, has an unusually good pattern matching engine for its intended area, assumes immutability by default and uses a notation for function signatures typically associated with FP, but I don't think those are enough to call it a "cleverly disguised Haskell". In fact, it has been my observation that the language has been getting progressively less functional since its early days. Not that I consider this to be bad.
- thirsteh 12y agoSure -- basically what you said: http://science.raphael.poss.name/rust-for-functional-programmers.html#straightforward-equivalences http://science.raphael.poss.name/rust-for-functional-program... Of course it's not exactly Haskell, but it's arguably closer to FP than it is to C, yet manages to be approachable to imperative programmers. I think this is fantastic.
- nightski 12y agoThat would be a really tough argument to make. It goes to great lengths to give control over memory layout and control and lacks a LOT of the features of Haskell's type system. It's a lot more like a prettier D than Haskell. Not only that with every iteration it has been moving farther away from the FP paradigm.
- naasking 12y agoI think you mean GHC's type system, since Rust is arguably quite close to Haskell 98 in spirit, ie. algebraic types, lambdas, pattern matching, traits = single parameter type classes.
- Retra 12y agoI think the point is that it seems actively inspired by Haskell -- that the things people like about Haskell are the same things the designers of Rust want in their language.
- saosebastiao 12y agoAs far as I can tell, there is some Haskell inspiration in the form of typeclasses (traits in Rust), but almost everything else that resembles FP has a more common denominator in ML. (Even Haskell's type classes have some common lineage with SML Functors)
- agumonkey 12y agoReminds me of hop and house (haskell based OS) http://lambda-the-ultimate.org/node/299 http://lambda-the-ultimate.org/node/299 ~ 2004
- detrino 12y ago> Rust is basically Haskell cleverly disguised as a C-style language so as to not scare away imperative programmers. This comment is very condescending. It makes it seem as if C programmers are ignorant and Haskell programmers are enlightened. Haskell is a garbage collected, lazy, pure language which makes it unsuitable for many of the domains C-style languages are used in. These are also qualities not shared by Rust, which may explain why there is less resistance in its uptake by C programmers.
- thirsteh 12y agoOh, come on. Don't take things so seriously. There are tons of Haskell programmers who don't know C, too, and Rust is just as much of a way for them to reap the benefits of C as it is anything else.
- naasking 12y ago> Haskell is a garbage collected, lazy, pure language which makes it unsuitable for many of the domains C-style languages are used in. Don't be so sure! [1] You could simply use Haskell as a metalanguage to generate a C program that does what you need, just like they did with copilot. No Haskell runtime needed. [1] https://github.com/leepike/copilot-discussion https://github.com/leepike/copilot-discussion
- kyllo 12y agoI'd say Rust is more like C and OCaml had a baby.
- saosebastiao 12y agoAn amazing compliment, IMO.