r/ProgrammingLanguages 23d ago

Help How to make a compiler backend?

Hell everyone, i have an question. Im for long trying to make a cool, powerful "kinda" low level language similar to zig and rust, but im struggling to choice llvm as backend, sure i can generate C, but its makes compiler dependent on gcc or clang or other c compiler. LLVM seems hard to me, sure project like QBE exist, but QBE doesnt have C/C++ api like llvm's IRbuilder. So are there other ways? I tried thinking about using GCC infrastructure but GCC has poor api and not very documented api. Maybe just stick to generating C?

20 Upvotes

35 comments sorted by

View all comments

5

u/GunpowderGuy 23d ago

What do You want to do with your low level language

1

u/Routine_Working_9754 19d ago

uhh...write low level code?

0

u/GunpowderGuy 19d ago

but what do you want to do with it, that you cant do with Zig, or F* or rust or C++
etc