4 ms·
How I wish Scala would be more like OCaml instead of a disgusting mess of useless sigils and buzzwords.
by _pmf_ 13y ago
How I wish Scala would be more like OCaml instead of a disgusting mess of useless sigils and buzzwords.
- octo_t 13y agoWhat "useless sigils and buzzwords" does Scala have?
- lmm 13y agoThe Dispatch periodic table is probably a discredited meme by now, but it's all too representative of many scala libraries. Akka uses ! and ? for its two most important methods (and a pet moan: the experimental typed channel proposal uses :+: for type-level lists despite their being functionally the same as shapeless' :: HList). Shapeless constraints can't even be typed on a normal keyboard - they're things like ->[A]#λ or <<:[B]#λ (real examples from my day job). Scalaz is only slightly better (pulling up a random example I see "@@" used as an operator). Sometimes these sigil operators have non-sigil aliases but that's the perl trap of "there is more than one way to do it" - one can't just ignore the sigils because one has to read code as well as write it (and given that even quite major libraries like scalaz come with no scaladoc, one is often forced to read someone else's code to figure out what a function does). I love scala, but I do find myself wishing method names were required to be alphanumeric.
- octo_t 13y agoBoth ! and ? have their history in Erlang, it was a conscious design decision to use those sigils. I've not looked at typed channels at all, but yeah, thats annoying. Scalaz and Shapeless are designed to do crazy type level stuff, taking their inspiration from type/group/set theory. And yes, I agree Scala is the successor to Perl (but I have no problem with that :p )
- pjmlp 13y agoYeah, I also prefer the ML syntax.
- owyn 13y agoThere is Yeti, an ML style language for the JVM: http://mth.github.io/yeti/ http://mth.github.io/yeti/ (edit to address questions/comments) I haven't actually used it so I have no idea if it's ready for "real" use (whatever that means! everyone has a different definition) However, it's under active development which is more than you can say for ML. I only found it when I saw the above comment and thought "I wonder if there is an ML for the JVM" but I have put it on my own todo list to check it out. And I know the pain of which you speak pjmlp, I have to use PHP for my day job...
- pjmlp 13y agoThanks for pointing it out, but on my line of work I will jump of joy the day I will ever manage to use anything besides Java on the JVM. Fortune 500 enterprise development, offshoring and modern programming languages are hard to combine.
- edwintorok 13y agoYou can compile OCaml to run on the JVM, although I never tried / needed to do such a thing: http://ocamljava.x9c.fr/preview/ http://ocamljava.x9c.fr/preview/
- mjt0229 13y agoIs yeti ready for real use?
- mjt0229 13y agoYes. Scala is a great language, but it devolves into line noise so quickly. ML's relative lack of brackets is so nice, and so is the automatic currying of multi-argument functions. I also really love discriminated unions, and it's really hard to simulate them in Scala.
- bronxbomber92 13y agoI agree with the first two points about ML, but I'm curious where you've had problems using Scala's case classes as you would ML's discriminate unions (minus the added verbosity)?