4 ms·
One of the main reasons is because Go syntax is designed for fast compilation.
by adrianlmm 12y ago
One of the main reasons is because Go syntax is designed for fast compilation.
- raverbashing 12y agoI'd like to see the impact of different grammars in compilation time, which I suspect are small. C++ compilation is not slow because of the grammar, but because of things like multiple includes
- vidarh 12y agoI've yet to see any evidence that Go is all that fast to compile, but whether it is or not there's simply no way that the syntax will be what makes a difference vs C. Compilers like GCC are "slow" because they do a lot of work. To see a good demonstration of how fast C compilation can be, consider Bellards TCCBOOT [1] which boots into a version of TCC that then compiles a Linux kernel and executes it - the compilation took a reported 10 seconds on a 2.4GHz Pentium 4 in 2004. When testing against the then-current gcc 3.2 with -O0, TinyCC was about 9 times faster than GCC. There are certainly things about C that makes fast compilation tricky, but it's not the syntax (abusing a text based pre-processor instead of having a proper module system being suspect #1) Even so, last time I looked, GCC stood up fairly well agains the Go. [1] http://bellard.org/tcc/ http://bellard.org/tcc/
- WalterBright 12y agoThe declaration syntax detail has nothing to do with compilation speed.