📎 Webclip
What's coming in Elixir 1.3
Elixir 1.3 adds several language and tooling changes that aim to make code more consistent, easier to refactor, and easier to inspect. The post also notes a few deprecations that may produce warnings in existing projects.
Reading notes#
- Imperative assignment is being deprecated so all special forms can move toward simpler, more consistent scoping rules, even if that means a little extra verbosity in some cases.
withgainselsefor handling error cases and guards, which makes nested control flow and error processing easier to express.- New date and time types are added to the standard library, improving interoperability between libraries that previously used different date packages.
escriptcan now be installed from a URL, and Mix gets tasks for listing and uninstalling installed escripts.- ExUnit gets a readable diff for failed tests, and
String.myers_difference/2supports that feature. - A
makecompiler is added for projects that need it, especially libraries that distribute NIFs. defdelegatedeprecates list usage and:append_first, while allowing optional parameters in delegates.Process.sleep/1is added, but the post recommends using it mainly for retry delays rather than waiting on tasks or monitoring processes.- OTP
optional_callbacksis supported so behaviour modules can define defaults and implementations can keep only the required callbacks. - New Mix tasks
deps.treeandapp.treeshow dependency and application trees. - The post ends by encouraging regular compilation against Elixir master to catch deprecations early.
