Compilation Speeds - Fortune [possible satire]

GeDaMoTurbo Pascal :P
rindolfGeDaMo: where?
Aruseusmany modern language features are slow to compile. rust has that problem too
InPhaseFast compilation, fast development, fast runtime. Choose 2.
rindolfInPhase: heh
rindolfInPhase: 2 or less
GeDaMorindolf: that was to beaky's "instant compile speeds"
rindolfGeDaMo: ah
InPhaseThere's a fundamental reason one ends up with that trade-off of choosing 2. Turning complicated ideas into fast instructions is complicated. And that complexity has to eventually be processed somewhere, either in the head of the programmer, by the compiler, or as a runtime cost.
rindolfInPhase: interesting
_W_most slow compilers are slow, not because it is necessary, but simply because making it fast hasn't been a priority
InPhase_W_: Well the major C++ compiler designers, and the C++ language committee, reportedly spent effort trying to significantly speed up compilation in recent years. But I think we can see there were not many meaningful results from those efforts. They've had trouble finding ways that don't majorly break the features that make the C++ runtime fast.
xenoif I don't learn how to read a file line by line in Swift, this one will also be slow, memory consuming or unstable ;/
xeno:/
_W_well C++ compilation is already relatively fast, so it makes sense that there wouldn't be a lot to gain
jeayeThere have been huge results in the reduction of TMP compilation speeds, thanks to pressure from the clang/llvm world.
jeayeTemplates, of course, being the biggest practical slowdown in C++ compilation, that's a big win.
rindolfjeaye: what is TMP?
jeayerindolf: Template MetaProgramming
_W_I'd go so far as to say that there's more of a correlation between how young a language is and how slow its compilation is, than between complexity of language and how slow the compilation is
rindolfjeaye: ah
SlashLifejeaye: And to be fair, I don't think it was obvious 20-25 years ago how big TMP would become.
rindolf_W_: some languages started off with fast compilers
_W_yes, it's not a hard rule by any means
rindolf_W_: and gcc got slower - https://github.com/shlomif/fc-solve/blob/master/fc-solve/docs/gcc-2.95.txt
gehnfast in terms of time to compile? or fast in terms of the performance of the resulting executable?
_W_gehn: time spent in compilation was what was being discussed
_W_(and contrasted up against speed of development and speed of execution)
gehnah
xenowould guess most languages started off with fast compilers that got slower
_W_probably, at least up to some level of complexity and features
velcospeed of development is subjective, its place is not at all with the other too
velcotwo*
gehncompile time is certainly something that impacts dev time
gehnat least in my experience
gehnI like C++, but I don't love everything about it. it would be nice if we had significantly faster C++ compile times
velcoin my experience, it does impact time taken only when not writing code
gehnwell, testing the code written is a pretty important and continuous process of my development
gehnI have unit tests, but those don't cover everything
gehnand GUIs are often more difficult to test at all
gehnespecially difficult to test things like the result of a render operation on an OpenGL context
gehnso, needing to wait a significant amount of time (upwards of a minute or several) just to test some fairly simple change can spiral time-to-dev costs
rindolfgehn: yes
rindolfgehn: using ccache has changed my life
velcowhat percentage of this time is spent compiling? and what is spent analysing the issue, coming up with a solution, implementing the solution, writing a test, code review, running the test?
gehnrindolf, is that different from how a Makefile or whatever (or a cmake generated project) should be able to detect which files need compile and which don't?
gehnvelco, like I said, it's not always feasible to write a test for everything
rindolfgehn: sometimes it is
gehnI don't have an answer as to exact percentage, but on many days I suspect I spend almost 50% of my total time waiting for compiles
rindolfgehn: if you did “make clean” for example
velcogehn: Sure. Why do you feel compelled to tell this to me?
gehnthat might be an overestimate, but it's not far away
Aruseusgehn, if you have a file b that depends on a. if you change a, then you'll need to recompile b even if you didn't change it at all. so probably not everything will change
gehnvelco, were you not asking the percentage question as a response to what I had said?
rindolfobxkcd: https://www.explainxkcd.com/wiki/index.php/303:_Compiling
gehnunit tests help a lot
velcogehn: yes, and if you don't write test, my list potentially incomplete list of things allows for a 0 percent
gehnbecause they compile much faster as each unit is typically decoupled from the entire app
velcogehn: sound like you need to rethink your workflow
gehnvelco, sorry I don't understand what you just said
gehnvelco, maybe, but I'm not sure what to change about said workflow
velcogehn: I have not put a restriction of non-zero time on any particular item in my list, so I don't understand why do you need to tell me some of these may take zero time
gehnso, it's great to write unit tests, and I write a lot of them, but when doing more GUI centric integration centric work - a workflow centered around unit tests isn't viable
gehnvelco, I seriously still don't understand what you're saying?
gehnwhen did I say anything about zero time?
rindolfgehn: there is also https://en.wikipedia.org/wiki/Distcc
gehnvelco, yes, what about that statement?
velcoI have found that a a simple change incurs less than 2 minutes of building of a large c++ project, most of it spent in linking
gehn2 minutes is still kind of a lot
gehnI tend to not write tons of code before recompiling and testing
gehnso I might spend anywhere from 30s to 5 minutes on a few lines, and then I usually want to test again before moving on
gehnwith unit tests where compilation and runtime is usually < 20-30s that's mostly not an issue
gehnbut when compile times start to rise above the minute-or-several mark, then this begins to become more of a problematic issue
velcowhy run compilation and test so often?
gehnI think the answer to that should be fairly clear to many if not most devs
velcoI run it when I have written a committable amount of code
exio4_nozncvelco: fail early
gehnthe more lines of code you write the more chance that you've made a mistake, and the further you go without checking your work, the more likely it is you'll end up in a very difficult to debug situation that consumes more time than it should
velcoexio4_noznc: it looks to me that some fail even before starting :P
gde33shouldn't make mistakes
gehnlinting helps with that a lot
gehnbut still doesn't prevent logic or runtime errors
velcogehn: that does not come form my experience; it is very rare I have an error in each line I write
gehnso I guess velco is a near god-like perfect programmer
velcoin fact, most are correct; hence, testing them in isolation proves pointless
gehnfor the rest of us mortals however...
gehnI don't test lines in isolation
Channel##programming
NetworkFreenode
Published2018-05-09