Elm is lovely, and I'd definitely encourage people to take a look at it from an education point of view at the least. However, I think that's a disingenous comparison.
TypeScript is a superset of JavaScript, which means any JS dev already knows most of TypeScript. They're effectively just learning the type system and best practices on implementing it.
The syntax of Elm is extremely different, which would effectively require developers to learn an entirely new language. It's also a completely different proposition. It's a whole framework, which means complete buy-in on a project. I know there are some interop packages, but you would normally use it instead of React/Vue/Angular etc. This means it's only suitable for new projects.
It's a very nice framework (imo) but it's not a true comparison.
There are not many stories of integrating Elm to existing projects, but there are some. We at Conta AS integrated Elm in our big AngularJS application. So Elm work side by side with AngularJS. It’s possible to embed Elm program to AngularJS code, and it’s possible to embed AngularJS component to Elm program. Which makes the communication part easy. It’s true for any other technology such as React, Vue, etc..
I've tried Elm and I think it's really great. I've watched a handful of Evan's conference talks and I respect him a lot.
However, when I choose what tech to go deep in with my limited free time, I want to see more than zero mentions of it in the "who is hiring" threads. I don't feel like Elm's traction has gained any in the two years since I first dabbled in it. If I was in a position to pick the tech stack for my work, I'd give Elm serious consideration though.
Because TypeScript is hardly a new programming language. It's like adding JSDoc to your code and running a linter, in terms of amount of effort involved, and the learning curve is just slightly higher than that.
I am honestly stuck between two worlds, React and Elm. There is a toy project that I've alternately developed using both React and Elm, which is a little neurotic when I think about it. I find working with components to be more intuitive and organized than my Main.elm ends up being, but, even using Typescript's strictest settings I seem to get runtime errors, which bothers me a great deal.
Before trying Elm I'd never used a purely functional language. It's definitely a different way of thinking and I'm glad I took the time to wrap my head around it.
JavaScript interop I suppose. TypeScript allows incremental integration with other JS libraries, while Elm forces an awkward ports/messaging abstraction.
Looked at Elm and it looks quite interesting. however concerns for going to it
- Skill transfer. If I learn react, I can use my JavaScript skill to understand how everything works under the hood. If I learn Typescript with React, knowing react, I can focus on learning new language feature while not learning at the same time how to build the application.
With Elm, I have to learn the language and the framework, all at once, basically learning from scratch.
- compatibilities with libraries. Here I definitely might be wrong, not knowing Elm enough, but okay, say you don't need a framework because it's included. What about utility library. Like i don't know, analytics or fancy animations?
- Job Market. I'm not going to learn a language that I cannot use anywhere, and if I'm a company, I'm not going to choose a language for which is going to be hard to hire people.
Now Elm sounds real cool and I want to like it. But it doesn't seem very wise to spend time doing that vs learning something like Apollo+Graphql, or Typescript, or Vue, which have much more obvious benefits to my career.
The job market is a chicken and egg type problem. Management would not allow Elm based projects as there are no othe Em programmers on staff. We cant ask for Elm programmig experience in resumes as we dont have any Elm based projects.
I wonder how other languages,like Scala, managed to get traction in the enterprise whereas Elm has not even though it can solve real issues that we face with Javascript development.
Scala got traction in places I've worked partly by making the pitch that the team hires people based on software engineering aptitude, not prior knowledge of specific technologies.
A new hire often has to learn a number of new/different technologies. The language is one of the easiest of those.
I agree it is definitely a chicken and egg type problem (which doesn't negate the fact that it is a problem)
I don't know for Scala, but in general Marketing and money thrown at hackathon and meetups can get things moving in that regard. However I believe Elm doesn't do much of that.
I love Elm, but from a practical place, I think ReasonML is more fruitful to learn because of the fact that any valid ReasonML (sans JSX) is also valid ocaml, so you're nearly learning two languages at once.
Well you are a minority then. I also love elm. I gave talks about it in meetups/confs and organized a local elm meetup but finding job as elm developer is extremely hard.
Similar to the other commenters, I find this comparison to be a bit unfair since TS is not a completely new programming language.
Apart from that, Elm is a great language! I've been dabbling around with it in the past and I especially liked its great DX and that it's purely functional. Comparing it to ReasonML would be very interesting, too :)
Would be true if Typescript significantly differed, but as it is, it’s basically JS with a few type annotations. The only learning curve is typing these dynamic constructs properly, rather than wrapping your teams head around other concepts, constructs and patterns.
I check in and pick Elm up again every few months to see where it's at, I really enjoy using it and agree it's miles ahead of TS in some ways. However I've heard very little from the team about a next release and 0.19 left a few open questions. It's not something I'd pick for a project at work.
TypeScript is a superset of JavaScript, which means any JS dev already knows most of TypeScript. They're effectively just learning the type system and best practices on implementing it.
The syntax of Elm is extremely different, which would effectively require developers to learn an entirely new language. It's also a completely different proposition. It's a whole framework, which means complete buy-in on a project. I know there are some interop packages, but you would normally use it instead of React/Vue/Angular etc. This means it's only suitable for new projects.
It's a very nice framework (imo) but it's not a true comparison.