Who here's familiar with Rust? And it's automatic code generation facilities?

I want some advice.

@balrogboogie @federicomena Thanks!

To set some context I'm implementing my own browser engine (I'm happy to discuss why, but I don't think it's relevant here) and the trickiest bit so far has been parsing CSS properties.

So I created a program which reads in an internal domain specific language and outputs piles of match statements and type declarations as text files.

I find that program extremely helpful in coping with even a relative few CSS properties, but I don't like maintaining it.

@balrogboogie @federicomena So does Rust have anything nicer to help me implement this? Or even integrate it into the Cargo build system?

I can provide links to show what I'm trying to accomplish.


@alcinnz you can use a build script with cargo. In fact, they have an example of code generation right in the cargo docs: doc.rust-lang.org/cargo/refere

You can make your code generation library a crate, include it as a `[build-dependency]`, then use it in your `build.rs` file to generate code at build time


Sign in to participate in the conversation

"cèilidh" (pronounced "kay-lee") is a Scottish Gaelic word meaning "visit." It is used to describe large gatherings where communities would come together to eat, drink, and be merry.

This instance uses Mutant Standard emoji, which are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.