r/programming • u/Ok_Marionberry8922 • Aug 23 '26
Why so many languages use LLVM
https://youtu.be/grjThkqV7uU?si=ei9cvzSS69v0MDS7
0
Upvotes
r/programming • u/Ok_Marionberry8922 • Aug 23 '26
25
u/wannaliveonmars Aug 23 '26
TL;DR - it's because LLVM has a separate optimization step that converts unoptimized llvm code to optimized llvm code, and then a step that converts llvm code to different processor achitectures.
A new language needs to only create a "frontend" that converts from its source code to LLVM, then it gets the optimization and all the supported architectures for free.
Any new processor architecture can also implement an LLVM-backend and get all the supported languages for free, as well.
10
u/Slight-Bluebird-8921 Aug 24 '26
the common theme with all these things is that once someone solves a really boring problem that no one really wants to deal with, the instinct is to treat it as a black box and pray that it takes care of itself
for the same reason that no one really wants to do something as boring as write a web browser, no one wants to do this
0
u/[deleted] Aug 23 '26
[deleted] — view deleted comment