4 ms·
Interesting, it seems that it allows the exact syntax of shell commands, without using strings. // valid rust code and shell code, no strings run_cmd!(
by gitgud 6y ago
Interesting, it seems that it allows the exact syntax of shell commands, without using strings.
// valid rust code and shell code, no strings
run_cmd!(du -ah . | sort -hr | head -n 10)?;
How does rust parse the statement within run_cmd()? Can rust parse other languages like this?
run_html!(<div>COOL</div>)
- steveklabnik 6y agohttps://crates.io/crates/typed-html-macros https://crates.io/crates/typed-html-macros
- qwertycrackers 6y agoYeah, there's a system for macro definition where you define the language the macro accepts. It's very powerful and can probably do most of what you're imagining in this comment.
- gabssnake 6y agoYes! If you are interested in doing front-end in Rust using Wasm, checkout Yew : https://github.com/yewstack/yew https://github.com/yewstack/yew The data flow is inspired by React, you’ll feel right at home.