For those interested in compiling down to Javascript with a strongly and statically typed language, there's a brilliant proper subset of Haskell that compiles down to Javascript called "Fay": https://github.com/faylang/fay/wiki
Also Roy, which is statically typed (with type inference) and is designed for JS interop. It's also written in JS and can be installed with just npm install roy http://roy.brianmckenna.org/
I haven't written any Elm but having written some Haskell I can say it's surprising how often you _don't_ need a debugger in a functional language. I doubt Elm not having a debugger is as difficult as, for instance, Javascript or Coffeescript not having a debugger would be.
Paraphrasing a great programmer: "The best debugger is your brain". I have no issue with people using a debugger, but it is not a must in order to debug, imho.
The bigger problem I encountered trying it out yesterday was that it (at the moment) is fairly happy to generate an empty page and not give any compiler errors.
I assume that will change, but it made it pretty hard for me to get started with the language.
That said, I hope it changes, because Elm looks really neat!
This is not a statement about the skills of other developers. This is a statement about the applicability of JavaScript to the sorts of problems people are trying to solve with it. There are a lot of nice things about JavaScript that people didn't quite understand or appreciate in the early days, but that doesn't change the fact that the HTML5 stack is deeply flawed in many ways for the needs of application developers. That shouldn't be surprising or controversial: All of these technologies were developed in a simpler time for a simpler set of problems.... and in a rush.
It's fairly crazy, but then again there are ~700 programming languages listed on Wikipedia, so really, there are just a lot of programming languages in general.
In terms of Foo->JS there seem to be two main camps, at least that I've noticed: writing a "better" JS (CoffeeScript / Dart et al), and writing something that converts your language to JS so you don't have to learn JS (ClojureScript, Scala.js etc) at all.
The latter can have ~700 of those before you've even started to duplicate yourself, so there is still a ways to go :P
Arguably there are only half a dozen or so "real" contenders in the former category (in the same way when you decide you want to learn a new programming language you don't pick from all ~700).
I recently attended a coding dojo where we wrote code in elm and tests in coffeescript. I was new to both languages but I was surprised how easier elm felt compared to coffeescript (note: I have some haskell background ;]).
Here are the results: https://github.com/dzsodzso63/PreziCodingDojo/tree/master/fr...
Great news that Evan can dedicate fully to Elm as his main job. I'm very curious about the language and its departure/simplification over traditional DOM manipulation with JS. I hope the best for the project and would love to see some effort for the compiler targeting asm.js :D
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.
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 :)
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.
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 ;)
I think i also got confused the first time i saw that syntax (being used to C-like languages hehe). It started making lots of sense once i got familiar with the concept of currying and functions as first-class values.
Suppose you have a function f with type Int -> Int -> Int (you can read it as "it takes two integers and returns an integer" or "it takes one integer and returns a function that takes an integer and returns an integer"), then:
f
is the function itself, and it is a usable value.
f 42
is a function of type Int -> Int, and a perfectly valid value too. And
f 42 33
is just and Int.
It's like with each application you take one arrow from the function type; until you get something that's not a function any more :)
It's just new and you're not used to it. There's nothing wrong with finding new and different syntax confusing, as long as you're willing to keep an open mind.
If you use it for a while, you'll get used to it. After a while, I've found it makes the most sense. I think it's better because it reduces the amount of syntactic noise in the code.
It's a simple design decision. Function application is the most important part of the language. So it gets the best syntax: none.
A lot of modern mathematics also drops the parens, especially in areas related to modern algebra. It really makes the most sense and is less ambiguous, with parens not being overloaded between grouping and application.
I was really impressed by elm, but I strongly prefer working with a library that provides some of the features without transpiling. If anyone else is interested, I'm looking for some help with my project: https://github.com/jlatt/frp.js
I think the idea here is that you aren't /forced/ into inversion of control. That is, if it is clearer to write things side by side, instead of separated into another callback function, you can keep them together.
[+] [-] Ixiaus|13 years ago|reply
[+] [-] rtfeldman|13 years ago|reply
[+] [-] jallmann|13 years ago|reply
http://ocsigen.org/js_of_ocaml/
The site has some cool demos including webgl, canvas, and a OCaml toplevel (REPL).
[+] [-] zem|13 years ago|reply
[+] [-] revelation|13 years ago|reply
At this point, go to the next blackboard. Write after me:
You can not debug Elm. There is no debugger. You can not debug Elm. There is no debugger.
[+] [-] icarus127|13 years ago|reply
[+] [-] PuercoPop|13 years ago|reply
[+] [-] triplepoint217|13 years ago|reply
I assume that will change, but it made it pretty hard for me to get started with the language.
That said, I hope it changes, because Elm looks really neat!
[+] [-] halacsy|13 years ago|reply
[+] [-] egeozcan|13 years ago|reply
Every time I see such strongly worded statements, I get amazed by how the authors got to analyze the skills of every developer in the world.
[+] [-] subb|13 years ago|reply
For us/In my opinion, the cost of writing Javascript is just too high.
See? Now the rage is gone! I think I'm going to sell this trick...
[+] [-] snprbob86|13 years ago|reply
[+] [-] gonehome|13 years ago|reply
I didn't realize how many there were.
[+] [-] SCdF|13 years ago|reply
In terms of Foo->JS there seem to be two main camps, at least that I've noticed: writing a "better" JS (CoffeeScript / Dart et al), and writing something that converts your language to JS so you don't have to learn JS (ClojureScript, Scala.js etc) at all.
The latter can have ~700 of those before you've even started to duplicate yourself, so there is still a ways to go :P
Arguably there are only half a dozen or so "real" contenders in the former category (in the same way when you decide you want to learn a new programming language you don't pick from all ~700).
[+] [-] zem|13 years ago|reply
not gained much traction so far, but it's a useful place to post interesting links as i find them.
[+] [-] zsol|13 years ago|reply
[+] [-] zem|13 years ago|reply
[+] [-] epidemian|13 years ago|reply
[+] [-] steveklabnik|13 years ago|reply
And built some simple GUIs using Shoes: https://github.com/steveklabnik/frp_shoes
[+] [-] jcurbo|13 years ago|reply
[+] [-] aristidb|13 years ago|reply
[+] [-] weego|13 years ago|reply
[+] [-] IanChiles|13 years ago|reply
[+] [-] halacsy|13 years ago|reply
[+] [-] efnx|13 years ago|reply
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 ;)
[+] [-] fabokzs|13 years ago|reply
[+] [-] jessedhillon|13 years ago|reply
[+] [-] epidemian|13 years ago|reply
Suppose you have a function f with type Int -> Int -> Int (you can read it as "it takes two integers and returns an integer" or "it takes one integer and returns a function that takes an integer and returns an integer"), then:
is the function itself, and it is a usable value. is a function of type Int -> Int, and a perfectly valid value too. And is just and Int.It's like with each application you take one arrow from the function type; until you get something that's not a function any more :)
[+] [-] tikhonj|13 years ago|reply
If you use it for a while, you'll get used to it. After a while, I've found it makes the most sense. I think it's better because it reduces the amount of syntactic noise in the code.
It's a simple design decision. Function application is the most important part of the language. So it gets the best syntax: none.
[+] [-] sixbrx|13 years ago|reply
[+] [-] efnx|13 years ago|reply
[+] [-] d0m|13 years ago|reply
[+] [-] Dewie|13 years ago|reply
[+] [-] egonschiele|13 years ago|reply
[+] [-] AndreasFrom|13 years ago|reply
[+] [-] tingletech|13 years ago|reply
http://www.instinct.org/elm/
[+] [-] obviouslygreen|13 years ago|reply
[+] [-] 205guy|13 years ago|reply
[+] [-] jlatt|13 years ago|reply
[+] [-] j_s|13 years ago|reply
https://github.com/Reactive-Extensions/RxJS
[+] [-] Nekorosu|13 years ago|reply
[+] [-] cuttooth|13 years ago|reply
[+] [-] saosebastiao|13 years ago|reply
[+] [-] boothead|13 years ago|reply
[+] [-] nahname|13 years ago|reply
[+] [-] laszlok|13 years ago|reply
[+] [-] icarus127|13 years ago|reply
[+] [-] zeckalpha|13 years ago|reply
[+] [-] jluan|13 years ago|reply
[+] [-] wheatBread|13 years ago|reply