4 ms·
Sounds as if there are some bits of the article that could be tightened up or corrected, but I found the article very helpful. It's been about 10 years since I
by CoffeeDregs 12y ago
Sounds as if there are some bits of the article that could be tightened up or corrected, but I found the article very helpful. It's been about 10 years since I've coded in a C-style language (Java, C#, C++), but I'm very familiar with significant-whitespace languages (Python, Haskell, Coffeescript). The C-style-ish-ness of Rust has colored my perception of the language: the features sound great... but it looks like C? Admittedly, an unfortunately shallow perspective, but we've all got a lot of ground to cover and the view from 10km is necessarily incomplete.
The article's side-by-side examples really opened my eyes. I understand that Rust doesn't implement all of the functionality of Haskell, but it's comforting to see analogous functionality. So Traits aren't Type Classes; but as a beginner in Rust and as a first-order approximation, I can hear sorta-Type-Classes when I see Traits. That'll get me past the first steps, then I can dig into the detail of Traits.
I would suggest the author include a section on Side Effects since that's a big talking point around functional languages. Some allow them pretty freely (Ocaml) and some don't (Haskell). The only place I really see mention of this Big Deal is a little header to a code comparison saying "Recursion with side effects:".
- deleted 12y ago[deleted]
- thinkpad20 12y agoI find it odd that you're dividing languages based on syntax. Saying "significant-whitespace languages (Python, Haskell, Coffeescript)" suggests that there's some sort of commonality between them, when they're really vastly different languages. It's almost like saying "blue-white-red countries (France, Cambodia, Russia)" :P
- sjwright 12y ago> "blue-white-red countries (France, Cambodia, Russia)" As distinct from "red-white-blue" countries (USA, Cuba, North Korea) or "blue-red-white" countries (Netherlands, Australia, Iceland). After all, most programming languages are written as lines of code that represent statements that the computer must execute in some comprehensible order. Wake me up when this metaphor is deemed passé!
- CoffeeDregs 12y agosuggests that there's some sort of commonality between them There is a commonality: they use significant whitespace. I understand that this is a syntactic difference and, given that I said I had used each quite a bit, that they're quite different languages. That said, syntax is chosen for a reason and I feel most comfortable in the significant whitespace world. I'm excited by Rust but, shame on me, the syntax had confused me into thinking the language was more C-ish than Haskell-ish. My point in the grandparent was that the article did a nice job of changing my (admittedly shallow) opinion.
- knz42 12y agoThanks for the suggestion about side effects. I added a small sentence to that effect.