[erlang-questions] Is Erlang ideal for a global exchange?

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Mon Jan 19 18:24:29 CET 2015


On Mon, Jan 19, 2015 at 6:01 PM, xu xiut <xiut.xu@REDACTED> wrote:

> For those who were wondering what type of exchange I'm wanting to build,
> it's a bitcoin exchange with derivative contracts


The key requirement to ask is: what will be your major worry when writing
such an exchange? Different languages will make it either easy or hard to
solve certain problems in your domain. So you need to pick a language which
will put you in a position where you have the right strength and can ignore
the weaknesses due to them not being a factor.

Erlang is an excellent choice if you value predictable latency and highly
robust operation, even in the event of considerable load on the system.
Here, your main vehicle for scaling would be to buy more cores. It tends to
be a bad choice if you have a small computational kernel which takes all
the time. In that event, you need a language where you can tune the tight
kernel for speed, while ignoring everything else.

OCaml is an excellent choice if you believe the problem space itself
requires complicated abstractions where you are likely to make a mistake at
the type-structural level of the program. If you use the type system
cleverly, you can arrange such that you cannot make mistakes by accident on
how to program the exchange correctly. OCaml is pretty fast to boot, and
you can get decent asynchronous behaviour with core.async. Otoh, you won't
be able to seamlessly scale in more than a single core and if this proves
to be a bottleneck in your system, you have to write code all of a sudden
to handle it.

Java + LMAX/Disruptor has its share of problems. Go is excellent when it
comes to multi-core scaling and computational processing power. But it
severely lacks when it comes to robust behaviour.

My bet would definitely be on either Erlang or OCaml. The former because
there is a nice fit with the problem domain. The latter because it is a
favorite among high-frequency-trading companies, and its abstraction
features are a well-known advantage in that space.

-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150119/788fdbc7/attachment.htm>


More information about the erlang-questions mailing list