Filbert – a BERT serializer for .Net

I spent the last cou­ple of nights and put togeth­er a small BERT seri­al­iz­er for .Net called Fil­bert.

 

What’s BERT?

BERT (Binary ERlang Term) is a bina­ry for­mat based on Erlang’s bina­ry seri­al­iza­tion for­mat (as used by erlang:term_to_binary/1) but sup­ports a cou­ple of com­plex types such as boolean, dic­tio­nary and time, in addi­tion­al to the prim­i­tive types.

BERT and BERT-RPC was spec­i­fied by GitHub’s cofound Tom Pre­ston-Wern­er and bas been in pro­duc­tion use at GitHub as part of their infra­struc­ture allow­ing them to inte­grate Ruby and Erlang through the Ernie BERT-RPC serv­er.

The encod­ing for­mat for BERT is the same as Erlang’s exter­nal term for­mat which you can read about in great detail here. It is not as high­ly opti­mized as some­thing like pro­to­col buffer but is very easy to under­stand and imple­ment and does not require a sep­a­rate con­tract def­i­n­i­tion file (the .pro­to file for pro­to­col buffer) in order to be able to seri­al­ize a type.

 

How can I try it?

I have yet to put togeth­er a Nuget pack­age for Fil­bert but will do so in the near future, in the mean time why not fork the project on GitHub and try it out for your­self?

I have includ­ed a sim­ple F# and C# exam­ple project as part of the solu­tion, and if it’s not clear then have a read of the tuto­r­i­al page to help you get start­ed.

 

I have ensured rea­son­able test cov­er­age for both encoder and decoder but there are no doubt many edge cas­es which I haven’t con­sid­ered and would real­ly appre­ci­ate any feed­back you have on how best I can improve the solu­tion Smile