Elixir Icon

Elixir

Elixir is a dynamic, functional language designed for building scalable and maintainable applications.
61 Stories
All Topics

Elixir dockyard.com

Creating a Sonos volume knob with Elixir and LiveView

Steven Fuchs loves his Sonos, but…

While it is the radio of the future, our most common usage is as the radio of the past. We tend to tune it to one station and leave it there. By far, our most common interactions with the system are changing the volume and pausing/playing the music, often creating scrambles to find a phone to turn down the volume in order to answer a different phone. What we needed was an analog interface to this digital system that was always at arms reach.

Hackers gonna hack. Steven reached for Elixir and scratched his own itch with this very cool little hardware project. Here’s a demo video of it in action.

Elixir simplabs.com

Writing Rust NIFs for Elixir with Rustler

A Native Implemented Function is implemented in C (or Rust when using Rustler) and can be called from Elixir or Erlang just like any other function. It’s the simplest and fastest way to run native code from Erlang but it does come with a caveat: a crash in a NIF can bring down the whole BEAM. This makes Rust a safer option than C for implementing NIFs as its type system and ownership model guarantee memory and thread-safety.

Jerod Santo YouTube

Jonathan Clem from the GitHub Actions team joins me for a jam session

I thought it’d be cool to get mix test and mix format running on pushes to the changelog.com repo, so I gave GitHub Actions the old college try. After (not too much) futzing around on my own, I figured I’d have more success by getting an expert to help out. Good call be me! 😆

In this ~1 hour jam session, we go from zero to a successful Actions workflow. I learned a lot along the way, and you might too by joining us on the journey. Thanks, Jonathan!

The Changelog The Changelog #402

What's next for José Valim and Elixir?

We’re joined again by José Valim talking about the recent acquihire of Plataformatec and what that means for the Elixir language, as well as José. We also talk about Dashbit a new 3 person company he helped form from work done while at Plataformatec to help startups and enterprises adopt and run Elixir in production. Lastly we talk about a new idea José has called Bytepack that aims to help developers package and deliver software products to developers and enterprises.

Jerod Santo YouTube

Using Phoenix LiveView to build a collaborative scratch paper like Google Docs

Jam session! I sat down (metaphorically) with Phoenix’s new LiveView feature to see if I can integrate it into our admin to provide a Google Docs-esque experience for podcast co-hosts.

This is my first long-form video where I work toward a goal with no clue how to actually get there. Please let me know if you dig this style in general and/or if you have any advice on the particulars.

José Valim dashbit.co

An upcoming authentication solution for Phoenix

José Valim, writing on the Dashbit blog:

I have thought about launching “Devise for Phoenix” probably hundreds of times. I had long conversations with Chris McCord (creator of Phoenix) and co-workers about this. Helping Phoenix users get past the burden of setting up authentication can be a great boost to adoption. At the same time, I never found a proper way to approach the problem.

You can probably guess what’s coming next…

About 2 months ago I decided to handwrite a simple and secure authentication solution on top of a Phoenix application.

Cool stuff. Click through to learn the details of what he came up with (and what’s happening next).

Johanna Larsson blog.jola.dev

Building Hex Diff

Johanna Larsson built the super cool Hex Diff tool for the Elixir community. What does it do?

In short, you input any Hex package name and a version range, and it will generate a highlighted git diff for you, right there in your browser. Not only that, but you can also share the link to the diff, and even highlight a specific row.

In this post on her blog, Johanna goes into the details of how she built the project, how it works, and issues she ran into along the way.

Lars Wikman underjord.io

Lumen - Elixir & Erlang in the browser

Lars Wikman:

The Lumen Project is an alternative implementation of the Erlang VM, more known as the BEAM. It is designed to work in WebAssembly with the specific goal of bringing Elixir and Erlang to the browser with minimal overhead, tightly compiled rather than porting a full VM. Can it replace JS for some developers?

An excellent article, highly recommended. Lars hangs out in our community chat and suggested we do an episode with the Lumen team. Talks are underway, so stay tuned for that.

Elixir github.com

A source code companion to Elixir's official Mix/OTP guide

This is a great resource to have at your disposal while reading the official Elixir docs.

While working throughout the guide - there were multiple positions where the ideolog seemed overwhelming resulting to various logical bugs because of shorthand syntax mismatch. There is no repository available to cross-check your results either to fix your bugs. Hence - I thought it would be nice to have this as a reference guide to how you need to implement your project.

I need this in my life.

Jonathan Clem jclem.net

On the utility of Phoenix LiveView

Jonathan Clem:

What I’m most excited for with Phoenix LiveView isn’t necessarily the cool technology that it really is, but more the freedom that it gives me to quickly implement nice-to-have features that would otherwise be too much work to bother with.

I’m having a lot of fun with Svelte right now, but it’s probably time for me to turn my attention to LiveView. Where there’s enough smoke, there’s usually 🔥…

Phoenix mitchellhanberg.com

Temple – an elegant HTML library for Elixir and Phoenix

Conventional template languages like EEx use a form of interpolation to embed a programming language into a markup language, which can result in some ugly code that can be difficult to write and debug.

Temple is written using pure elixir.

There are some good ideas here, for sure. (Click through for code samples.)

My concern with this (and with pretty much all non-HTML style template languages) is cognitive overhead for folks who’d rather be writing HTML. That being said, if I were creating a web app from scratch all by my lonesome, I’d 💯% give Temple a go.

Rust blog.discordapp.com

Using Rust to scale Elixir for 11 million concurrent users

The Discord team bumped up against some limitations of the BEAM (Erlang’s virtual machine) when dealing with rather large data structures:

The double-edged sword of immutable data structures is that mutations are modeled by taking an existing data structure and an operation and creating a brand new data structure that is the result of applying that operation to the existing data structure.

This meant that when someone joined a server — internally referred to as guilds — with a Member List of 100,000 members, we would have to build a new list with 100,001 members in it.

You’ll want to click through and read all of the data structures they tried to fix this problem. It’s some seriously solid engineering and I love how they continued to measure and push themselves further. Finally, they reached for Rust thanks to BEAM’s NIF feature and really scaled up the speed.

0:00 / 0:00