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

 

What’s BERT?

BERT (Binary ERlang Term) is a binary for­mat based on Erlang’s binary 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­tional to the prim­i­tive types.

BERT and BERT-RPC was spec­i­fied by GitHub’s cofound Tom Preston-Werner 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 server.

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 highly 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 .proto 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 together 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 yourself?

I have included 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­ial page to help you get started.

 

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

Share

One Response to “Filbert – a BERT serializer for .Net”

  1. […] my pre­vi­ous post on Fil­bert I have added a sim­ple but func­tional BERT-RPC client which I have man­aged to […]

Leave a Reply