You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Jens Geyer <je...@hotmail.com> on 2016/07/24 20:41:02 UTC
interesting Bond features
https://microsoft.github.io/bond/why_bond.html
In terms of mapping to target languages, Bond again is much more similar to
Thrift than Protocol Buffers. Like Thrift, Bond generates native types to
represent schemas in the target language and uses native collections. Bond
however doesn\u2019t hard-code type mappings. For example in C++ the defaults are
STL containers like std::vector however user can easily map custom types
(e.g. use boost::multi_index_container in a generated C++ struct or map a
uint64 schema field to a System.DateTime field in a generated C# class).
Bond generated C++ structs can also use custom allocators. See custom type
mappings for more details.
https://microsoft.github.io/bond/manual/compiler.html
Schema AST
The compiler exposes a JSON representation of the schema Abstract Syntax
Tree. The AST is intended for tools that need to access to the schema
information contained in Bond IDL files with the full fidelity. The compiler
can also take the JSON representation of the AST as an input, enabling tools
which programmatically construct/modify Bond schemas.
Re: interesting Bond features
Posted by Jens Geyer <je...@hotmail.com>.
https://microsoft.github.io/bond/manual/compiler.html#generic-struct
Generic structs are parameterized with one or more type parameters which can
be used within the struct definition in any place where a concrete type
could be used (e.g. base struct, field type, container element type,
parameter of a generic struct).
struct Example<T1, T2> : T1
{
0: T1 field;
1: list<T2> list;
2: Generic<T2> generic;
}
-----Urspr�ngliche Nachricht-----
From: Jens Geyer
Sent: Sunday, July 24, 2016 10:41 PM
To: Thrift-Dev
Subject: interesting Bond features
https://microsoft.github.io/bond/why_bond.html
In terms of mapping to target languages, Bond again is much more similar to
Thrift than Protocol Buffers. Like Thrift, Bond generates native types to
represent schemas in the target language and uses native collections. Bond
however doesn\u2019t hard-code type mappings. For example in C++ the defaults are
STL containers like std::vector however user can easily map custom types
(e.g. use boost::multi_index_container in a generated C++ struct or map a
uint64 schema field to a System.DateTime field in a generated C# class).
Bond generated C++ structs can also use custom allocators. See custom type
mappings for more details.
https://microsoft.github.io/bond/manual/compiler.html
Schema AST
The compiler exposes a JSON representation of the schema Abstract Syntax
Tree. The AST is intended for tools that need to access to the schema
information contained in Bond IDL files with the full fidelity. The compiler
can also take the JSON representation of the AST as an input, enabling tools
which programmatically construct/modify Bond schemas.