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

Add a syntax extension #11

Closed
emberian opened this issue Sep 6, 2014 · 3 comments
Closed

Add a syntax extension #11

emberian opened this issue Sep 6, 2014 · 3 comments

Comments

@emberian
Copy link
Contributor

emberian commented Sep 6, 2014

Especially with cargo, generating code using tools can be annoying. Add a syntax extension that will generate the code into a module. With include_str etc, no flexibility is lost.

@dwrensha
Copy link
Member

dwrensha commented Sep 6, 2014

This would be really cool -- much better than my current hack for getting Cargo to do code generation, which you can see in these two repositories:

https://github.com/dwrensha/capnp-rpc-rust
https://github.com/dwrensha/acronymy

@tv42
Copy link

tv42 commented Feb 3, 2024

Can this ancient bug be closed? It seems using a build.rs build script and include! of files from OUT_DIR is the standard way to do code generation for Rust these days, and capnpc makes that as easy as it's anywhere.

(I do wish we didn't need the C++ binary, but that's not what this issue is about.)

@dwrensha
Copy link
Member

dwrensha commented Feb 4, 2024

This issue was opened in September of 2014. In November of 2014, capnproto-rust started using a build.rs build script, which I guess must have been a newly introduced feature of Cargo around then: capnproto/capnp-rpc-rust@33ac799

I could still imagine someone wanting to use a procedural macro, like capnp_mod!(example.capnp) to avoid needing an explicit build script, but it's unclear whether that's what this issue is exactly asking about. If someone wants that, they can open a new issue (but be advised that I prefer to avoid proc-macro).

@dwrensha dwrensha closed this as completed Feb 4, 2024
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

3 participants