Elixir Blog Posts

“It doesn’t even have static types!”

“The VM is heavy because I like Rust.”

“There are no jobs!”

Have I mocked now? :stuck_out_tongue:

5 Likes

More like stubbed at the back :neutral_face:

2 Likes

I started playing with Elixir’s Explorer library, trying to implement some code from python for time-series ML.
I wrote about the whole process, with code and benchmarks, if anyone is interested:

The Livebook

Preparing Financial Time Series for ML in Elixir: Going FAST with Explorer & a C NIF
ML in Elixir is getting more and more popular every day!
Working with Time Series in Elixir might sound like the best idea but turns out it is much faster and easier than you think! And together with NIFs we can really optimize performance. Together with Elixir’s beautiful syntax we can do A LOT and very fast. This is only the beginning!

I wrote a short blog post of creating static site in elixir and load phoenix component inside md files, I hope it is useful

4 Likes

I recently started blogging and just wrote my first blog post about Elixir!

In this post, I go through a common occurrence in large codebases: seemingly unrelated files being recompiled every time you change a module. It contains a deep dive on why this happens, how to fix and how to permanently prevent such long (re)compilation chains from showing up again.

The iteration time between making changes and observing changes should be as fast as possible. The slower it is, the more it impacts your productivity. If you suffer from long recompilation chains, I highly suggest you take the time to read the post!

3 Likes

For the sake of completion:
Part 2 of implementing bar types from Advances in Financial Machine Learning book, in Elixir!

Happy to hear any thoughts or comments!

Preparing Financial Time Series for ML in Elixir, Part 2: Information-Driven Bars — With Explorer & More NIFs!

https://medium.com/@yairoz/preparing-financial-time-series-for-ml-in-elixir-part-2-information-driven-bars-with-explorer-c59ccb996a68

1 Like

We wanted to use the Jina embeddings v2 model for an Elixir project but it’s not supported out of the box in Bumblebee.
Here, I describe how to implement and verify the Jina model so we can run it in Elixir.

Spoiler alert: it’s probably less work than you expect.

3 Likes

implementing more code from ‘Advances in Financial Machine Learning’ in Elixir. The labeling step, using the Triple Barrier Method:
The Triple Barrier Method: Labeling Financial Time Series for ML in Elixir

I had an issue with esbuild subprocess staying around as “zombie” and I finally found a solution I wanted to share with you:

At first I tried to exit when stdin was closed but it was not working, I found a workaround which uses an interval to send a SIGNULL signal to the parent to check if it is alive.

You should check for the closure of stdin to detect the parent closing the port. E.g. that’s how the bun package does it: bun/priv/wrapper.js at main · crbelaus/bun · GitHub

I tried, but it does not work reliably.

const cleanup = async () => {
  // Dispose the watch context properly
  console.log("--- dispose");
  await ctx.dispose();
  process.exit(0);
};

process.stdin.resume();
process.stdin.on("close", () => cleanup());

await ctx.watch();

This seems to work just fine for me.

1 Like

This works on my local machine but not on our shared dev server. With this I still find some zombie processes after a few days of people working on the project.

I recently made some optimizations at work that saved more than 40% CPU at peak time. The post explains how I identified and fixed the bottleneck

Blog - ETS vs Redis

2 Likes

I wrote an article about how we’re using Elixir’s Mix tasks, Sourceror, and Igniter to streamline project and dependency setup on client projects:

1 Like

I have been trying to exercise my writing muscles, getting past the barrier of finishing it up and posting it online. Therefore I chose a small subject for it, namely how default function arguments work in Elixir.

https://www.rigotti.nl/default-function-args-in-elixir/

1 Like

I wrote an article a little while back about transforming a typical Python for loop to Elixir pipelines or comprehensions - essentially how to go from imperative to functional. The filter, map, reduce rubric should be useful for anyone who isn’t used to Elixir comprehensions.

3 Likes

I wrote a short blog post of Improving SEO with Wallaby + Image + LiveBook. I hope it is useful :blush: :smiling_face_with_three_hearts:

3 Likes

A blog post about the challenges of deploying an application that scales in Kubernetes using releases

https://medium.com/@chargio/moving-from-a-single-pod-to-multiple-pods-in-k8s-with-a-simple-elixir-application-69b0f1cb71e8

I wrote a tiny blog post about:

  1. how to print out the type info of an Elixir variable and
  2. how to allow regexes in NimbleOptions definitions
2 Likes