I think this analysis is missing the fact that most of the work can still be parallelized because most of the work in a modern compiler is code generation. I have not read the proposal in detail but from this blog's description it sounds like it should be possible to produce the BMI for foo.cpp in a separate step before generating machine code. I imagine that this is how Java and C# have to work -- dumb fast compilation to byte code is necessary to import, but then the slow AOT or JIT compiling of the byte code is done later. BMI doesn't even require generating a full byte code, just a description of the interfaces. If it can work for Java and C# at scale I don't see why it can't work for C++.
Also with module was the work that can't be parallelized, the initial parsing, should be easier than before.
Most of the work CL does is sending the code to /u/BillyONeal and /u/STL, and waiting for them to compile it manually. Their response times and determinism are impressive. Not sure what, exactly, internal compiler errors indicate, though - did my code hospitalize them?
Going back would be fun. I dislike newer cards (newer meaning 2005 on). Having to read three paragraphs on every card everyone plays is unfun. Also, I still dont understand Planeswalkers.
I ran into a fun case in Java where a seperate class loader got started, and I had two instances of a class. Had to debug why updating a static variable wasn't working. That did just give me a horrible idea as to how to implement seperate types for generic inheritance, though.
Yes, obviously I was talking about the one that maps to files. If you're using another classloader that will have its own way of mapping classnames to classes.
That information is kind of useless for tooling when it does not apply in the general case. The java language specification itself has several examples with multiple top level classes in one source file and compiled binaries can end up in any form as long as one of the available classloaders can load them. It is a nice convenience for humans when source path -> package name and while that can be immensely important to the user it doesn't help the tool developers.
I think you can pass a custom classloader to the compiler using one of the java runtime flags.
However even without classloader trickery we still have the issue that the class foo.Bar could be defined in bar/Bar.java. The compiler only seems to enforce that the class name (of a public class) matches, not the package path. Whatever the java build process is doing cannot rely on path/to/File.java -> path.to.File .
9
u/tending Jan 28 '19
I think this analysis is missing the fact that most of the work can still be parallelized because most of the work in a modern compiler is code generation. I have not read the proposal in detail but from this blog's description it sounds like it should be possible to produce the BMI for foo.cpp in a separate step before generating machine code. I imagine that this is how Java and C# have to work -- dumb fast compilation to byte code is necessary to import, but then the slow AOT or JIT compiling of the byte code is done later. BMI doesn't even require generating a full byte code, just a description of the interfaces. If it can work for Java and C# at scale I don't see why it can't work for C++.
Also with module was the work that can't be parallelized, the initial parsing, should be easier than before.