I’d like to have some way to obfuscate binary code that Rust compiler generates. Ideally I’d like to be able to write compiler plugin that inject itself into compiler’s pipeline after macro expansion, gets abstract syntax tree, modifies it in terms of obfuscation and passes the AST back to the pipeline. Is it possible to do now? All the compiler plugin examples for Rust I’ve seen are only about adding some smartass macro to the language.
Alternatively I can think of doing a custom preprocessor tool that reads Rust code, parses it into AST, modifies it and spits out modified Rust code back to the compiler (by redirecting stdin for example). Can I reuse Rust’s lexer and parser to achive that? Are these APIs stable for now?