Skip to content

Instantly share code, notes, and snippets.

@NickClark
Last active September 27, 2021 22:33
Show Gist options
  • Save NickClark/a13139a49e083af88405 to your computer and use it in GitHub Desktop.
Save NickClark/a13139a49e083af88405 to your computer and use it in GitHub Desktop.
Elm vs TypeScript Thoughts

Elm and TypeScript

  • Elm Task - An Elm specific implementation of Observables (more limited?)
  • TS and Elm - Once it compiles it usually runs (Provided you're following the warnings provided in either the compiler output (better) or editor (best) )
  • Editor and tooling support?
  • TS and Elm - Typed Langs
  • Most suitable for complete apps, not just a JS compiler
  • Enforces Reactive programming - Angular 2 (Observables) provides the same thing, just not forced.
  • Know TS, know JS. Able to contribute back to the community easier.
  • Object assignment kinda weird: { point | x = 42 } Reason? (overall weird sytnax)
  • Elm is new, very few libs. Interface to JS has to be done through Ports? TypeScript handles this better, you can get safety out of community type definitions using DefinitelyTyped (tsd, or typings)
  • Elm's own benchmark only perfomrs at par, and that apparently is against libs that are already out of date. benchmark
  • Elm - An interesting library, perhaps behind the times as the web is adopting Web Components, ES6, Observables, and ShadowDom
  • TS - best combination of safety and ease of integration with JavaScript libraries, guaranteed to stay with the evolution of JS as it's just a superset and excellent tooling.
@jtomaszewski
Copy link

jtomaszewski commented Oct 17, 2016

Nice summary @NickClark. I've got very similar realisations lately too.

I think one of the coolest features of Elm is the immutability - which can't be achieved by TS for now. Hopefully es7 spread operator get merged soon.

Anybody knows how is the ts support for ImmutabilityJS working in the reality? Is the typing working, do we need to attach a lot of immutability to the interface definitions to support it?

@kokizzu
Copy link

kokizzu commented Feb 20, 2017

Elm is cool :3 just like Haskell on JS platform..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment