Hacker News new | ask | show | jobs
by thysultan 1926 days ago
You can literally emit runtime assembly in C in any C toolchain, what are you on about?
1 comments

How do you dynamically generate machine code without linking something like LLVM?
I believe that's actually what folk are doing these days, literally linking in LLVM and using it to compile C into machine code then executing it during runtime.
That's what I mean by "alternative toolchain," though; some of the code that you are executing at runtime isn't being generated by the normal GCC/Clang toolchain. It's being generated by your custom setup which links in LLVM.

You'd still need to compile your code with a regular toolchain, but you also need additional tools to compile, optimize, and debug code at runtime. That's what I meant by toolchain, even if it is not the conventional (static) definition.

same way you would with llvm, you can map executable memory without llvm and execute it.