Hacker News new | past | comments | ask | show | jobs | submit login

If you use the normal toolchains for C vs another language, the other language still can be faster because it can dynamically generate bytecode based on runtime information. In the normal C toolchain, this is not possible.

However, if you used an alterative toolchain that could also generate bytecode from C at runtime, then I would bet that C would stay on top or be equal.




You can literally emit runtime assembly in C in any C toolchain, what are you on about?


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: