5 ms·
What happened between Go 1.4.3 and 1.5 which introduced such a slow down in compile times?
by RichWalton 11y ago
What happened between Go 1.4.3 and 1.5 which introduced such a slow down in compile times?
- stefano 11y agoThey rewrote the compiler from C to Go.
- incepted 11y agoWell, at least I bet the compiler compiles itself faster now :-)
- wund 11y agoTo be specific I think they used a transpiler, probably Russ Cox's c2go (https://github.com/rsc/c2go https://github.com/rsc/c2go).
- oconnor663 11y agoWhat's the point of doing that? I get that you want a language to bootstrap itself, but if you skip the experience of actually writing the compiler, and the code you have to maintain is a weird non-idiomatic machine-generated thing, what have you gained?
- raverbashing 11y agoAutomatic translation for most of the code where it doesn't make a difference Then you can get this base and start improving on it
- redtuesday 11y agoMore developers (who don't know c (good enough), but are proficient in go) who can contribute to the compiler code long term (and improve the transpiled compiler). Other reasons would interest me as well.
- chrisseaton 11y agoAre there large numbers of people skilled in writing compilers, but don't know C? I doubt it. That practical point aside, I do think it's good to lower the barrier of contributing.
- geodel 11y agoI think it is similar to what some people say that they will contribute to open source project only if it is on github. So it is not logical but nonetheless many want it.
- redtuesday 11y agoYes, I doubt it too. But are they interested in contributing to the go compiler if they don't already do that? I would guess go users are more interested in contributing to go. Plus the compiler people who are good at c and are already contributing can probably get up to speed with go quickly if they want to and don't know go yet. Or they already know go because they use it.
- zurn 11y agofrom https://talks.golang.org/2015/gogo.slide#4 https://talks.golang.org/2015/gogo.slide#4 "Why move the compiler to Go? Not for validation; we have more pragmatic motives: Go is easier to write (correctly) than C. Go is easier to debug than C (even absent a debugger). Go is the only language you'd need to know; encourages contributions. Go has better modularity, tooling, testing, profiling, ... Go makes parallel execution trivial. Already seeing benefits, and it's early yet. Design document: golang.org/s/go13compiler" and https://talks.golang.org/2015/gogo.slide#10 https://talks.golang.org/2015/gogo.slide#10 "Why translate it, not write it from scratch? Correctness, testing. Steps: Write a custom translator from C to Go. Run the translator, iterate until success. Measure success by bit-identical output. Clean up the code by hand and by machine. Turn it from C-in-Go to idiomatic Go (still happening)."
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]