News for hackers. Stuff that matters.
Re:Ask HN: Does all languages who target LLVM have the same ... by komon on Friday September 15, 2023 @03:23PM (#37527997)
The output from an LLVM frontend compiler is LLVM IR, which is sort of a high-level architecture-agnostic assembly.

The LLVM backend compiles this IR to the target architecture's machine code.

Some optimizations can (and do?) happen in the backend compiler, but for the most part it is up to the frontend to emit IR that is well optimized within the semantics of the frontend language.

The history of Rust, for example, is filled with examples of optimizations made not to the standard library, but to how the frontend emits IR.

Beyond that, different languages and ecosystems are going to have differing levels of optimization in their stdlib and runtime that will have an outsize effect on day-to-day performance.

Re:Ask HN: Does all languages who target LLVM have the same ... by Alifatisk on Saturday September 16, 2023 @07:04AM (#37533725)
Thank you for your well detailed response, I appreciate that! I was very curious about this and did some digging but couldn't find a straight answer.

Which yours was.