Might not be exactly what you are looking for but take a look at GraalVM's Truffle [1].
[1] https://www.graalvm.org/22.0/graalvm-as-a-platform/language-...
[1] https://www.graalvm.org/22.0/graalvm-as-a-platform/language-...
The API is simple to use, if your language is written in Java. OP mentions using Rust, so it's probably not a huge win for him.