Introduction to Elixir

Elixir is a dynamic, functional language designed for building scalable and maintainable applications. It is a functional, concurrent, general-purpose programming language that runs on the Erlang virtual machine (BEAM). Elixir builds on top of Erlang and shares the same abstractions for building distributed, fault-tolerant applications. Elixir also provides a productive tooling and an extensible design. The latter is supported by compile-time meta-programming with macros and polymorphismvia protocols.

José Valim is the creator of the Elixir programming language, an R&D project of Plataformatec. His goals were to enable higher extensibility and productivity in the Erlang VM while keeping compatibility with Erlang’s ecosystem.

All Elixir code runs inside lightweight threads of execution (called processes) that are isolated and exchange information via messages. Due to their lightweight nature, it is not uncommon to have hundreds of thousands of processes running concurrently in the same machine. Isolation allows processes to be garbage collected independently, reducing system-wide pauses, and using all machine resources as efficiently as possible (vertical scaling).

Processes are also able to communicate with other processes running on different machines in the same network. This provides the foundation for distribution, allowing developers to coordinate work across multiple nodes (horizontal scaling).

Elixir is used by companies such as E-MetroTel, Pinterest and Moz. Elixir is also used for web development, by companies such as Bleacher Report, Discord, and Inverse, and for building embedded systems. The community organizes yearly events in United States, Europe and Japan as well as minor local events and conferences.

Some of the features of Elixir are as follows:

  • A language that compiles to bytecode for the Erlang Virtual Machine (BEAM)
  • Everything is an expression
  • Erlang functions can be called from Elixir without run time impact, due to compilation to Erlang bytecode, and vice versa
  • Meta programming allowing direct manipulation of AST
  • Polymorphism via a mechanism called protocols. Like in Clojure, protocols provide a dynamic dispatch mechanism. However, this is not to be confused with multiple dispatch as Elixir protocols dispatch on a single type.
  • Support for documentation via Python-like docstrings in the Markdown formatting language
  • Shared nothing concurrent programming via message passing (Actor model)
  • Emphasis on recursion and higher-order functions instead of side-effect-based looping
  • Lightweight concurrency utilizing Erlang’s mechanisms
  • Railway oriented programming via the with construct
  • Built-in tooling for managing dependencies, code compilation, running tests, formatting code, remote debugging and more
  • Lazy and async collections with streams
  • Pattern matching to promote assertive code
  • Unicode support and UTF-8 strings

The above is a brief about Elixir complied from various sites. Watch this space for more updates on the latest trends in Technology.

Leave a Reply

Your email address will not be published. Required fields are marked *