I agree…so why make life hard for yourself? :) Pick an intermediate language that was designed as a compiler target.
-
-
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 -
Replying to @pcwalton @RichFelker
Fair, I've never tried to write a GC language targeting C. The portability situation is better now, sure; back when I started playing with LLVM even Windows support was shaky.
1 reply 0 retweets 2 likes -
A GC language could target C by storing all heap pointers on a shadow stack or similar. Remember how the Factor runtime used macros and later smart pointers for that
1 reply 0 retweets 1 like -
Yeah, you could do that, or you could use conservative GC. It won’t be perf-competitive with the best GCs though.
2 replies 0 retweets 1 like -
Replying to @pcwalton @slava_pestov and
Why wouldn’t a conservative GC be competitive?
1 reply 0 retweets 0 likes -
Replying to @jfbastien @slava_pestov and
It can’t be a moving GC, which means it can’t have bump allocating TLABs in the nursery. So malloc will be slower than it needs to be.
1 reply 0 retweets 0 likes -
Replying to @pcwalton @slava_pestov and
The JSC GC is conservative and non-moving, seems to be doing fine. Agreed malloc when you can't just bump a pointer isn't as fast, but you have other costs that this, no?
2 replies 0 retweets 0 likes -
Replying to @jfbastien @pcwalton and
Hot take: JSC’s GC gets to cheat a bit because JS heaps are small and short lived, and also JS is (largely) single threaded.
2 replies 0 retweets 1 like
True. I also used to hear rumors that WebKit had several known leaks, but they didn’t matter that much because page navigations blow away the whole heap anyway. Dunno if that was true, but it seems plausible enough.
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.