Procedural macros should be defined in a separate crate to the core functionality
Closed this issue · 10 comments
Defining the procedural macro inline introduces the libsyntax dependency. It is only required at compile time (for executing the macro), but having the macro definition in with the rest of the types like Server
etc means that all users of rustful have a runtime dependency on libsyntax.
This has the knock-on consequence of forcing all libraries using rustful to be dynamically linked (as libsyntax is only available as a dynamic library).
I would recommend providing two crates, rustful
and rustful_macros
(like regex
and regex_macros
in the core distribution); at least until the syntax extension story gets sorted out a little more.
Why this is important: I'm trying to get rustful running on Heroku, and this will be much easier if we can statically link the binaries and not ship a full set of *.so files at runtime.
Thank you for such a handy library!
You are right, I will definitely separate them. It's technically no problem and will only have benefits, as far as I can see.
Thanks for your your input and I'm glad to see that someone is trying it out.
It should be fixed now.
Awesome! What incredibly fast turnaround time.
I'm going to try it out and see if I can deploy rustful to Heroku. If I can, I'll write up some instructions this afternoon and send you a link.
It was mostly cut and paste and I would have done the Arc wrapping anyway, so I decided to just do it right away.
I'm using it, myself, in my soon-to-be website/portfolio and plan to maybe host it through Digital Ocean, so it would be great to see how it works out.
Keep us updated on how it works out with Digital Ocean! I've been getting ready to make a site in rust and I'm wondering about the viability of using some online hosting. I already read emk's blurb on installing rust on an old ubuntu http://www.randomhacks.net/2014/05/30/rust-on-ubuntu-10.04-lucid/ and I look forward to hearing how it turns out for the both of you. 👍
I actually have Rust and Rustful running on Heroku as we speak, and it's working great with Ogeon's changes. I'm already working on a blog post explaining how it works, and I hope to post something this afternoon once I clean up the loose ends.
Thank you so much for your help, Ogeon!
No problem! I look forward to reading your post.
Thanks to your help, everybody should now be able to run Rustful applications on Heroku. I just want to say that your ultra-fast improvements today made this very easy!
I have read your post and it's nice to see that Rustful is usable in a distributed environment, like I wanted it to be. Thank you for showing the interest and taking the time to make something concrete, even if it's just an example. It'll be interesting to see where all this goes next.