It's like an extremely lightweight LLVM yet I can't find any decent discussions on it on HN so far, except one with a half dozen semi useful comments.
Rochus•7mo ago
> It's like an extremely lightweight LLVM
Is it? Does it have e.g. an SSA IR and an optimizer pipeline? Can I use it as a backend for my AOT compiler? Does it support C calling conventions? Does it support cross-compilation? If yes, that would indeed make it a lean LLVM alternative.
90s_dev•7mo ago
You're right. I am going to leave HN. Clearly I am not smart enough to be here. Everything I have said here in the past month has been proven wrong by a commenter, and it has gradually dawned on me that I'm just not as smart or experienced or knowledgeable as I thought I was. I'll find some programming subreddit or something that's more at my level. Thanks for helping me see this.
Rochus•7mo ago
Not actually the response to my questions I expected. I don't know AsmJit and so far assumed it just makes assembler programming a bit easier.
Asm2D•7mo ago
It's not, SSA and an optimizing pipeline was never the goal of AsmJit actually. You emit your SIMD code as you want it an no optimizer or other transformations mess with it - that's the goal and it works great for use-cases that don't need an additional optimizing pipeline.
However, it can do the mentioned cross-compilation. AsmJit is not dependent on host architecture in any way - you can generate AArch64 on X86 and vice versa. It's of course more optimized for JIT so it offers many tools to help with creating your own lightweight JIT compilers and running the code you generate.
So, no, it's not an LLVM alternative, but it's also not a trivial assembling engine. It has a unique position as it optimizes for low-latency code generation, which LLVM doesn't.
Rochus•7mo ago
Interesting, thanks. I've seen that there is a kind of IR; does it support the same IR code to run on different targets? Is SIMD part of this abstraction?
90s_dev•7mo ago
Rochus•7mo ago
Is it? Does it have e.g. an SSA IR and an optimizer pipeline? Can I use it as a backend for my AOT compiler? Does it support C calling conventions? Does it support cross-compilation? If yes, that would indeed make it a lean LLVM alternative.
90s_dev•7mo ago
Rochus•7mo ago
Asm2D•7mo ago
However, it can do the mentioned cross-compilation. AsmJit is not dependent on host architecture in any way - you can generate AArch64 on X86 and vice versa. It's of course more optimized for JIT so it offers many tools to help with creating your own lightweight JIT compilers and running the code you generate.
So, no, it's not an LLVM alternative, but it's also not a trivial assembling engine. It has a unique position as it optimizes for low-latency code generation, which LLVM doesn't.
Rochus•7mo ago