r/Compilers • u/Retired-69 • Jun 27 '26
Thoughts on multi-target compilation?
I've just finished adding multi-target compilation to my language, and it actually works. Incremental compilation currently halts before the code generation stage, which is intentional and I have no plans to change that.
Currently, the compiler can target x86-64, ARM64, and RISC-V from the same frontend.Raw machine code and assembly.
Are there any common pitfalls or edge cases I should be aware of as I wrap up the backend?
Everything is handwritten—I'm not using LLVM or any other compiler framework. I started by writing raw machine code in Notepad, built an assembler from that, then ported everything to Linux. I'm in the final stage now, and if everything goes according to plan, I should have a demo ready in about 1–2 months.
View all comments
Show parent comment
1
u/Retired-69 Jun 30 '26
What built-in intrinsicts mean? Well to say it short. It replace inline assembly. IC have 138 built-in intrinsic that let you handle everything from memory, bootloader, interupts, cpu. Microsft Midori if you have head about it was the first to experiment on the way I am handling intrinsics .
When it comes to Print() it use a SysCall to talk to the OS.
The code I showed that you reference to work very well actually.
You call it what you want, but this was first of all about multi taget which is now solved.
Pointers are handled and regarding pointer provenance. Most languages don't track where a pointer originated beyond the language's ownership or lifetime rules. IC tracks the originating compilation Domain of pointers. If a higher-level Domain attempts to permanently retain a pointer to lower-level Domain memory that shouldn't outlive its origin, the compiler reports a Cross-Domain Provenance Leak.
Just wait maybe a month and a demo should be public. I am now in the process of the 2nd bootstrrap.