Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting codegen to use syntex_syntax (ie rustc's libsyntax) #13

Closed
kamalmarhubi opened this issue Apr 12, 2015 · 3 comments
Closed

Porting codegen to use syntex_syntax (ie rustc's libsyntax) #13

kamalmarhubi opened this issue Apr 12, 2015 · 3 comments

Comments

@kamalmarhubi
Copy link

I've been looking around for someting rusty and capnp-y to do to get to know both better. I saw that capnpc-rust is producing output by interpolating and concatenating strings. I also saw that syntex_syntax makes rustc's libsyntax available through cargo.

Any interest in this port?

@dwrensha
Copy link
Member

Hi Kamal!

I suppose some benefits that libsyntax might provide are:

  1. The ability to avoid an extra code generation step (I think this is what @cmr was hinting at in Add a syntax extension capnproto-rust#11).
  2. Extra static error checking.
  3. Nice pretty printing.

Am I missing anything?

Cargo's support for code generation in build scripts lessens the weight of (1). The other benefits would be nice to have, but it seems like using libsyntax to achieve them would bring a significant cost in terms of verbosity.

It also appears that syntex has not been maintained for the past two months, so you'd first need to bring it up to date.

Perhaps I could interest you in taking on some other project relating to capnproto-rust? :)

Two things that would be really cool to support are generics and a dynamic API. I think that the key to implementing both of these features will be to port the schema and schema-loader implementations from capnproto-c++.

Another goal of mine is to eliminate our uses of unsafe in the capnp runtime library. Last I counted, there were something like 160 such uses. We should be able to get that down to zero without paying too much performance penalty.

Also, now that libgreen is dead, we need to figure out a better concurrency story for capnp-rpc-rust, possibly using mio.

Or, lest these biggish projects scare you away, you could get your feet wet by fixing a smallish bug such as capnproto/capnproto-rust#31. And that reminds that yet another fun project might be to try fuzz testing capnproto-rust with American Fuzzy Lop.

@kamalmarhubi
Copy link
Author

++features, ++security are definitely fine with me. I hadn't looked too much into the AST-generation code to decide if it had value; I just don't like mashing strings together. I'll take a look around!

@kamalmarhubi
Copy link
Author

Closing this since it sounds like you don't consider it terribly desirable. I 'd also prefer not to have to take on maintainership of another project to get this done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants