Elixir v1.16.0-rc.1 released

1. Enhancements

Elixir

  • [Code] Add :emit_warnings for Code.string_to_quoted/2
  • [File] Add :offset option to File.stream!/2
  • [Kernel] Auto infer size of matched variable in bitstrings
  • [Kernel] Preserve column information when translating typespecs
  • [String] Add String.replace_invalid/2

Logger

  • [Logger] Add Logger.levels/0

Mix

  • [mix archive.install] Support --sparse option
  • [mix compile.app] Warn if both :applications and :extra_applications are used
  • [mix compile.elixir] Pass original exception down to diagnostic :details when possible
  • [mix deps.clean] Emit a warning instead of crashing when a dependency cannot be removed
  • [mix escript.install] Support --sparse option
  • [mix release] Include include/ directory in releases

2. Bug fixes

Elixir

  • [Code] Keep quotes for atom keys in formatter
  • [Macro] Address exception on Macro.to_string/1 for certain ASTs
  • [Module] Make sure file and position information is included in several module warnings (regression)
  • [Path] Lazily evaluate File.cwd!/0 in Path.expand/1 and Path.absname/1

IEx

  • [IEx.Pry] Fix prying functions with only literals in their body

Mix

  • [mix archive.install] Restore code paths after archive.install
  • [mix escript.install] Restore code paths after escript.install
28 Likes

This will be really nice the next time I need that :smiley:

7 Likes

Looks like Enum.random got a cool speedup too, I enjoyed learning more about this technique: Implement Algorithm L for Reservoir Sampling in Enum · elixir-lang/elixir@8e9cbfc · GitHub

9 Likes

I am not sure what it means. It is when matching a known variable with ^ ?

Within the context of a binary pattern, yes: Automatically compute size for <<^var::binary>> · Issue #13089 · elixir-lang/elixir · GitHub

3 Likes

Alright thanks. Nice one indeed :slight_smile:

Small precision: it works with the <> shorthand too (used to raise an ArgumentError):

var = "foo"
^var <> rest = "foobar"
17 Likes