4 ms·
Go 1.5 Bootstrap Plan
- deleted 12y ago[deleted]
- f2f 12y agowhat language progress? this is Go we're talking about :) (before the downvotes start raining, my joke is referring to the Go compatibility promise, not the lack of whizbang blinkenlights)
- robbrown451 12y agoSo you need 1.4 to build 1.5....can you then rebuild 1.5 from 1.5? Would it be different? Would it make a difference if you then rebuilt 1.5 using 1.5 built using 1.5 rather than 1.5 built using 1.4?
- nsajko 12y agoIf both compilers are correct, which compiler you compiled the program (compiler in this case) with shouldn't matter for the correctness of the code; but the generated code would be different. There should be no difference in the code generated by instances of the same compiler version, although the code of the compiler programs itself would be different (i.e. different performance, time of exec...) if they were compiled with different compiler versions. Edit: That's all assuming same version of the language being compiled. That's why they say the go1.x compilers may need to stay restricted to go 1.4 for their code. P.S. See Linux From Scratch or osdev.org for more about this
- emeraldd 12y agoThat's actually a step in bootstrapping the system. Generally, to bootstrap a language a new language involves building a minimal bootstrap compiler/runtime that is just enough to be able to rebuild the full system: 1. build bootstrap system with existing tools 2. compile full system with bootstrap 3. compile full system again with new compiler Or something like that. Edit/Note: The OP linked document is a pretty good explaination of the whole process as well as the implications ...
- masklinn 12y ago> So you need 1.4 to build 1.5....can you then rebuild 1.5 from 1.5? If the language is forward-compatible, yes. It could be different if new optimisations have been added, or the code generator has changed. > Would it make a difference if you then rebuilt 1.5 using 1.5 built using 1.5 rather than 1.5 built using 1.4? It should not, the 1.5 compiler should be stable and yield the same result whether it was built using a 1.4 compiler or a 1.5 compiler. That's actually a common technique to look for regressions and validate the bootstrapped compiler. For instance to compile rustc you download a "stage 0" compiler at Vx which compiles a "stage 1" compiler using Vy > Vx source. That stage 1 compiler is then used to compile the stage 2 compiler from the same source. Stage 1 and stage 2 may not be identical since stage 0 and stage 1 may have different optimisations &al, so the stage 2 compiler is used to compile rust a third time, and that compilation is checked against the original stage 2 (and should be a fixpoint).
- jsherer 12y agoI'm curious, as the document doesn't mention it, what is the benefit of bootstrapping? Is it primarily to allow future development to happen in the bootstrapped language, instead of the lower-level language (C in this case)? Or is there some other benefit I'm missing?
- enneff 12y agoYep, exactly. We want to write our compiler in Go, now that the language and libraries are good and stable. It's a process we started more than a year ago: http://golang.org/s/go13compiler http://golang.org/s/go13compiler
- josteink 12y agoMicrosoft found themselves unable to improve the C# language using a compiler written in a lower level language like C/C++ so they've rewritten it in C# to allow further language development and to support more sophisticated language features. It also has the benefit of the team implementing the language actually dogfooding it, causing natural evolutionary improvements. I suspect Google is doing this with go for the same reasons.
- masklinn 12y ago> It also has the benefit of the team implementing the language actually dogfooding it, causing natural evolutionary improvements. On the other hand, a big risk is that the language will evolve towards being better at writing compilers, which is a highly idiosyncratic task.
- rsc 12y agoYes, that is a real risk. I have written about this before. It's much more of a risk at the start, when there are no other sizable programs. Now there are plenty of sizable Go programs, so I am not worried about overfitting to compiler development.
- girvo 12y agocough OCaml cough I jest, but, "ha ha only seriously". It's an interesting problem when writing languages in themselves, that you need to try not to make your language great for writing compilers and nothing else!
- binarycrusader 12y agoUgh...this is going to make new ports such a pain. I can understand why they're doing it, but this is going to make my life a lot more difficult. If 1.4 is going to become the bootstrap toolset, that also suggests that 1.4 will essentially become "long-term supported", meaning that if new ports require fixes to the bootstrap toolset (even in the cross-compilation) scenario, hopefully they'll accept those changes upstream.
- abtinf 12y agoI'm not sure I understand why this makes ports harder. Shouldn't it be possible to port to a new system simply by porting Go 1.4 to that system? Once that base version is ported, a script can build 1.4, then build 1.5 and any succeeding base versions until the current version is reached. Of course, system-specific features would have to be added for each go release beyond 1.4, but that would have to be done anyway. What am I missing?
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]
- rsc 12y agoNo no no no no no no no no. THIS IS NOT TRUE. See the discussion with binarycrusader on this very page.
- rsc 12y agoWhat new ports are you working on? (I'm just curious.) Go is already very good at cross-compiling. That can be used to do a new port (as a trivial example, the fact that the compiler doesn't run on NaCl didn't hurt the NaCl port at all). There is a section in the doc explicitly about this. We are doing new ports too (like power64), and I don't anticipate the bootstrapping change slowing them down appreciably.
- jesuslecharlle 12y agoOfficial support for Bootstrap in Go would be nice but personally I much prefer ZURB Foundation so it would have been better if they let the end-user make the choice.
- doognukem 12y agoThis document is referring to the process of bootstrapping a compiler http://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29 http://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29 not the web UI framework http://getbootstrap.com/ http://getbootstrap.com/
- kbd 12y agoUnfortunately it looks like the troll was successful.
- jesuslecharlle 12y agoCheers mate. UPDATE: DDoSing your site now.
- deleted 12y ago[deleted]
- wowoc 12y agoWell, now I just hope that generics are extremely helpful in writing compilers! :-)
- barryallen22 12y agoIf Go 1.5 relies on Go 1.4 which relies on C doesn't go 1.5 still rely on C? I don't get why they're doing this. Also, will go 1.5 have generics?
- mkohlmyr 12y agoThe idea is not to not rely on C. The idea is to not have to do the compiler development in C.
- cheepin 12y agoI'm more surprised that the Go 1.4 compiler is written in C. Writing a compiler in C sounds very unpleasant compared to a language like OCaml. Does anyone know why they made this choice for the initial design?
- dsymonds 12y agoThe Go compiler in 2007 was written in C because it was an adaptation of the Plan 9 C compiler. That was done because it was the expedient choice at the time, especially while the language was still being designed and would change quite a lot. Nowadays the language is stable, and we have existing Go compilers, so we can reasonably bootstrap a Go compiler written in Go.
- enneff 12y agoKen Thompson wrote it. He's pretty good at C.
- tbrock 12y agoYeah someone also asked him if they did "code reviews" while developing Unix. The response always makes me laugh. Interviewer: Was there any concept of looking at each other's code or doing code reviews? KT: [Shaking head] We were all pretty good coders.
- zek 12y agoWhy does being a good coder preclude code reviews? Even experts make mistakes and even when there are no mistakes an outside perspective can often be useful. People think in different ways and may have something to add even if you are all really good programmers.
- ansible 12y agoIs this going to use the same C to Go conversion tool that helped with the Go runtime conversion?
- choffee 12y agoIs this going to be tricky for distributions or will they just have to keep a 1.4 version of Go around just to build modern versions of Go?