8 ms·
Hi! Author here. Let me know if you have any questions. Andy, the same Andy mentioned in the article, wrote a blog post in 2014 with his perspective of what it
by chadaustin 10y ago
Hi! Author here. Let me know if you have any questions.
Andy, the same Andy mentioned in the article, wrote a blog post in 2014 with his perspective of what it's like to use Haskell in production, if you're interested. https://engineering.imvu.com/2014/03/24/what-its-like-to-use-haskell/ https://engineering.imvu.com/2014/03/24/what-its-like-to-use...
- rakpol 10y agoHoping for a little advice: I'm trying to push for some development culture changes at work, one of which is doing more local, incremental refactors rather than large, all-at-once changes (i.e. the sort of thing for which one books 'architecture meetings'). Since we'll hopefully be massaging large parts of the codebase, there's an opportunity to jump into something new with both feet. Question: what do you think of the thesis of pure4j [1] vis. frege [2]? Namely, are the advantages gained by switching to a haskell-like language far above those attained by simply forcing effects into a small part of the codebase? [1]: https://github.com/pure4j/pure4j https://github.com/pure4j/pure4j [2]: https://github.com/Frege/frege https://github.com/Frege/frege
- codygman 10y agoI can't speak for pure4j, but I would be very wary about suggesting Frege at my workplace to (what I'm assuming are) Java programmers. I feel like some Java programmers would have almost as much culture shock with something like Haskell as some of the php programmers at IMVU apparently did.
- rakpol 10y agoFair point, but it might almost be worth it just to suggest it just to see what the opposition is like -- if there isn't much, or any, go with Frege; otherwise, fall back to pure4j. I'd imagine framing the decision as picking from two choices would improve the odds of at least one being selected.
- pron 10y agoYou may want to consider http://www.ocamljava.org/ http://www.ocamljava.org/ instead of Frege.
- rakpol 10y agoThat definitely made the short list! I picked up ocaml for a side project and enjoyed the language quite a bit. However, ocamljava is either dead or dormant at this point (last commit to master in June of last year) and it seemed to only have had one major contributor -- it would seem irresponsible to adopt such a solution in light of that.
- pron 10y agoIn that case, it's almost as irresponsible to adopt Frege... It's not like it's got any real traction, either.
- rakpol 10y agoAah, fair point, it is pretty niche. Still, merely going off of their comparative contribution graphs [1] [2] and issue trackers [3] [4], it seems like Frege has a fair bit more throughput: for better or for worse, it seems like more _things_ are happening. Although I'll be the first to admit it's a misleading metric for determining the maturity of a project, it's still something. Imagine finding a bug in Frege: it seems like they merge even small patches from contributors, whereas ocamljava is essentially a one man show. Adopting ocamljava would probably mean forking and maintaining it too, whereas there's a possibility of just contributing to Frege. That's all just my opinion, of course, and I hardly have enough industry experience to back up its validity! 'Just sanity checking my reasoning :) [1]: https://github.com/Frege/frege/graphs/contributors https://github.com/Frege/frege/graphs/contributors [2]: https://github.com/xclerc/ocamljava/graphs/contributors https://github.com/xclerc/ocamljava/graphs/contributors [3]: https://github.com/Frege/frege/issues https://github.com/Frege/frege/issues [4]: https://github.com/xclerc/ocamljava/issues https://github.com/xclerc/ocamljava/issues
- 10y ago
- chadaustin 10y agoPersonally, I think you'll have more success with something more gradual than a complete syntactic overhaul. I've never used pure4j or frege but it sounds like pure4j is something you could try out incrementally, which could be quite immediately useful for your team. Best of luck!
- rakpol 10y agoThe idea behind both would be to introduce it incrementally, carving out parts of the codebase to be rewritten one section at a time. You're right, though; pure4j offers an immediate and easily obtainable win, so it'd definitely be an easier pill to swallow. Thanks :)
- Buttons840 10y agoScala is an obvious option as well. I haven't used Scala but it's surely more palatable to Haskellers than plain Java. Also. There is work underway to enable GHC to compile for the JVM.
- wtracy 10y agoTo expand on this suggestion: Scala isn't big on purity (AFAIK the language has no concept of pure functions out of the box) but it is big on immutable data types, and mostly-pure functions arise naturally when you're working with immutable types. Immutable types happen to be something that is familiar and comfortable to Java developers. I would therefore expect to meet a lot less resistance to "syntactic sugar and immutable classes" than "functional programming with pure functions" even if the end result is 80 percent the same.
- roflc0ptic 10y agoThis was the compromise our team made. Our team was having a bad time dealing with Spring. Our lead dev is a functional buff who really likes Haskell, and got us all hype about trying something new. We picked scala in lieu of Haskell because the learning curve with Haskell was a much harder sell. We avoid mutable data types unless there's a compelling reason (interop with Java libraries, for example), and most of our functions are implicitly pure. ScalaZ might have some purity constraint, idk. 5 months in with Scala and it has been a wonderful experience. Now I just have to convince our front end dev to switch over to Scala.js...
- MustardTiger 10y agoWe tried the same thing, but it did not go well at all. We picked scala because people should be able to learn it easier and more gradually. But we found as people learned FP using scala, they realized how much scala held them back. We ended up redoing a PHP project in scala, then as it was 80% done redoing it again in haskell. And then from there out using haskell for everything.
- 10y ago
- rjtobin 10y agoNot relevant to this particular blog post, but I just wanted to say thank you: one of your old projects, Sphere, had a big influence on me as a young programmer (in my early teens), and is a big part of why I got into programming. SCons is also awesome. I'm glad to see you are still doing cool stuff :)
- chadaustin 10y agoSuper cool! Glad I could help! Isn't it hilarious how almost everything you could do in Sphere is actually quite easy directly in browsers these days?
- rjtobin 10y agoHaha yeah. You might say that your choice of ECMAScript was prescient :)
- groovy2shoes 10y agoI toyed around with Sphere a bit, but RPG 6.5 was where it was at for me. I spent weeks poring over that code, and it was my first encounter with C++. I learned so much, especially from the implementation of the toolkit (tile editor, map editor, etc.). I never was able to compile it myself, though, as I didn't have access to a proper Borland C++ compiler for DOS, but that didn't matter so much as long as I could read the code and see the end result. Cheers!
- Bromskloss 10y agoI'd love to take your course on Haskell. :-)
- majewsky 10y agoI'm just learning Haskell through a university course. It's quite traditional in the author's nomenclature, with extensive discussion of laziness, currying and point-free notation. But it introduces monads very similarly to how he did it: starting with Arrays, drawing parallels to Maybes, then introducing Control.Monad.State through an assignment before moving on to IO. This has helped me a lot in grasping the concept behind monads.