5 ms·
> It’s not really that go is better designed for fast compilation One of the explicit goals, by Go's creators, was fast build times. I still remember Rob Pike
by zeroxfe 3y ago
> It’s not really that go is better designed for fast compilation
One of the explicit goals, by Go's creators, was fast build times. I still remember Rob Pike introducing Go during an all-hands at Google, where he talked about the very long build times for C++ and Java in Google's monorepo, and then showed some promising demos. (Most of us rolled our eyes at it then, because it was just a "hello world", but it's quite impressive how the language has evolved and remained true to its goals.)
> - it is just a plain language where the compiler can just spit out vaguely optimized code, and call it a day.
It's a simple language, but I wouldn't call it plain, nor characterize the optimizers that way.
- kaba0 3y agoIt is not faster at compilation than Java, which was not particularly designed for such. Also, as can be seen, go is not a well-designed language, having language warts we knew for 50 years. I would take the creators’ claims with a huge grain of salt.
- mariusor 3y ago[flagged]
- kaba0 3y agoSo which of my statements do you take issue with? I do think highly of Rob Pike and Ken Thompson for their IT work, but they are simply not good at language design, which just shows that PL design is quite unlike working on an OS.
- mariusor 3y agoBoth statements, because unless otherwise qualified you're comparing apples to oranges when you say Java compiles as fast as Go. There's always going to be more overhead on running the Java bytecode on the JVM than there will be when running the native instructions generated by a compiler (even as "unoptimized" as Go is). And someone that makes that assertion with a straight face without this caveat is not someone that should be dissing Rob Pike about language design.
- rayiner 3y agoBut Java is inspired by Smalltalk, which is a late-binding language that defers most things to runtime. I believe in Java you can generate bytecode directly as you’re parsing the source file.
- riku_iki 3y ago> It is not faster at compilation than Java why do you think so? Their goal was to be much faster, but I can't find much benchmarks..
- Mawr 3y agoJava is compiled to bytecode, for later compilation to machine code at runtime (JIT). Go is compiled AOT, straight to machine code. It makes no sense to compare them. Unless you meant that Java's AOT compilation is faster than Go's?
- kaba0 3y agoThe parent comment explicitly mentioned that Java is slow at compilation, which is just false. Also, there are single-pass compilers that produce machine code, they are not fundamentally slower than a byte code generator. Of course extensive optimizations will be more expensive.