4 ms·
Also, no plans to get rid of implicits apparently. Sorry Scala, we're not gonna be friends.
by MrBuddyCasino 9y ago
Also, no plans to get rid of implicits apparently. Sorry Scala, we're not gonna be friends.
- pul 9y agoNot fully, but implicit type conversion must be marked explicitly: https://medium.com/bigdatarepublic/key-takeaways-from-the-scala-days-keynote-702febe95c3d https://medium.com/bigdatarepublic/key-takeaways-from-the-sc...
- modersky 9y agoHere's the current state: https://github.com/lampepfl/dotty/pull/4229 https://github.com/lampepfl/dotty/pull/4229
- Cyph0n 9y agoImplicits are very powerful when used correctly, but are terrible if not.
- MrBuddyCasino 9y agoIf "<feature> is very powerful when used correctly, but terrible if not": think long and hard before adding to a language.
- lmm 9y agoCompletely agreed. Implicits are the one place where Scala genuinely pushes the art of language design a bit beyond what's really possible; I expect future languages to come up with a better solution to the same problem. But in the meantime the things they enable - typeclasses, extension methods, the magnet pattern - are too valuable to do without, and we can't just sit around and wait for the perfect language to arrive. I wouldn't want to have any more language features that pushed as hard as implicits do, but one somewhat-experimental feature in a language is ok, just about. I don't think Scala is a thousand-year language, but it strikes the best balance given the current state of the art.
- yawaramin 9y agoTypeclasses: barely workable–if the implementor knows how to save the caller from paying the 'import tax' Extension methods: too much potential for confusion Magnet pattern: no idea what that is Personally I feel OCaml strikes the best balance :-) But we may be arguing about an inch here rather than a mile.
- dionian 9y agowhich is why I'd be against adding them in Java and favor keeping the power in scala.
- YorkshireSeason 9y agoWhat is your main complaint with implicits? If you don't like them, why don't you add "Use of implicits forbidden" to your coding style guidelines, and check in code-reviews, and add a "grep implicit" check to your CI setup that refuses to commit Scala code with implicits? Let me paraphrase M. Odersky's PLDI 2017 keynote: The essence of Scala is implicits You can find it at https://www.youtube.com/watch?v=br6035SKu-0 https://www.youtube.com/watch?v=br6035SKu-0
- philipwhiuk 9y ago> If you don't like them, why don't you add "Use of implicits forbidden" to your coding style guidelines, and check in code-reviews, and add a "grep implicit" check to your CI setup that refuses to commit Scala code with implicits? Because Scala libraries that do useful stuff are infested with them. Akka loves the things. > main complaint They obscure complexity, pretending that complex stuff is simple. It makes simple stuff trivial but complex stuff harder.
- YorkshireSeason 9y ago> Akka loves the things. So? Treat Akka as a black box. You can always explicitly pass implicit arguments.
- MrBuddyCasino 9y ago"If you don't like them, why don't you add "Use of implicits forbidden" to your coding style guidelines, and check in code-reviews, and add a "grep implicit" check to your CI setup that refuses to commit Scala code with implicits?" Only someone who has never worked in a team before would suggest this.