So, I rewrote my game in C3 (opens external site)
View full thread · View on Hacker News
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
View full thread · View on Hacker News
I did a little research and it looks like Zig puts everything into one module and feeds it to LLVM. That approach is inherently single-threaded because there's just one giant module. Clang, on the other hand, treats each translation unit as a module, so it works in parallel. Presumably c3c works the same but I'm not familiar with it.
I really wish Zig would parallelize the object file emission in a way that would benefit any selected backend (i.e. whether LLVM or their own backend).
Replies (2)
Replies (2)
To get even more mileage you can do some optimizations in the frontend, before LLVM lowering (as long as it won’t break debug) to reduce IR even further.
Replies (1)
Considering this, I think LLVM might want to add other methods of paralallelizing computation within a single compilation unit.
Replies (1)
Furthermore, I believe the assumptions are built hard into LLVM.
But I mean it's not even a problem. Even if you build everything monolithic (and we can debate the downsides of that), you can still create "virtual" modules in order to parallelize codegen. It's an extremely obvious win and it's dead simple. I'd be surprised if Zig doesn't do that. It's literally the first idea that would come to mind for speeding up "single compilation unit" languages.
We found that out the hard way, when we compiled our relatively simple scripting language, only to be faced with minutes of compilation for scripts of ~2000 lines. Larger tweaks to the front end to avoid certain patterns worked to a degree.
The point is, IR matters more than one might think.
Replies (1)
Replies (2)