I've been working on a JIT compiler in Go, with embedded game
scripting as my mental model.
my project is similar. It needs high performance foreign code interop.
I want a 2 nanosecond CALL/RET path rather than a 43 nanosecond CGO switch.
but I feel it is super complicated, with a huge API surface, while also not being general enough.
I've drafted up a spec for a self-describing foreign JIT stack-frame protocol. I'd appreciate any early feedback before I implement/file a real proposal. See the attached markdown. It has a pretty small additional API surface. Most of the complexity burden is shifted to the JIT author.
Thanks for your thoughts.
Jason