Functional programming on the JVM

Posted by    |      

Folks, all the blogs crowing about the incredible wonders of ohmigod functional programming!!!! — by which you mean using higher-order functions like map() and filter() in some language with ubiquitous side effects — are getting pretty tired. Back in the 80's, Smalltalk guys used to call that object-oriented programming. It's a stupid accident of history that Java doesn't have higher-order functions, and so putting them back in where they should have been all along isn't really some great paradigm shift. Now, there is a lot that the Java family of languages is in the process of learning from the really interesting work on type systems done in the academic community around languages like ML and Haskell, but higher-order functions are somehow the least interesting thing there.

My take: if you're really serious about functional programming being The Future Of Computing, write a Standard ML compiler for the JVM. ML has a powerful static type system and a clean syntax, is very well-thought-out and extremely well-specified, and is even quite readable, at least as far as functional languages go. And it's not a mishmash of itself with some other language ;-) Hell, if you get a compiler running, I promise to look seriously into the possibility of supporting ML as an alternative language for the new platform we're building for Ceylon.

Well, it was just a suggestion...

P.S. Yeah, I would have said Haskell, but I'm guessing that implementing non-strict evaluation on the JVM would be tough. And I don't think we would survive, sanity intact, the inevitable flood of ohmigod MONADS!!!!! blogs ;-)

Back to top