r/ProgrammingLanguages • • 16d ago

Is there any other compiler backend other than LLVM, MLIR?

/r/Compilers/comments/1y04br0/is_there_any_other_compiler_backend_other_than/
10 Upvotes

18 comments sorted by

29

u/Mickenfox 16d ago edited 16d ago

It's funny that Microsoft has spent 25 years developing a (now) MIT-licensed stack just for nobody to even remember CIL exists or that it has AOT compilation now.

9

u/pjmlp 16d ago

It had AOT since the beginning, however it only supported dynamic linking, and requires signed binaries, thus many never bothered.

3

u/miffy900 15d ago

It also only supported windows for a good long while.

5

u/omniuni 16d ago

They kept it closed for just long enough for LLVM to take over.

2

u/kwan_e tonal-lang 14d ago

It might be MIT-licenced, but that doesn't give you patent protection. And Microsoft and partners who developed the CIL infrastructure have patents on them. They've given a pinky-promise that they won't enforce those patents, so no surprise people wanted to avoid it at the time.

3

u/Wriiight 15d ago

Web assembly is an alternative that is often overlooked

1

u/naharashu 15d ago

Isnt it only for browsers?

4

u/Wriiight 15d ago

Not exclusively. Lookup “wasmtime”

3

u/MCWizardYT 14d ago

Nope. WebAssembly and WebGL were invented for browsers, but native runtimes exist for both

17

u/kat-tricks 16d ago

just saw QBE in a clip from a zozin stream, it's lighter than llvm and used in the Hare lang apparently?

6

u/DTCreeperMCL6 15d ago

I like qbe. Its a good tool to learn assembly too

11

u/GunpowderGuy 16d ago

https://cranelift.dev/

has the advantage over llvm, of having less technical debt. it also has a fast mode that is faster than llvm, and a optmization mode that has interesting properties over llvm

https://github.com/bytecodealliance/rfcs/blob/main/accepted/cranelift-egraph.md

3

u/AdreKiseque 15d ago

Oh this is sick

3

u/bl4nkSl8 16d ago

Cranelift C via clang (though that uses llvm) or gcc

A bunch of smaller ones Zig (for some targets it doesn't use llvm)

2

u/david-1-1 14d ago

There is also the very old backend by Richard Freiburghouse that for the first time allowed many front ends for various languages (like PL/1) to generate code for a minicomputer that itself would fit into the small memory of a minicomputer.

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 15d ago

Check out Cliff Click's "Simple": https://github.com/SeaOfNodes/Simple

1

u/MCWizardYT 14d ago

If the language is high level and dynamic, it can target the JVM. Especially if it already uses bytecode; all you'd need to do is translate it.

GraalVM can streamline this process so that you don't even need to worry about the underlying bytecode. It provides Truffle, an awesome language developing framework. The project includes Espresso, which is a reference implementation of Java on top of Truffle that actually performs very well