After dabbling with #Elixir for a bit last year and realizing that I had to dip into #Erlang as well, I got overwhelmed by the thought having to learn two languages and stopped learning either… 🙈
Now I’m between jobs (a few detail over here) and gave erlang a fair chance and I really like it! Reading https://learnyousomeerlang.com was pretty easy because I at least remembered all the basic types from elixir last year. Just had to learn the syntax for the most part.
I really really like how concise it is and embracing exceptions is refreshing after all those years of if err!=nil { return err }
which you usually have after each statement in Go. Check out this comparison of a basic WAV file reader I ported from Go to Erlang. I know get why people praise its ability to destructure binary formats so well. It’s brilliant.
At first I could implement some parts of http://willowprotocol.org which has been haunting me like Casper the friendly ghost, after having met @gwil and @Aljoscha at p4p in Berlin earlier this year. It felt like a bit too tough as a mountain and I didn’t really know where to start. I wanted something more immediately useful instead of stating a model train that I don’t feel comfortable sharing with others.
So I instead picked up cable last week, Cabal’s new partial replication protocol. It’s shaping up quite nicely already for about a week of work. It decodes and verifies all the basic types, adding encoders now that I’m mostly done with the network and request / response handling. The way that processes and message passing forces you to isolate state feels really elegant and not as… “oppressive” as I assumed.
Repo is over here: https://git.sr.ht/~cryptix/caberl
Next big step is adding persistence, for which I will try to leverage sqlite, for now at least. Super stretch goal is having a basic UI written in elixir/phoenix before my new job starts in November. Let’s see where we end up. I’m already much further along then I guessed when I started.
I also gave a quick introduction to Cable if you haven’t heard or heard the time to look into it: https://m.youtube.com/watch?v=PQvXn6plVHY - It’s a 24minute video so it just touches on the high level concept without going into too much detail of what the encoding is like etc. Let me link the slides here as well. (I don’t think I can turn them into a blob in manyverse)