Hacker News new | past | comments | ask | show | jobs | submit login
Elm, Elixir, and Phoenix: Reflecting on a Functional Full-Stack Project (teamgaslight.com)
135 points by deathtrader666 on March 5, 2018 | hide | past | favorite | 36 comments



If anyone wants to learn more about the stack, Pragmatic Studio are about to release their course on Elixir/Phoenix/Elm - building Multi-Player Bingo. https://pragmaticstudio.com/courses/unpacked-bingo

I worked through their Elm course and it was excellent.


I have done several of their courses over the years and they have all been fantastic. Perfect pacing.


Your comment landed kind of spammy, is it a free course?


There are many comments on HN which recommend products/services that are not free. The fact that the course has a cost doesn’t make the comment “spammy”.

If the parent posted an affiliate link then that would have indeed been spam.

The courses from Pragmatic Studio are indeed excellent. Sometimes quality has a cost, and people should be ok with that. Not everything will be a free resource.

Note: I have no affiliation with Pragmatic Studio, they are just great courses.


Yeah, I should just ask the price ballpark.

It was not meant to criticize the OP but English is not my first language and sometimes I sound judgmental by mistake.


The courses on Pragmatic Studio are $50-80 each depending on the their length, which varies from 8-10 hours each.


Linking to a paid product is not a spam. If it was a paper book would you complain as well?


I can look for a paper book in a library, I can add it to my wish list at Amazon if the book is there, it is not always a hard cash investment.

And I love to read good reviews here, they spare me a lot of time I would otherwise use researching a service or product.

For me a good review of a paid resource must mention the price ballpark so people have a choice to follow the link or not. May be OP is just a happy customer and not affiliated with them in any way but IMHO the parent comment really sounds like a guerrilla marketing ad for me.


I think in the context of courses and books, it's more common that they are paid unless noted otherwise.

So in this case, if it happened to be a free course, I would have expected the parent comment to specifically mention that it's free, otherwise it's implied to cost money.

I'm kind of curious now, how exactly would you have written the parent comment's message?


My first answer to the OP sounded a lot more judgmental than intended.

His post is fine although I would try to spare fellow HNrs a visit to the site just search for basic information like duration and how much it costs or how it compares to similar online resources.


Well, since his post didn't have that information, it would be nice for you to provide that info and spare fellow HNrs a visit to the site, instead of accusing the poster of being a marketing drone.


I could not find price information - looks like they are just collecting emails, but someone in this thread mentioned other courses are in the 50-80 USD ballpark.


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.


I 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.


From 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.


I 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.


I 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.


Are you confused or am I confused? Elm does ship it's own runtime and standard library. Or at least it used to.


Whoops, I must be confused. I thought Elm compiled to Javascript, and didn't implement a custom runtime.


Elm does compile to JavaScript, but does come with it's own runtime on top of it and standard library.


Yeah, true_religion seems confused/misinformed.


> 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.


Have 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.


I 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.


Yeah, 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.


As an Elixir dev I tend to agree. I've found ClojureScript to be a nicer fit (Reagent with re-frame if needed).


What 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.


The Suave-Fable-Elmish stack (Made popular under the "SAFE-stack" name) is very nice. 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.


Why 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.


The 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.


I'm exploring ClojureScript on both client (browser) and server (node).

Or perhaps, some day, https://github.com/clojerl/clojerl.


And there's also LFE (Lisp Flavoured Erlang)[1] if you prefer Lisp to Lua.

  [1] http://lfe.io/


I'm not an elm developer, but i think its closest analogue is probably Reason or bucklescript-tea, neither of which is jvm-based.


Purescript is lots of fun to use and has a helpful community.


Seems pretty inconvenient that the library you want to use isn't allowed in elm's package repo.

edit: FYI, you have a typo:

> This is represented in Maybe‘s definition: type Maybe = Just a | Nothing.

Maybe's type is type Maybe a = Just a | Nothing


That was a much more involved read than I expected. I haven't really tinkered with Elm much, despite hearing a lot about it.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: