5 ms·
Explicitly passing &self is lame. Haskell's implicit parameters are clever.) Actually, the language fells Rubysh - a bit of syntax from here and there. Swift
by dschiptsov 10y ago
Explicitly passing &self is lame. Haskell's implicit parameters are clever.)
Actually, the language fells Rubysh - a bit of syntax from here and there. Swift has much more refined and concise syntax, because they paid way more attention to details.
Patter matching on type constructors could have been taken from Haskell - it won't hurt.
Block syntax with where clause (why?) is really bad.
The syntax inconsistency and awkwardness aren't major issues, but it is telling.
- pcwalton 10y agoNone of your examples make sense to me. You say "explicitly passing self is lame" and then praise Golang for "feature restraint" when it does the exact same thing. I don't know what "pattern matching on type constructors" means. You use the constructor syntax to pattern match in Rust. There is no such thing as "block syntax with where clause". Where clauses go on signatures, not blocks. This is also the exact same syntax as Swift, which you praise for "more refined syntax".
- dschiptsov 10y agoGolang is praised for attention to details and fair attempt to attain that kind of balanced mix of complementing each other features. The principles, rather idealistically, are outlined here: http://karma-engineering.com/lab/wiki/Bootstraping http://karma-engineering.com/lab/wiki/Bootstraping Pattern matching is technically almost unchanged since Standard ML, but in Haskell the syntax is refined by perfectionists (in best possible meaning of this word). Swift, obviously, trying very hard to look familiar for [Objective-]C (but not Java) programmers, and to follow the principle of less astonishment, produced much more concise syntactic choices, and the devil is in the details. BTW, if one wants to see another example of carefully crafted language, there is PLOT http://users.rcn.com/david-moon/PLOT3/ http://users.rcn.com/david-moon/PLOT3/
- pcwalton 10y agoThis is very philosophical and also entirely unresponsive to my points.
- AlisdairO 10y ago> Explicitly passing &self is lame Explicit passing of &self (or &mut self, or self) might be 'lame', but it also gives more clarity as to what the code is doing. I can't say it's ever once given me pause.