Python & Go

Mensanator mensanator at aol.com
Wed Nov 11 21:00:07 EST 2009


On Nov 11, 6:53 pm, kj <no.em... at please.post> wrote:
> I'm just learning about Google's latest: the GO (Go?) language.
> (e.g.http://golang.orgorhttp://www.youtube.com/watch?v=rKnDgT73v8s).
> There are some distinctly Pythonoid features to the syntax, such
> as "import this_or_that",

There's more to Python than import statements.
In fact, this Go language is nothing like Python.

> the absence of parentheses at the top of
> flow control constructs,

Huh?

> and quite a few statements without a
> trailing semicolon.  

Those are exceptions, the rule appears to be "ends with semicolon".
In this example, I see semicolons all over the place.

05    package main

07    import (
08        "./file";
09        "fmt";
10        "os";
11    )

13    func main() {
14        hello := []byte{'h', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o',
'r', 'l', 'd', '\n'};
15        file.Stdout.Write(hello);
16        file, err := file.Open("/does/not/exist",  0,  0);
17        if file == nil {
18            fmt.Printf("can't open file; err=%s\n",  err.String());
19            os.Exit(1);
20        }
21    }


> Then again, there's a lot that looks distinctly
> un-Pythonlike, such as the curly brackets all over the place.  

Duh.

> And
> among the un-Pythonlike stuff there's a lot that looks like nothing
> else that I've ever seen...

Go look at a C++ program sometime.

>
> Just out of curiosity, how much did GvR contribute to this effort?

I hope none that he would admit to.

>
> Cheers,
>
> G.
>
> P.S. Keeping up with Google is becoming a full-time job.  It's
> friggin non-stop.  Who can handle it?  Truly incredible.




More information about the Python-list mailing list