a curiosity question. is "all but impossible" correct? shouldnt it be "all but possible" or "all but easy"? whenever i see the "X is all but Y" phrase, it makes sense to me that X is not Y. its everything else but/except Y. am i thinking correctly or is the use in the slides correct?
Go in Go
51–60 of 156 posts
Re: Go in Go
#52Fun fact: what's common between Rob Pike, Bjarne Stroustrup, Larry Wall, Guido van Rossum, and so many other language inventors? They're all C programmers!
Wasn't CFront written in C++?[1] (Of course, the initial version of C with classes was probably written in C.)
Re: Go in Go
#53a curiosity question. is "all but impossible" correct? shouldnt it be "all but possible" or "all but easy"? whenever i see the "X is all but Y" phrase, it makes sense to me that X is not Y. its everything else but/except Y. am i thinking correctly or is the use in the slides correct?
Re: Go in Go
#54Earlier quoted context omitted.
There's quite a few languages that bootstrap: https://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29#...
So if you follow it all the way down, what does all these self-hosting code become? Machine code?
Re: Go in Go
#55> Code is cleaner, testable, profilable, easier to work on.
This is just great!
Re: Go in Go
#56Fun fact: what's common between Rob Pike, Bjarne Stroustrup, Larry Wall, Guido van Rossum, and so many other language inventors? They're all C programmers!
Why to you think all of them created languages to replace C on their daily work?
There are many reasons to use a specific programming languages besides "I like it".
For example I will never use C on personal projects, but will use it without any complaints if that is what my customers ask for.
Re: Go in Go
#57Can some one answer this question. It says that Go1.4 will be needed to compile Go1.5. Does this mean that Go1.4 will always be needed, even for Go1.6 and beyond? So are they essentially locking things to the Go1.4 "C" code, then updating on top of that?
No, any newer version works. You can build 1.5 with 1.5, you will be able to build 1.6 with 1.5 and 1.6.
Of course, that's the nature of bootstrapping! If someone managed to erase all the software from all the computers in the world, we'd have to go back and find an "Old world" Mac and use the on-die Forth compiler to write a C compiler so we could start compiling things again.
Re: Go in Go
#58Just out of curiosity, is this the first time a language is written using itself?
Re: Go in Go
#59Earlier quoted context omitted.
> is "all but impossible" correct? Yes. > whenever i see the "X is all but Y" phrase, it makes sense to me that X is not Y. It's not "X is not Y", it's "X is all but Y", that is, X is very nearly not Y. "All but impossible" means it's possible, but only barely.
And to make it extra confusing there's "X is anything but Y" idiom which basically means what pvinis says.
Re: Go in Go
#60Earlier quoted context omitted.
There's quite a few languages that bootstrap: https://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29#...
So if you follow it all the way down, what does all these self-hosting code become? Machine code?
Start by implementing in Assembly as little as possible for the programming language as an interpreter.
Meaning just one form of conditionals, just one looping construct, very few basic types, basic IO.
Then use the bare bones interpreter for the second stage, writing a real compiler that is able to process the same basic language and additional constructs.
Another alternative is to add some bytecode format that can then be used equally for interpretation or as input to native code generation.
Niklaus Wirth originally designed P-Code with the intent to make Pascal compilers easier to port. He wasn't thinking to use it as full OS VM, like the guys at UCSD did with they Pascal dialect.
Another trick is to design the bytecode in such a way that it can directly be translated to native code via a macro assembler. It won't generate fast code, but it will provide an easy path for a compiler instead.
Nowadays the Assembly step tends to be replaced by another language that can be found in most platforms, so many tend to choose C.
Not always because it is the best language to write compilers in, but rather because it is ubiquitous or there is some library the authors want to use, thus perpetuating the myth that all languages require C for those not so well versed in compiler design.