AstonJ

AstonJ

How has Elixir blown (or expanded!) your mind? Please tell us here!

Can be something that’s unique to Elixir, or just something that it introduced to you. Can be something you discovered a while ago.. or something you just come across - whatever it is, please share :023:

Showing Posts 40 to 31

namelos

namelos

Erlang/OTP is mind-blowing to me. However, if there’s no Elixir, I probably never actually take a serious look at them (although it was always on the todo list). I can raise some examples:

  1. I realized the scheduling efficiency is much more important than execution speed:
    Given Java is much faster than Erlang – Erlang is much faster than Java is most of the Web and other scenarios. The nature of most user-oriented scenarios is about unordered events and operations.
    Erlang vs Java is more like agile vs waterfall. If the requirement never changes probably waterfall is better, just like scientific calculation or batch operations. But more scenarios are dynamic, react to change is far more important than personal efficiency.

  2. I realized programming language is probably is not enough. We need operating systems. Processes. Applications. Isolation.
    Typically most of the libraries run on your threads, in typical programming languages. If one of them crashes, everything crashes unless you handle them.
    In typical language: two objects, one is saying ‘hi’ to another, and another responds with something the former does not understand. The whole world explodes. That’s crazy! And yet we’re so used to them.
    In typical operating system, if there are some application crashes, people is not expecting the whole operating system crashes. They’ll be really pissed if it does.

  3. Your database and your application could be the same thing.
    Actor is similar to this philosophy, and riak_core / lasp / o(e)rleans are stepping toward this direction. It’s not popular or easy to handle right now, but we will eventually be there. The database is always ‘the’ problem that makes me really think ‘there should be a much better’ way. After I read these solutions, I believe there’s a bright future for this philosophy.

They are really mind-blowing.
SICP and Lisp blew my mind on how to write software.
Erlang/OTP blew my mind on how to run software. And running software properly is so important nowadays.

nico_amsterdam

nico_amsterdam

Didn’t knew we had test coverage built-in.

Simply run:
mix test --cover

cjbottaro

cjbottaro

reduce is god. Didn’t really sink in until I started using a functional language for real.

Macros are fine, but macros calling other macros still makes my head hurt.

Pattern matching is the thing I miss most when working with other langs.

Eiji

Eiji

Something like that:

defmodule MyMind do
  @moduledoc "Simplified implementation of my mind on timeline!"

  @date_join ~D[2016-05-11]

  @doc "Not sure how much extra online English lessons affects those results …"
  @spec at(Date.t()) :: String.t()
  def at(date), do: date |> Date.compare(@date_join) |> do_at()

  defp do_at(:lt), do: "I think … I'm … fine … thank you …"
  defp do_at(_), do: "Yo bro! I'm great, thanks! And you?"
end

btw. Last time I tried to properly remind my past, but I hit such error:

Exception in thread "main" java.lang.StackOverflowError
        at java.io.PrintStream.write(PrintStream.java:480)
        at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
        at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
        at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:104)
        at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:185)
        at java.io.PrintStream.write(PrintStream.java:527)
        at java.io.PrintStream.print(PrintStream.java:669)
        at java.io.PrintStream.println(PrintStream.java:806)
        at MyMind.recursiveRemindPast(MyMind.java:65505)
        at MyMind.recursiveRemindPast(MyMind.java:65535)
        at MyMind.recursiveRemindPast(MyMind.java:65535)
        at MyMind.recursiveRemindPast(MyMind.java:65535)
        ...

Looks like there is still lots of work for me! :077:

csisnett

csisnett

It blows my mind how much you can learn about good software practices by reading the debates here, watching Elixir conferences or taking a course on elixir.

snake117

snake117

There are a lot of features of Elixir that are great, but this is probably the first thing I would mention as well. It’s amazing how much code this feature alone can clear up.

Another thing that impresses me is how fast new versions of Elixir are released. I feel like it wasn’t even that long ago I got the Programming Elixir 1.2 book and now the 1.6 book is out, but 1.8 is the latest version :stuck_out_tongue_closed_eyes:

nico_amsterdam

nico_amsterdam

Just discovered this one:

iex
iex(1)> :wx.demo()
victorolinasc

victorolinasc

One silly thing that really surprised me (coming from a Java World a while ago…) was this simple snippet:

raise_msg = &"Ooooops... something went wrong! Something: #{inspect(&1)}"

# some logic and then...

raise raise_msg.("bad thing")

Maybe this is common to Rubists and the like but it’s simple and I like it.

The first thing that shocked me on the BEAM was the fridge example in Learn You Some Erlang for Greater Good. It was that moment when light weight processes made sense and from there to gen_servers was easy. This is still my recommendation when someone is new to the BEAM (although it is written in erlang, it is really well written and easy to follow…).

Here is the final code that made me understand how to deal with mutable state using processes in an immutable language with recursion:

-module(kitchen).
-compile(export_all).

start(FoodList) -> spawn(?MODULE, fridge2, [FoodList]).

store2(Pid, Food) ->
    Pid ! {self(), {store, Food}},
    receive
        {Pid, Msg} -> Msg
    after 3000 ->
        timeout
    end.

take2(Pid, Food) ->
    Pid ! {self(), {take, Food}},
    receive
        {Pid, Msg} -> Msg
    after 3000 ->
        timeout
    end.

fridge2(FoodList) ->
    receive
        {From, {store, Food}} ->
            From ! {self(), ok},
            fridge2([Food|FoodList]);
        {From, {take, Food}} ->
            case lists:member(Food, FoodList) of
                true ->
                    From ! {self(), {ok, Food}},
                    fridge2(lists:delete(Food, FoodList));
                false ->
                    From ! {self(), not_found},
                    fridge2(FoodList)
            end;
        terminate ->
            ok
    end.
factoryd

factoryd

I was already in love with pattern matching from other languages. That stuff is seriously addicting. Like no turning back addicting.

I started a new job and Elixir was the only language in a list of pre-approved languages to write new stuff in.

Honestly…what blew my mind the most was realizing that this is what Akka is emulating. Except this is the real deal. No more messing with ExecutionContexts or defining huge nests of case classes. Or worrying about Haskellisms.

I love Elixir. It’s scratching every itch.

imprest

imprest

Code maintainability and comprehension for decent multi-core performance on a stable VM.
I rarely get that sinking feeling of technical debt
i.e. oh crap why am I doing this… this is going to be hard to maintain or change 10 years from now.

As a part-time programmer and business manager, Elixir is incredibly refreshing to write and maintain systems with.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
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
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
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
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
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

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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
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