3 ms·
Scala ?
by paramk 11y ago
Scala ?
- djsumdog 11y agoExactly!
- greydius 11y agoAll we need is higher kinded types and implicits.
- incepted 11y agoHigher Kinded Types, yes, but implicits... Yuck. Scala has definitely proven them as a failed experiment, I hope we will never seem them again in languages going forward.
- gclaramunt 11y agounless, you're proposing a global implicits dictionary a-la Haskell, leave them alone, I much prefer to give up subtyping...
- Others 11y agoI really like Scala. It is a really interesting language, and a productive one for me to program in. However, I agree that implicits are a bad feature. 90% of the confusing bits of Scala are because implicits exist and are, well, implicit.
- acjohnson55 11y agoImplicits are tricky, but they are the best way I know of to solve the problems they do. Other languages (JavaScript, Swift, etc.) have essentially open classes, where attachment of additional functionality to a type impacts a program globally. Implicits make it much easier to scope these extensions. They are also quite useful for wiring up context (take Akka's ActorSystem, for example) at the declaration level, so that the bodies of your classes and functions only explicitly talk about your domain objects, rather than framework machinery. They're also a big part of the power behind projects like Shapeless, which are quite useful for scrapping boilerplate. Most controversially, they are also used to implement implicit type conversions. Modern idiomatic Scala discourages this, but it can sometimes be helpful.