Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Elixir 1.2 Brings Enhancements, Performance Improvements

Elixir 1.2 Brings Enhancements, Performance Improvements

This item in japanese

José Valim has announced version 1.2 of the dynamic, functional programming language Elixir.

Valim, creator of Elixir, says it "brings enhancements, bug fixes, performance improvements and more," noting that it requires at least Erlang 18+.

In the blog post Elixir v1.2 released, Valim lists several notable improvements to the language. These include the addition of multi aliases/imports/require, support for variables in map keys, support for the pin operator in map keys and function clauses, and the addition of the with special form to match on multiple expressions, replacing:

case"my_file.ex") do
  {:ok, contents} ->
    case Code.eval_string(contents) do
      {res, _binding} ->
        {:ok, res}
      error ->
  error -> error

with the more concise:

with {:ok, contents} <-"my_file.ex"),
     {res, binding} <- Code.eval_string(contents),
     do: {:ok, res}

Improvements to the Elixir workflow include the ability for umbrella applications to share both build and configuration files, with Valim noting that this aims to "drastically reduce compilation times" in umbrella projects. This is done by adding the configuration:

build_path: "../../_build",
config_path: "../../config/config.exs",

to each umbrella app's mix.exs file.

"Mix will now consolidate protocols by default as we are now able to consolidate in parallel and cache the consolidation results, providing the best performance across all environments without affecting compilation times," Valim continues.

As an experimental feature in Elixir 1.2, developers can opt-in to allow Mix to fetch and compile Rebar 3 dependencies.

On Hacker News, in the related discussion Elixir 1.2.0 Released, sentiment towards the release and Elixir in general was so positive it led user cxz to comment

I'd be curious to hear some criticism, negative experiences, downsides from people with deeper experience. This thread is 100% positivity and praise, which is highly unusual for HN.

Despite this, the original sentiment remained positive, with user elteto commenting "From my experience the positivity is not unwarranted, Elixir is a great, young language with an awesome community (as most new languages have)."

The only sign of criticism came from the user gleb, who commented that there were some small "problems", saying

The only one that really concerns me is Ecto and its integration in Phoenix. It makes simple things hard and hard things impossible.

More generally, I don't get the feeling that Phoenix was "extracted from a production web app" like Rails was. With Rails you knew there was at least one app, Basecamp, that worked on top of it. With Phoenix I am not so sure. This is a very preliminary opinion, but first impressions matter.

Demonstrating the community's reputation, José Valim responded personally to gleb, saying he would "love to hear more about the Ecto/Phoenix integration and what feels hard and what feels impossible," inviting the user to email him.

More details about Elixir 1.2 can be found in the changelog. Elixir is released user an Apache 2 licence, and InfoQ readers eager to contribute to the language should check the and guides for more information.

Rate this Article