TBF LLVM has a lot of obnoxious UB around float <-> int operations, division, sqrt, etc. too
-
-
I think, at a higher level, using *any* language as a compiler target requires thorough understanding of the target language semantics—even assembly language
2 replies 0 retweets 2 likes -
Replying to @jckarter @RichFelker
I agree…so why make life hard for yourself? :) Pick an intermediate language that was designed as a compiler target.
2 replies 0 retweets 1 like -
Replying to @pcwalton @RichFelker
I've written compilers targeting both C and LLVM, and while LLVM does make some things easier, it also makes things like FFI harder (even with C), and like Rich says you give up a lot of portability.
2 replies 0 retweets 2 likes -
Replying to @jckarter @RichFelker
You give up some portability. Not “a lot” of portability. Compiling to C also makes things like proper debug info and stack maps/register maps for GC harder (and by “harder” I mean “impossible”)
2 replies 0 retweets 1 like -
No, you just put the necessary data structures for walking live objects inside your objects rather than trying to access some underlying layer that would make it intrinsically nonportable.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @jckarter
How, without runtime overhead? I see no way around having to spill every root to the stack around every function call (and that’s assuming you can walk your stack). “Portable” GC is a nonstarter from a performance point of view.
1 reply 0 retweets 1 like -
You don't make objects collectable if their lifetime can be known statically. Only objects where reference patterns don't admit static analysis need to be walkable.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @jckarter
“Knowing the lifetime statically” means “stack and register maps”, which are impossible to do in C.
2 replies 0 retweets 0 likes -
Cards on the table: I’m, in vain, trying to prevent other projects from falling into the trap of “implement conservative GC, then spend a decade trying to dig out of the hole”. SpiderMonkey is the only project I know of that successfully transitioned from conservative to moving.
1 reply 0 retweets 2 likes
"Conservative GC" is just fake C full of shitty UB (invalid pointer arithmetic).
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.