News

Elixir 1.7, the programming language for Erlang virtual machine, releases

2 min read

Elixir 1.7 has been released. Elixir builds on top of Erlang designed for building scalable and maintainable applications. This release is focused on improving error handling, logger reporting, and documentation. It also brings improvements to ExUnit, Elixir’s testing library.

ExUnit improvements

ExUnit is Elixir’s unit testing library. ExUnit uses Elixir macros to provide error reports when a failure happens using the assert macro. The assert macro can look at the code, extract the current line, extract the operands and show a difference between the data structures alongside the stacktrace when the assertion fails.

However, for certain ‘bare’ assertions, ExUnit usually re-runs the tests, debugging or printing the values. In Elixir 1.7, now, whenever a “bare” assertion will fail, it will print the value of each argument individually.

E.g, For a simple example such as assert some_vars(1 + 2, 3 + 4), users will get this report:

Their build tool Mix has also received new updates.

  • There is a new –failed flag that runs all tests that failed the last time they ran.
  • The coverage reports generated with mix test –cover includes a summary out of the box.

Updates to the ExDoc tool

ExDoc is a tool to generate documentation for user Elixir projects. It leverages metadata to provide better documentation for developers. These are the updates to ExDoc.

Erlang/OTP logger integration improvements

Elixir 1.7 fully integrates with the new :logger module available in Erlang/OTP 21. The Logger.Translator mechanism has also been improved to export metadata, allowing custom Logger backends to leverage information such as:

  • :crash_reason, a two-element tuple with the throw/error/exit reason as the first argument and the stacktrace as the second.
  • :initial_call, the initial call that started the process.
  • :registered_name, the process’ registered name as an atom.

Updates to Logger configuration system

From Elixir 1.7 the Logger macros such as debug, info, will evaluate their arguments only when the message is logged. The Logger configuration system also accepts a new option: compile_time_purge_matching that allows users to remove log calls with specific compile-time metadata.

There are also certain developments in areas not directly related to the Elixir codebase. A new Development section has been added to the website, that outlines the Elixir team structure and goals. It also now has its own mini-documentary.

Read the Elixir-lang blog for the full list of Elixir 1.7 updates. You can also check the Install section to get Elixir installed and read the Getting Started guide to learn more.

Read Next

Elixir Basics – Foundational Steps toward Functional Programming
5 Reasons to learn programming

Sugandha Lahoti

Content Marketing Editor at Packt Hub. I blog about new and upcoming tech trends ranging from Data science, Web development, Programming, Cloud & Networking, IoT, Security and Game development.

Share
Published by
Sugandha Lahoti

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago