Hacker News new | past | comments | ask | show | jobs | submit login
[dupe] Microsoft Bond (github.com/microsoft)
128 points by TheHydroImpulse on April 6, 2015 | hide | past | favorite | 15 comments



Previous discussion [1]

    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=8866694


Very cool, seems I missed it the last time it was on HN. From a quick glance over the docs, it seems by default the only parsing interfaces available are "fully realized", i.e. complete conversion to data structures in the target programming language, or "pull based" parsing a bit like expat.

One 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.


Bond has 3 ways of working with serialized payloads:

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...

[3] https://microsoft.github.io/bond/manual/bond_py.html


GitHub repo code stats says "Haskell 6.7%". So Microsoft uses Haskell internally?


For those not in the know, Microsoft drives much of the development of GHC (the Haskell compiler) and other core projects through Microsoft Research.

https://news.ycombinator.com/item?id=1719456

It looks like the Bond compiler is written in Haskell.

https://github.com/Microsoft/bond/tree/master/compiler


Simon Peyton Jones, who's the lead developer of GHC, works at Microsoft Research. http://research.microsoft.com/en-us/people/simonpj/


And before Haskell became this trend thing with own web sites and all, SPJ distributed ghc on his MS web site. Usually you had to wait for the Windows binary quite a bit, FreeBSD came first.

He also hosted a "how I make working under Windows NT barely acceptable" document under (research.)microsoft.com.


Yes, besides what the sibling posts already mentioned.

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.

[0] https://ocaml.org/community/support.html


Yes, though the number is a little misleading. I believe the core functionality of Bond is all in Haskell, and everything else is just client libraries for other languages.


Our compiler/codegen [1] is all written in Haskell. That's a very significant part of Bond, but I wouldn't say that "everything else is just client libraries". All currently supported languages (C++, C# and Python) heavily rely on meta-programming [2] so the libraries for them are quite sophisticated.

[1] https://microsoft.github.io/bond/manual/compiler.html

[2] https://microsoft.github.io/bond/manual/bond_cpp.html#transf...


I skimmed the page and honestly wasn't getting what this did. So I looked up Thrift since it is supposedly similar, skimmed and still didn't understand. Same goes for Avro. Finally I looked into Protocol Buffers and bam, I pretty quickly understood what the hell this thing does for me and why I should care. Please, please, please, if you have an open source project give some examples of usage along with the corresponding code, it'll speed up adoption five fold.

Here is ultimately what helped me understand the problem space:

https://developers.google.com/protocol-buffers/docs/overview


Anybody more familiar with this care to compare and contrast with Apache Thrift?


Perhaps you're looking for this https://microsoft.github.io/bond/why_bond.html

It sounds intriguing but I'm not very experienced with thrift to know how well it compares in real use-cases.


what is it ? something like protobuffers?


yup and also like Apache Thrift.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: