
Elm at Prezi - enum
http://engineering.prezi.com/blog/2013/05/21/elm-at-prezi/
======
Ixiaus
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>

~~~
zem
i like the looks of opa too: <http://opalang.org/>

~~~
klibertp
I would like it, but why oh why does it have Algol-like syntax? It started
with ML-like one IIRC, so whyyyy? (it's just an expression of disappointment,
not actual question)

~~~
zem
yeah, that disappointed me deeply too :(

------
revelation
_[..] and every line of JavaScript code costs too much time to maintain._

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.

~~~
halacsy
is there any theoretical limitation?

~~~
revelation
No, its plain old lazyness. All these "compiled to JS" language makers would
rather add more fancy syntactic sugar or extend the standard library than
getting their goddamn bases covered.

I have no problem with that, but please don't go on about how you are much
more productive in this language than in JS, and how much cheaper the code
will be to maintain.

~~~
cia_plant
I think it's ridiculous to call people "lazy" who wrote an entirely new
language from scratch and released it for free, because it's lacking one
feature.

------
egeozcan
> The cost of writing JavaScript is just too high

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
Usually, to calm myself, I reword it like this :

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...

~~~
aero142
I was taught in early rhetoric and composition classes that it is poor style
to include "In my opinion" and other qualifiers in pieces that are clearly
rhetorical or opinion based. The repetition is unneeded. In engineering
discussions it is very common to differentiate between opinions and knowns.
When discussions happen between people who don't agree on these things,
someone gets annoyed. The engineers get annoyed when people state opinions as
fact and think the other person is making unjustified assumptions. The non-
engineers get annoyed and think that the other person is being pedantic.

------
fossuser
Here's a list of languages that compile down to Javascript:
[https://github.com/jashkenas/coffee-script/wiki/List-of-
lang...](https://github.com/jashkenas/coffee-script/wiki/List-of-languages-
that-compile-to-JS).

I didn't realize how many there were.

~~~
SCdF
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).

~~~
lucian1900
> so you don't have to learn JS

So you don't have to use a language you find deficient, so you can share code
with your backend, so you can use the same tools you're used to ...

------
zsol
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...](https://github.com/dzsodzso63/PreziCodingDojo/tree/master/frpDojo)

~~~
zem
livescript is a more haskellish descendant of coffeescript:
<http://livescript.net/>

------
epidemian
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

------
steveklabnik
I've really enjoyed playing with FRP, I even wrote a little gem in Ruby for
it: <https://github.com/steveklabnik/frappuccino/>

And built some simple GUIs using Shoes:
<https://github.com/steveklabnik/frp_shoes>

~~~
jcurbo
Me too, I did a project for grad school using FRP.
<https://github.com/jcurbo/functionally-reactive-solar-system>

------
aristidb
It seems like Haskell users are quite intent on not using Javascript... Elm is
written in Haskell. So is Fay. And of course ghcjs.

~~~
weego
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.

~~~
jschmitz28
> 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.

~~~
discreteevent
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?)

~~~
chongli
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.

------
jessedhillon
I find function application without parentheses enclosing the parameter list
to be highly unreadable. Is there something wrong with me?

~~~
tikhonj
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.

~~~
jessedhillon
Can you give an example of composed function application? E.g.,

    
    
      f(a, b, g(x, y))
    

Thanks

~~~
tikhonj
You use parentheses only for grouping. So

    
    
        f a b (g x y)
    

is how you would write your example. In Elm, you could also use the function
application operator to avoid writing the parentheses:

    
    
        f a b <| g x y -- EDIT: flipped the operator around
    

In Haskell, this would be done with $, which used to exist in Elm as well:

    
    
        f a b $ g x y
    

Once you get used to mentally parsing the $ as grouping the rest of the
expression together--admittedly, it does take a little while--the last version
is probably the most readable. At least that's what I've found.

~~~
wheatBread
Small revision, the second code line should be:

    
    
        f a b <| g x y
    

Just like F# :)

~~~
weavie
F# could also write that as g x y |> f a b. Which can read much more
intuitively - you are sending the results of g x y to the function f a b.

(I think its that, I'm a little rusty..)

------
egonschiele
I am so excited! It's nice to see a functional language like Elm getting
financial support from a company.

------
AndreasFrom
Elm 0.8 was recently announced with a range of improvements for those
interested: <http://elm-lang.org/blog/announce/version-0.8.elm>

------
tingletech
not to be confused with the elm, the old unix mail client:

<http://www.instinct.org/elm/>

~~~
obviouslygreen
I knew this was unlikely to be the subject of the article but clicked through
anyway... oh well.

~~~
kbenson
I was really hoping someone had compiled Elm to JS. That would give me some
hope that mutt would be next...

------
jlatt
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>

~~~
j_s
See also Microsoft Research's Reactive Extensions for JavaScript, released
under the Apache License 2.0:

<https://github.com/Reactive-Extensions/RxJS>

~~~
alipang
Or even better, Bacon.js

<https://github.com/raimohanska/bacon.js>

~~~
j_s
Thanks for the heads up!

Do you have time to explain why bacon is better than Reactive Extensions, and
thus the only frp library for JavaScript that you chose to link to? I don't
have too much experience with frp in general (primarily just the Reactive
Extensions for .NET), and even less with JavaScript implementations, so I'm
not really in a position to begin making the comparison.

Edit: ah, found <https://github.com/raimohanska/bacon.js#for-rxjs-users> for
starters!

~~~
boothead
It's _much_ simpler for a start - you've got a good chance of being able to
read and understand all of the code in an afternoon.

------
Nekorosu
Elm is the future and I'm glad to see it now has some good company's support.

~~~
cuttooth
Elm is the future as much as Java is dead in the software development
industry.

~~~
encoderer
> Elm is the future as much as Java is dead in the software development
> industry.

Correct me if I'm wrong, but it seems like what you've done here is just take
one narrow interpretation of Nekorosu's comment and used that as the basis for
a dismissive reply that offered no value.

\--- _Dateline 1995:_

Nekorosu: "Java is the future"

Cuttooth: "Java is the future as much as C is dead in the software development
industry" \---

It's a big industry, cut. There's room for everybody.

~~~
cuttooth
The point was that JavaScript is king and this "Elm is the future" suggests
that it'll be a major player. Right now it's a niche toy language. There's
room for plenty of those, sure, but it takes years of work and development for
a language to become worth its salt. Java had its fair share of issues for a
while, and arguably still does.

------
saosebastiao
Awesome...you have me intrigued. I would worship the ground you walk on if you
targeted asm.js.

------
boothead
Slightly off topic but does anyone know of ans FRP library for python?

------
nahname
Inversion of control is a good thing. Why would you want to avoid it?

~~~
icarus127
I'm genuinely curious, why do you think inversion of control is an unqualified
Good Thing™?

~~~
alipang
Because of certain limitations in Java-style type systems...?

------
jluan
Congratulations, Evan!

~~~
wheatBread
Ahhhh, I recognize that user name! Thank you!! :D

