Could Elm replace JavaScript?

preview_player
Показать описание
A quick look at Elm.

💬 Topics:
- Advantages and disadvantages of JavaScript;
- Basic Elm project example;
- Why use Elm?

#javascript
Рекомендации по теме
Комментарии
Автор

I hope it does, Elm is such a friendly a pleasant place to be. As opposed to the chaos of JavaScript, though, some prefer the chaos. To each their own

striker
Автор

It appears that the only things that can replace JS are a superset language which will work with existing libraries( e.g. TypeScript) or any lang that compiles to WASM when it gets DOM access.

AlexanderSuraphel
Автор

I worked with Elm a few years ago. It's pretty nice as a language, but there were two things which I didn't like: First, as you mentioned, the templating. After working with JSX, it really feels like a big step back, it's far less readable and unintuitive to write. Second, the interoperability with JS. Even though it compiles to JS, plugging in third-party libraries requires a lot of work.

What I liked better was ReasonML/ReScript. It solves similar problems, but it comes with JSX and integrates perfectly with React (React was even originally designed in OCaml, which resulted in ReasonML) and supports many React libraries. And adding new ones is pretty straightforward. It works best with React but it's not tied to it, there are also bindings for e. g. SolidJS.

But it seems like ReScript, Elm and other alternative compile-to-JS languages have lost a lot of momentum in the last couple of years, TypeScript is just everywhere. I really preferred ReasonML's and Elm's type system and language features over TypeScript, but integrating untyped JS is just far easier with TypeScript, and the learning curve is much flatter when coming from JS. And sadly it's very hard to compete with such a massive ecosystem.

VeitLehmann
Автор

The last elm release was almost 4 years ago (October 2019). I don't know if the project is still in development. But the official elm twitter seems to be active though.

voidtraveller
Автор

It's been 5 years I work with elm.
Never got any runtime error
I love it :)

CharlonTank
Автор

Elm is a very nice little language that I think is just not well-enough supported. For ML in the browser, I’m leaning toward F# compiled to JavaScript with Fable.

republicanhaircutman
Автор

What do you think about F#? Either on the backend or frontend?

samuraijosh
Автор

As far as I can tell, Elm, when compiled into JavaScript, resembles like a React/Vue SPA application (Elm has its own virtual DOM). As you know SPA (client-side-rendering) applications have big problems with SEO and achieving good results in Google Lighthouse.

1. Does Elm have support for server-side-rendering?
2. What is the reactivity model of an application written in Elm (is there a classic hydration like in React, or maybe something similar to resumability from Qwik)?
3. Can Elm be used to write backend in Node/Deno?

coder_one
Автор

Hell yeah! This is amazing. I love Haskell and this makes me 😊

korigamik
Автор

I didn't understand anything case I didn't try any functional language before, but they should've just stick to HTML, something like JSX

limpiadora
Автор

remember Dart. with all the power of Google, still didn't get anywhere.

gladly it found its home with flutter

nixoncode
Автор

Fantastic video. Can you do a similar one on Elixir?

mawill
Автор

If we are going to work with languages that compile to Javascript later, why not stick to strongly backed languages like Dart or Kotlin instead? Those languages can also write actual web apps, without needing to use React Native, so it's also beneficial to your career if you want to move away from the mess that pure Javascript is.

YuriG
Автор

Probably only wasm can replace javascript when it gets direct dom access

knolljo
Автор

Too short. I think we would benefit from diagnosing some example medium-size app.

pauljohnsonbringbackdislik
Автор

9 months later, I still dont think there is a huge value prop for this if it just compiles down to Javascript. Has there been another use for ELM that isn't just an abstraction of Javascript??

cg
Автор

I doubt it, Elm seems to have been having problems growing its community. I've never used it myself so I don't really know why. I'm just all in on Javascript/Typescript now lol

cg
Автор

Also worrying is the fact that looking at Elm's repository - there hasn't been a commit there for several years. The website of the language itself hasn't been updated for several years either. Could it be that the project has simply died?

coder_one
Автор

i have not used elm directly but i have used a gui framework in another language inspired by it and i wasn't much of a fan.

bearziif-s
Автор

They should make a roblox/minecraft in elm lang 😮

mariobroselli