Microsoft Bond
github.com
github.com
Bond – An extensible framework for working with schematized data (microsoft.github.io)
99 points by dons 85 days ago | cached | share | flag | 41 comments
[1] https://news.ycombinator.com/item?id=8866694One of the more interesting aspects of a serialization library is how it copes with efficiently extracting small fields out of otherwise large structures, usually by only decoding the absolute minimum required to access the field. This is a common operation e.g. when running aggregate queries over data-at-rest. For example, Cap'n'proto is well suited to this. Does Bond support anything like it?
I can imagine driving the parser APIs using custom code to achieve a similar effect, but that seems a lot of work when there are alternatives that don't require it.
1) Simple deserialization where an object is fully materialized. This is the simplest (you write your business logic against idiomatic types in your target language) but, as you note, might not be best from performance perspective in some scenarios.
2) Lazy deserialization at the level of nested structs via bonded<T> [1]. In many cases this allows to optimize performance if you don't need to materialize the whole object but w/o loosing much in terms of simplicity of the programming model.
3) Transforms [2]. This is a very generic and very powerful abstraction in Bond. All higher level APIs like serialization and deserialization are internally implemented using this mechanism (even Python bindings [3] are fully implemented on top of Bond C++ meta-programming infrastructure driving Boost Python). In C++ it is built using template meta-programming and in C# using LINQ expressions. In Both cases it is a little like having a generic, strongly typed parser for richly typed data.
[1] https://microsoft.github.io/bond/manual/bond_cpp.html#unders...
[2] https://microsoft.github.io/bond/manual/bond_cpp.html#transf...
https://news.ycombinator.com/item?id=1719456
It looks like the Bond compiler is written in Haskell.
He also hosted a "how I make working under Windows NT barely acceptable" document under (research.)microsoft.com.
They also use Ocaml[0] and their very own F#.
Erik Meijer was also an Microsoft employee and responsible for bring LINQ and FP programming into the VB.NET and C# languages. Also provided lots of lectures about FP at Channel 9.
Usually many FOSS advocates tend to be unaware how much money the big bad Microsoft has invested into the ML eco-system and making FP concepts mainstream.
[1] https://microsoft.github.io/bond/manual/compiler.html
[2] https://microsoft.github.io/bond/manual/bond_cpp.html#transf...
Here is ultimately what helped me understand the problem space:
https://developers.google.com/protocol-buffers/docs/overview
It sounds intriguing but I'm not very experienced with thrift to know how well it compares in real use-cases.