Hacker News new | ask | show | jobs
by bootload 3442 days ago
"Compilers are usually not networked, concurrent, or timing-dependent, and overall interact with the outside world only in very constrained ways."

Are there any parallel compliers?

3 comments

I can say that for C and C++, the compilation is very often parallelized at the translation unit (file) level, by starting multiple instances of the compiler either locally or over a network with something like distcc. This is simple and effective enough that there wouldn't be much gain in parallelizing the compilers: all the cores are already busy most of the time.
It depends on what you mean by parallel.

Certainly the Roslyn C# compiler is highly parallel. All files are parsed in parallel, then all classes are bound (semantically analyzed) in parallel, then the IL serialization phase is sequential.

"It depends on what you mean by parallel."

Across different machines, not cores on ^a^ chip?

I wouldn't say that's what most people mean by parallel, but in that case I think you're better off building a layer on top of the compiler for that.

For instance, provided deterministic compilation you could keep a networked cache of compiled libraries that would be delivered as needed.

Trying to be network-parallel at any finer level is probably a waste of time -- network and (de)serialization overhead would eat away all the advantages.

Microsoft's CL.exe is, through the /MP option
Which only has effect if you pass multiple files to compile.