Erlang Language

External Term Format

Introduction#

External Term Format is a binary format used to communicate to outside world. You can use it with any language through ports, drivers or NIF. BERT (Binary ERlang Term) can be used in other languages.

Using ETF with Erlang

binary_to_term().

Using ETF with C

Initializing data structure

#include <stdio.h>
#include <string.h>
#include <ei.h>

Encoding number

#include <stdio.h>
#include <ei.h>

int 
main() {
}

Encoding atom

Encoding tuple

Encoding list

Encoding map


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow