Years ago, I started work on a library that does this in Java: <a href="https://github.com/dvx/jssembly" rel="nofollow">https://github.com/dvx/jssembly</a><p>The syntax looks like this:<p><pre><code> jsm.define("test", new Block(x64) {{
__asm(
"nop", // no-op
"ret" // return
);
}}).invoke();</code></pre>