Question: Is there an example of a build.rs that converts s-expr's into plain Rust code ?
Please note, the above question asks: "Is X possible?" Please refrain from debating "Is X a good idea?" "Why would you want to do X?" "Should we fork Rust to support X?"
===
In a separate thread, I saw this:
Question here is: has anyone managed to create a build.rs which converts s-exprs to Rust ?
Ignore garbage collection / scheme semantics for now. Imagine we have a language that has Rust semantics, but merely chose to adopt s-exprs as the syntax. Is build.rs something that could take a directory full of src/*.s-expr and generate a virtual directory of src/*.rs which is then compiled ?
build.rs can run whatever you want. So if you want to run a transpiler in it, you certainly can.
There's probably not an example of doing it specifically (since it's not particularly useful) but it's just putting pieces together. It's no different from generating code based on interface definition files or whatever.
If the code generation is best done on every build then OUT_DIR would be the way to go.
If the code generation is best done ahead of time, only by the crate maintainer(s), then some code that ran outside of the build process would probably be better. For example a shell script or a task defined using xtask.