If it's low level and platform independent, that probably means more that it provides the tools to the user to work on many platforms, rather than it does the work for many platforms for the user.
Jit libraries like this are building blocks, not a turnkey interpreter to native execution pipeline.
The "LIR representation" itself is machine independent, but a given stream of LIR instructions won't necessarily be portable. (If I'm understanding correctly)
This is pretty common in low tech compilers as well. Basically you assume just a few registers, and have some templates for various code sequences that compute a result and push it onto a stack, or that sort of thing. The code you get is way less efficient than an optimizing compiler would produce, but it beats most interpreters. GNU Lightning is a similar sort of JIT compiler.
> Although sljit does not support higher level features such as automatic register allocation
I don't quite see how it can be architecture independent if it doesn't do register allocation. Does it use a small fixed amount of virtual registers which work on every target? Or does it spill virtual registers to memory if required?
> The key design principle of sljit is that it does not try to be smarter than the developer.
> This principle is achieved by providing control over the generated machine code like assembly languages.
So it sounds like this is essentially your LLVM backend, taking care of going from intermediate representation to machine code.
Optimisations have to be done separately.
I see how a lightweight code generator could be quite useful, is sljit used in any larger projects?