5 ms·
I'm a big fan of Elixir, but the community gravitation toward Elm has always struck me as a bit weird. The two languages have nothing in common beyond both bei
by s_kilk 9y ago
I'm a big fan of Elixir, but the community gravitation toward Elm has always struck me as a bit weird.
The two languages have nothing in common beyond both being functional, and it kinda feels like someone posted a "Elixir and Elm" blog post in the early days and it all just snowballed arbitrarily from there.
- jrobn 9y agoI think it’s mostly people who are writing in Elixir are, at this point, already on the fringes of using “new shiny language” and would be more likely to us “new shiny front-end framework” in new projects. I really like Elixir, a lot. I’ve had Erlang experience and I’ve never understood the hate around it’s syntax. Elixir is definitely more friendly in that regard and I’m glad it’s bringing the tremendous value of the BEAM and OTP to more mainstream development circles.
- lilactown 9y agoI think it's a novel inversion of the status quo, where statically typed languages live on the server and dynamic languages live on the client. I think that Elm and Elixir fit their respective development niches (UI, distributed systems) extremely well, both have similar community cultures, and both started gaining some traction at around the same time.
- true_religion 9y agoI think Elixir is a wonderfully expressive language built on a strong foundation in the ErlangVM. It inherits Erlang's semantics which I've always liked. Elm on the other hand inherits Javascript as its foundation, and the browser as its target. Javascript has an anemic standard library, and isn't a functional strongly typed language to begin with. Now since the browser is the target, file size is important, preventing Elm from simply shipping its own runtime + standard library.
- pseudonom- 9y agoAre you confused or am I confused? Elm does ship it's own runtime and standard library. Or at least it used to.
- ehsanu1 9y agoYeah, true_religion seems confused/misinformed.
- true_religion 9y agoWhoops, I must be confused. I thought Elm compiled to Javascript, and didn't implement a custom runtime.
- lilactown 9y agoElm does compile to JavaScript, but does come with it's own runtime on top of it and standard library.
- vim_wannabe 9y agoWhat are some relatively popular alternatives (that are not on the JVM)? Maybe the options are somewhat limited here if you want both to be functional.
- karmajunkie 9y agoI'm not an elm developer, but i think its closest analogue is probably Reason or bucklescript-tea, neither of which is jvm-based.
- loop0 9y agoWhy not JVM? I'm asking because I'm starting to learn functional and I think Clojure is a very nice language to write both backend and frontend.
- macintux 9y agoThe JVM is a great kitchen sink environment. The BEAM and Erlang/Elixir are much more finely tuned for their strengths: distributed systems, fault tolerance, immutable data/functional programming. If you need raw performance, the JVM is definitely better. If you don't want to have to deal with the inherent tension between a FP language and mutable surroundings, the BEAM is worth a look.
- leshow 9y agoPurescript is lots of fun to use and has a helpful community.
- alkonaut 9y agoThe Suave-Fable-Elmish stack (Made popular under the "SAFE-stack" name) is very nice. https://safe-stack.github.io/ https://safe-stack.github.io/ It has the drawback of the frontend language not being as tiny as Elm is, but it has the benefit (which I think is no little benefit) of having the same statically typed language (F#) on both front and back end. Whether it's "Relatively popular" is hard to say. It's tiny as far as web stacks popularity goes, but in completely functional web stacks it probably has taken a bite already.
- 9y ago
- kiliancs 9y agoFrom a strictly technical perspective (that is, excluding otherwise important factors like hiring) Elm is one of the best solutions for web UI development. The language is small (compared to Haskell for example), it pretty much enforces a sane approach to state management and componentalization, frees you from a whole class of JavaScript bugs including runtime exceptions and is very fast. The fact that it's functional just makes it more attractive to developers that are already confortable with or committed to functional languages such as Elixir.
- rdtsc 9y ago> The two languages have nothing in common beyond both being functional, That's good enough for most people. From experience switching quickly between the two paradigms takes a bit longer than staying with the same one. That is once think about reducers, closures, immutable data it's easier to stay in that mindset then going back to mutable objects and attributes.
- macintux 9y agoHave spent a lot of time doing Python after a few years in Erlang, and I've wasted a lot of time chasing down stupid mistakes because I still tend to think immutability when it isn't warranted. I love useful constraints.
- rdtsc 9y agoI am using both, and I find that at least in Python I started using more functions and passing the state around. A nice side-effect is that also makes that code more testable as there is less need for mocks (since functions are more pure), but it's also more verbose and people think I am crazy now. Though also Python in a sense already has some extra state visibility by passing self around in member function as opposed to hiding in an implicit this.
- macintux 9y agoYeah, I implemented a state loop since my process is relatively short-lived. I'm sure anyone who knows Python would hate my code, and I'm not particularly proud of that: I simply don't know the usual idioms. I was excited when I discovered accidentally that tuple unpacking in function heads was supported in Python, then depressed when I discovered that was dropped in Python 3, "because no one uses it". Sigh.
- somlor 9y agoAs an Elixir dev I tend to agree. I've found ClojureScript to be a nicer fit (Reagent with re-frame if needed).