Erlang/OTP 27 Released
All artifacts for the release can be downloaded from the Erlang/OTP Github release and you can view the new documentation at https://erlang.org/doc.
You can also install the latest release using kerl like this:
kerl build 27.0 27.0The new Erlang/OTP 27 release contains new features, improvements as well as a few incompatibilities. Some of the new features are highlighted below.
Many thanks to all contributors!
Documentation
EEP-59 has been implemented. Documentation attributes in source files can now be used to document functions, types, callbacks, and modules.
The entire Erlang/OTP documentation is now using the new documentation system.
New language features
Triple-Quoted Strings has been implemented as per EEP 64 to allow a string to encompass a complete paragraph.
Adjacent string literals without intervening white space is now a syntax error, to avoid possible confusion with triple-quoted strings.
Sigils on string literals (both ordinary and triple-quoted) have been implemented as per EEP 66. For example,
~"Björn"or~b"Björn"are now equivalent to<<"Björn"/utf8>>.Compiler and JIT improvements
The compiler will now merge consecutive updates of the same record.
Safe destructive update of tuples has been implemented in the compiler and runtime system. This allows the VM to update tuples in-place when it is safe to do so, thus improving performance by doing less copying but also by producing less garbage.
The
maybeexpression is now enabled by default, eliminating the need for enabling themaybe_exprfeature.Native coverage support has been implemented in the JIT. It will automatically be used by the
covertool to reduce the execution overhead when running cover-compiled code. There are also new APIs to support native coverage without using thecovertool.The compiler will now raise a warning when updating record/map literals to catch a common mistake. For example, the compiler will now emit a warning for
#r{a=1}#r{b=2}.The order in which the compiler looks up options has changed.
When there is a conflict in the compiler options given in the
-compile()attribute and options given to the compiler, the options given in the-compile()attribute overrides the option given to the compiler, which in turn overrides options given in theERL_COMPILER_OPTIONSenvironment variable.Example:
If
some_module.erlhas the following attribute:-compile([nowarn_missing_spec]).and the compiler is invoked like so:
% erlc +warn_missing_spec some_module.erlno warnings will be issued for functions that do not have any specs.
ERTS
The
erlcommand now supports the-Sflag, which is similar to the-runflag, but with some of the rough edges filed off.By default, escripts will now be compiled instead of interpreted. That means that the
compilerapplication must be installed.The existing experimental support for archive files will be changed in a future release. The support for having an archive in an escript will remain, but the support for using archives in a release will either become more limited or completely removed.
As of Erlang/OTP 27, the function
code:lib_dir/2, the-code_path_choiceflag, and usingerl_prim_loaderfor reading members of an archive are deprecated.To remain compatible with future version of Erlang/OTP
escriptscripts that need to retrieve data files from its archive should useescript:extract/2instead oferl_prim_loaderandcode:lib_dir/2.The default process limit has been raised to
1048576processes.The
erlang:system_monitor/2functionality is now able to monitor long message queues in the system.The obsolete and undocumented support for opening a port to an external resource by passing an atom (or a string) as first argument to
open_port(), implemented by the vanilla driver, has been removed. This feature has been scheduled for removal in OTP 27 since the release of OTP 26.The
pidfield has been removed fromerlang:fun_info/1,2.Multiple trace sessions are now supported.
configurenow automatically enables support for year-2038-safe timestamps.By default
configurescripts used when building OTP will now try to enable support for timestamps that will work after mid-January 2038. This has typically only been an issue on 32-bit platforms. Ifconfigurecannot figure out how to enable such timestamps, it will abort with an error message. If you want to build the system anyway, knowing that the system will not function properly after mid-January 2038, you can pass the--disable-year2038option toconfigure, which will enableconfigureto continue without support for timestamps after mid-January 2038.’STDLIB
There is a new module json for encoding and decoding JSON.
Both encoding and decoding can be customized. Decoding can be done in a SAX-like fashion and handle multiple documents and streams of data.
The new
jsonmodule is used by thejer(JSON Encoding Rules) for ASN.1 for encoding and decoding JSON. Thus, there is no longer any need to supply an external JSON library.Several new functions that accept funs have been added to module
timer.The functions
is_equal/2,map/2, andfiltermap/2have been added to the modulessets,ordsets, andgb_sets.There are new efficient
etstraversal functions with guaranteed atomicity. For example,ets:next/2followed byets:lookup/2can now be replaced withets:next_lookup/1.The new function
ets:update_element/4is similar toets:update_element/3, but takes a default tuple as the fourth argument, which will be inserted if no previous record with that key exists.
binary:replace/3,4now supports using a fun for supplying the replacement binary.The new function
proc_lib:set_label/1can be used to add a descriptive term to any process that does not have a registered name. The name will
be shown by tools such asc:i/0andobserver, and it will be included in crash reports produced by processes usinggen_server,gen_statem,gen_event, andgen_fsm.Added functions to retrieve the next higher or lower key/element from
gb_treesandgb_sets, as well as returning iterators that start at given keys/elements.common_test
Calls to
ct:capture_start/0andct:capture_stop/0are now synchronous to ensure that all output is captured.The default CSS will now include a basic dark mode handling if it is preferred by the browser.
crypto
- The functions
crypto_dyn_iv_init/3andcrypto_dyn_iv_update/3that were marked as deprecated in Erlang/OTP 25 have been removed.dialyzer
- The
--guioption for Dialyzer has been removed.ssl
- The
sslclient can negotiate and handle certificate status request (OCSP stapling support on the client side).tools
- There is a new tool
tprof, which combines the functionality ofeprofandcprofunder one interface. It also adds heap profiling.xmerl
- As an alternative to
xmerl_xml, a new export modulexmerl_xml_indentthat provides out-of-the box indented output has been added.For more details about new features and potential incompatibilities see the README.
Hooray for process labels ![]()
What a release. And it’s like an Elixirification of Erlang: they are using ExDoc for Erlang’s docs, added sigils and heredocs and new :json module in the stdlib.
Congratulations on the release and also to the ExDoc team who’ve paved the way for the new (much improved) Erlang docs. A bit fun that there’s now Elixir code in the main OTP repository.
Fantastic to see a native JSON encoder/decoder, hopefully it will trickle down into different Elixir projects soon ![]()
Wow, I love the new docs!
Has anyone experienced increased memory when running mix compile with OTP 27?
We are on Elixir 1.17.2 already and today I was working on upgrading from otp 26.2.5.1 to 27.0.1.
There is a 20-30% increase in memory consumption.
This can be expected, for several reasons. For example, if the compiler gets faster, it can now do more things (and potentially allocate more memory) within the same time frame. Or perhaps there are new compiler optimizations, which require more memory to execute.
If you have a particular module that is using memory, then it is something I can help debug, if it is the whole project, then it may be hard to pinpoint a particular cause.
Yes, it’s the whole project unfortunately. How would I measure the memory used for compiling each module?






















