
Elm 0.14 – Simpler Core, Better Tools - teamonkey
http://elm-lang.org/blog/announce/0.14.elm
======
dcre
If you're interested in Elm but don't really know what it's about, I highly
recommend Evan's Strange Loop talk, "Controlling Time and Space: understanding
the many formulations of FRP."

It will help to already have a bit of background in functional programming.

[https://www.youtube.com/watch?v=Agu6jipKfYw](https://www.youtube.com/watch?v=Agu6jipKfYw)

~~~
musername
Started watching, the slides animations are a nice enhancement. Are they
perhaps written in elm?

~~~
dcre
He works for a company called Prezi whose product is the slideshow software
he's using. God, I sound like a stalker, don't I.

------
pflanze
The Elm website is blank without JavaScript enabled. Here's a script to
extract the Markdown in the given page and optionally format it without having
to enable JavaScript in the browser:

[https://github.com/pflanze/de-elm](https://github.com/pflanze/de-elm)

(Edit: here's a copy of the content of the linked page:
[https://github.com/pflanze/de-
elm/blob/master/examples/annou...](https://github.com/pflanze/de-
elm/blob/master/examples/announce-0.14.elm.md) . Tell me if you don't like
this and I'll remove it again.)

~~~
3rd3
Why doesn’t elm provide text content separately in a machine-readable format,
for example in a set of hidden HTML elements?

~~~
riffraff
<noscript> is basically designed for this, I'd favor it's use too.

------
couchand
_The benefits are actually much deeper though. Now that we know exactly how
the API has changed, it is possible to automatically enforce strict versioning
rules. If there are breaking changes, the new release must be a major version
bump._

This is very interesting to me. It demands consideration: do we need a person
to manually bump the version anymore at all? If you can statically verify that
a change meets the criteria, couldn't the package publishing process
autoincrement the appropriate version segment and be done with it?

~~~
riffraff
there are probably cases in which you want to change the version independently
of API changes, i.e. "going stable" (0.x to 1.0), major internal changes, new
interfaces with deprecations of the old ones etc.

~~~
couchand
Good point, you still need an escape hatch to bump a version segment higher
than the minimum necessary one, for many reasons.

I'm not sure I agree that the phrase "going stable" really applies to a semver
project. The most stable release would just be the highest number in each
segment. Version 1.0.1 is almost by definition going to be more stable than
1.0.0, since the changes are only backwards-compatible bug fixes. At least
that's my understanding of semver.

~~~
riffraff
semver has a special case for 0.x, which is basically "before 1.0 there are no
guarantees". In their words:

> Major version zero (0.y.z) is for initial development. Anything may change
> at any time. The public API should not be considered stable.

(Yes, this means that you can use 0.x and declare yourself "semver compatible"
and break on any patch release)

------
rnhmjoj
What is the point of changes like [] to List, mod to %, . to << and >>? Is it
just aesthetics?

When I looked at Elm it was really similar to Haskell. After I learned a bit
of Elm I dove into Haskell. Now that I'm coming back to Elm I'm having
problems because I confuse this different syntaxes many times.

I hoped they could maintain the language more similar to it to make the switch
between them easier.

~~~
fallat
Yes, aesthetics. Here is another one:

: and :: are reversed.

They have no intention of making them more similar- in fact I was told there
is going to be more subtle diverging happening.

Elm was really cool for me too at first, but these subtleties are just a pain.
I am now using haste (haste-lang.org), which seems to have really come a long
way over the course of its 3 year life span. I highly recommend it to those
wanting to use Haskell as a front-end web development language.

~~~
rnhmjoj
Wow, haste is great. Thank you for sharing.

------
StevePerkins
Have there been any performance improvements under Firefox? Almost every Elm
demo that I've seen so far has been basically unusable under that browser.
I've been told that the issue is some difference between Chrome and FF with
canvas drawing... but regardless of where the fault lies, Elm is pretty much a
Chrome-only technology until that gets worked out.

~~~
jcollard
Someone please correct me if I am wrong but I believe the answer is yes. I
believe this is the relevant PR:

[https://github.com/elm-lang/core/pull/25](https://github.com/elm-
lang/core/pull/25)

I believe the original improvements were done here:
[https://github.com/jwmerrill/elm-animation-
frame](https://github.com/jwmerrill/elm-animation-frame)

I modified a game I wrote to use the modified run time. I can see a huge
difference between the two in Firefox.

Unmodified: [http://jcollard.github.io/elm-flyer-
old/](http://jcollard.github.io/elm-flyer-old/)

Modified: [http://jcollard.github.io/elm-
flyer/](http://jcollard.github.io/elm-flyer/)

~~~
jwmerrill
Author of that PR here. It may help Firefox some, but in my experiments I'm
still seeing that driving canvas animations with Elm performs much better in
Chrome than in Firefox.

If there are any Firefox engineers reading this, maybe there is a good
benchmark to be extracted out of this observation? I'd be interested in
discussing this with someone. Feel free to reach out at the e-mail address in
my profile.

------
davexunit
Awesome. I like the name change from 'lift' to 'map'. Also, the public API
diffs that the packaging tool provides looks very neat. Congrats to the Elm
team!

------
bjz_
It's nice to see that they have replaced Either with Result[0]. I wonder if
Rust's Result type[1] was the inspiration? (not sure if there is prior art)

[0]: [http://elm-lang.org/blog/announce/0.14.elm#making-error-
hand...](http://elm-lang.org/blog/announce/0.14.elm#making-error-handling-
easier)

[1]: [http://static.rust-
lang.org/doc/master/std/result/index.html](http://static.rust-
lang.org/doc/master/std/result/index.html)

~~~
wheatBread
I started looking into Rust again while picking the term "union type" because
of their choice to use the term "enum". I ran into the Result type in some
code I was reading and it just made so much more sense to me as a new person
learning the language. Basically, it made it self-evident to me that "a
library for error handling should be named with error handling in mind." You
will also see a Result type in some Haskell libraries so it's not
unprecedented there.

I also got tired of explaining "the good result goes in Right, because it's
'Right'" like I'm endlessly telling a bad dad-joke.

~~~
bjz_
Yeah, we used to have an Either type in the Rust std, but it was pretty much
never used because we had Result.

------
AlexanderDhoore
Elm really is fascinating... Am I the only one who thinks FRP is just a
reincarnation of dataflow programming?

I'm learning Verilog in my spare time, because I want to implement a
dataflow/FRP language in hardware. (People tried to build massively parallel
hardware in the past to run dataflow languages... I'm pretty sure it's a good
idea.) Should be interesting!

~~~
tree_of_item
That's like saying Rust is "just a reincarnation of imperative programming".
Dataflow is an extremely general category, there's a lot of room for important
differences; describing something as "dataflow" doesn't really tell you much
about it.

~~~
AlexanderDhoore
Well, of course I'm generalising here. It's just that, to me, dataflow and FRP
look very similar. At least once you go past syntax and superficial things.

(I just realised you meant to say that FRP is a subset of dataflow. I agree!)

------
lsjroberts
I used Elm for my Ludum Dare entry. As a first attempt using a functional
language I definitely did many things wrong, but I found it very easy to
iterate. Great language and I'm going to look into going further with it for
game development.

------
tree_of_item
Eh, that's a tagged union, but I think "union type" usually refers to untagged
unions like you see in more dynamic languages such as TypeScript and
Facebook's Flow. Tagged unions are typically called sum types. That is,
searching for "union type" is gonna give you results about untagged unions or
C style unions. I'm not sure this new terminology helps.

~~~
brandonbloom
Depending on who you ask, there's another established meaning of "union type"
when contrasting it against "sum type" in a safe context. Sum types are
discriminated unions in which each constructor tag in the union is disjoint
from each other member and all other types. In contrast, "union type" tends to
imply that you can share constructors/tags between types.

For example Julia:
[http://docs.julialang.org/en/release-0.3/manual/types/#type-...](http://docs.julialang.org/en/release-0.3/manual/types/#type-
unions)

Typed Racket: [http://docs.racket-lang.org/ts-
guide/beginning.html#%28part....](http://docs.racket-lang.org/ts-
guide/beginning.html#%28part._.Datatypes_and_.Unions%29)

Haskell: [http://okmij.org/ftp/Haskell/extensible/#open-
union](http://okmij.org/ftp/Haskell/extensible/#open-union)

And many more.

~~~
tree_of_item
This is precisely what I was describing, perhaps I wasn't clear enough. I
should have mentioned Typed Racket as well. Unless you think this is different
from what I said? Typed Racket's unions are just like TypeScript and Flow's
unions, in fact TypeScript uses a similar occurrence typing algorithm where
you need to do a type check in order to compute with a union value, e.g.

    
    
        if (isString(x)) {
          // only now can we call string functions on x
        } else if (isNumber(x)) {
          // only now can we call number functions on x
        }

~~~
brandonbloom
OK, then we're on the same page regarding Elm's name choice: That is, it's a
poor choice if they are actually disjoint unions aka sum types.

That said, forgive me pedantry for a moment: I think your use of the word
"tag" is unclear. Typically, both sum types and union types must be tagged. If
you think about something like the JVM, every object is tagged with a pointer
to it's class. Untagged, or "tagless", objects are closely related to
"unboxed" objects, but still not quite the same thing. The point is that the
tag is something that can be inspected, switched on, etc at runtime. Where as
a tagless representation does not require that runtime overhead.

It's possible to have a Union(int, String) or something like that where one
type is typically untagged and the other typically tagged. If the compiler
could eliminate the tag at runtime from context, then it would just eliminate
the union and substitute the type with either int or String directly. So if it
can't tell from context, it must actually make it a Union(Box<int>, String) so
it can discriminate by tag.

Tangential: There is of course a trade off in tagless representations in terms
of type system complexity and runtime cost. If you want to change from a
List<int> (specialized list of machine ints) to a List<Integer> (nullable
boxed ints), that's an O(N) operation to add the tags (and a more complex type
system).

~~~
jmite
The thing is, "sum types" really only works if you're familiar with the
analogy between boolean algebra and arithmetic (why OR becomes +).

Yes, they are disjoint union, but there's really no such thing as non-disjoint
union in a statically typed language i.e. that's what makes it typesafe.

~~~
tel
You can have "non-disjoint unions" in typesafe languages, you just will be no
longer capable of distinguishing between the types of the members.

------
thewarrior
Is anyone here using Elm in production ?

~~~
RehnoLindeque
We've been using it to render schematic symbols and PCB footprints at
CircuitHub.com (this has been going on for a couple of months). I'm testing it
out in other areas of the product at the moment, so if all goes well
additional Elm widgets might land on our site very soon.

------
shard
For a second I had thought that someone had released an update for the Elm
mail client. Color me disappointed (although I am more of a Pine guy myself,
up to ~2006 at least).

------
jmgrosen
That's pretty ridiculous. Literally the day after I start working on my Elm
project in a couple months...

Anyway, the changes here do look pretty nice. Looking at the docs, it seems
that they've added more examples, which is always appreciated! I still don't
like the impurity that comes with the Signal.Channel, though... not that I
have a better idea.

------
lucian1900
Very cool.

Interestingly enough, the dice is loaded. If you click long enough, you'll get
an upside down V shape.

~~~
davidrusu
There's actually 2 dices, so there are quite a few more ways to get a 7 than
to get a 2

7 = 1+6, 2+5, 3+4, 4+3, 5+2, 6+1

2 = 1+1, 1+1

~~~
e12e
Or, the difference between 1d12 and 2d6 (roll of one 12 sided die, vs summing
the roll of two six sided dice).

------
peapicker
I must be getting old... I saw the headline and thought "Isn't the elm mail
client at a higher version than that?"

