Cellane

Cellane

Been asked to do a presentation about Elixir - what should I include?

I’ve been asked by my supervisors at work to finally give everyone in the team presentation about “that Elixir thing you can’t seem to shut up about” (:rofl:) so I’m busy preparing slides that would hopefully present a good pitch as to why FP and Elixir is a good idea. I’d be happy to hear about past talks and presentations from other people that I could use as inspiration!

Most Liked

dimitarvp

dimitarvp

Make VERY SURE to outline the runtime’s benefits:

  • Preemptive scheduling (what 99% of the runtimes out there don’t have)
  • OTP’s let it crash and get restored way of work
  • Supervisors!
  • Extremely easy to achieve parallelism and concurrency

Most people just fangirl at the language and a lot of other people are very rightfully not impressed. This decision is only 5-10% about the languages (say because of meta-programming / macros and good libraries). 90-95% of the benefit is the runtime so do your very best to highlight that!

dimitarvp

dimitarvp

Preemptive scheduling

Not one single OTP Process (what in other programming languages are called actors, green threads, fibers) can affect the latency of the others. The average execution time of any given function should remain mostly the same even under heavy load – a huge selling point IMO. That’s why Phoenix apps on $5 worth of servers can handle 2000+ requests a second (while a Ruby on Rails or Laravel vanilla app can be brought to its knees by 100-200 requests a second).

Parallelism / concurrency

Consider this:

def send_email_batch(list_of_emails) do
  # This will receive no more than 100 email addresses
  YourMailSender.send_batch_message(list_of_emails)
end

list_of_emails # Supposedly a very big list
|> Stream.chunk(100)
|> Task.async_stream(&send_email_batch/1, timeout: :infinity, max_concurrency: 20)
|> Stream.run()

:point_up: This will get a big list of emails, break the list into smaller lists of 100 emails each and send each chunk (batch) in parallel, but it never sends more than 20 batches at the same time (the :max_concurrency option of Task.async_stream), e.g. at any given time maximum of 2000 emails are being sent (if we assume this is your email sending provider’s API rate limit and that you want to comply with it).

This extremely transparent parallelism / concurrency is what brought me to Elixir.

AstonJ

AstonJ

Some great thoughts by Dimi and you might also find what Robert wrote in the Erlang Rationale worth a look :smiley:

These EF threads might also contain something of use?

:nerd_face:

Good luck and let us know how you get on :+1:

Where Next?

Popular Backend topics Top

AstonJ
Thought this video was interesting: What are your thoughts? Any areas you agree/disagree? Which web-dev tech do you think is worth ado...
New
New
DevotionGeo
Some time ago I read somewhere that Rocket will work with stable versions of Rust. The previous version’s changelog says, “Core: Removed...
New
New
finner
During a recent code review I came across this scenario: Code in review if (input.getValue() != null) { return Arrays.asList(value);...
New
First poster: bot
About Self Self is a prototype-based dynamic object-oriented programming language, environment, and virtual machine centered around the p...
New
First poster: bot
proposal: Go 2: permit types to say they may only be created by containing package · Issue #43123 · golang/go. It would be useful to per...
New
jaeyson
Hi all!, anybody tried this Elixir quiz from @Tetiana? She’s the one who made Elixircards.
New
jss
If you like video courses, maybe you should try this: https://clojureforpros.com/
New
apoorv-2204
I’m experimenting with Hexagonal / Clean Architecture in Elixir. The classic Behaviour + Impl split works great for mocking and isolating...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1023 17214 380
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New