I hate this mindset. "<my favorite language> is used to solve REAL problems, other languages are not as good for creating VALUE. Any powerful language features, ergonomic syntactical sugar or tooling that does not exist in <my favorite language> is useless". So strange
Maybe this makes more sense:
Coming from more expressive languages, one of the good things I could say about Go's developer UX is that you are so helpless to circlejerk over abstractions that there is simply nothing else to do than to write concrete code to solve the problem.
Elm is similar versus the huge type expressive power of Haskell. Elm's type system is so minimal compared to similar languages that you can't spend hours perfecting your higher kinded advanced type abstraction that perfectly annotates and cordons off the problem domain because there isn't enough typing power to do that. You have to go "welp, good enough" and move on.
Personally, I tend to prefer using and abusing all the sugar and tools that a compiler gives me. I find that I'm not a terribly smart person most of the time, and if a compiler engineer has a figured out a good bit of abstraction to make the code safer or more readable or faster, I'm inclined to use it.
There are plenty of success stories with this approach. Love it or hate it, I think SQL is overall a reasonably pleasant language, and almost completely removed from the underlying hardware. You think relationally with SQL, not really in terms of for loops or memory allocation.
All that being said, I will admit that sometimes I don't want to spend the entire day trying to decipher whatever the hell GHC is trying to tell me with its weird errors. Go makes you do a lot more manually, but at the same time you also don't need to understand the intricacies of a sort of approximation of type theory or linear logic.
IMO, I genuinely think that right now the two best languages in terms of abstraction usability are Clojure and F#. They both allow for lots of great abstract stuff, but they also do allow you to cheat when necessary, and being on the JVM and .NET Framework respectively, there's no shortage of libraries available.
I like golang a lot and use it professionally and there are plenty of errors and issues that can require syntax and code that to people who aren't super proficient in it would think is over-complicated and end up fighting the compiler (channel can be awkwardly implemented and related issues and what not can be.... non-obvious..).
I've been writing a ton of rust recently and until I became proficient I felt it was really complicated and led me to fight with a compiler (borrow checker I suppose) and honestly it took me coming back to it a second time almost a year later to break through it and now i'm as productive in rust as I am in golang... but it was my familiarity, I found tools I wasn't aware of, my SQL query strings & templates are now checked statically and so I feel more productive in rust in some ways.
That is really not the point being made. The point is rather "the language helps me keep focused on what I do, because many subtleties in other languages don't exist, and those have me overthinking things". Whether what you do is REAL work or a friday night game jam is irrelevant.
Also I wouldn't say that Elm lacks ergonomics or powerful expression features. It does lack browser API features, but I don't believe that's what the author enjoys.
IMO the biggest problems with almost all popular programming languages are
1) null
2) exception based error handling
such that, when you call foo() where foo is
String foo(){ blabla }
you can get a String, null OR an exception (!!!) and most compilers happily let you treat it as if it only ever returns a String.
I hope some day null is no longer a thing, and that Functional Programming types like Option, Either, Try etc in the native libraries is the new default.
incredibly, there's still no consensus as to which exceptions should be used for what and when, though these days the most common approach is to simply stick only to RuntimeExceptions, which is terrible.
Functional error handling using Option, Either, Try etc are arguably much simpler, safer and more powerful than exceptions.
Simpler because they don't rely on dedicated syntax- they're just regular objects no different to any other object.
Safer because unlike exceptions, they force callers to handle all potential outcomes, but no more. (no risk of ignoring errors and no risk of catching a higher level of error than desired, ubiquitous bugs in exception based error handling)
Powerful because they support map, flatmap, applicative etc, making it easy to eg chain multiple computations together in desired ways, which is unwieldy and bug prone when using exceptions.
It could be that, when learning Java, Python and any other language, we learn that methods return objects... and that's that. No weird dedicated syntax and magic, special treatment for returning anything other than the happy path, and the HUGE complexity that comes with it, eg the dedicated syntax itself and how it behaves, differences between checked and unchecked exceptions, hierarchies of exceptions etc etc.
In addition to that, when lists and booleans implement map, flatMap etc, you can actually reduce syntax of languages even further- there's no need for looping syntax like for, while etc, and no need for if else either. This is probably too extreme for most people, but think about it. There's literally no reason to have this syntax in the language if the types in the library give you the same functionality.
So my dream languages would be something like Kotlin ie with inferred type safety, immutability by default etc but without support for null at all, no exceptions at all, no looping or conditional syntax, and a better, smaller, simpler library.
Obsession with language features or syntax tends to move people towards building castles in the sky and being too obsessed with code rather than the software that actually runs on a physical machine. A lot of fancy features usually come at quite high runtime or compile time costs with not really meaningful benefits in a large software system.
Unless you're writing software explicitly for the sake of staring at code, unopinionated and simple, fast and pragmatic languages that get out of the way are the tool of choice for good reason.
I definitely don't think ergonomics and features from other languages are useless! I just feel a bit overwhelmed and distracted by variety sometimes, especially when working on teams.
For example, about 50% of the JS teams I've worked with collectively agreed not to create new classes. I think I'd prefer working with JS if there were only one way to do things, but it doesn't mean that classes are bad or useless.
Ultimately it comes down to trying to do a cost/benefit analysis of the complexity at hand and deciding if the additional layers add enough value and how far your problem deviates from the supporting structures. The issue is, it's often quite difficult to know a priori what is helpful and what just adds complexity because goals are often moving targets and you have to try and assess the range of potential goals with the flexibility of all the middle layers you introduce.
The full context helps
Most languages are too powerful for my palate.
Don’t get me wrong – I love Rust and many other languages! But sometimes they’re just too much for me.
When writing Rust or JS or Haskell or Python or Lisp, I’m overwhelmed by opportunity. Should I make this generic? Should I use classes or structs? Immutable or mutable? Macros? Functional or imperative array manipulation?
I try to please compilers and coworkers and customers, but all are disappointed. Give me a woodshop and I’m lost, but give me a simple chisel and I intuitively know what to do. There’s a certain freedom in restricted toolsets.
Languages like Go and Elm spurn extravagance. They resist overcomplication. They force me to solve real problems instead of fighting compiler errors and stylistic differences.
Furthermore, consistent code makes portable mental-models. Go and Elm codebases tend to be extremely readable.
However, I don't like the way the project is run. It's one Benevolent Dictator that has a particular vision for Elm and he's not really sharing with the community. For context, the latest Elm version (0.19.1) was released in October 2019. It kind of feels like a nice tree house left to the elements because the person grew out of interest, but kept a lock on the door.
0.19 also prohibited interaction with non-Elm code which I recall a controversy about. But can't seem to find out if anyone forked 0.18 because of that.
https://gotoaarhus.com/2023/sessions/2529/elm-on-the-backend
What is the maintenance burden of the average React app? When I have written an Elm app, I feel confident that I could come back to it in a few years time with no issues.
To me, this stability is a testament to the language's thoughtful design and rejection of the constant churn of contemporary web development. At the risk of sounding like a Game of Thrones fan waiting for Winds of Winter, I look forward to the next version coming out with modest changes and bug fixes whenever it is ready.
I don't think people would be saying Elm is dead if there were regular bug fix patches coming out and we were on v0.19.21. The reason why people are declaring Elm dead isn't because new features haven't been added in two and a half years, it's because there hasn't been a bug fix update in two and a half years.
Sure, the language is stable in that it doesn't change, but stable can also mean bug-free, and Elm is certainly not stable enough to justify going that long without a single bug fix.
The authors refused to fix a parser error related to negative literals: https://github.com/elm/compiler/issues/1773
It is clear that Elm is understaffed, to say the least.
For example, all Elm apps having the same architecture ("TEA") is one of the biggest wins over alternative apps where every project, even those you make yourself, will do things differently.
Elm Janitor (https://github.com/elm-janitor/apply-patches) is a curation and applicator of community patches to Elm proper. Haven't used it, but it seems like a promising way forward.
Elm uses a different name for the “not equal” operator:
5| text "Hello!" != "balbla"
^^
Switch to (/=) instead.
Note: Our (/=) operator is supposed to look like a real “not equal” sign (≠). I
hope that history will remember (!=) as a weird and temporary choice.
Wondering if it is just me, or it really is passive-aggressive? It was the first red flag for me.upd: formatting
Passive aggressive might be like this
"there are some languages that feel the need to use !=. They have the 'opinion' that this was a good idea, look at them. They are so cute trying to be a real language with such *interesting* design choices"
Rescript does piggyback on normal JS ecosystem and build systems so comes out worse there. But it's easier to integrate with existing js codebases and npm packages for the same reason, and its output can be used from js in any framework if you plan for it.
I was really missing the elm command/update model for a while but at some point I realized adding that semantics to a react reducer with a custom hook was completely reasonable, and there are a couple existing projects doing exactly that. I wrote my own in an afternoon and have been copying it around to new projects since.
I'm like 90% happy with this transition now. It doesn't always feel quite as safe & magical as elm did, but it's also a lot easier to integrate with other systems.
432 comments | 3-years ago
Only contacts I've had about Elm positions have been about rewriting existing Elm apps to something else.
Impossible to justify for serious projects at this point.
Edit: moved the position of the citation.
We only use it when there is complexity: when there is just a little progressive enhancement needed on a SSR HTML page we happily use vanilla JS or jQuery (we're looking for a good TS-based jQuery-like solution the fits that bill).
What we like about Elm:
* makes us think about tech design issues early on (you cannot just ignore them)
* its a transformative experience: devs become better at writing any language after having solid Elm experience
* its fast to compile compared to TS+React+Redux+Babel+WebPack+...
* no unhandled runtime errors! (yes it is true, no more errors with Elm)
Just like I find Ruby a very nice language that was hidden in Perl, I see Elm as a very nice language that was hidden in Haskell. Thanks Evan for creating it.
And yes I truly believe Elm is not dead but merely finished to a great extend.
Oh, as a bonus, want to have your mind blown, check out this:
https://www.youtube.com/watch?v=nSrucNcwlA8&t=275s
(when I watch that video I cannot unhear "look at all the boiler plate im not writing" in David Heinemeier Hanson's high pitch voice; referring to the original Ruby on Rails demo)
I used to work with elm some years ago and my coworkers claimed this as part of their reasoning for choosing elm. Shockingly, we still had runtime errors! Elm helps reduce some type system based runtime errors. But that’s only a subset of exceptions, and it’s not perfect at even catching those. Try this in elm:
div [ attribute "@style" "color: green" ]
It’ll compile just fine. And crash completely at runtime.
No less a CS personage than goddamned Donald Knuth uses the decimal expansions of irrational constants to denote that his programs approach "finished" with smaller and smaller changes. Somehow this is fine when he does it but "the language is basically cooked as far as syntax goes" is an unacceptable answer to the Elm decriers. Dogs bark; the caravan goes on. Mazel Tov on launching your thing in production. I wish you a thousand years of success.
Elm is fine for learning, but that's all for me. Serious products for serious customers require more than "beautiful typings"
https://www.youtube.com/watch?v=IcgmSRJHu_8
https://www.youtube.com/watch?v=x1FU3e0sT1I
the talks are geared towards elm but I think they offer some great advice applicable to programming in general.
But that would take a lot of effort, so I just use Elm instead.
[1]: https://gist.github.com/JoelQ/6b303d9ad450537163b6f8f6cf8a4e... [2]: https://ellie-app.com/mQ52TY6k3zZa1
I don't think I'd ever use "elegant" to describe Go
it's a workhorse language that's readable and full of utility.
When I think elegant, I think Clojure. Not that I'd want to use it day to day (I have)
the architectural model is good, and there are many projects mimicking it in a more open way.