D support in Thrift needs your reviews!

David Nadlinger see at klickverbot.at
Sun Mar 11 14:43:51 PDT 2012


As you might remember, I worked on adding D support to Apache 
Thrift [1] during Google Summer of Code 2011. A few months (and 
DMD releases) down the road, the patch was finally submitted to 
Thrift upstream [2], with the test suite passing on all of 
Windows, Linux and OS X.

The problem now is that while there is definitely interest in 
using D with Thrift, the upstream team is (unsurprisingly, 
perhaps) lacking people who know D well enough to review the 
almost 24k LOC patch. Thus, the patch has been sitting in the 
Apache JIRA for almost two months now.

So, if you are interested in Thrift or already have some 
experience with it, it'd be great if you could have a look at the 
code and let me (and the Thrift issue tracker, of course), know 
what you think. You should be able to find anything needed from 
the ticket [2], let me know if something is missing.

———
What the library doesn't have (yet):
  - @safe-ty annotations (pure doesn't apply to most of the code): 
I tried to add them a while back, but hit some unpleasant 
compiler bugs.

  - Compile-time Thrift IDL parsing: While most of the codegen is 
done at D compile time anyway, having the interface file parser 
in CTFE as well wasn't really feasible when GSoC started (before 
Don's rewrite), and integration with the main Thrift compiler 
would have been required in any case. Now, a CTFE implementation 
might be a nice use case of one of the CTFE parsing libraries, 
though (the current code generator is only 700 lines of C++, plus 
parser), if you want to tackle this, let me know.

  - A HashSet implementation in Phobos it could generate code 
against; currently, a void[0]-AA-based hack is used. I've been 
meaning to look into adding something to std.container for ages 
now, but with me being swamped in work and the container design 
being »in flux« (e.g. allocators)…

  - While I implemented a feature to generate Thrift IDL from 
existing D structs and interfaces at compile time (now that is 
cool), which can do a round-trip for all Thrift-generated code, 
it probably breaks in the face of real-world D code – please 
use it, break it, and ideally fix it. ;)

  – There are lots of cool ideas for D-specific features which 
could be added, for example a Thrift server which maps RPC 
requests to std.concurrency messages, etc. So far, I mostly 
concentrated on providing the parts which Thrift users expect to 
be there, i.e. which the C++ and Java implementations also offer. 
This also involves a slightly non-idiomatic design in some 
places, which is unfortunate, but Thrift generally strives to 
find a good balance between offering a »native« feel in each 
target language and cross-language consistency.
———

Thanks,
David


[1] http://thrift.apache.org/
[2] https://issues.apache.org/jira/browse/THRIFT-1500


More information about the Digitalmars-d mailing list