-
Notifications
You must be signed in to change notification settings - Fork 159
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
Build broken since rustc nightly-2017-03-04 #80
Comments
Last version that compiles for me is |
Thanks for reporting! Sadly, we're in an annoying intermediate state right now. The latest changes pretty much force us to use the new procedural macro interface (rust-lang/rust#38356), but parts of this new system aren't finished yet. My recommendation at this point is to pin to As far as I know, the only thing blocking a port is this task:
The current parser, which performs direct pattern matching on There are also these nice-to-haves:
This isn't a hard requirement, but the codegen would be nicer with this around.
Answered at rust-lang/rust#38356 (comment) Maud will pretty much go with what that comment describes. |
rustc 1.17.0-nightly (fd182c401 2017-03-13)
I've been heavily using your crate for some time now and I'm using it in product prototyping. That it's stuck on an older nightly is a pressing problem (just reiterating, I assume everyone sees this). So maybe now is the time to reconsider the whole design of maud. I find myself wondering whether being a compiler plugin is a good basis for maud. Could we leave this design behind and write a static HTML templating crate that uses more stable and simple patterns (e.g. the newtype pattern)? This would add more compile time validation possibilities over the present implementation (e.g. what tags exist and in what contexts are they allowed), without much extra work. I think such a new design will also make contributions easier, since Rust programmers do not need to be deeply invested in the (IMO poorly documented) compiler plugin architecture. I suppose sometimes this kind of alternative design has crossed your mind or has been proposed to you. Could you please share your view on this? |
@lfairy unfortunalety Rocket requires a newer version of rust (>nightly-2017-03-04) so maud cannot currently be used with Rocket... too bad because I like both |
using an older version of Rocket and pinning rust could solve this, however the Rocket extension of maud uses a too-recent Rocket version. I'm submitting a PR to fix this. So using latest maud with pinned rustc and rocket 0.2.2 should work |
You can instruct Cargo.toml to look for local crate instead of remote one then the fix is not necessary.
|
Good news! I had another look at the proc macro interface. Turns out the current I will push this fix out later today. |
This idea has already been implemented as Domafic. I also thought about building a solution around closures (like Markaby) but didn't have the time to explore this. I wonder how ergonomic this would be, especially when
This can be implemented in Maud as well. Since the macro has access to the full syntax tree at expansion time, it can emit warnings then. The proc macros 2.0 interface doesn't expose diagnostics support at the moment, but from my understanding it's on the roadmap.
What Maud does, on a fundamental level, isn't hard to understand. Most of the difficulty is in the compiler plugin interface, which (as you say) isn't well designed or documented. Proc macros 2.0 should address both of these concerns. A fully type-driven solution also introduces its own complexity. Since everything needs to be recorded in the type, you end up with large type signatures that often can't be written down. This leads to fiddling with closures or |
Released as maud_macros 0.16.3. |
libsyntax
changes again ... I've been working on fixes myself for a while today, but the required set of changes appeared to grow quickly, and I wouldn't be able to fix them efficiently without being very familiar withlibsyntax
andmaud
internals.The text was updated successfully, but these errors were encountered: