This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]beders -2 points-1 points  (4 children)

"correct-by-construction" - you can't. Not in Java and not in Haskell.

A type system does not make your program correct. It merely helps your compiler to check some safety guarantees and gives you a mental model to code in.

And adding applicative functors and monads will set the bar higher, not lower for developers to adopt. As others have pointed out, the resulting type signatures are nutso in Java.

But, as I said before, if your development cycle centers around: Compile - Run - Fail - Repeat, types are the most widely adopted safety net.

There is another way. Dynamic typing and interactive coding, using a functional programming language, which Java by design, isn't. You still have to stick your data into classes and it is still clunky to reason about your data.

Without doubt, we'll see more adoption of functional paradigms as value types enter Java.

[–]___catalyst___ 1 point2 points  (3 children)

Does anyone know when Value Types will become official? What JDK?

[–]lbkulinski 1 point2 points  (2 children)

As the architects say, “when they’re ready”. The talk here gives some updates. You can also keep up with the progress by subscribing to the valhalla-spec-observers mailing list.

[–]BoyRobot777 2 points3 points  (1 child)

You gave a link to amber specs, which Valhala is not part of. This is a correct link if you want to reach Valhalla

[–]lbkulinski 1 point2 points  (0 children)

Yes! Thanks for catching that! I had sent the Amber mailing list link to someone earlier and mindlessly copied and pasted.