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

> Namely, instead of generating machine code targetting a specific architecture, LLVM generates assembly code for an imaginary machine, and then converts that intermediate representation to actual code for whichever architecture we're interested in.

Why is that not possible for real-world languages? e.g. have one language which would include the specifics and complications of each language of the world and use it as intermediary for going back and forth to any language in the world.




It's not really that easy even in LLVM. Just like how real world languages don't map 1:1 to each other with all their idioms and untranslatable phrases, LLVM IR isn't a generic virtual machine. Instead, LLVM IR targets various overall architectures such as "64bit ARM processor" with "such-and-such ABI", so there is a limit to which processors the final assembly can be generated for.




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

Search: