11. tightly coupled loosely coupled
generalized
Pros fast failure separation
extensible
specialized
Cons failure companion slow
less extensible
12. fast
tightly
ideal
coupled
standard
specialized
loosely
useless
coupled
slow
13. BERT/BERT-RPC
Erlang Serialization Specs,
with extended specs for RPC,
--{call, Module, Function, Arguments}
--> {reply, { some, term, Value }}
Binary ERlang Term,
Older than any of below;
Thrift, Protocol Buffers, Avro,
MsgPack...
14. BERT/BERT-RPC cont’d
Older than any of below;
Thrift, Protocol Buffers, Avro,
MsgPack...
Various Implementations
C++, Clojure, Erlang, Factor (?),
Go, Haskell, JavaScript, Python,
Ruby, Scala.
15. How to use BERT in C
#include “ei.h”
INCLUDES= -I$(EI)/include
LDFLAGS= -L$(EI)/lib -lei
EILIB= `code:lib_dir(erl_interface).`
erl_interface.h is deprecated.
21. Linked-in Driver
in-process erlang-port,
% acts like an Erlang process
% Message can be sent/recv’d,
less failure-separeted.
Erlang
process
output(..){
?DEMO. ... }
22. Native Interface
Functions
Since R13B03, Beta,
Built-in code runs inside ERTS,
almost hacking ERTS, Erlang
process
Nothing separated.
hello(..){
... }
23. NIF fast
tightly
ideal
coupled
Linked-in Driver
standard
specialized Port Driver
loosely
useless
coupled
C node
slow
32. References
ERTS: Interoperability tutorial guide
http://www.erlang.org/doc/tutorial/overview.html
BERT/BERT-RPC
http://github.com/blog/531-introducing-bert-and-bert-rpc
http://bert-rpc.org/
Erlang external term format
http://erlang.org/doc/apps/erts/erl_ext_dist.html
NIF
http://erlang.org/doc/man/erl_nif.html
Toke, vs tcerl
http://bit.ly/8nPhm2
Erlang external term format