4 ms·
As a programmer who's getting annoyed and tired of Java's boilerplate, I welcome this. I went from Haskell to Clojure to JavaScript. I loved Haskell the langu
by tieTYT 13y ago
As a programmer who's getting annoyed and tired of Java's boilerplate, I welcome this. I went from Haskell to Clojure to JavaScript.
I loved Haskell the language. What I don't is third party libraries are usually directly or indirectly (through a dependency) tied to an OS. I've heard, even on irc's #haskell, that it's hard to reuse code unless you're on linux. Coming from Java, this is a deal breaker for me.
Then I tried Clojure. I liked it, but I found it very challenging to refactor and mentally debug my code. I missed all the benefits of static typing. core.typed seemed like an answer, but when you compare it to other languages it seems to triple the verbosity which is a real turn off.
JavaScript (via CoffeeScript) is a pretty good middle ground, but immutable state is nearly impossible. If I get lazy, it's so easy to go back to a OO/procedural style and I don't like that. That probably does have its benefits, but not when you're trying to learn a new programming paradigm.
I know very little about Scala, but I get a terrible impression from it. Where Clojure is about simplicity, Scala seems to be about complexity.
Since I learned Haskell, I wished there was a way I could use it and have it "just work" when I decide to use a library. Frege may be the answer. I've heard of it a long time ago. My concern is that I'd be 1 of 3 people who'd be using it. But nothing's perfect.
- cgag 13y agoI'm confused as to how javascript is a good middle ground. What does it give you that Clojure doesn't? You do mention the fact that it encourages imperative code and loses immutability. How does it improve refactoring or debugging?
- tieTYT 13y agoThat's a fair question and I don't understand it myself. Perhaps it's because the Firefox/Chrome dev tools are so useful. Perhaps its because I understand what the errors are trying to tell me. In JS I usually have a good mental model of the data I'm dealing with. I didn't have that with Clojure. I didn't have it in Haskell either, but the Haskell compiler would immediately get in my face about it until I fixed it.
- voxfrege 13y ago> My concern is that I'd be 1 of 3 people who'd be using it. This concern is probably well founded. :) And yet. Remember, you get Java source code from the Frege compiler, and once you pack up your JAR with Proguard, say, nobody will be able to tell you didn't write it in Java. (Well, slightly exaggerated, but you could have used some obscure library, who knows?) So, if you have a small project, or some Haskell project without too many GHC extensions you want for some reason on the JVM, give it a try.
- andrewflnr 13y agoI suspect the GP is more worried about community support for the language than other people making fun of them for using it. :)
- voxfrege 13y agoSure, nothing can replace a big community. OTOH, it looks like the Poster did have bad experience with Haskell community, though. A small community is superior insofar as they are more motivated to help, and are more likely to take (critical) feedback into account. I think it is fair to say that the Frege community (currently about 6 more or less active contributors) does its best, judging from http://stackoverflow.com/questions/tagged/frege http://stackoverflow.com/questions/tagged/frege and https://groups.google.com/forum/#!forum/frege-programming-language https://groups.google.com/forum/#!forum/frege-programming-la... Of course, if someone demands, say, to implements GADTs or multi-param type classes by tomorrow, the answer will be gentle, but not affirmative.
- dustingetz 13y agoAny data structures on the public API would have to be marshaled from whatever JVM language into fredge. Even sharing code between scala and java can be painful and obvious.
- voxfrege 13y agoNot true.
- chongli 13y agoIt's a real shame that FFI-dependent Haskell libraries don't build out of the box on platforms other than Linux. If you really like the language, have you considered some workarounds for this problem directly? It may be a lot easier to do a workaround than to switch to a new language entirely. It sounds like multi-platform support is important to you, how do you intend to deploy your software? In many cases, you can get away with rolling up binaries and not worrying about trying to actually build the software on your target machine.
- tieTYT 13y agoI tried to get it to work, but it's really hard. Imagine you barely know the language and you barely understand how binary libraries work in linux and you're getting these errors that you've never seen before. You ask for help but it seems like you're the 2nd person on the planet who's ever experienced this issue. You read the post of the 1st guy, but for some reason his solution doesn't work for you and you don't understand why. Most people in #haskell told me to switch to linux which seems like a ridiculous solution. I documented my struggle as another HN comment you can read here: https://news.ycombinator.com/item?id=5615683 https://news.ycombinator.com/item?id=5615683
- chongli 13y agoMost people in #haskell told me to switch to linux which seems like a ridiculous solution. Yeah, that's really unfortunate. This problem will continue to persist as long as people keep switching to linux to avoid it or abandoning the language altogether. How long ago was your attempt and how did you install Haskell itself on your system?
- lmm 13y agoScala is the most enjoyable language I've ever programmed in. Most of the complexity is superficial or shaped to the problem; there are a lot of features and they can be combined to make complex things, but each of them makes sense, and there's very little in the way of fiddly edge cases to memorize.
- tieTYT 13y agoWhat other languages have you programmed in?
- lmm 13y agoMore than I could remember all of, but certainly Python, Java, C, TCL, Javascript, C++, ML, Perl, 6502 assembler. I've stuck my head around the door of Haskell, so to speak, but not written anything substantial in it; I haven't tried Clojure (I've never heard a reason to use it over Scala, and I've become very attached to powerful type systems).
- islon 13y ago"Where Clojure is about simplicity, Scala seems to be about complexity." I have the same opinion. I would really like to try a haskell on the jvm but I'd prefer if it'd be strict instead of lazy.