Live data from Hacker News

Elixir 1.9

elixir-lang.org

71–80 of 174 posts

Re: Elixir 1.9

#71
post #39

If anyone is on the fence on learning Elixir / Phoenix (Elixir's most popular web framework library) please do yourself a favor and give it a shot. If you're on a time crunch and want the best bang for your buck on "why bother learning yet another language to write web apps in?" then watch this talk called "The Soul of Erlang and Elixir": https://www.youtube.com/watch?v=JvBT4XBdoUE I'm not affiliated with the languag…

My preferred way of learning a new language/framework is watching someone walk through creating a real app in that language/framework so I can see all the folders/files I need to touch and the thought process moving step-by-step. Unfortunately I haven't found much in the way of that for Phoenix, the stuff on Udemy is pretty outdated last time I checked. Any recommendations?

The way I've learned so far was building my own app while skimming the docs and looking at successful open source projects like https://github.com/thechangelog/changelog.com for inspiration and guidance. Basically error driven development and looking up things as needed. Of course also taking advantage of IRC / Slack / Forums when I get really stuck.

But recently I read the Programming Phoenix 1.4 book (written by the authors of Elixir and Phoenix) and it really filled in a ton of gaps and made so many things click together. I can't speak highly enough about it. In fact, finishing that book today is what provoked me to write my comment here. The book might be exactly what you're looking for as like 5% of the book focuses on the super basics and a toy example, but 95% of the book focuses on building up a pretty real app and layering on features as you go. It's also up to date and feature complete even though the book is labeled as a beta release.

By the time you finish the book, you exercise a ton of interesting things along the way (including how to take advantage of Erlang's VM to build features that would be 100x more effort and probably 10x worse in other tech stacks). You definitely don't just build a simple todo app. I don't even want to say what we build in the end because it feels like a spoiler. I only say that because when I hit the last section of the book I had no idea what was coming and was blown away by what it covers. It literally made me smile for hours just thinking about how badass everything is when it all comes together.

Re: Elixir 1.9

#72
post #39

If anyone is on the fence on learning Elixir / Phoenix (Elixir's most popular web framework library) please do yourself a favor and give it a shot. If you're on a time crunch and want the best bang for your buck on "why bother learning yet another language to write web apps in?" then watch this talk called "The Soul of Erlang and Elixir": https://www.youtube.com/watch?v=JvBT4XBdoUE I'm not affiliated with the languag…

My preferred way of learning a new language/framework is watching someone walk through creating a real app in that language/framework so I can see all the folders/files I need to touch and the thought process moving step-by-step. Unfortunately I haven't found much in the way of that for Phoenix, the stuff on Udemy is pretty outdated last time I checked. Any recommendations?

For event sourcing in Elixir this is a very good walk-through: https://blog.nootch.net/post/event-sourcing-with-elixir/

Another example is: https://github.com/AltTracker/alttracker

It's an implementation of fully functional site. The beauty of Elixir is that the code is very readable.

Re: Elixir 1.9

#73
post #19

Earlier quoted context omitted.

I would be curious to know what makes this feature a major selling point. Aren't rolling deploys easier to handle? I'm not saying it's not a great feature, but honestly, it probably stopped being useful since Erlang/OTP was originally designed.

It's a difference in run time purpose. With a single code base capable of having millions of processes running as the norm, some handling direct client requests and others handling in-progress work, data storage, holding open connections for transfers, etc...you get the capability to deploy without disrupting ANY of that. Most run times can't do anything close to that. Think about all of those X million websocket ben…

For all that to work you will need:

- to understand exactly what your app is doing

- to understand exactly what Erlang/Elixir releases are doin

- to understand exactly how cod upgrade works

- to understand exactly or very damn well how to make the system handle those 1 million connections

- to understand exactly how to handle all the things you wrote about

And then, and only then will you be able to "think about being able to deploy without forcing all X million to try to reconnect at the same time."

There are no magic bullets.

Re: Elixir 1.9

#74
post #69
post #39

If anyone is on the fence on learning Elixir / Phoenix (Elixir's most popular web framework library) please do yourself a favor and give it a shot. If you're on a time crunch and want the best bang for your buck on "why bother learning yet another language to write web apps in?" then watch this talk called "The Soul of Erlang and Elixir": https://www.youtube.com/watch?v=JvBT4XBdoUE I'm not affiliated with the languag…

I gave it a try, but for me after years of programming in C like languages the syntax is really hard. I know it is very similar to Ruby. I wish there was a ElixirC syntax that would also compile to Earlang.

After years of programming with C-like langauges, I actually came to really appreciate the syntax of Erlang. It's actually fairly simple and straightforward. I think the biggest issues people have with it are:

* Capitalized variables names

* use of comma, semi-colon, and period as clause delimiters

It's interesting, but I think that Prolog-style syntax is probably the easiest to read if you don't have syntax highlighting available (though I don't think there is as much of a difference with syntax highlighting).

Re: Elixir 1.9

#75

One part of releasing Elixir applications I never found a definite answer was how closely the build environment has to match the final environment where the release is deployed. The Erlang runtime is bundled with a release, and this part is platform-dependent as far as I understand. If I'm writing an application that I'll only deploy myself I can of course match the environments exactly. But what about if I wanted to…

This sounds like a job for Docker to me. Build a container, deploy an image to Kubernetes. Someone else wants to use it, they can get it running wherever they want to run containers without worrying about the runtime environment other than just the container configuration.

Re: Elixir 1.9

#76

One part of releasing Elixir applications I never found a definite answer was how closely the build environment has to match the final environment where the release is deployed. The Erlang runtime is bundled with a release, and this part is platform-dependent as far as I understand. If I'm writing an application that I'll only deploy myself I can of course match the environments exactly. But what about if I wanted to…

It needs to be a matching libc. So a release that includes the Erlang runtime and is built on Debian (glibc) won't run on Alpine (musl).

Re: Elixir 1.9

#77

I know nothing about Elixir/erlang besides following installs for apps. I have used it, installed via ASDF on my Raspberry pi since dependencies weren't up to date. Can anyone provide a good place to start on where to get started with Elixir? I tend to learn by working on stuff and not just reading etc, maybe a step by step in elixir? I am going into the literature now as well Thanks in advance for any help!

The How I Start guide was just updated for 1.9 http://howistart.org/posts/elixir/1/index.html

Re: Elixir 1.9

#78

Earlier quoted context omitted.

It's a difference in run time purpose. With a single code base capable of having millions of processes running as the norm, some handling direct client requests and others handling in-progress work, data storage, holding open connections for transfers, etc...you get the capability to deploy without disrupting ANY of that. Most run times can't do anything close to that. Think about all of those X million websocket ben…

For all that to work you will need: - to understand exactly what your app is doing - to understand exactly what Erlang/Elixir releases are doin - to understand exactly how cod upgrade works - to understand exactly or very damn well how to make the system handle those 1 million connections - to understand exactly how to handle all the things you wrote about And then, and only then will you be able to "think about bein…

Eh...it’s basically a 1 line command with distillery. Another for the rollback capability.

It’s pretty magical. There’s a reason people love it.

Certainly, don’t use it if you don’t need it...it introduces extra complexity...but if you do it’s really hard to beat.

Re: Elixir 1.9

#79
post #69
post #39

If anyone is on the fence on learning Elixir / Phoenix (Elixir's most popular web framework library) please do yourself a favor and give it a shot. If you're on a time crunch and want the best bang for your buck on "why bother learning yet another language to write web apps in?" then watch this talk called "The Soul of Erlang and Elixir": https://www.youtube.com/watch?v=JvBT4XBdoUE I'm not affiliated with the languag…

I gave it a try, but for me after years of programming in C like languages the syntax is really hard. I know it is very similar to Ruby. I wish there was a ElixirC syntax that would also compile to Earlang.

I think you might find one that suits your needs in this list

https://github.com/llaisdy/beam_languages

Re: Elixir 1.9

#80

One part of releasing Elixir applications I never found a definite answer was how closely the build environment has to match the final environment where the release is deployed. The Erlang runtime is bundled with a release, and this part is platform-dependent as far as I understand. If I'm writing an application that I'll only deploy myself I can of course match the environments exactly. But what about if I wanted to…

adding to what kungfooguru said, if your concern is just distributing the software, you don't need hot upgrades and you don't mind packaging the VM with it, you can compile to escript[1] and run the binary everywhere, just like you do with jars on the JVM (of course you need the BEAM installed on the system, while releases are self contained).

[1] https://hexdocs.pm/mix/master/Mix.Tasks.Escript.Build.html

Post reply on HN