Live data from Hacker News

Go in Go

talks.golang.org

51–60 of 156 posts

Re: Go in Go

#51
post #42

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?

Nice explanation at http://grammarist.com/usage/all-but/

Re: Go in Go

#52
post #47

Fun 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!

Bjarne Stroustrup

Wasn't CFront written in C++?[1] (Of course, the initial version of C with classes was probably written in C.)

[1] https://en.wikipedia.org/wiki/Cfront

Re: Go in Go

#53
post #42

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?

All but impossible means nearly all the way to being impossible.

Re: Go in Go

#54
post #46
post #27

Earlier 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?

They usually need a previous version of the compiler to compile themselves. Turtles all the way down if you will.

Re: Go in Go

#55
> Getting rid of C was a huge advance for the project.

> Code is cleaner, testable, profilable, easier to work on.

This is just great!

Re: Go in Go

#56
post #47

Fun 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!

Working on UNIX operating systems means there isn't much of a choice in terms of system programming languages.

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

#57

Can 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.

Right, but if someone surreptitiously deleted all Go compiler binaries from the world, then we'd have to go back to compiling the C source of 1.4...

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

#58
post #23

Just out of curiosity, is this the first time a language is written using itself?

It's a sign of maturity to show that a language can bootstrap itself, prolog has been written in prolog, erlang was written with prolog first, then later rewritten in erlang, as other's have pointed out, it's pretty common for C/C++, Lisp, Assembly. This of course applies more to compiled languages.

Re: Go in Go

#59
post #50

Earlier 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.

aaah thats why i get confused. i thought its always one phrase, but its "all but" and "anything but". now i get it. lets just say this whole confusion is anything but unclear now. it used to be all but impossible to understand what people meant.

Re: Go in Go

#60
post #46
post #27

Earlier 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?

A common pattern used to be as follows:

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.

Post reply on HN