Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Things I enjoy working with Elixir

Things I enjoy working with Elixir

In this talk I will show you the features that I like the most about Elixir and its ecosystem. What do I find most attractive? What language features make me more productive? How did I learn Elixir by myself in my spare time? Which tools and frameworks do I use?

Avatar for Carmen Berros

Carmen Berros

May 11, 2022
Tweet

Other Decks in Programming

Transcript

  1. Who am I? I work in Solarisbank AG, in the

    Lending Unit as Senior Software Engineer https://www.linkedin.com/in/mcberros/?locale=en_US
  2. How did I learn Elixir by myself in my spare

    time? - Udemy - https://elixir-lang.org/ - Practice, practice, practice: https://exercism.org/
  3. What is Elixir? - Dynamic, functional language for building scalable

    and maintainable applications. - Elixir leverages the Erlang VM, known for running low-latency, distributed, and fault-tolerant systems.
  4. Language features Dynamic Types are checked in run-time, not during

    compilation. Static types can be introduced in Elixir through typespecs.
  5. Language features Functional - Immutable data structures and no changing

    state - Functions are treated as first-class citizens
  6. Platform features Scalability - All Elixir code runs inside lightweight

    threads of execution (called processes) that are isolated and exchange information via messages Fault-tolerance - Elixir provides supervisors which describe how to restart parts of your system when things go awry, going back to a known initial state that is guaranteed to work.
  7. Erlang - We can use Erlang libraries from within their

    Elixir code. - Most common: - :crypto - hashing functions, digital signatures, encryption - :timer - functions related to time - :math - mathematical functions - :io - format text output - :rand - random values
  8. Mix

  9. OTP

  10. And the state? - Functional: No changing state - How

    do we maintain the state of a loan or a person? - We could use: - Using Processes and message passing - ETS (Erlang Term Storage) - Or abstractions instead of Processes directly: - Agent - Simple wrappers around state. - GenServer - “Generic servers” (processes) that encapsulate state, provide sync and async calls, support code reloading, and more. - Task - Asynchronous units of computation that allow spawning a process and potentially retrieving its result at a later time.
  11. Persistent workflows - We can use persistent workflows - We

    get the entity from the database, apply the operation, save in the database and continue the workflow - It is very easy to follow the flow
  12. Q&A