I'm still lurking and hoping for a compiler subforum if one were to ever show up
Hi! Custom OS dev is cool! I wonder, what are your thoughts on compilers?
Re: Hi! Custom OS dev is cool! I wonder, what are your thoughts on compilers?
I've never seen a compiler written directly in assembly, that's so fascinating! I wonder, is there some C code example for a code snippet that a C compiler would commonly optimize wrongly?
I'm still lurking and hoping for a compiler subforum if one were to ever show up
i'm currently working on a pair of two languages using the same shared compiler, but nothing's really in a super usable state yet. I hope to have an alpha working in a month or two.
I'm still lurking and hoping for a compiler subforum if one were to ever show up
- Demindiro
- Member

- Posts: 165
- Joined: Fri Jun 11, 2021 6:02 am
- Libera.chat IRC: demindiro
- Location: Belgium
- Contact:
Re: Hi! Custom OS dev is cool! I wonder, what are your thoughts on compilers?
I don't have a concrete example at hand, as most code is fairly typical and a lot of bugs in mainstream compilers (GCC/Clang) get ironed out by essentially bruteforce due to how widely they are used.
Where potential issues lurk is in atypical code which may trigger paths that haven't been extensively tested. One notorious example is LLVM's noalias attribute, which Rust repeatedly tried to use yet had to disable frequently as Rust is the first mainstream language to make extensive use of it. (Though last I heard no further issues have been found).
Re: Hi! Custom OS dev is cool! I wonder, what are your thoughts on compilers?
Huh! I find it curious you would go so far to avoid that potential issue. But I admit I didn't ever really check if a compiler optimized something wrongly, so I don't know how prevalent that is.