Live data from Hacker News

Elm and Phoenix/Elixir in Production for France TV

vincent.jousse.org

51–60 of 80 posts

Re: Elm and Phoenix/Elixir in Production for France TV

#51

Earlier quoted context omitted.

Its true that you can't currently write a service worker in Elm. However, in practice for any decent size app you are going to end up with a mix of Elm and Javascript with communication happening through ports. Therefore you can write the service worker in JS and then talk to it from Elm. Of course it would be nicer to be able to write everything in Elm, but I find having the majority of your app in Elm with a bit of…

I'm a huge TypeScript fan. Yet I worry about adding Elm to new projects, mostly because it raises the level of developer I need to hire to maintain it. I'm not in SV or in a tech hotspot at all, so maybe I have to think about this more than the average HN reader.

I just helped a relatively junior developer—sharp but with no real functional programming experience—get started with Elm for a small internal tool. He got something up and running almost entirely. I think I spent around ~1.5 hours helping him get things set up and understand the basics.

Personally, I'm actually not the biggest fan of the design philosophy behind Elm, but I do have to admit it's easy to learn with some great introductory learning materials. Getting somebody motivated up to speed on maintaining Elm is not an issue.

For what it's worth, I think the same is true of Haskell-style languages in general: with a bit of guidance, it's not hard to make new programmers productive. That's the experience IMVU[1] had when switching several internal projects to Haskell from PHP, if you want a case study. I met the lead engineer who wrote that post once and he explained that it actually took about as long to train an incoming developer (with no FP experience) in Haskell as it did to train incoming PHP developers on IMVU's in-house PHP "flavor" (frameworks, code organization... etc).

Picking up Haskell or Elm is a bit difficult by yourself for a few reasons: there's no clear path on what to learn, the learning materials are a bit hit-or-miss and there's a lot of incidental complexity. However, if you provide a bit of guidance (ie curate libraries) and help overcome some of the incidental complexity (ie install the compiler and tools) it's surprisingly accessible.

[1]: https://engineering.imvu.com/2014/03/24/what-its-like-to-use... (see "Training" section especially)

Re: Elm and Phoenix/Elixir in Production for France TV

#52
post #4
post #2

Nice writeup. Elixir definitely seems like a solid language for web dev. For the frontend, I prefer Scala.js since I'm kind of a Scala fanboy, but I've heard great things about Elm. One little comment. At the beginning of the post, you make it seem like the app needs to scale with the number of viewers, when in fact it doesn't. I think you should clarify this to avoid confusion.

We are doing a fairly large Elm app right now. And especially the refactoring reasons and static type system are appealing to us when you work in a team. Also being a functional language it is easy to crank out features in an afterthought, e.g. we added an Undo/Redo feature for operations the user does in this single-page client app. And being side-effect free this "merely" boils down in wrapping function calls in an…

> Also being a functional language it is easy to crank out features in an afterthought.

I am a big fan of functional languages, but I don't take for granted that they allow us to crank out any additional feature easily. The ease of adding of undo/redo functionality is a common selling point, but it seems to fall out directly from a preference for immutable data.

Re: Elm and Phoenix/Elixir in Production for France TV

#53
post #40

Earlier quoted context omitted.

The way Elm outputs JS today, it doesn't really have much to gain from being Closure compliant. Even uglify manages to remove most dead code from an Elm "blob", because Elm outputs javascript with a single scope. An Elm app is smaller than both a Cljs+React(om, reagent) and a JS+React app.

Dead code elimination is only part of the benefits of Closure. The advanced compilation mode does a lot to optimize the final JS.

I haven't had much luck the the advanced setting for Elm - seems to optimise too much away, and I get undefined field errors when I try to run the code.

Re: Elm and Phoenix/Elixir in Production for France TV

#54

Even if you don't like JavaScript, it's really surprising to me that a CTO picks something like Elm that nobody uses and only a few know or are interested in [1]. I'm curious to know how the author will recruit developers, specially in France. My last company migrated all its backend in Node this year, ONLY because it was the easiest option to recruit full-stack developers. The market is completely saturated here (th…

As he said, it was going to be used live and he wanted to be sure that it wouldn't blow up on set, whilst still allowing for rabid development in a small time window. Seems like a perfect use case.

Re: Elm and Phoenix/Elixir in Production for France TV

#55
post #47
post #37

Earlier quoted context omitted.

It really is. We're rebuilding our entire backend in Elixir and it's just been incredible every step of the way. I can't recommend it enough. The language and ecosystem are an amalgamation of industry lessons from the past three decades on what it takes to build robust networked applications. It's the most painless programming experience I've had. These days other languages feel like museum pieces when I have to jump…

Good to see industry uptake is picking up. Gives me hope that one day I can have a job programming in Elixir :)

Haha, what's more: through a series of coincidences I found out that the guy who built our competitor's product also did so with Elixir!

(Well... not quite competitor. A similar product to ours, but which deals with the management of electricity.)

So yeah, there's quite a few startup using Elixir already :) and a handful established companies as well. -- Pinterest, for example: http://venturebeat.com/2015/12/18/pinterest-elixir/ :

> The notification system runs across 15 servers, whereas the old system, written in Java, ran on 30. The new code is about one-tenth of the size of the old code.

Re: Elm and Phoenix/Elixir in Production for France TV

#57

Earlier quoted context omitted.

At the very least, Elm code should be compatible with Google's Closure compiler (just like Clojurescript). There is no reason the Elm folks should try to re-invent the wheel on this, just harness the power of the Closure utilities by making your emitted JS standardized and compliant. Then you get all sorts of things for free, like dead code elimination, just for starters. The Clojure team realized this from the start…

I disagree. Google Closure is antiquated and complicated to configure and adds a lot of unpleasant baggage to cljs. I love Clojurescript as a language, but using it alongside existing js libraries is awkward and error-prone, and getting the build process to work smoothly takes way more time than it should. Cljs gets a lot right too, but it shouldn't be held up as an example in this regard.

Do you know about cljs-js ? https://github.com/cljsjs/packages

Re: Elm and Phoenix/Elixir in Production for France TV

#58
post #55
post #47

Earlier quoted context omitted.

Good to see industry uptake is picking up. Gives me hope that one day I can have a job programming in Elixir :)

Haha, what's more: through a series of coincidences I found out that the guy who built our competitor's product also did so with Elixir! (Well... not quite competitor. A similar product to ours, but which deals with the management of electricity.) So yeah, there's quite a few startup using Elixir already :) and a handful established companies as well. -- Pinterest, for example: http://venturebeat.com/2015/12/18/pinte…

I guess time to start looking then :) Thank you for the info

Re: Elm and Phoenix/Elixir in Production for France TV

#59
post #53

Earlier quoted context omitted.

Dead code elimination is only part of the benefits of Closure. The advanced compilation mode does a lot to optimize the final JS.

I haven't had much luck the the advanced setting for Elm - seems to optimise too much away, and I get undefined field errors when I try to run the code.

That's because Elm does not output JavaScript in the standardized format for Closure.

Re: Elm and Phoenix/Elixir in Production for France TV

#60
post #57

Earlier quoted context omitted.

I disagree. Google Closure is antiquated and complicated to configure and adds a lot of unpleasant baggage to cljs. I love Clojurescript as a language, but using it alongside existing js libraries is awkward and error-prone, and getting the build process to work smoothly takes way more time than it should. Cljs gets a lot right too, but it shouldn't be held up as an example in this regard.

Do you know about cljs-js ? https://github.com/cljsjs/packages

Nope, I hadn't seen that. Definitely helps!
Post reply on HN