# Compiler Release Notes

## Compiler 4.0

### Fixed errors and malfunctions

- If records happened to be defined with initializers so that they included each other recursively, the compilation would eat up all memory and then crash. Now, an error message is given instead.
  (Own Id: OTP-2677)

- When using the `warn_unused_vars` option to the compiler, warnings could previously be incorrectly given for variables used within list comprehensions.
  (Own Id: OTP-3412)

- When using the option `warn_unused_vars` when compiling, unused variables introduced inside a `case`, `receive` or `if` were not always reported.
  (Own Id: OTP-3729)

### Improvements and new features

- The guard tests `list/1`, `atom/1` etc. now also have the names `is_list/1`, `is_atom/1`. All these guard tests are also BIFs that can be used in expression in function bodies, too.
  (Own Id: OTP-3791)

- There are more compiler optimisations. In particular, lists comprenhensions and record updates are faster.
  (Own Id: OTP-4142)

- Floating point operations are significantly faster if the compiler knows that floating point is involved. The guard bif `is_float/1` can be used ensure that the compiler knows the type.
  (Own Id: OTP-4143)

- To faciliate constructing records containing wildcards for functions such as `ets:match/2` and `mnesia:match_object/3`, a special field named `_` can now be assigned, meaning that all fields not explicitly assigned in the same record update will be assigned. Example: `#person{name = "Nisse", _ = '_'}`
  (Own Id: OTP-4147)

- New short-circuit versions of `and` and `or` called `andalso` and `orelse` have been added. They terminate evaluation of the boolean expression as soon as the truth value is known. The new operators cannot be used in guards.
  (Own Id: OTP-4148)

- The boolean operators `and`, `or`, and `not` can now be used in guards.
  (Own Id: OTP-4149)

- The compiler in R8 will issue a warnings when the atoms or functions `try` or `cond` are used, as these will be keywords in a future version of Erlang.
  (Own Id: OTP-4150)

- In the Open-Source release of Erlang/OTP, the HiPE (High Performance Erlang) extension can be enabled. (Using `./configure --enable-hipe` when building.) If the runtime-system is hipe-enabled, a module can be native-code compiled like this:

  `c(Module, [native|OtherOptions])`.

  Compiling in this way, the beam file will contain both standard beam byte-code and the native code. If loaded on a hipe-enabled system the native code will be loaded; otherwise the beam-code will be loaded.

  HiPE is supported for Ultra Sparc and Intel Pentium.
  (Own Id: OTP-4153)

There are also release notes for older versions.