News for hackers. Stuff that matters.
Re:Frege: A JVM pure functional programming language in the ... by tieTYT on Thursday November 07, 2013 @01:51PM (#6691501)
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.

Re:Frege: A JVM pure functional programming language in the ... by voxfrege on Thursday November 07, 2013 @02:01PM (#6691598)
> 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.

Re:Frege: A JVM pure functional programming language in the ... by andrewflnr on Thursday November 07, 2013 @02:46PM (#6691926)
I suspect the GP is more worried about community support for the language than other people making fun of them for using it. :)
Re:Frege: A JVM pure functional programming language in the ... by voxfrege on Thursday November 07, 2013 @04:43PM (#6692622)
Sure, 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 and 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.

Re:Frege: A JVM pure functional programming language in the ... by dustingetz on Thursday November 07, 2013 @03:52PM (#6692293)
Any 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.
Re:Frege: A JVM pure functional programming language in the ... by voxfrege on Thursday November 07, 2013 @03:57PM (#6692339)
Not true.
Re:Frege: A JVM pure functional programming language in the ... by cgag on Thursday November 07, 2013 @01:57PM (#6691555)
I'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?
Re:Frege: A JVM pure functional programming language in the ... by tieTYT on Thursday November 07, 2013 @02:28PM (#6691798)
That'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.
Re:Frege: A JVM pure functional programming language in the ... by chongli on Thursday November 07, 2013 @03:37PM (#6692213)
It'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.

Re:Frege: A JVM pure functional programming language in the ... by tieTYT on Thursday November 07, 2013 @03:52PM (#6692299)
I 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

Re:Frege: A JVM pure functional programming language in the ... by chongli on Thursday November 07, 2013 @08:36PM (#6693872)
Most 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?

Re:Frege: A JVM pure functional programming language in the ... by tieTYT on Friday November 08, 2013 @01:34PM (#6698137)
It was a little over 6 months ago. I installed it from this: http://www.haskell.org/platform/
Re:Frege: A JVM pure functional programming language in the ... by chongli on Friday November 08, 2013 @10:51PM (#6700623)
Ahh. Have you ever used MSYS+MinGW? It's pretty much a necessity for developing POSIX-based tools on Windows.
Re:Frege: A JVM pure functional programming language in the ... by lmm on Thursday November 07, 2013 @09:10PM (#6693997)
Scala 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.
Re:Frege: A JVM pure functional programming language in the ... by tieTYT on Friday November 08, 2013 @01:36PM (#6698149)
What other languages have you programmed in?
Re:Frege: A JVM pure functional programming language in the ... by lmm on Friday November 08, 2013 @07:50PM (#6700139)
More 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).
Re:Frege: A JVM pure functional programming language in the ... by islon on Friday November 08, 2013 @07:52AM (#6695776)
"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.