Go (language)

Samuel Baldwin recursive.forest-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Thu Nov 19 17:10:22 EST 2009


2009/11/19 Richard Pieri <richard.pieri-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>:
> My peeve with the comparison with Python is two-fold.  First, Python has an
> interactive interpreter.  You can sit down, fire it up, and start typing Python
> right there.  Second, Python is modular.  Any object in a Python program can be
> used by any other Python program that imports the first one.  Go can't do
> either.

They're actually working on a command line interpreter at the moment.

I don't understand what you mean about Go not being modular. I can
write a package in Go that can be used by anything else: identifiers
will be exported if:

	1. the first character of the identifier's name is a Unicode upper
case letter (Unicode class "Lu"); and
	2. the identifier is declared in the package block or denotes a field
or method of a type declared in that block.

Then I just run `import "mypackagename"' and I'm all set, the
identifiers will be accesible through `mypackagename.Identifier'. It's
also possible to control where they get imported to if I want to.

I don't really know how Python works, but Go's Interface types seem
extremely handy for writing robust code easily.

> My third is not so much a gripe as a Go fail.  That fail being Go's alleged
> conciseness.  Go's version of Hello World is something like 4 lines of code.
> Python's is 1 (2 if you include the #! interpreter line).

I think the idea is it's more concise even for large projects; for
simple projects something like perl may be more concise, but for
larger programs, Go is supposed to win out. See Mr. Marx's example.

-- 
Samuel Baldwin - logik.li





More information about the Discuss mailing list