Introducing Elm to a JavaScript Web App
noredinktech.tumblr.com
noredinktech.tumblr.com
Pros:
- All the Joys of functional programming .
- Once you satisfy the compiler you can be fairly sure that code will just work.
- FRP saves you from callback hell.
- Fairly easy Javascript Integration via Ports( also see con on this)
- Time traveling debugger ( see con about this)
- Active mailing list.
- Automatic package versioning which more or less works for the most part
- Pure render function ( popularized by ReactJS), makes writing/debugging UI's trivial and painless.
- "Concurrent" FRP
Cons:
- Javascript integration is very and tedious. You have to declare all your ports in main which breaks abstractions. There is "secret" way of integration via Native modules but this will break if compiler changes ( which does quite often ).
- Debugger/reactor won't work if you have ports, basically all non trivial apps.
- All the ui components have to be reimplemented since stuff like jqueryui/webcomponents don't work ( react suffers from this also)
- No support for isomorphic apps, its a client side only tech.
- Can't do code splitting. Compiler generates one big blob of js.
- Constantly changing terminology ( eg: mailbox)
- IDE's/code editors are on the same level as dynamic languages i.e no code completion, refactoring ect.
- It generates beautiful javascript code
- It can separate PureScript modules into nodejs modules
- It has an even stronger type system than elm . For example, typeclasses
- has great interop with javascript
- Because it can compile to node.js modules, and can use node.js libraries, it's actually possible to write a Universal app (I tend to avoid isomorphic, as it means something totall different in pure functional programming languages like PureScript. (https://github.com/paf31/purescript-isomorphisms)).
One issue I have had so far is that once your project gets big, the compile times are pretty annoying. But apart from that; a great language!
Is there any in-depth recent comparison of elm and purescript somewhere? I found some links from almost a year ago but I assume it changed a lot since then.
[0] slamdata.com
[1] github.com/bitc/purescript/tree/psc-compile/psc-compileEven though this doesn't make grammatical sense and missing a word, somehow I understand exactly what it means.
The readme.md is wonderful.
https://yobriefca.se/blog/2015/07/29/zombie-dice-score-card-...
If you're running Clojure on the backend then you can cross-compile things like validation logic between the two. Use the same build tools and libraries.
The language looks very interesting and promising, I am very pissed by the fact that I had no chance to try it in our latest project because of those miserable bugs.
I fear something like this though will make it more difficult to hire and on board new people. I'm currently trying to hire 3 senior/very experienced JS developers and that's hard enough.
[0]: https://github.com/evancz/elm-todomvc/blob/master/Todo.elm
I'm excited that Elm could bring front end web developers to Haskell.
I'm excited that Haskell could bring more developers to ML-family languages.
Elm (lang) looks interesting though.
I wrote a blog post about it recently: http://adzerk.com/blog/2015/06/splint-functional-first-aid-j...
In a nutshell, it's a jQuery-friendly packaging of the ClojureScript runtime and the Javelin cell library, usable in existing applications. You basically write ClojureScript in JavaScript syntax.
Why?