Wilson Mar bio photo

Wilson Mar

Hello!

Calendar YouTube Github

LinkedIn

Elixir leverages the Erlang BEAM VM for running low-latency, distributed, and fault-tolerant systems in web development, embedded software, data ingestion, and multimedia processing.

US (English)   Norsk (Norwegian)   Español (Spanish)   Français (French)   Deutsch (German)   Italiano   Português   Estonian   اَلْعَرَبِيَّةُ (Egypt Arabic)   Napali   中文 (简体) Chinese (Simplified)   日本語 Japanese   한국어 Korean

Overview

This is a hands-on tutorial to provide you a deep yet succinct introduction sequenced in logical order for fastest learning. “PROTIP” tags identify items which are not in most other sites.

NOTE: Content here are my personal opinions, and not intended to represent any employer (past or present). “PROTIP:” here highlight information I haven’t seen elsewhere on the internet because it is hard-won, little-know but significant facts based on my personal research and experience.

  1. https://elixir-lang.org is the marketing home page for the Elixir language.

    Famous users of Elixir mentioned on the Elixir home page are Farmbot and Pepsico.

    • https://serokell.io/blog/elixir-companies
    • https://serokell.io/blog/elixir-in-production

    Elixir was created after Go and Rust.

    The website is built using Jekyll at
    https://github.com/elixir-lang/elixir-lang.github.com

  2. Elixir is open sourced under Apache 2.0 license at
    https://github.com/elixir-lang/elixir
  3. https://github.com/elixir-lang/elixir/wiki

  4. See the 12-minute documentary featuring: Jose Valim; Justin Schneck, co-author of the Nerves framework; and [at 9:13] @Chris_McCord, creator of the Phoenix Framework

    • https://www.youtube.com/watch?v=lxYFOM3UJzo
    • https://cult.honeypot.io/originals/elixir-the-documentary
    • https://elixircasts.io/getting-started-with-phoenix

  5. VIDEO: Elixir Tutorial by Derek Banas

Elixir and Erlang compile to the same bytecode.

Erlang VM (BEAM) users

  • https://www.wikiwand.com/en/Elixir_(programming_language)
  • https://github.com/membraneframework/beamchmark

BEAM for Erlang is like JVM for Java.

WhatsApp is using it. Also Pinterest. “Almost all telecoms”?

Erlang BEAM runs backbone switches with 500-600 gigabits throughput per each in eighties with like 10-20 milliseconds of downtime per year. They actually originally written software for those switches in C++ (few years of hundreds of devs work) but it crashed with like few dozen simultaneous calls, so that project was a huge failure and then Joe Armstrong’s team of THREE devs written software in Erlang in few months and it was huge success. It was basically the first production-level implementation of CSP actor model concurrency.

Any Erlang thread can push code to any node in the mesh.

https://github.com/llaisdy/beam_languages There are 33 languages on the BEAM!

https://news.ycombinator.com/item?id=27684045 stressgrid benchmarks

VIDEO: Why We’ve Adopted Elixir by Pusher

https://serokell.io/blog/elixir-in-production-glific

https://github.com/0xAX/erlang-bookmarks/blob/master/ErlangBookmarks.md List of websites about Erlang


Installs

This section is based on:

  • https://www.pluralsight.com/guides/installing-elixir-erlang-with-asdf
  • https://joyofelixir.com/a-setup-and-install
  • https://elixir-lang.org/install.html

One-off install

If you’re creating a temporary enviornment to run whatever is the latest version of Elixir (without Erlang), on MacOS using Homebrew:

    brew install elixir

Alternately, on Fedora & Ubuntu, see: https://gist.github.com/rubencaro/6a28138a40e629b06470

Verify install

  1. Verifying Elixir is done the same way across all *nix operating systems:

    elixir -v

    The response at time of writing:

    Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace]
     
    Elixir 1.13.1 (compiled with Erlang/OTP 24)
    

    Previously:

    Erlang/OTP 23 [erts-11.1.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe] [dtrace]
     
    Elixir v1.10.4
    

    IEX (Interpreted Elixir)

  2. You’ll see the same version by invoking the Interactive Elixir console:

    iex
    Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace]
     
    Interactive Elixir (1.13.1) - press Ctrl+C to exit (type h() ENTER for help)
    iex(1)> _
    

CAUTION: If you are connected to a compromised distributed node, your computer can then run code on YOUR PC (to view your private files, steal SSH keys, etc.). That can occur via remote shell option iex --remsh or --sname

OTP from Erlang

PROTIP: The “OTP” in “Erlang/OTP 24” version name stands for “Open Telecommunications Platform”. Telecommunications because the Erlang library was developed by the Swedish telecommunications company Ericsson in the 1990’s.

PROTIP: Erlang OTP version 24 adds a JIT compiler. It only runs on x64 but should significantly improve performance on that platform. For some workloads people are reporting as much as a 40% improvement. I would expect to see some improvement in those benchmarks as a result.

OTP 25 plans to have JIT support for ARM64 (on AWS Gravator servers).

  • https://serokell.io/blog/elixir-otp-guide

OTP is set of tools and libraries that Elixir inherits from Erlang, a programming language on whose VM it runs.

OTP contains the Erlang compiler, databases, test framework, profiler, debugging tools. But, when Alchemists (developers program in Elixir) talk about OTP in the context of Elixir, they usually mean the Erlang actor model that is based on lightweight processes that make Elixir so efficient.

An Erlang process is much lighter than an operating system’s threads and processes.

“Elixir is synatactic sugering on Erlang”[1]

Erlang functions can be called from Elixir, and vice versa, without run time impact, due to compilation to Erlang bytecode.

  • As part of https://elixir.libhunt.com/ “Awesome Elixir”, Elixir utilities: https://elixir.libhunt.com/categories/935-utilities

ASDF to manage Elixir and Erlang versions

Thus, many Elixir projects require a correspondence between the Elixir and Erlang runtime versions.

Like NVM is needed for Node.js work or Rbenv for Ruby, ensure that your project installs a specific version of Elixir and Erlang by using the ASDF version manager.

NOTE: ASDF is not an acronym but is the four letters on the QWERTY keyboard layout home row for the left hand.

ASDF enables you to switch among versions (of multiple languages) by ensuring that each version of each project has the environment it needs.

  1. On MacOS:

    brew install coreutils curl git
  2. Clone ASDF into a folder in your $HOME folder:

    git clone https://github.com/asdf-vm/asdf.git ~/.asdf --depth 1

    NOTE: To remove ASDF, simply remove folder .asdf from your home directory and undo the configuration changes described below.

  3. Include ASDF in your shell’s configuration:

    For zsh, add the following to ~/.zshrc or ~/.bash_profile:

    source $HOME/.asdf/asdf.sh

    Alternatively, if you use oh-my-zsh, add asdf to your plugin configuration.

  4. Install languages as ASDF Plugins. A typical Elixir project needs the Elixir and Erlang plugins:

    asdf plugin add erlang

    Sample response:

    initializing plugin repository...Cloning into '/Users/wilsonmar/.asdf/repository'...
    remote: Enumerating objects: 3585, done.
    remote: Counting objects: 100% (779/779), done.
    remote: Compressing objects: 100% (541/541), done.
    remote: Total 3585 (delta 456), reused 479 (delta 234), pack-reused 2806
    Receiving objects: 100% (3585/3585), 815.43 KiB | 2.75 MiB/s, done.
    Resolving deltas: 100% (1818/1818), done.
    
    asdf plugin add elixir
    initializing plugin repository...Cloning into '/Users/wilsonmar/.asdf/repository'...
    remote: Enumerating objects: 3585, done.
    remote: Counting objects: 100% (779/779), done.
    remote: Compressing objects: 100% (541/541), done.
    remote: Total 3585 (delta 456), reused 479 (delta 234), pack-reused 2806
    Receiving objects: 100% (3585/3585), 815.43 KiB | 2.75 MiB/s, done.
    Resolving deltas: 100% (1818/1818), done.
    
  5. If your project requires Node.js, also install the nodejs plugin.

    https://medium.com/@marcelo_lebre/a-tale-of-three-kings-e0be17a16e2b compared Python/Flask, Go, and Elixir (with plug and cowboy) and concluded “Go might be best for processing, Elixir for I/O intensive services, and Python for more mainstream scenarios.”

    https://www.researchgate.net/publication/326165107_Comparing_languages_for_engineering_server_software_erlang_go_and_scala_with_akka

Versions available

PROTIP: ASDF requires that a precise version be specified for each language to be installed.

  1. Use ASDF to list all available versions of Erlang:

    asdf list-all erlang
    # ...
    24.1.7
    24.2
    # ...
    
  2. Use ASDF to list all available versions of Elixir:

    asdf list-all elixir
    # ...
    1.13.1-otp-23
    1.13.1-otp-24
    # ...
    master-otp-23
    master-otp-24
    # ...
    

    Notice that each Elixir version references the version of Erlang (such as 24).

  3. Navigate your project folder root to create a .tool-versions file to specify precise versions of each language to be installed:

    </pre>asdf local erlang 24.2 asdf local elixir 1.13.1-otp-24 </pre>

  4. Create a .tool-versions file in your account $HOME directory so that ASDF can use those versions whenever a project doesn’t specify versions of its own:

    asdf global erlang 24.2
    asdf global elixir 1.13.1-otp-24
    

    Security vulnerabilities

  5. View the list of security vulnerabilities identified:

    http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=elixir

    https://vulmon.com/searchpage?q=elixir

    Install ASDF version manager

  6. Install Erlang:

    asdf install erlang 24.2
    
    In the sample response, there may be messages during the installation about omitted modules, which will not affect the rest of the runtime.
    
    Erlang compiles modules based on the available libraries from your system. For example, some features (such as the built-in observer) require wx libraries. 
    
    CAUTION: Usage of :observer.start REQUIRES use of the cookie-based node system.
    
    
    asdf_24.2 is not a kerl-managed Erlang/OTP installation
    No build named asdf_24.2
    Downloading 24.2 to /Users/wilsonmar/.asdf/downloads/erlang/24.2...
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
    100   652  100   652    0     0   3060      0 --:--:-- --:--:-- --:--:--  3075
    100  102M  100  102M    0     0  4443k      0  0:00:23  0:00:23 --:--:-- 9087k
    Extracting source code
    Building Erlang/OTP 24.2 (asdf_24.2), please wait...
    Build failed.
    checking if we can add -fno-common to CFLAGS (via CFLAGS)... yes
    checking C99 support... yes
    checking CFLAGS for -O switch... configure: error: 
      CFLAGS must contain a -O flag. If you need to edit the CFLAGS you probably
      also want to add the default CFLAGS. The default CFLAGS are "-O2 -g".
      If you want to build erts without any optimization, pass -O0 to CFLAGS.
    ERROR: /Users/wilsonmar/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts/configure failed!
    ./configure: line 366: kill: (-21348) - No such process
    make: *** No rule to make target `is_cross_configured'.  Stop.
    make: *** No rule to make target `all'.  Stop.
     
    Please see /Users/wilsonmar/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_build_24.2.log for full details.
    
  7. Install Elixir:

    asdf install elixir 1.13.1-otp-24
    
    
  8. Replace the versions above with those you used during installation. This will create a .tool-versions file in your project, which will instruct ASDF which versions to use. If you’d like to set a global, or default, version, run:

Have mix install dependencies

At last count (Jan 2022), there were 11,500 packages on hex.pm, the package manager for Erlang.

Mix is like Ruby’s RubyGems, Bundler, and Rake combined (for dependency management).

NOTE: A “.mix” folder is created within your user $HOME folder.

See https://elixirschool.com/en/lessons/basics/mix

Mix dependencies as two-item tuples like {:plug, “~> 1.1.0”}

  1. Install

    mix deps.get

    Example response:

    Resolving Hex dependencies...
    Dependency resolution completed:
    Unchanged:
      dialyxir 1.1.0
      erlex 0.2.6
      file_system 0.2.10
      mix_test_watch 1.0.2
           * Getting dialyxir (Hex package)
           * Getting mix_test_watch (Hex package)
           * Getting file_system (Hex package)
           * Getting erlex (Hex package)
    
  2. Learn about applications:

    mix help compile.app | more

    As with all Linux, at the “:”, press spacebar on keyboard to page down or up/down arrow to move a single line at a time.

    Press “Q” to exit display mode.

  3. Learn about dependencies:

    mix help deps | more
  4. Create a Mix project for a new app: https://elixirschool.com/en/lessons/basics/documentation#exdoc-4

    mix new hello_world
  5. To identify vulnerabilities, see

    https://snyk.io/blog/secure-elixir-development-with-snyk/

    Get sample code in GitHub

  6. See a list of all repos on GitHub:

    https://github.com/topics/elixir

  7. In the list of libraries containing code samples:

    https://github.com/h4cc/awesome-elixir

    There is this:

  8. Get the “Learn with me” repo github.com/Maultasche/LwmElixirCode before starting from the first of Kevin Peter’s 82 learning diary entries on The Inquisitive Developer:

    git clone git@github.com:Maultasche/LwmElixirCode.git --depth 1
    cd LwmElixirCode
  9. Navigate to the lib folder:

    Like Python and Javascript, Elixir is a dynamically-typed language, where data types can be determined at run time rather than compile time.

    Invocation

    REMEMBER: Compiled Elixir source code files have extension of .ex for the application’s main business logic, invoked using iex app.ex.

    .exs file extension are for interpreted code. Test specification files have extension of .exs (containing assert commands), invoked using elixir test.exs.

    Again, .ex is for compiled code, .exs is for interpreted code.

    https://elixirschool.com/en/lessons/basics/iex_helpers#iexexs-2 Every time IEx starts it will look for a configuration file named .iex.exs in the current directory or the user’s $HOME directory as the fallback.

  10. Check whether typespecs are accurate:

    mix dialyzer

    Notice the end of the run:

    Total errors: 0, Skipped: 0, Unnecessary Skips: 0
    done in 0m1.08s
    done (passed successfully)
    
  11. List files generated by above command:

    archives
    dialyxir_erlang-24.2.plt
    dialyxir_erlang-24.2_elixir-1.13.1.plt
    

GitHub repositories

https://github.com/search?q=elixir

STAR: https://elixirschool.com/en at https://github.com/elixirschool/elixirschool

https://www.wikiwand.com/en/Mix_(build_tool) Mix is a build automation tool that provides tasks for creating, compiling, and testing Elixir projects, managing its dependencies, and more.

Weather app

https://www.codewars.com/collections/elixir


Hello World Interactive

The Greetings.ex program in Elixir defines two nested modules:

  • String concatenation uses the <> operator:

    iex> name = "Sean"
    iex> IO.puts("Hello " <> name )
    "Hello Sean"
     
defmodule Greetings do
  @moduledoc """                # attribute
  Example of basic language features
  """
  def morning(name) do
    "Good morning, #{name}"  # string interpolation is like in Ruby
    IO.puts("Hello " <> ${name} )  # <> concatenates
  end
end
   

To execute within Elixir’s interactive mode:

iex
iex> Greetings.morning "Joe"

The response:

"Good morning, Joe"

Language Features

VIDEO: “Elixir: The only Sane Choice in an Insane World” by Brian Cardarella at GOTO 2017

“Why We Chose Erlang over Java, Scala, Go, C” at InfoQ

https://elixirschool.com on basics covers the subject so succinctly. Some notable features:

  • Sigils, which are prefixed with a tilde “~”, is Elixir’s way of handling literals. https://elixirschool.com/en/lessons/basics/sigils

    iex> Date.utc_today
    ~D[2028-12-31]
     
    iex> t = Time.utc_now
    ~T[19:39:31.056226]
     
    iex> t.hour
    19
     
     

    https://elixirschool.com/en/lessons/basics/date_time

  • Elixir supports Perl Compatible Regular Expressions (PCRE), so “i” can be appended to the end of a sigil to turn off case sensitivity.

  • An atom is a constant (what Ruby calls symbol) whose name is a colon and its value:

    iex> :true === true
    true
     

    CAUTION: Atoms are not garbage collected, so can be a vector for denial of service attacks.

  • Atoms are used to reference modules from Erlang libraries (including built in ones):

    @doc Using crypto library:
    :crypto.strong_rand_bytes 3
    <<23, 104, 108>>
     
  • List concatenation:

    iex> [1, 2] ++ [3, 4, 1]
    [1, 2, 3, 4, 1]
     
    iex> [1] -- [3, 4, 1]
    [2, 3, 4, 1]
     
  • ”++/2” describes the function as having an Arity of 2 arguments. To list built-in modules and their Arity:

    iex> Map.  # press Tab
    delete/2             drop/2               equal?/2             
    fetch!/2             fetch/2              filter/2             
    from_struct/1        get/2                get/3                
    get_and_update!/3    get_and_update/3     get_lazy/3           
    has_key?/2           keys/1               map/2                
    merge/2              merge/3              new/0                
    new/1                new/2                pop!/2               
    pop/2                pop/3                pop_lazy/3           
    put/3                put_new/3            put_new_lazy/3       
    reject/2             replace!/3           replace/3            
    split/2              take/2               to_list/1            
    update!/3            update/4             values/1        
     
  • Import List to use its “last” and “first” (item) functions:

    iex> import List
    nil
    iex> first([1, 2, 3])
    1
    iex> last([1, 2, 3])
    3
     
    
    
  • Use List comprehension - square root generator:

    iex> list = [1, 2, 3, 4, 5]
    iex> for x <- list, do: x*x
    [1, 4, 9, 16, 25]
     
  • Keyword list:

    iex> for {_key, val} <- [one: 1, two: 2, three: 3], do: val
    [1, 2, 3]
     
  • From a keyword list create into a map:

    iex> for {k, v} <- [one: 1, two: 2, three: 3], into: %{}, do: {k, v}
    %{one: 1, three: 3, two: 2}
     
  • Maps are unordered keyword lists:

    iex> map = %{:foo => "bar", "hello" => :world}
    %{:foo => "bar", "hello" => :world}
     
    iex> %{map | foo: "baz"}
    %{foo: "baz", hello: "world"}
     
    iex> map[:foo]
    "bar"
     
    iex> key = "hello"
    "hello"
     
    iex> %{key => "world"}
    %{"hello" => "world"}
     
    iex> map.hello
    "world"
     

See

  • https://elixirschool.com/en/lessons/basics/enum
  • https://elixirschool.com/en/lessons/basics/pattern_matching
  • https://elixirschool.com/en/lessons/basics/control_structures
  • https://elixirschool.com/en/lessons/basics/functions
  • https://elixirschool.com/en/lessons/basics/pipe_operator is |>

Logging

Elixir 1.11 in 2020 completes all log levels in Erlang:

  • Logger.notice
  • Logger.critical
  • Logger.alert
  • Logger.emergency

PROTIP: Catching of logging sensitive information is difficult to automate (even during Dynamic Security Testing) and thus currently require manual/team code review.

Thread Safety

  • https://dockyard.com/blog/2021/03/30/elixir-is-safe

Like Akka, Elixir uses the “Actor Model” where processes don’t share memory and communicate only with messages. Instead of sharing memory, Elixir/Erlang only passes messages. Thus, stack smashing is impossible since everything is held in the HEAP and the stack is simulated.

No chance for deadlocking.

To spawn a self-contained process thread for non-blocking IO:

IO.inspect ["Hello from process ", self()]
spawn(fn -> IO.inspect ["Hello from process ", self()] end)

BEAM Performance

According to Griffin Byatt, Erlang uses an alternative to XML, JSON, etc. by using zlib compression (:erlang.term_to_binary and :erlang.binary_to_term) to serialie data to binary before sending it over the wire or saving it in files, which may be vulnerable to “binary zip bombs” which can consume more memory than the app has. So vigilence is necessary.

See https://www.toptal.com/back-end/server-side-io-performance-node-php-java-go

Testing Elixir Functionality

  1. Execute the test:

    mix test

    See https://elixirschool.com/en/lessons/testing/basics

  2. When running a test initially, watch it step by step:

    mix test.watch

    $40 BOOK: https://pragprog.com/titles/lmelixir/testing-elixir/ “Testing Elixir: Effective and Robust Testing for Elixir and its Ecosystem” by Andrea Leopardi and Jeffrey Matthias (Pragmatic Bookshelf, July 2021) “Create and structure a comprehensive ExUnit test suite, starting from the basics, and build comprehensive test coverage that will provide safety for refactoring and confidence that your code performs as designed. Explore testing Elixir-specific challenges such as OTP-based modules, asynchronous code, Ecto-based applications, and Phoenix applications.”

  3. Press control + C

    BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
        (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
    
  4. Craft ExUnit tests

    ExUnit is Elixir’s official unit testing framework – maintained by the Elixir team and shipped with Elixir, so you don’t have to install anything additional.

Language Features

Elixir/Erlang aims for predictable behavior that operates gracefully under extreme circumstances.

Emphasis on recursion and higher-order functions instead of side-effect-based looping.

Elixir is a functional language, which means lazy evaulation, pattern matching, and “higher-order” functions which can receive and output a function as well as data.

Elixir uses Erlang NIF’s (Native Implemented Functions) to bring in C or Rust to compute heavy math.

Elixir was designed from the ground up for fault tolerance. Unlike Go, the entire Go program goes down when a goroutine crashes. In Elixir, whenever a process dies, only that single process dies, without affecting the rest of the program. Even better, the failed process will get restarted automatically by its supervisor. This allows the failed process to retry the operation that has failed.[5]

Robustness is achieved by supervisors which monitor Elixir processes and restart them when they crash.

Phoenix Framework

VIDEO: Getting Started with Phoenix to bootstrap a web app.

VIDEO: https://www.phoenixframework.org/

Previously: VIDEO: “Phoenix a Web Framework for the New Web” by José Valim at GOTO 2016 Conference.

Out of the box, Phoenix supports WebSockets, routing, HTML templating language, internationalization, JSON encoders/decoders, seamless ORM integration(Ecto), sessions, SPA toolkit, and a lot more.[5]

https://elixirschool.com/blog/now-with-more-elixir From Jekyll to Phoenix using https://elixirschool.com/en/lessons/misc/nimble_publisher

Phoenix implements the server-side Model View Controller (MVC) pattern.

https://serokell.io/blog/introduction-to-phoenix

CAUTION: “Don’t put BEAM on a public network, ever. Ericsson is not going to fix it”. said Don A. Bailey in 2017. (In distributed Phoenix/Erlang, monotonic timers are used to auto-generate cookies based on host uptime (nmap). Cookies are converted to an atom.)

VIDEO description of exploit was pointed out by Andrei Clinciu.

PROTIP: So setup Erlang with TLS/SSL with certificates and public key encryption, as epmd may still talk UNENCRYPTED.

And setup a firewall that blocks everything unless specifically allowed.

github.com/dependabot/elixir-security-advisories is a repository of CVE security advisories filed against published Elixir packages.

Sobelow scanner

VIDEO: ElixirCast: Sobelow by Griffin Byatt is a security-focused static analysis tool to identify (OWASP) vulnerabilities in the Phoenix Framework.

  1. VIDEO: “. Install github.com/nccgroup/Sobelow

    mix archive.install hex sobelow
  2. Verify Sobelow (-compact):

    mix sobelow -v

    If you see:

    WARNING: Sobelow cannot find the router. If this is a Phoenix application
    please use the `--router` flag to specify the router's location.
    
    mix sobelow --router filepath

TOOL: https://snyk.io/blog/secure-elixir-development-with-snyk/

Octo database toolkit

Phoenix ships with PostgreSQL as the database.

https://github.com/elixir-ecto/ecto Ecto is the go-to database library in the Elixir ecosystem, to interact with SQL databases such as Postgres and MySQL - inserting, validating, changing, and querying data.

See https://serokell.io/blog/ecto-guide-for-beginners

Phoenix Liveview

In 2020 the Phoenix framework introduced LiveView to enable building of rich real-time web interfaces within Elixir (like Single-Page Applications, but with no JavaScript and React coding). Thus, more customized user experience with less complexity.

elixir-liveview-spa-compare-1290x530
from VIDEO: “Phoenix LiveView for web developers who don’t know Elixir” says “I don’t think you can implement Google Maps in LiveView”.

https://elixirschool.com/blog/phoenix-live-view/

VIDEO: LiveView takes care of synchronizing client and server state, so you don’t have to develop and maintain a REST/GraphQL API.

[7] BOOK: “Phoenix in Action” (Manning 2021 TWITLESS40) by Geoffrey Lessel VIDEO. From Manning [video]

See https://www.testingliveview.com/

Livebook

Livebook https://github.com/livebook-dev/livebook is inspired by Jupyter Notebooks and Deepnote. Like Jupyter, combining markdown with executable Elixir code blocks that let the reader not only learn from the docs but try out the system being documented right in the ReadMe.

Nerves Framework

Nerves is a programming framework for building embedded systems in Elixir, such as Raspberry Pi.

https://twitter.com/NervesProject

https://hexdocs.pm/nerves/installation.html

https://pragprog.com/titles/thnerves Build a Binary Clock with Elixir and Nerves

Nerves can be used together with Phoenix: An IoT Birdhouse Picam MJPG stream with Elixir Nerves (poncho project) & Phoenix LiveView Components (DHT GenServer) at https://github.com/daskycodes/bird_app. Setup include SSH & WiFi to send snaps to a telegram chat

Broadway

https://github.com/dashbitco/broadway Broadway enables building of data ingestion/data processing pipelines in Elixir.

BOOK: https://pragprog.com/titles/lhelph “Functional Web Development with Elixir, OTP, and Phoenix” by Lance Halvorsen (Pragmatic BookshelfJanuary 2018) uses Elixir version 1.5 or higher and Phoenix 1.3.

Meta programming

Use Elixir to write code that writes code.

https://serokell.io/blog/elixir-metaprogramming

BOOK: https://pragprog.com/titles/cmelixir Metaprogramming Elixir

Challenges

https://github.com/bijanbwb/enbala_take_home

Video Subcriptions

Various technical subscription service vendors stream video tutorials (view instead of Netflix, HBO, Disney+, etc.):

https://elixircasts.io $190/year for “Alchemist’s Edition” paywall.

OReilly.com has videos and live classes as well as books from Pragmatic (for one $499 subscription).

At Pluralsight:

Udemy.com has several courses from independent authors

At time of writing, these services did not return content after a search for “elixir”:

References

[1] VIDEO: Why Elixir Matters: A Genealogy of Functional Programming by Osayame Gaius-Obaseki (@osagius)

[2] VIDEO: “Let’s Get Functional with Elixir!” by Nate Taylor</a>: “Elixir is a functional language for everyone, where I felt dumb with Haskell”.

[5] https://betterprogramming.pub/modern-languages-suck-ad21cbc8a57c compares aspects for each language. by Ilya Suzdalnitski, Senior Elixir engineer.

https://pragprog.com/categories/elixir-phoenix-and-otp/

BOOK: “Elixir in Action, Second Edition” by Sasa Juric (Manning, February 2019) “teaches you how to build production-quality distributed applications using the Elixir programming language. Author Saša Juric introduces this powerful language using examples that highlight the benefits of Elixir’s functional and concurrent programming.”

Social

DOTHIS: Sign up for: http://elixirforum.com

https://twitter.com/hashtag/myelixirstatus https://twitter.com/elixirlang https://twitter.com/elixir_radar

The first ElixirConf was held 2017 in Warsaw Poland. SUBSCRIBE.

VIDEO: ElixirDaze 2016 - Processing 2.7 million images with Elixir (vs Ruby) by David Padilla from Confreaks

Jobs

https://www.indeed.com/jobs?q=elixir&l=Remote

https://www.linkedin.com/jobs/search/?geoId=103644278&keywords=elixir&location=United%20States

https://bendyworks.com/#what-we-do

DockYard

https://thoughtbot.com/services/elixir-phoenix


More on languages

This is one of a series on programming languages: