News for hackers. Stuff that matters.
Re:Elm at Prezi by aristidb on Wednesday May 29, 2013 @01:52PM (#5787850)
It seems like Haskell users are quite intent on not using Javascript... Elm is written in Haskell. So is Fay. And of course ghcjs.
Re:Elm at Prezi by weego on Wednesday May 29, 2013 @02:38PM (#5788144)
The world seems to be intent on writing mountains of code to avoid writing javascript, and usually ending up with a system that compiles to more javascript than if they just wrote javascript. Saying javascript is broken is a nonsense, they mean they feel they should be above writing javascript due to its quirks and inconsistencies. Whatever they write the end result is still the "broken" language they wanted to avoid. It all seems like a huge waste of resources and smart people's time to me, but then I've been writing javascript for getting on for 15 years so perhaps im past it and don't "get it" anymore.
Re:Elm at Prezi by baddox on Wednesday May 29, 2013 @02:54PM (#5788278)
> and usually ending up with a system that compiles to more javascript than if they just wrote javascript

That's not really a useful or sufficient argument against languages that target JavaScript, since you won't be reading or maintaining the JavaScript code itself. You could say the same thing about assembly code ("languages which target assembly languages usually end up outputting more assembly code than if the programmer had just written the assembly code manually"). If you're really concerned about lines of code (which is itself somewhat troublesome), a more valid comparison would be the lines of Elm code versus the lines of human-written JavaScript code to implement the same thing.

Re:Elm at Prezi by jschmitz28 on Wednesday May 29, 2013 @02:49PM (#5788234)
> The world seems to be intent on writing mountains of code to avoid writing javascript, and usually ending up with a system that compiles to more javascript than if they just wrote javascript.

Does it really matter how much javascript gets created? That statement could be made for any higher level language where X lines of the higher level language compiles into 5X lines of the target language. Maybe you could hand write your program in the target language using only 4X lines, but the point of the higher level language is to make it easier for the programmer to avoid mistakes as well as reduce source code size, not necessarily compiled code size.

Re:Elm at Prezi by discreteevent on Wednesday May 29, 2013 @05:17PM (#5789165)
Except that when JavaScript is the target code size does matter because it has to come up over the wire no? That's why something like Dart advertises the fact that it does tree shaking. (Elm may aim for the same efficiency who knows?)
Re:Elm at Prezi by chongli on Wednesday May 29, 2013 @11:32PM (#5790748)
You can do tree shaking in JavaScript with tools like Google Closure Compiler and uglifyjs (a bit more limited). Any language which compiles to JavaScript aught to be able to make use of these tools.
Re:Elm at Prezi by IanChiles on Wednesday May 29, 2013 @01:58PM (#5787880)
I think that may not be the case - it may be more that Haskell is a fabulous language to write compilers and parsers in, and so lots of compilers and parsers are written in it :)
Re:Elm at Prezi by chongli on Wednesday May 29, 2013 @11:37PM (#5790764)
It's a bit of both. I will say that it's very frustrating to use other languages after adjusting to Haskell. The way it feels when it feels when you're out on your own without a helpful compiler to guide you? It's like losing your sense of balance!
Re:Elm at Prezi by halacsy on Wednesday May 29, 2013 @01:57PM (#5787871)
because JS is flexible, the VMs are really good recently and the web platform is tempting but haskell coders miss safety, succinct syntax and efficiency.
Re:Elm at Prezi by efnx on Thursday May 30, 2013 @11:50AM (#5793215)
Yes - I think once you start being productive with Haskell you prefer to work in languages with strong type systems that are purely functional (Haskell and subsets of it). When I work in Haskell it feels like a burden has been lifted from my shoulders - for real! Coming back to JS is simply painful.

I think more programmers would experience this if it weren't for Haskell's insane learning curve. It took me a ~year of casual learning and skimming before I could do anything useful. Very casual, though ;)

Re:Elm at Prezi by fabokzs on Wednesday May 29, 2013 @02:47PM (#5788216)
I'm wondering if we need a different testing approach for these new wave "functional programming languages".
Re:Elm at Prezi by abesto on Wednesday May 29, 2013 @03:27PM (#5788518)
You mean like QuickCheck? http://en.wikipedia.org/wiki/QuickCheck
Re:Elm at Prezi by zsol on Wednesday May 29, 2013 @04:49PM (#5788976)
hear, hear