Elixir is a functional programming language that was created by José Valim. It’s popular among programmers because of its simplicity and speed, but it can also be used for more complex tasks. This article will guide you on how to get started with Elixir programming language so that you can become a master of your craft!
- Download Erlang from erlang.org. You can find the latest version here: https://www.erlang-solutions.com/download/.
- Install Erlang on your computer by following a specific set of instructions
Elixir is a functional programming language, so you need to install the tools first. The official website of Elixir has instructions on how to do this: https://docs.elixir-lang.org/en/latest/.
Generally, Ubuntu 16.04 is used to install Erlang 18, in order to get started with the Elixir programming language. It seems that Ubuntu 18 doesn’t come with Erlang by default anymore but if you’re running an older version then follow their instructions for installing it here: https://www.ubuntuhandbook.org/index_files/section_16_-_installing_packages_on_ubuntu_1604/.
Create your first project
You can start your first Elixir project with the following steps:
- Create a new file and name it “HelloWorld”. The below code will create Hello World in your text editor:
- Now you need to import some modules from elixir into your project so that we can use them later on when executing our application in iex shell or iex command line interface (CLI). These are:
- ExUnit – For testing purposes;
- Ecto – For database access;
- After installing all the above-mentioned prerequisites, run these commands one by one until they finish successfully: For eg.:“`bash mix deps.get“`
Run your code
The first way to run your code is by typing it in the terminal. You can use the iex command for this purpose, which stands for Interactive Elixir and is what you’ll use when your program needs to be run directly from the command line.
The most basic example of using this feature would be:
iex> 1 + 2
Start using packages
If you want to add new features or remove repetitive code, packages are the way to go. They can be used to extend the functionality of your code, as well as allow you to reuse code that already exists in Elixir.
Some examples of useful packages include:
- Ecto – Database access
- Hex – Hexagonal data structures (lists, maps etc.)
If you want to learn more about Elixir, then the best way is by getting involved in the community. There are several ways that you can do this:
- The Elixir community website has links to all sorts of useful information on their site. They also have a great forum where you can ask questions and get answers from other users.
- The official documentation for Elixir is available here: https://elixir-lang/docs/4_0_0/. This will give you a good overview of what it takes to learn this language and build applications with it!
- If you’re more interested in using Slack (or another chat platform) instead of forums or mailing lists, there’s an official Slack channel for Elixir called [#elixirc](https://www.slackinboxes).
You can learn this language but you have to start from the beginning.
When you start learning Elixir, it’s important to know that there is no single way to learn the language. While some people may be able to get up and running with their first Elixir project in a few hours or days, others may spend months struggling with basic concepts before they can even write code.
There are three main ways you can approach learning Elixir:
- Install Erlang (the OTP library) and then install both Erlang and Elixir on your machine. This will give you everything needed to run an application locally on your computer. You can then use that toolset as a starting point for developing new projects or improving existing ones; however, if you don’t have experience using Ruby/Rails or NodeJS before starting this path then expect some frustration along the way!
- If installing those packages seems overwhelming at first glance then consider creating something small like an IRB console interpreter which allows developers without any knowledge about server-side languages such as Ruby/Rails etc…to write simple scripts without having access through command line tools like rails console, etc
In this article, you’ve learned how to install Elixir and Erlang, create your first project and run it. We covered some basic essential commands that are useful in any programming language. If you want to learn more about Elixir or Erlang, stay tuned for more!