logoalt Hacker News

feelameeyesterday at 7:09 PM3 repliesview on HN

why use modules if PCH on your diagram is not much worse in compile times?


Replies

nickelproyesterday at 7:37 PM

Macro hygiene, static initialization ordering, control over symbol export (no more detail namespaces), slightly higher ceiling for compile-time and optimization performance.

If these aren't compelling, there's no real reason.

WalterBrightyesterday at 8:39 PM

Having implemented PCH for C and C++, it is an uuugly hack, which is why D has modules instead.

bluGillyesterday at 7:46 PM

modules are the future and the rules for are well thought out. Ever compiler has their own version of PCH and they all work different in annoying ways.

show 1 reply