Does Rust have any DSL for web use (e.g. Rails in someways is a DSL to Ruby)?
I ask because I imagine a simplified (Rust) syntax would be more inviting to newcomers.
Does Rust have any DSL for web use (e.g. Rails in someways is a DSL to Ruby)?
I ask because I imagine a simplified (Rust) syntax would be more inviting to newcomers.
Yup, they are called "macros". Rwf uses a few of them, some of which you'll find familiar, e.g. `render!` which returns a rendered template with HTTP 200 [1].
[1] https://levkk.github.io/rwf/views/templates/templates-in-con...
That's good to know.
From the ReadMe example, is there a way to use macros to simplify the following line of code:
I ask because many web developers don't come from a C/C++/Rust background - so the line above will be jarring/off-putting to many.(Awesome project btw)
Rust can be an intimidating language but the example you’ve provided there really shouldn’t be intimidating to anyone that’s using TypeScript today. There’s a little learning to with &self and & but that’s really basic Rust stuff. I don’t think it’s wise for a framework to attempt to hide core components of the language.
You might be surprised, with Typescript's ubiquity in the web space the type definitions probably won't be too scary. I've never used Rust but I assume `&` is some kind of Rusty pointer.
Coming from Typescript that doesn't look very ominous to me, though it would nice if the types could be inferred somehow.
Thanks!
Yes, I was thinking of adding a shorthand for that. Will add something soon!
for controller routing. I think pavex have great idea (https://www.lpalmieri.com/posts/pavex-progress-report-02/) for using rustdoc json