AstonJ

AstonJ

Thought this would be a nice way to start the year - have you seen or written an Elixir function or piece of code that you are particularly fond of? Perhaps you admired its simplicity (or complexity!) or maybe your surprised yourself or surpassed your own expectations of what is possible?

Whatever the reason, please share! :blush:

Showing Posts 1 to 2

Rob1

Rob1

Thanks for this question Aston. I hope my response adds value to this forum :), I didn’t post this anywhere yet:

I finished learning the basic Elixir syntax and put up this simple example of a GenServer with Supervisor project.

I was able to run a million tasks in 4.2 seconds seconds on my PC which is very good for a task queue like this, it means dispatching approximately 238,095 tasks per second which is very good.

I do realize that the latest HexDocs “antipatterns” document specifically calls out creating unnecessary GenServers:

An example of this anti-pattern, as shown below, is a module that implements arithmetic operations (like add and subtract ) by means of a GenServer process

And then pretty much shows something very similar to what I made, so I realize that it is not really an example of where I would use a GenServer in production.

But I feel proud of completing this task, since GenServers and supervisors are one of the more advanced concepts in Elixir, and this is, after all, a complete application that uses them.

hlx

hlx

Very good! If you are looking for next steps:

  • Look at replacing IO.puts/1 with Logger.debug/2
  • Write some tests that interact with the GenServer
  • See if you can start the genserver with a DynamicSupervisor
— All posts loaded —

Where Next? Top

Trending in Discussions Top

cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
achempion
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews