Very strange statement. Most programming languages/runtimes do small operations very quickly.
Very strange statement. Most programming languages/runtimes do small operations very quickly.
For example, you can generate really short C++ programs that exploit the template mechanism to perform heavy calculations at compile time.
24k loc of C (24743 total excluding headers and comments), using ninja and cmake, without using the autofail tool suite (which ups the time taken about about 150%):
$ time make
...
real 0m16.929s
user 0m9.952s
sys 0m4.641s
23kloc of go code (23588 total excluding comments): $ time go build
...
real 0m1.667s
user 0m1.331s
sys 0m0.214s.net has a pretty good back end and the only thing you really fight with is not instruction compilation/execution time, but garbage collection. GC is mainly why you might want to use C++ sometimes instead of C#.
I'm also surprised to hear they are ahead on garbage collection. Assuming they are using a sweep and/or copy collector and not reference counting, why is it more deterministic than the CLR's?
I'd like to see some benchmarks/numbers if you have them handy.
Anecdotal evidence points to go being faster on nearly all counts bar regular expressions once you know what you are doing. The GC differences come from the fact that go does a hell of a lot less allocations. It's possible to write complex code in go which doesn't allocate or GC at all. The same is not true for the CLR. Fundamentally the GC in go is slower and causes more pauses but you can easily tune around it without shitty hacks like the disruptor pattern.
Anyway numbers cannot be published thanks to Microsoft's suspicious intentions with their EULA so you'll have to compare yourself behind closed doors.
.net has value types that you can use to avoid allocations. I've used them to write GC free code before where it's necessary, like doing a physics engine. I'm not sure if this is comparable to how you are avoiding GC in Go.
All mainstream languages compile in about that ballpark, if not faster.
I've always found it odd that one of the driving design principles of Go was "fast compilation". It's always struck me as odd and short-sighted, obviously motivated by the Go authors' history with C++. If only they had spent some more time studying other languages, they would have realized that compilation times are really not a concern in languages these days, and they might also have designed Go with more modern features in mind, such as exceptions and generics.
Already in 1987 Turbo Pascal 4.0 was compiling quite fast, Borland states around 34,000 lines/minute for the 5.5 version in 1989.
Similar compilation speeds are possible for languages with modules, since the early 80's.
Go's compilation speed is only news for someone that never used a module based language for systems programming like Modula-2 or Turbo Pascal, just to name two.
We are repeating history because the old ways were forgotten or replaced.
Some Modula-2 compilers:
http://plas.fit.qut.edu.au/gpm/
http://www.excelsior-usa.com/xdsx86.html
Modern Turbo Pascal compatible compilers:
http://www.mikroe.com/mikropascal/avr/
http://www.embarcadero.com/products/delphi
It is just a matter to look for them.
See http://talks.golang.org/2012/splash.article for discussion on the import/compile system.
Also, when you code with generics, you're coding with Hitler.