You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Allen George <al...@gmail.com> on 2016/12/18 17:12:53 UTC

Update on Rust Thrift Generation

Hi everyone -

Just wanted to send a quick update on the progress of the Rust Thrift
code generation. I've been working on it for the last couple of months
and have implemented most of it. What remains:

- derived services
- struct constants
- docstring generation
- compact protocol

Of the above, "derived services" are the biggest worry. Rust is not an
object-oriented language so implementing this could be...quite
involved and require some rework of the generated code. Other than
that, there's a lot to do to clean up the code, add comments,
documentation and unit tests to the underlying rust library. Finally,
the only thing that I would really like to see change on the
thrift-compiler side is that "type" be considered a reserved word.

Here's the auto-gen code for ThriftTest.thrift:
https://gist.github.com/allengeorge/5e602bf40ba68ebe0eb2d3117b5d943d

All my work is against thrift-0.10.0, and I've verified that
framed/buffered/binary works with TestThrift.thrift against all the
clients I'm able to compile on my local machine (only D and Lua are
missing). I'm happy to work with everyone to get the code up to snuff
and - ideally! - merged into Thrift proper when missing pieces are
completed.

Cheers,
Allen

Terminal Musings: http://www.allengeorge.com/
Raft in Java: https://github.com/allengeorge/libraft/
Twitter: https://twitter.com/allenageorge/

Re: Update on Rust Thrift Generation

Posted by Allen George <al...@gmail.com>.
Hi Jens,

Thanks for the kind words! I'm sorry for the delay in responding
(holiday season and all).

Yes, the usage of "type" was the only conflict I experienced - at
least that I noticed. I suppose people could use fields like: "pub",
"fn" and so on, but I think if one is doing that they should be aware
that they're asking for trouble :)

I'd sent a message about "type" a couple of months ago and a course of
action was suggested:
http://mail-archives.apache.org/mod_mbox/thrift-dev/201611.mbox/browser

I didn't follow up at that time because I was in the initial stages of
the Rust work and didn't know what other issues I'd encounter. Now
that I've implemented a fair bit I can send a PR around that.

Cheers - and happy holidays to everyone!
Allen

Terminal Musings: http://www.allengeorge.com/
Raft in Java: https://github.com/allengeorge/libraft/
Twitter: https://twitter.com/allenageorge/


On Tue, Dec 20, 2016 at 4:08 PM, Jens Geyer <je...@hotmail.com> wrote:
> HI Allen,
>
> great to hear there's progress!
>
> I have to admit I haven't looked at the state of your code base. If at least
> binary is implemented working, plus framed transport, that would be Good
> Enough™ for a first merge, Compact and JSON would be really nice to have,
> but they can be integrated in subsequent patches. I would not consider this
> part of your list a blocker.
>
>> thrift-compiler side is that "type" be considered a reserved word.
>
> Is that the only conflict you experience? Usually there are a lot more, and
> the exact list depends very much on the language. OTOH "type" is a common
> one, that might justify adding it to the global list. Is there a patch or PR
> for that?
>
>
> Have fun.
> JensG
>
>
> -----Ursprüngliche Nachricht-----
> From: Allen George
> Sent: Sunday, December 18, 2016 6:12 PM
> To: dev@thrift.apache.org
> Subject: Update on Rust Thrift Generation
>
> Hi everyone -
>
> Just wanted to send a quick update on the progress of the Rust Thrift
> code generation. I've been working on it for the last couple of months
> and have implemented most of it. What remains:
>
> - derived services
> - struct constants
> - docstring generation
> - compact protocol
>
> Of the above, "derived services" are the biggest worry. Rust is not an
> object-oriented language so implementing this could be...quite
> involved and require some rework of the generated code. Other than
> that, there's a lot to do to clean up the code, add comments,
> documentation and unit tests to the underlying rust library. Finally,
> the only thing that I would really like to see change on the
> thrift-compiler side is that "type" be considered a reserved word.
>
> Here's the auto-gen code for ThriftTest.thrift:
> https://gist.github.com/allengeorge/5e602bf40ba68ebe0eb2d3117b5d943d
>
> All my work is against thrift-0.10.0, and I've verified that
> framed/buffered/binary works with TestThrift.thrift against all the
> clients I'm able to compile on my local machine (only D and Lua are
> missing). I'm happy to work with everyone to get the code up to snuff
> and - ideally! - merged into Thrift proper when missing pieces are
> completed.
>
> Cheers,
> Allen
>
> Terminal Musings: http://www.allengeorge.com/
> Raft in Java: https://github.com/allengeorge/libraft/
> Twitter: https://twitter.com/allenageorge/
>

Re: Update on Rust Thrift Generation

Posted by Jens Geyer <je...@hotmail.com>.
HI Allen,

great to hear there's progress!

I have to admit I haven't looked at the state of your code base. If at least 
binary is implemented working, plus framed transport, that would be Good 
Enough™ for a first merge, Compact and JSON would be really nice to have, 
but they can be integrated in subsequent patches. I would not consider this 
part of your list a blocker.

> thrift-compiler side is that "type" be considered a reserved word.

Is that the only conflict you experience? Usually there are a lot more, and 
the exact list depends very much on the language. OTOH "type" is a common 
one, that might justify adding it to the global list. Is there a patch or PR 
for that?


Have fun.
JensG


-----Ursprüngliche Nachricht----- 
From: Allen George
Sent: Sunday, December 18, 2016 6:12 PM
To: dev@thrift.apache.org
Subject: Update on Rust Thrift Generation

Hi everyone -

Just wanted to send a quick update on the progress of the Rust Thrift
code generation. I've been working on it for the last couple of months
and have implemented most of it. What remains:

- derived services
- struct constants
- docstring generation
- compact protocol

Of the above, "derived services" are the biggest worry. Rust is not an
object-oriented language so implementing this could be...quite
involved and require some rework of the generated code. Other than
that, there's a lot to do to clean up the code, add comments,
documentation and unit tests to the underlying rust library. Finally,
the only thing that I would really like to see change on the
thrift-compiler side is that "type" be considered a reserved word.

Here's the auto-gen code for ThriftTest.thrift:
https://gist.github.com/allengeorge/5e602bf40ba68ebe0eb2d3117b5d943d

All my work is against thrift-0.10.0, and I've verified that
framed/buffered/binary works with TestThrift.thrift against all the
clients I'm able to compile on my local machine (only D and Lua are
missing). I'm happy to work with everyone to get the code up to snuff
and - ideally! - merged into Thrift proper when missing pieces are
completed.

Cheers,
Allen

Terminal Musings: http://www.allengeorge.com/
Raft in Java: https://github.com/allengeorge/libraft/
Twitter: https://twitter.com/allenageorge/