# Highlights
Erlang 5.3/OTP R9C

> This document describes the major new features of and changes to Erlang 5.3/OTP R9C, compared to Erlang 5.2/OTP R9B. Some of them have already been delivered as patches to R9B and/or R8B. For more detailed information, please refer to the release notes for the individual applications.

> This version is focused on improved performance and stability, rather than introducing new functionality, hence it is called R9C. As it is not a major release, the highlights of R9B are included as well.

## Documentation

- Erlang Reference Manual NEW
  Describes the Erlang programming language. The focus is on the language itself, not the implementation. The language constructs are described in text and with examples rather than formally specified, with the intention to make the manual more readable.
- OTP Design Principles, describing behaviours and how to program OTP applications, has been rewritten.
- The modules `erl_tar` and `filelib` have been documented and are thus now officially supported.

## Build Process NEW

The build process has been improved so that it is possible to build Erlang/OTP from source even on Windows platforms. There is also a completely new installation program for Windows.

## ERTS, Erlang emulator

- The BIF erlang:hibernate/3 allows a process to shrink its memory consumption while waiting for messages. Could be used instead of saving out a process's data to an ETS table and terminate it.
- Major improvements regarding memory management.
  - A number of new specialized memory allocators have been introduced in order to further reduce the memory consumption of the emulator. For example, allocators for binary data and ets data. Most allocators can be enabled/disabled and fine-tuned. In order to resemble the Erlang 5.2/OTP R9B emulator, most of the new allocators are by default disabled. See the ERTS documentation on how to tune the different memory allocation features.
  - New functionality for inspection of memory usage.
- A new option i to the system flag +B makes it possible to start an Erlang system which ignores the break signals, i.e cannot be terminated with CTRL-C. This can be used to protect a system from termination caused by a mistake by the operator. See the documentation for the `erl` command.

## Compiler, Erlang compiler

- When updating a record, the record is now always checked for the correct record tag and size. Earlier versions of the compiler did not consistently add such a test (depending on the size of the record and the number of fields updated).
- For the bit syntax, it is now supported to match with a sizefield that is bound (from left to right) during the same matching. Example:
  `<<Size, B:Size/binary,Rest/binary>> = <<2,"AB",3,"CDE">>`
  During the matching Size is bound to 2 and then used as the size for B which will be bound to "AB" etc.

## Crypto

Previous versions of Crypto where delivered with statically linked binaries based on SSLeay. That is not longer the case. The current version of Crypto requires dynamically linked OpenSSL libraries that the user has to install. The library needed is `libcrypto.so` (Unix) or `libeay32.[lib|dll]` (Win32). For further details see the `crypto(6)` application manual page.

## HiPE, High Performance Erlang

Significantly improved performance for bit syntax matchings.

## Erl_interface

- New ei functions where added to encode and decode GCC and Visual C++ 64 bit extended integer types.
- The ei library now supports 64 bit platforms.

## IC

The CORBA stub/skeleton-files generated by IC reduced in size and decreased dependencies off Orber's Interface Repository.

## Kernel

- The `gen_tcp:shutdown/2` function has been added. To handle shutdown from the other side, the option `{exit_on_close, true|false}` has been added to the `inet:setops/2` function.
- The module 'global' has been improved regarding cleaning up after the simultaneous death of many processes having globally registered names. It now takes significantly less time and CPU load.
- A new function erlang:send/3 has been added to give more control to when to send if the sender risks being suspended or delayed due to automatic node connection. This function supersedes erlang:send_nosuspend/2,3, which is retained for backward compatibility, and has been upgraded to handle local processes and ports.
- A new class of error messages "warnings" are added. Warnings can be mapped to either error reports (the default), Info reports or a new class of reports, namely "warning reports". Non severe errors in OTP will be reported as warnings instead of forcing error reports.
- The support for IPv6 in the `gen_tcp`, `gen_udp` and `inets` modules is enhanced and documented.

## Megaco, a Megaco/H.248 protocol stack

- It is now possible to send more then one transaction (request) in a message.
- Ack's (to be sent) can be accumulated and sent in one message.
- Only spawn a process for the reply-timer if the user uses three-way-handshake.

## Observer

### crashdump_viewer NEW

A HTML based tool for browsing Erlang crashdumps. The tool can handle crashdumps from OTP R7B, R8B and R9B as well but there is additional information in the crashdumps for R9C.

## ODBC

Improved error handling and customization of the port program, i.e. the port program now uses native functions to read and write to standard_in and standard_out on the Windows platforms. This will increase the stability of the port program on Windows.

## Orber

Less (internal) processes used when Orber act as client-side ORB. Due to this change, closed connections and socket errors are dealt with in a more gentle way. If the latter occurs, the error_logger application is used to generate an error report containing a description of what went wrong.

## OTP_MIBs NEW

The OTP mibs that where included in the SASL application have been moved to this new application otp_mibs. This is a step too create a pure core for Erlang/OTP that does not depend on specific, non-mainstream applications such as SNMP.

## SSL

The Erlang SSL application is now based on OpenSSL version 0.9.7a. Both the documentation and the code has undergone a big improvement.

## STDLIB, Erlang Standard libraries

- There are two new functions `erlang:list_to_integer/2` and `erlang:integer_to_list/2` that takes a number base argument. See the documentataion for details.

- New format characters for `io:format/2` and similar are ~b, ~B, ~x, ~X, ~+ and ~# which are various ways of formatting integers in different bases such as hexadecimal, binary, octal etc. See the documentation for details.

- New format characters for `io:fread/2` and similar are ~u, ~- and ~#. See the documentation for details.

- A new feature in the Erlang shell enables the user to write functions which can restrict the execution of certain functions from the shell. See the documentation for `shell`.
- The modules `erl_tar` and `filelib` are now documented which means that they are also supported.

## Tools

- The Erlang mode for Emacs is now properly documented with a user's guide and manual page. Also lots of bugs has been fixed and a new feature for aligning arrows has been added.
- Cover, the code coverage tool is enhanced with several new features such as:

- Completely new interface for WebCover.
- Can export and import cover data to create total coverage from several different test runs.
- Multi node support.
- `analyse_to_file` can now create real nice html output with uncovered lines colored red.

# Highlights
Erlang 5.2/OTP R9B

## Asn1, compiler and runtime functions for ASN.1

- New option optimize in combination with per_bin and ber_bin which makes the encode/decode functions much faster than before. In rough terms the encode/decode is 2 times faster when optimize is used.
- It is now possible to add options to the Erlang compiler to be used when compiling the generated .erl file. Any option that is not recognized as a specific ASN.1 option will be passed to the final step like: `erlc +debug_info Mymodule.asn` or `asn1ct:compile('Mymodule',[debug_info])`.
- The feature "multi file compilation" which compiles several ASN.1 modules together and produces one .erl file is improved.

## Comet, COM client for Erlang (REMOVED)

The Comet application is removed from the product because we currently have no resources to maintain it. We plan to make it available on the Open Source site. It still works on Windows NT 4, but there are problems on Windows XP.

## Compiler

- The documentation for the 'compile' module now lists several options that were previously undocumented or only documented in the 'erl_lint' documentation. One very useful option is `warn_unused_vars`, which also is improved in the compiler. Use of this option can reveal bugs and dead code, it is highly recommended.
- The endianess specification 'native' has been added to the bit syntax. It will resolve to either big or little endian at load time. It is specially useful for communcating with linked-in drivers.

## cosEventDomain, OMG Event Domain Admin Service NEW

A new Corba service "cosEventDomain" is added as a separate application. cosEventDomain is compliant with the OMG service CosEventDomainAdmin.

## ERTS, Erlang emulator

- The previous hard system limit of 255 known remote nodes has been removed. With the exception of node-name atoms, all data regarding remote nodes is now garbage collected.
- Improvements regarding memory handling, introduction of sl_alloc version 1 and sl_alloc version 2 (default) which makes it possible to tune the memory allocation behaviour to best suite a certain system.
- The endianess specification 'native' has been added to the bit syntax. It will resolve to either big or little endian at load time. It is specially useful for communcating with linked-in drivers.

## Et, an Event Tracer with graphical viewing of trace data NEW

The two major components of the Event Tracer (ET) tool is a graphical sequence chart viewer (et_viewer) and its backing storage (et_collector).
One collector may be used as backing storage for several simultaneous viewers where each one may display a different view of the same trace data.

## GS, a Graphics System

GS is updated to use Tcl/Tk 8.3.4. This is a major update since GS previously used an ancient version of Tcl/Tk.

## HiPE, High Performance Erlang NEW

A number of useful and promising features from the HiPE project at Uppsala University is integrated into this version of Erlang/OTP. The major features are:

- Native code generation for Sparc (Solaris) and x86 (Linux). The `native` option to the compiler is used to select this codegeneration. It is then possible to run the generated modules together with the ordinary interpreted modules on a standard OTP R9B system.
  The native codegeneration can give significant performance improvements especially on sequential code. See http://www.csd.uu.se/projects/hipe/hipe.html for more info. This feature is intended for evaluation and may be supported in future versions. Feedback is velcome.
- "Shared heap" a new approach to memory handling within the Erlang emulator where all Erlang processes share a common heap. This way of handling memory is very interesting and have a potential to reduce memory consumption an improve performance. A separate emulator is built to support "shared_heap", it is started with '`erl -shared`'. This feature is intended for evaluation and may be supported in future versions. Feedback is velcome.

## Inets, HTTP server and FTP client.

- A HTTP client is added to the application. Author: Johan Blom of Mobile Arts AB. It is provided as is with very limited documentation in this version but we plan to support it fully in coming versions of Inets.
- Updated to handle HTTP/1.1.

## Kernel

- The set_net_ticktime/[1,2] and get_net_ticktime/0 functions has been added to the net_kernel module (see net_kernel(3)) which makes it possible to change the net_tick time during operation.
- There are new functions `bchunk/2,3` in the `disk_log` module that are to be used like `chunk/2,3` but return objects as binaries.
- The loading of BEAM code at start-up of embedded systems has been optimized: if the thread pool is non-empty (see the system flag `+A` in `erl(3)`) and files are read from a file system (the default, see the value `efile` of the `-loader` flag in `erl(3)`) disk seek times have been reduced.

## Megaco, a Megaco/H.248 protocol stack

- The binary codecs ber_bin and per_bin is now both compiled with the +optimize asn1-compiler flag for better runtime performance.
- The previously included tool, et, has been moved out of the Megaco application. It is now provided as a separate application called Et.

## Mnesia, a heavy duty real-time distributed database

- The table fragmentation functionality in Mnesia has been improved.
- Select and match_object is done in parallel which should improve performance.
- A new concept of hash modules has been introduced. This means that a user now can define its own mapping between record keys and the actual table fragment hosting the record.

- Improved table loading performance during startup. Mnesia should be able to utilize the network bandwidth better, and Mnesia also uses new dets functionality to improve the loading of disc_only_copies tables, if possible.

## Observer NEW

Observer is a new application with various facilities for "observing" a live system with minimal disturbance. The application is fully functional and supported, but the functionality and API's are still in beta-status i.e they can be changed in the next versions. We are very interested in feedback from users regarding the functionality in Observer.

Observer currently contains two different parts:

- Trace Tool Builder , a base for building trace tools for single node or distributed Erlang systems.
- Erlang Top, a tool for monitoring of Erlang processes similar to the UNIX top utility.

## ODBC

- The Erlang ODBC application consists of both Erlang and C code. The C code is now delivered as a precompiled executable for Windows and Solaris.
- Various optimizations.
- New API that has an Erlang/OTP touch and feel instead of being a C-interface with Erlang syntax. The old interface is deprecated and will be removed in Erlang/OTP R10.

## Orber, a CORBA Object Request Broker

- Support for fragmented IIOP-1.2 messages.
- Possible to add and use the IOR component TAG_ALTERNATE_IIOP_ADDRESS.
- Unique VMCID:s assigned to Orber by the OMG.
- Supports the Fixed datatype.
- Possible to add new initial references.
- The NameService can be configured to be stored on disk.
- It is now possible to set Orber's configuration parameters in, for example, an Erlang shell.
- Possible to list which port numbers Orber may use locally when connecting to another ORB.
- Improved documentation.
- Several new debugging facilities:

- Two IIOP trace interceptors included (different verbosity).
- Type checking within an Erlang node.
- OrberWeb, which is an extension of the WebTool application.
- IOR dump.

## OS_Mon, monitoring of disk usage and OS resources

- cpu_sup:util/0 and cpu_sup:util/1 which returns information about cpu utilization have been added. For further information see cpu_sup(3).
- Nodename is now used as key in loadtable (os_mon mib).
- The loadCpuLoad5, loadCpuLoad15 values has been added to the os_mon mib.

## Packages NEW

This is an extension to Erlang with structured program module packages, in a simple, straightforward and useful way. The implementation is done by Richard Carlsson from the HiPE team at Uppsala University and is intended for evaluation. This or a slightly modified solution may be supported in future versions of Erlang/OTP. The debugger might have some problems with the naming of modules when packages are used. See http://www.erlang.se/publications/packages.html for more info. There is also a paper about Packages at http://www.it.uu.se/research/reports/2000-001.

## Runtime_Tools

- Trace ports can now be opened on remote nodes
- It is possible to use the local node as a "trace control node", i.e. trace only remote nodes.
- The function `dbg:i/0` now prints information about all traced nodes
- Added a number of functions for controlling tracing on remote nodes.

## STDLIB, Erlang standard libraries

- A number of improvements in `dets`.
- The function `ets:select_count/2` is added to the stdlib application.
- New functions `sofs:extension/3` and `sofs:partition/3`.
- A new module `ms_transform` which implements a parse transform that translates 'fun' syntax into "match specifications". This simplifies writing of "match specifications" used in `ets:select` and in `dbg.`
- The undocumented and deprecated modules `bplus_tree` and `unix` has been removed.

## Tools

There is a new tool `cprof,` a call count profiler. It is something inbetween `cover` and `fprof,` and can be used to get a picture of which functions are most frequently called.
See tools user's guide and reference manual.