by facorreia · 10y ago · 0 comments
The tooling is amazing though.
> You lose some guarantees, but gain a lot, and the quality
> of a codebase will always be up to its programmers.
I started using Haskell because I thought it was cool how it could spread out work over multiple cores. I continue using it because of its guarantees, enabling me to do large refactors and be reasonably confident that the compiler has caught all errors (if I construct my types properly).I would argue that the only true value a compiler has to offer are guarantees. A compiler that is able to do something "most of the time" isn't worth much. So, losing some guarantees may be both crucial and irrelevant, depending on which guarantees we're talking about.
I think the answer that to that question appears to be yes [1], but I stopped experimenting. I am considering resuming my experiment now that Frege appears to be crystallizing a bit more.
The java interop is nice, albeit it imposes discipline (as it should). Since java doesn't care about side effects, most of the values returned from a java function call will be in a Mutable monad. Here [2] is a good walkthrough for how it is done in case you want to try it out.
[1] https://groups.google.com/d/topic/frege-programming-language...
[2] http://mmhelloworld.github.io/blog/2013/07/10/frege-hello-ja...
Do you have some examples for "compiler bug"?
1. (Search for "asInstanceOf"): http://typelevel.org/cats/tut/freemonad.html
2. (Finally fixed and will hopefully be released soon - yay!): https://issues.scala-lang.org/browse/SI-2712
3. https://twitter.com/extempore2/status/430456002392391681
4. http://pchiusano.blogspot.com/2011/05/making-most-of-scalas-...
5. (Anecdotal): Various pattern matching peculiarities.
Compiler bugs: As long as I write code on the happy path and steer clear of scalaz/shapeless/cats, the compiler is pretty well-behaved and I can go months without getting a compiler crash. However, when I add those in and start writing pure functional code with complicated types that hits the intersections of various features (e.g., GADTs, package objects, implicits), I get a few crashes per week related to known bugs.
It works pretty well, and I am not trying to complain too much about all the mileage I get out of Scala and the excellent tooling! Just trying to get the most out of it.