Great start with Elixir

Reading Time: 2 minutes

What is Elixir?

Elixir is a functional programming language and it leverages the Erlang VM, known for running low-latency, distributed, and fault-tolerant systems. It provides successful participation in web development, embedded software, data ingestion, and multimedia processing, across a wide range of industries. 

Elixir Installation in ubuntu

Here, is the installation part of elixir in ubuntu and the only prerequisite of installing elixir is erlang version 22.0 or later.

  • Ubuntu or Debian
    • Add Erlang Solutions repository: wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb && sudo dpkg -i erlang-solutions_2.0_all.deb
    • Run this command: sudo apt-get update
    • Install the Erlang/OTP platform and all of its applications: sudo apt-get install esl-erlang
    • Install Elixir using this command : sudo apt-get install elixir

Elixir runs in two formats one is ex and another one is exs. Exs is the script version that is not gonna be compiled to a beam file which is erlang virtual machine runs.

Language Feature

Functional Programming

Functional programming promotes a coding style that helps developers write code that is short, concise, and maintainable., and pattern matching allows developers to easily destructure data and access its contents.

Extensibility and DSLs

Elixir has been designed to be extensible, letting developers naturally extend the language to particular domains, in order to increase their productivity.

Tool Feature

Tools like IEx (Elixir’s interactive shell) are able to leverage many aspects of the language and platform to provide auto-complete, debugging tools, code reloading, as well as nicely formatted documentation.

$iex is an entry point to the interactive elixir shell.
i variable_name provides the information about data types of variables.

Example code

Like every programming language has modules and functions, similarly here we are using the module in elixir IO which is just output text.

Conclusion

This blog has brief information about the dynamic functional programming language Elixir. It also gives some information about installation in ubuntu or interactive elixir shell.

knoldus

Written by 

Rakhi Pareek is a Software Consultant at Knoldus. She believes in continuous learning with new technologies. Her current practice area is Scala. She loves to maintain a diary to put on her thoughts daily. Her hobby is doodle art.