
Elm 0.19.1 - roebk
https://elm-lang.org/news/the-syntax-cliff
======
sunseb
I built a project using Elm last summer. Here is my quick feedback:

\+ The language syntax is very nice and refreshing.

\+ It's a joy to work with the compiler.

\+ If it's compiling, it's working! No runtime exceptions.

\+ Static typing!

\+ Functional programming!

\- The language doesn't have component composition (like in React or Vue) and
you end up having huge chunks of spaghetti code (but to be fair, it kind of
works because of the compiler).

\- It's complicated to implement routing and to build a Single Page
Application.

\- Only pure functions in Elm, so doing API calls and generating random
numbers are unnecessary hard.

\- It's a pain to parse JSON.

\- There is no variable shadowing, so naming your stuff is harder than it
should be.

\- Vue embraces HTML, Elm avoids HTML, and it's really a pain to build HTML
view in Elm. <div><a href="hello">world</a></div> becomes div [] [ a [ href
"hello" ] [ text 'world" ] ]

\- There is a lack of leadership and community building in this project. We
don't know what's going on and where the project is going. It's like a black
box. No roadmap. All issues on Github, all posts on Elm Discourse get no
response.

So in the end, Elm is an interesting beast, but I think it's too academical
and not really practical for serious projects.

~~~
toastal
HAML and Pug/Jade got popular precisely because HTML/XML is harder to read and
easy to make mistakes with all the closing delimiters you need. Making HTML a
function with two arguments for virtual DOM is simpler than needing to make an
XML parser with special rules ala JSX where people constantly get hung up on
className, etc., which compiles to this same binary functions you use in Elm
is API.

Pure functions are definitely a selling point. Random number generation needs
to be in an isolated part of your app unless it's a toy. Because it deals with
IO much like reading from disk, it should have a "hard"-ness to it.

~~~
sunseb
Ok let's see. Please can you convert this Vue code into Elm code?

[https://pastebin.com/trFAuJ7T](https://pastebin.com/trFAuJ7T)

Good luck!

~~~
hombre_fatal
The fact that you think this is some sort of puzzle makes me question how far
you actually got with Elm at all.

What's even the "good luck!" part for? Good luck knowing about List.map?

~~~
KurtMueller
It was presented to him as a puzzle and he solved the puzzle.

How far do you think he got in Elm?

------
shritesh
Elm already was the gold standard when it comes to helpful error messages and
it's amazing to see that they're still working to make it even better. I hope
other languages follow suit.

~~~
thiht
> Elm already was the gold standard when it comes to helpful error messages

I read this all the time about Elm, but did you actually try Elm for a real
world project?

I did, and Elm error messages were one of the most painful point of the
compiler: they're beautiful but very often completely unrelated to what's
actually going wrong. They actually drove me _away_ from the actual errors
more than once.

~~~
shritesh
> did you actually try Elm for a real world project?

I'm actually writing Elm at work and we have two separate Elm apps in
production.

YMMV but Elm with elm-graphql has been the most productive and confident I've
ever been writing frontend code.

------
markdog12
Gave it a whirl online, tried to change WebGL import to Webgl, thinking it
wouldn't do anything helpful.

It told me the lib import was prob a typo, with suggestions, and WebGL at the
top:

    
    
      You are trying to import a `Webgl` module:
    
      11| import Webgl
    
                 ^^^^^
      I checked the "dependencies" and "source-directories" listed in your elm.json,
      but I cannot find it! Maybe it is a typo for one of these names?
    
          WebGL
          Set
          Svg
          Array
    
      Hint: If it is not a typo, check the "dependencies" and "source-directories" of
      your elm.json to make sure all the packages you need are listed there!

------
miki123211
I hate using ^ to indicate an offending position on a line. For those
unfamiliar, the idea is that you display two lines, the erroneous one, and one
full of spaces, with a single ^ in it, where the ^ is directly underneath the
offending character. This is bad for accessibility and screen readers. They
read that the ^ is here, but actually finding out what the wrong character is
is problematic. Python does this, I think Rust too, and now Elm. Just provide
a column number next to the line number, just like Golang does. Any decent
editor will let me check what column I'm on. The ^ can, of course, be kept for
the rest, but the column number would be a welcome addition.

~~~
DougBTX
I can’t speak for the others, but at least in Rust the column number is at the
end of the first line of the error, in format file.rs:line:column, eg
main.rs:5:10

There are a few example errors here: [https://github.com/rust-
lang/rust/issues/36611](https://github.com/rust-lang/rust/issues/36611)

Are the annotated code snippets after the first line useless with screen
readers? I wonder if there’s a flag to hide just the snippets.

~~~
steveklabnik
There is a flag to hide the snippets and give a more compact output; you can
also get it in JSON, I believe.

------
reimertz
I remember meeting Evan back in 2013 when we both rented rooms in the same
apartment. I didn’t see him much but the first time he introduced himself, I
got to see an early version of the Mario demo.

I can still remember how I didn’t understand a thing ( was just starting my
internship) but still knew that he would achieve great things with Elm.

So happy to see him succeed and being able build such an amazing community
just by being himself.

Finally, I love how his personality has become a part of the language, most
obvious when reading error messages.

------
dorian-graph
As much as I really like Elm (and use it professionally), the speak of making
it developer/learner-friendly is humorous considering how the --debug flag was
broken for ~ 1 year [1].

fyi compilation speed has had a noticeable improvement as well with this
release, but is not mentioned in this blog post.

[1]
[https://github.com/elm/compiler/issues/1851](https://github.com/elm/compiler/issues/1851)

~~~
vanderZwan
RE: compilation speed, given that it appeals to an entirely different
demographic than the one being reached out to in this blog post I suspect it
was not mentioned because it would only be distracting. Nice though!

~~~
pdamoc
Mentioning compilation speed needs solid data to back the claim. This would
have delayed the release. To my understanding, there is some work being done
on a script that would produce this kind of reliable data and a later post
will be made to cover this detail.

------
jweir
Our application is mostly Ruby, but any interactive front end is now written
in Elm.

The one problem, for us, is when there is an Elm project the developers _not_
working on it are jealous of the developers who are.

It is fun to work with.

I think it because the compiler is freeing your brain from trivial issues and
allowing the brain to focus more on creative problem solving.

------
mordrax
We here at Pacific Health Dynamics, Sydney, Down Under want to give a big
thanks to Evan and the core team for all your hard, free, work!

We've recently hit 100k loc for our main frontend written all in Elm. The
journey from inception 2.5 yrs ago has been amazing and now we're in full
production mode, reaping the rewards of purity and the type system.

------
Karupan
I’ve been using Elm for about a year now. It’s my go to for most UI work these
days. However, my main concerns have been around:

1\. How community contribution is handled. I’ve been following the compiler
repo for a year now, and the number of bug reports (and PRs) that remain open
is concerning. I get it - they want to move slow and be deliberate in the way
it is developed. But fixing well known compiler bugs shouldn’t take a year.
Makes it harder to sell to dev teams.

2\. Using private packages. I know there have been workarounds (including
multiple src directories tracked via git), but they feel hackish.

I’ll continue using Elm for personal projects, but it is still a hard sell.

~~~
G4BB3R
What is your approach to UI? Elm Css, Elm UI or separated css files?

~~~
Karupan
I've used elm-css-modules-loader[1], although haven't tried it with Webpack 4
yet. Since my CSS is usually small (< 300 lines), I prefer a standalone
stylesheet.

[1] [https://github.com/cultureamp/elm-css-modules-
loader](https://github.com/cultureamp/elm-css-modules-loader)

------
mostlysimilar
I love Elm. I'm brand new to it but can't get enough.

The compiler is so friendly. It feels like Evan Czaplicki is talking to me
directly. :)

------
gregwebs
Take a look at how the prior 0.19 release makes elm projects smaller than is
possible with normal JS [1].

[1] [https://elm-lang.org/news/small-assets-without-the-headache](https://elm-
lang.org/news/small-assets-without-the-headache)

------
Existenceblinks
I think Elm too much underestimates people who learn a programming language.

I really like the Browser module recently.., it enables people to build more
things easier, that solves serious problems people trying to use Elm
seriously.

I am not sure how Elm evaluates feedback from language users. Elm is too much
focus on new comers, make it so new people are excited about it first week,
and then get stuck on things they want to actually build, and move on.

~~~
bussierem
As someone who's a recent convert to the language, I have started making
several webapps with Elm lately. The biggest thing the language lacks right
now IMO is solid tutorials for some concepts. I was able to make my way
through but due to the young age in the language tutorials are sparse and
widely varied in their effectiveness. In terms of learning the language, the
error messages were a godsend. Now that I am more comfortable with the
language overall (which only took a few weeks of intermittent learning), I
have joined the Elm slack channel.

I can say now that the Elm community is VERY responsive to current devs, and
Elm's development is not just focused on new people, but that is where the
blog posts and updates focus because, frankly, it's a new concept that Elm is
focusing on that many languages do not currently, so it bears mentioning and
makes for better updates than normal esoteric patch notes would (which any
power user CAN still find).

~~~
eckza
The community is overwhelmingly wonderful.

~~~
deckarep
I actually read this as: ”overwhELMingly“...

------
protomikron
That's really cool and I hope Elm keeps getting better. I like the opinionated
approach it takes and I will probably build my next web UI in Elm.

I just have to figure out what's the best way to wrap JS libraries, but I am
sure there is a way.

~~~
paulsmal
Yeah, there's elm ports. You can send messages between JS code and Elm

------
quickthrower2
Aah! I just saw this on my terminal after a routine install of elm-live on a
different machine:

Your elm.json says this application needs a different version of Elm.

It requires 0.19.0, but you are using 0.19.1 right now.

Smile to my face! So I came here. Awesome :-).

------
fortran77
We used Elm for our web client and loved it. None of us in our company are
"web people" \-- we're low-level C++/CUDA folks (and Erlang for network code)
-- but we needed to have a public facing web interface.

Elm worked great, and we had no problem having several developers contribute
to the same project without stepping on each other, with everyone able to read
each other's code.

It's been 100% stable, predictable, and reliable. And, yes, we're calling
JavaScript via ports. Works well.

------
triangleman
Update the title, this is more than just a release; the new messaging is worth
reading about.

------
lolc
I really appreciate the focus on helpful messages in Elm. When working with it
I'm recurringly surprised at how the computer seems so considerate for once.
Time well spent!

------
zerr
Any examples of large-ish real world apps?

~~~
zerr
EDIT: I've originally meant example sources to look at. Thanks for the replies
though - also interesting :)

~~~
Libbum
My biggest project, it's about 6k loc. So maybe that's not what you meant by
'big', but many of the others here have listed a lot of closed source apps.

[https://github.com/Libbum/Odyssey/tree/master/src](https://github.com/Libbum/Odyssey/tree/master/src)

------
hellofunk
I’m not sure who the intended audience for this post is, but I’ve never known
any serious or productive developer who quit learning a language just because
they got hung up on a few of the trivial syntax examples in this article.

~~~
wjsetzer
Did you read the part about survivorship bias?

And on top of that, it's a blog post. Evan gave examples of really helpful
error messages.

I don't use elm, as I don't do webdev and I don't agree with Evan's tendancy
to minimalism, but I really wish other languages had the "pair programming"
aspect of the elm compiler.

~~~
uhryks
That and iirc Evan concieved Elm with the aim of making it an accessible
language, and used (uses?) it to introduce teenagers to webdev.

------
andrepd
>Say you are learning Elm and do not know how to import modules yet. Maybe you
just try the JavaScript way to see if it works.

Or maybe you read the documentation section "Importing modules" which takes
you 5 f*ggin minutes? That's a lot less to ask than "implement very verbose
error messages that talk to you like you're a baby".

My opinion at least.

~~~
hombre_fatal
Well, this kind of RTFM bravado mindset is one of the reasons every compiler
has garbage errors and why manpages are more hassle than just googling "how to
unzip with tar" and why so many projects can't even be fucked to flesh out a
README. ("Just read the tests!")

So, if that's what you want, you already have every other programming language
to pick from. Let the rest of us have our fun. I've been programming for 20
years and appreciate Elm's errors every time.

Why should I need to do any more work than read a compiler error when I
accidentally write "import Webgl" instead of "import WebGL"?

~~~
andrepd
I'm giving my opinion. Please understand some people think differently than
you and that's fine.

>why so many projects can't even be fucked to flesh out a README

Not relevant.

>manpages are more hassle than just googling "how to unzip with tar"

Not relevant.

>Why should I need to do any more work than read a compiler error when I
accidentally write "import Webgl" instead of "import WebGL"?

Still not relevant, since that wasn't the example given (correcting typos like
this is indeed a very helpful compiler error; gcc does it for like a year or
two now).

>RTFM bravado mindset

I really don't think telling people to learn a language instead of typing
random things in hope that the compiler corrects them is being a hacker-
neckbeard who tells you to rtfm. The example given in TFA is literally: "if
you don't know how to import things yet, instead of reading the introduction,
googling "elm import", or literally just taking 2 minutes to figure it out,
just type what you would do in some other language, and the compiler will
gently tell you how to import a module in Elm", or in other words "type random
stuff until it works". Should the compiler also correct the user if they write
`#import <set.h>`? Or `open Set`? Or `from Set import _`? Again,_ in my
opinion* this is neither relevant nor desirable.

~~~
cuddlecake
> I'm giving my opinion. Please understand some people think differently than
> you and that's fine.

What does that mean? Should he have NOT responded to your comment? Does that
then mean that you should have not responded to his comment? Does that mean I
should have not responded to your comment? Does that also mean that you
shouldn't have made a comment, since Evan directly expressed his thoughts and
opinions in his post? Should we stop communicating at all and become Loopless
One-Directional Communication Graphs? Who shall be the original Opinion
Holder? Adam or Eve?

Anyway.

> Should the compiler also correct the user if they write `#import <set.h>`?
> Or `open Set`? Or `from Set import `? Again, in my opinion* this is neither
> relevant nor desirable.

If it can, why not? Why not tell the user: Hey, you've got `xyz`, but you can
only do `zyx` with those literals. Having detailed Errors is not a detriment.
I remember my first Segmentation Fault in C. Man, I cried.

Programming languages have users, and caring about the User Experience of a
language (i.e. Developer Experience, I supposed) is commonly desirable. There
is no downside to a good error message, neither for something as trivial as
imports, nor for common things like using the wrong key names in a Record.

I make heavy use of types in TypeScript, but the error messages when something
is out of order (ever so slightly) is just so brutal at times, with error
messages being 20+ lines long, where only the last line might be relevant. I,
for one, welcome our helpful error message overlords.

~~~
DanRosenwasser
> I make heavy use of types in TypeScript, but the error messages when
> something is out of order (ever so slightly) is just so brutal at times,
> with error messages being 20+ lines long, where only the last line might be
> relevant. I, for one, welcome our helpful error message overlords.

If you've got examples of cases where we can do better, feel free to file an
issue! We want to do better.

~~~
cuddlecake
Saw that you tweeted an example of error log improvements, which is exactly
what I meant with the 20+ lines of error messages with only the last one being
relevant.

Now I just need to wait until Typescript 3.7 trickles down to all my
dependencies so I can get that goodness. Sigh.

Sigh.

