Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's part of the LLVM philosophy that the compiler tools should be usable as a library. There was a not insignificant amount of drama[0] when the folks working on LLD (the then-new LLVM linker) decided they weren't going to follow that pattern. It was another 5ish years before they revisited that decision[1], but it's not a simple task to retrofit a project with proper error handling (exit on error is fine for a binary, but not a library), memory management (leaking is faster than freeing memory for a short lived process, but isn't acceptable in a library), etc.

[0]https://discourse.llvm.org/t/lld-status-update-and-performan...

[1]https://discourse.llvm.org/t/rfc-revisiting-lld-as-a-library...



I'd go a step further: the compiler should solely be a way to run the library, no extra code.


And packaged in a way that allows for both JIT and AOT workflows.




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

Search: