Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

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

Save for later
  • 3 min read
  • 27 Jul 2018

article-image
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.

  • Deprecated modules, functions, callbacks, and types now have a warning automatically attached to them.
  • Functions, macros, callbacks, and types now include the version in which they were added.
  • Future Elixir versions will include their own section for guards in the documentation and in the sidebar. They are currently exploring ways to generalize this feature in ExDoc itself.
  • Unlock access to the largest independent learning library in Tech for FREE!
    Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
    Renews at €18.99/month. Cancel anytime

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.

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