[erlang-questions] Maps & records: binding directly to bitstring comprehensions

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Fri Feb 7 22:15:37 CET 2014


On Fri, Feb 7, 2014 at 5:24 PM, Felix Gallo <felixgallo@REDACTED> wrote:

> Jesper, your instinct are correct as usual.  Unfortunately the protocol
> designers live upstream in a different group over which I have no control,
> and are incentivized to take the Facebook mantra of "move fast and break
> things" to heart.


One way would perhaps be to screw performance. Break the decoder into
multiple small pieces and define an interpreter for the small pieces. Now,
the definition is given by the input to the interpreter. It will be slow,
but it will be easier to reconfigure. When things slow down, you can
replace the interpreted variant with a faster code variant. The idea is
that you only need to implement each new concept they cook up, but not each
change.

The basic idea is to have a grammar for the format and then employ a parser
generator on the grammar. But you probably don't need the speed up front,
only getting the definitions correct.


-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140207/28ca3f95/attachment.htm>


More information about the erlang-questions mailing list