4 ms·
Not quite. The article mentions that Go 1 code needs to be able to coexist with Go 2 in the same codebase. So, at runtime, Go 1 code needs to be able to work w
by scribu 9y ago
Not quite. The article mentions that Go 1 code needs to be able to coexist with Go 2 in the same codebase.
So, at runtime, Go 1 code needs to be able to work with Go 2 types. That will impose some restrictions, I imagine.
- vram22 9y ago>The article mentions that Go 1 code needs to be able to coexist with Go 2 in the same codebase. Interesting. Are there any other languages where that is allowed? I'm assuming that by "codebase" you mean all the code that gets compiled into one program or library (for compiled languages), or is part of one program or library (for interpreted languages). And I don't mean the case where only a common subset of Lang X v1 features and Lang X v2 features are used in the same codebase (because in that case, there is no issue). That latter case is possible, for example, in Python, and probably some many languages too. In fact by the definition of the case, it should be possible in all languages.
- cyphar 9y agoI would just read the article. Basically, the restriction they want to impose is to make sure that you can import v2 code into a v1 codebase and vice-versa with a v2 compiler. So that means any syntax breakage would need to be versioned or otherwise inferred, I guess.
- scribu 9y ago> I'm assuming that by "codebase" you mean all the code that gets compiled into one program or library Correct. > Are there any other languages where that is allowed? One would be Racket, a Lisp which allows you to pick a syntax flavour using the #lang directive: https://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29 https://docs.racket-lang.org/guide/Module_Syntax.html#%28par...
- fanf2 9y ago>>>>The article mentions that Go 1 code needs to be able to coexist with Go 2 in the same codebase.<<<< >>Interesting. Are there any other languages where that is allowed?<< C / C++ Perl 5/6 The various language feature pragmas in Haskell.
- vram22 9y agoInteresting, didn't know this about C/C++, though I may have guessed it about Perl.