Live data from Hacker News

Scala – 1 Star – Would Not Program Again

overwatering.org

1–10 of 324 posts

Re: Scala – 1 Star – Would Not Program Again

#2
I like Scala. It's a JVM language, it's extremely powerful, but maybe it's too powerful for us mere mortals.

Eclipse allows very fast compilation times, but when I tried sbt, I gave up because I CAN'T wait for compilation: we're in 2013, I'm using a quad core at 3.4GHz, 12GB of RAM and SSD, so I'm not ready to wait. Eclipse allows fast incremental compilation.

Scala's type system is very rich. I don't know if there exists any type that can't be expressed in Scala. Since I don't know if such a type exists, I don't miss it. But that's probably too much, and in the end, idiomatic Scala emerges: some libraries use the type system in an idiomatic way. It's working, but understanding method signatures turns into a nightmare. Then you must learn the arcane of Scala to understand how the library works.

However, if YOUR Scala is simple enough, then the language can be cool, cooler than Java, and productive. Can be mixed with Java, runs fine for J2EE...

Re: Scala – 1 Star – Would Not Program Again

#3
As a java Dev I have been watching Scala to see what people make of it. It seems like Scala is generally perceived as an academic exercise.

We all want more powerful tools and infinite expression but at what point are we bikeshedding languages instead of building transparently clear solutions?

Scala seems to be solving problems i dont have.

Re: Scala – 1 Star – Would Not Program Again

#4
post #2

I like Scala. It's a JVM language, it's extremely powerful, but maybe it's too powerful for us mere mortals. Eclipse allows very fast compilation times, but when I tried sbt, I gave up because I CAN'T wait for compilation: we're in 2013, I'm using a quad core at 3.4GHz, 12GB of RAM and SSD, so I'm not ready to wait. Eclipse allows fast incremental compilation. Scala's type system is very rich. I don't know if there e…

> I don't know if there exists any type that can't be expressed in Scala.

Scala has a very rich type system, but let us not get ahead of ourselves--Scala, being non-dependently typed, cannot type many useful programs.

For an example of a useful dependent type, consider giving division the type Number -> {x : Number | x != 0} -> Number. Giving division the type Number -> Number -> Number is similar to how older Javas would type List as List and require all get operations to cast from Object--in both cases, the type system is unable to guarantee that your program won't crash.

If you want a glimpse of the state of the art of programming with dependent types, try Agda[0].

[0]: http://wiki.portal.chalmers.se/agda/pmwiki.php

Re: Scala – 1 Star – Would Not Program Again

#6
post #2

I like Scala. It's a JVM language, it's extremely powerful, but maybe it's too powerful for us mere mortals. Eclipse allows very fast compilation times, but when I tried sbt, I gave up because I CAN'T wait for compilation: we're in 2013, I'm using a quad core at 3.4GHz, 12GB of RAM and SSD, so I'm not ready to wait. Eclipse allows fast incremental compilation. Scala's type system is very rich. I don't know if there e…

> I don't know if there exists any type that can't be expressed in Scala. Scala has a very rich type system, but let us not get ahead of ourselves--Scala, being non-dependently typed, cannot type many useful programs. For an example of a useful dependent type, consider giving division the type Number -> {x : Number | x != 0} -> Number. Giving division the type Number -> Number -> Number is similar to how older Javas…

How does that actually work? Does that "type" basically compile down to an added n != 0 check at runtime, or is there more sophisticated dataflow analysis/theorem proving going on?

Re: Scala – 1 Star – Would Not Program Again

#8
post #6

Earlier quoted context omitted.

> I don't know if there exists any type that can't be expressed in Scala. Scala has a very rich type system, but let us not get ahead of ourselves--Scala, being non-dependently typed, cannot type many useful programs. For an example of a useful dependent type, consider giving division the type Number -> {x : Number | x != 0} -> Number. Giving division the type Number -> Number -> Number is similar to how older Javas…

How does that actually work? Does that "type" basically compile down to an added n != 0 check at runtime, or is there more sophisticated dataflow analysis/theorem proving going on?

Usually it enforces statically that you cannot create an Integer that violates its preconditions. If you even do so dynamically it'll make sure there's a dynamic check before the dynamic value can substantiate the more specific type.

Re: Scala – 1 Star – Would Not Program Again

#9
post #6

Earlier quoted context omitted.

> I don't know if there exists any type that can't be expressed in Scala. Scala has a very rich type system, but let us not get ahead of ourselves--Scala, being non-dependently typed, cannot type many useful programs. For an example of a useful dependent type, consider giving division the type Number -> {x : Number | x != 0} -> Number. Giving division the type Number -> Number -> Number is similar to how older Javas…

How does that actually work? Does that "type" basically compile down to an added n != 0 check at runtime, or is there more sophisticated dataflow analysis/theorem proving going on?

The latter.

Check out https://en.wikipedia.org/wiki/Agda_(programming_language)

Re: Scala – 1 Star – Would Not Program Again

#10
post #6

Earlier quoted context omitted.

> I don't know if there exists any type that can't be expressed in Scala. Scala has a very rich type system, but let us not get ahead of ourselves--Scala, being non-dependently typed, cannot type many useful programs. For an example of a useful dependent type, consider giving division the type Number -> {x : Number | x != 0} -> Number. Giving division the type Number -> Number -> Number is similar to how older Javas…

How does that actually work? Does that "type" basically compile down to an added n != 0 check at runtime, or is there more sophisticated dataflow analysis/theorem proving going on?

It depends. In the most general case, you have to prove that the program you have given has the type you have asserted. This is similar to proving a mathematical theorem. Generally, the computer will assist you in this endeavor--for example, if you want to prove that A implies B, and A and B are linear inequalities, this can be solved automatically.
Post reply on HN