release.2010-11-02

28 views
Skip to first unread message

Andrew Gerrand

unread,
Nov 2, 2010, 11:24:48 PM11/2/10
to golang-nuts
We've just tagged a new Go release, release.2010-11-02. As usual, you
can update by running:
hg pull
hg update release

This release includes a language change: the new built-in function, append.
Append makes growing slices much simpler. See the spec for details:
http://golang.org/doc/go_spec.html#Appending_and_copying_slices

Other changes:
* 8l: pe generation fixes (thanks Alex Brainman).
* doc: Effective Go: append and a few words about "..." args.
* build: fiddle with make variables.
* codereview: fix sync and download in Python 2.7 (thanks Fazlul Shahriar).
* debug/pe, cgo: add windows support (thanks Wei Guangjing <vcc...@gmail.com>).
* go/ast: add Inspect function for easy AST inspection w/o a visitor.
* go/printer: do not remove parens around composite literals starting with
a type name in control clauses.
* go/scanner: bug fixes, revisions, and more tests.
* gob: several fixes and documentation updates.
* godoc: bug fix (bug introduced with revision 3ee58453e961).
* gotest: print empty benchmark list in a way that gofmt will leave alone.
* http server: correctly respond with 304 NotModified (thanks Michael Hoisie).
* kate: update list of builtins (thanks Evan Shaw).
* libutf: update to Unicode 5.2.0 to match pkg/unicode (thanks Anthony Martin).
* misc/bbedit: update list of builtins (thanks Anthony Starks).
* misc/vim: update list of builtins.
* mkrunetype: install a Makefile and tweak it slightly so it can be built.
* netchan: fix locking bug.
* pidigits: minor improvements (thanks Evan Shaw).
* rpc: fix client deadlock bug.
* src: use append where appropriate (often instead of vector).
* strings: add Contains helper function (thanks Brad Fitzpatrick).
* syscall: SIO constants for Linux (thanks Albert Strasheim),
Stat(path) on windows (thanks Alex Brainman).
* test/ken/convert.go: add conversion torture test.
* testing: add Benchmark (thanks Roger Peppe).

Apologies if we missed anyone in the above list. We appreciate all your help.

To see a full list of changes between this and the previous release,
after updating, run:
hg log -r release.2010-10-27:release.2010-11-02

Enjoy.

Andrew

Dave Cheney

unread,
Nov 2, 2010, 11:48:05 PM11/2/10
to golang-nuts
I was just about to try +tip to get access to append(), but low and
behold, here it is in release form!

Keep up the great work, I am enjoying the Go experience immensely.

Cheers

Dave

kar

unread,
Nov 3, 2010, 1:11:22 AM11/3/10
to golang-nuts
about time. <3 go

good bye ol friend: >

func AppendBytes(d []byte, s []byte) []byte {
lens := len(d)
lenx := len(d) + len(s)
if lenx <= cap(d) {
d = d[0 : lenx]
} else {
n := make([]byte, lenx, resize(lenx))
copy(n, d)
d = n
}
copy(d[lens : lenx], s)
return d
}

func resize(n int) int {
if n < 16 { n = 16 }
return n + n/2
}

func Append(d []byte, val interface{}) []byte {
var b []byte
switch v := val.(type) {
case string: b = []byte(v)
case []byte: b = v
default: b = IntB(val)
}
if b != nil { d = AppendBytes(d, b) }
return d
}


On Nov 3, 11:48 am, Dave Cheney <d...@cheney.net> wrote:
> I was just about to try +tip to get access to append(), but low and
> behold, here it is in release form!
>
> Keep up the great work, I am enjoying the Go experience immensely.
>
> Cheers
>
> Dave
>
>
>
>
>
>
>
> On Wed, Nov 3, 2010 at 2:24 PM, Andrew Gerrand <a...@google.com> wrote:
> > We've just tagged a new Go release, release.2010-11-02. As usual, you
> > can update by running:
> >  hg pull
> >  hg update release
>
> > This release includes a language change: the new built-in function, append.
> > Append makes growing slices much simpler. See the spec for details:
> >        http://golang.org/doc/go_spec.html#Appending_and_copying_slices
>
> > Other changes:
> > * 8l: pe generation fixes (thanks Alex Brainman).
> > * doc: Effective Go: append and a few words about "..." args.
> > * build: fiddle with make variables.
> > * codereview: fix sync and download in Python 2.7 (thanks Fazlul Shahriar).
> > * debug/pe, cgo: add windows support (thanks Wei Guangjing <vcc....@gmail.com>).

Gabor

unread,
Nov 3, 2010, 2:58:06 AM11/3/10
to golang-nuts
Append is great, thank you.

I wish, I could test it in the Go Playground
but that seems to be based on an earlier version.
How much earlier ?

On Nov 3, 4:24 am, Andrew Gerrand <a...@google.com> wrote:
> We've just tagged a new Go release, release.2010-11-02. As usual, you
> can update by running:
>  hg pull
>  hg update release
>
> This release includes a language change: the new built-in function, append.
> Append makes growing slices much simpler. See the spec for details:
>        http://golang.org/doc/go_spec.html#Appending_and_copying_slices
>
> Other changes:
> * 8l: pe generation fixes (thanks Alex Brainman).
> * doc: Effective Go: append and a few words about "..." args.
> * build: fiddle with make variables.
> * codereview: fix sync and download in Python 2.7 (thanks Fazlul Shahriar).
> * debug/pe, cgo: add windows support (thanks Wei Guangjing <vcc....@gmail.com>).

Andrew Gerrand

unread,
Nov 3, 2010, 3:34:52 AM11/3/10
to Gabor, golang-nuts
On 3 November 2010 17:58, Gabor <g...@szfki.hu> wrote:
> Append is great, thank you.
>
> I wish, I could test it in the Go Playground
> but that seems to be based on an earlier version.
> How much earlier ?

It's two releases behind right now. It will be updated within the next 24 hours.

Andrew

Johann Höchtl

unread,
Nov 3, 2010, 4:51:40 AM11/3/10
to golang-nuts
On Nov 3, 4:24 am, Andrew Gerrand <a...@google.com> wrote:

> Other changes:
.
> * debug/pe, cgo: add windows support (thanks Wei Guangjing <vcc....@gmail.com>).

The blog post
http://blog.golang.org/2010/11/debugging-go-code-status-report.html
says debuging on windows using GDB is not supported. But there have
been little tweaks here and there for PE support. Is there sthg.
already working?

Johann
.
> Andrew

Wei guangjing

unread,
Nov 3, 2010, 5:10:36 AM11/3/10
to Johann Höchtl, golang-nuts
2010/11/3 Johann Höchtl <johann....@gmail.com>

try this CL: http://codereview.appspot.com/2124041/ 8l: emit DWARF in Windows PE.

you will can debuging on windows ;-)

Wei guangjing
 
Johann
.
> Andrew

Eleanor McHugh

unread,
Nov 3, 2010, 10:48:55 AM11/3/10
to golang-nuts
On 3 Nov 2010, at 03:24, Andrew Gerrand wrote:
> This release includes a language change: the new built-in function, append.
> Append makes growing slices much simpler. See the spec for details:
> http://golang.org/doc/go_spec.html#Appending_and_copying_slices

I feel a drastic code cull coming on :)


Ellie

Eleanor McHugh
Games With Brains
http://feyeleanor.tel
----
raise ArgumentError unless @reality.responds_to? :reason

unread,
Nov 3, 2010, 3:13:50 PM11/3/10
to golang-nuts
On Nov 3, 4:24 am, Andrew Gerrand <a...@google.com> wrote:
> We've just tagged a new Go release, release.2010-11-02. As usual, you
> can update by running:
>  hg pull
>  hg update release
>
> This release includes a language change: the new built-in function, append.
> Append makes growing slices much simpler. See the spec for details:
>        http://golang.org/doc/go_spec.html#Appending_and_copying_slices

I was thinking about whether it is possible to tell "append" is a good
feature or not. The non-obvious pros and cons seem to be:

Cons:
- It reduces the need for generic types in Go, thus further delaying
their (inevitable?) introduction.
- If introduction of generics is inevitable, then the "temporary hack"
in the form of "append" might not be best idea in the long run.

Pros:
- The compiler understands what "append" means (as opposed to the
situation when "append" is just another user-defined generic function
whose purpose is unknown to the compiler). This understanding can
eventually be used for better/faster type checking and for better
optimization of generated code.

Jessta

unread,
Nov 3, 2010, 8:18:42 PM11/3/10
to ⚛, golang-nuts
On Thu, Nov 4, 2010 at 6:13 AM, ⚛ <0xe2.0x...@gmail.com> wrote:
> I was thinking about whether it is possible to tell "append" is a good
> feature or not. The non-obvious pros and cons seem to be:
>
> Cons:
> - It reduces the need for generic types in Go, thus further delaying
> their (inevitable?) introduction.
> - If introduction of generics is inevitable, then the "temporary hack"
> in the form of "append" might not be best idea in the long run.

Generics may not be inevitable. Reducing their needs in the most
needed places may reduce their need
and interface{} can handle a lot of the additional cases.

I would prefer that most generic stuff be controlled by the language,
thus reducing the ability for
people go off and create their own mini languages within the
language(which is the real problem with generics and templating)

- jessta

--
=====================
http://jessta.id.au

Andrew Gerrand

unread,
Nov 3, 2010, 11:07:09 PM11/3/10
to Gabor, golang-nuts

The playground has been updated to the latest release; you can play
with append now. :-)

Andrew

Uriel

unread,
Nov 3, 2010, 11:55:36 PM11/3/10
to Jessta, ⚛, golang-nuts
On Thu, Nov 4, 2010 at 1:18 AM, Jessta <jes...@jessta.id.au> wrote:
> On Thu, Nov 4, 2010 at 6:13 AM, ⚛ <0xe2.0x...@gmail.com> wrote:
>> I was thinking about whether it is possible to tell "append" is a good
>> feature or not. The non-obvious pros and cons seem to be:
>>
>> Cons:
>> - It reduces the need for generic types in Go, thus further delaying
>> their (inevitable?) introduction.

I find baffling that somebody could think it is bad to reduce the need
for a complex and controversial feature.

This is where discussion of the issues and advantages of generics ends
and we almost enter the world of dogma, where the end is taken for
granted rather than questioned, and any means to reach that end become
justified, and anything that brings us closer to a different end is
considered bad.

The real end is not to have feature X, or feature Y, it is to help
people write good code as easily and simply as possible, append() does
this.

Generics on the other hand: maybe, if somebody can come up with a good
enough design, which nobody has done so far.

So for now the alternatives are append() and nothing, I think i will
take append(), thank you.

>> - If introduction of generics is inevitable, then the "temporary hack"
>> in the form of "append" might not be best idea in the long run.

Nothing is ever inevitable, people have been very productive writing
code in all kinds of languages without generics, and I don't see why
making the life easier of people writing Go code today could be
considered a bad thing.

Assuming somebody comes up with an acceptable design for generics, I
doubt append() would be considered an obstacle to implementing it.

And if append() is to be considered "a temporary hack" bound to be
replaced with something better when somebody can come up with that
something, the same is true of everything else in the language.

Should we remove channels and goroutines because maybe someday
somebody will come with with a better concurrency model? Should we not
add more libraries to the stdlib, because they all will eventually be
replaced by ones with better APIs?

> Generics may not be inevitable. Reducing their needs in the most
> needed places may reduce their need
> and interface{} can handle a lot of the additional cases.
>
> I would prefer that most generic stuff be controlled by the language,
> thus reducing the ability for
> people go off and create their own mini languages within the
> language(which is the real problem with generics and templating)

This can't be repeated often enough, and is perhaps the best argument
against full blown generics and operator overloading.

Every time I hear somebody claiming that they can
build/bolt-on/hack-up a 'DSL' on top of an existing general purpose
language by using generics, operator overloading, industrial amounts
of syntactical sugar, etc., instead of writing a *real* DSL, I want to
strangle them with my bare hands.

C++ and specially Ruby developers are the biggest sinners in this.
They have corrupted and distorted the concept of domain specific
language far beyond recognition, and turned it from one of the most
beautiful and powerful concepts in programming into a horrid
Frankenstein.

sed, make, /bin/sh, TeX are all DSLs.

Ruby 'DSLs' and the like are not DSLs, the are just hideously
convoluted and totally unpredictable APIs that lack any transparency
or clarity.

Sorry for being bitter, but I love DSLs and it makes me very upset
that whole generations of programmers are growing up having a totally
incorrect understanding what DSL are, and what makes them so powerful
and beautiful.

Peace

uriel

unread,
Nov 4, 2010, 4:49:22 AM11/4/10
to golang-nuts
On Nov 4, 4:55 am, Uriel <ur...@berlinblue.org> wrote:
> On Thu, Nov 4, 2010 at 1:18 AM, Jessta <jes...@jessta.id.au> wrote:
> > On Thu, Nov 4, 2010 at 6:13 AM, ⚛ <0xe2.0x9a.0...@gmail.com> wrote:
> >> I was thinking about whether it is possible to tell "append" is a good
> >> feature or not. The non-obvious pros and cons seem to be:
>
> >> Cons:
> >> - It reduces the need for generic types in Go, thus further delaying
> >> their (inevitable?) introduction.
>
> I find baffling that somebody could think it is bad to reduce the need
> for a complex and controversial feature.

Generics aren't controversial, they are natural.

> This is where discussion of the issues and advantages of generics ends
> and we almost enter the world of dogma, where the end is taken for
> granted rather than questioned, and any means to reach that end become
> justified, and anything that brings us closer to a different end is
> considered bad.

You are confused. Generics are not about something superficial that
wouldn't be there already. The need for generics in a language stems
from the *observation* that there are certain recurring programming
patterns. A prime example of this is that virtually any typed language
that does not have a generic list (it has just arrays) will contain
code that tries to implement the list, and this code will be seen all
over the source code written in the typed language without generics.
Since it is a typed language, the programmers want the code to be type
safe, and thus if you have [a list of apples] and [a list of oranges],
you will find codes that differ from each other *only* in the type
"apple" and "orange".

Existence of generics isn't controversial, it is natural.

> The real end is not to have feature X, or feature Y, it is to help
> people write good code as easily and simply as possible, append() does
> this.
>
> Generics on the other hand: maybe, if somebody can come up with a good
> enough design, which nobody has done so far.
>
> So for now the alternatives are append() and nothing, I think i will
> take append(), thank you.
>
> >> - If introduction of generics is inevitable, then the "temporary hack"
> >> in the form of "append" might not be best idea in the long run.
>
> Nothing is ever inevitable, people have been very productive writing
> code in all kinds of languages without generics, and I don't see why
> making the life easier of people writing Go code today could be
> considered a bad thing.

Shortsightedness is a bad thing.

> Assuming somebody comes up with an acceptable design for generics, I
> doubt append() would be considered an obstacle to implementing it.

The "append" construct in Go is pure syntactic sugar. Therefore it can
*not* be an obstacle to any future Go language developments.

> And if append() is to be considered "a temporary hack" bound to be
> replaced with something better when somebody can come up with that
> something, the same is true of everything else in the language.

"... true of everything else in the language."

I doubt that.

> Should we remove channels and goroutines because maybe someday
> somebody will come with with a better concurrency model? Should we not
> add more libraries to the stdlib, because they all will eventually be
> replaced by ones with better APIs?

You are overreacting.

> > Generics may not be inevitable. Reducing their needs in the most
> > needed places may reduce their need
> > and interface{} can handle a lot of the additional cases.
>
> > I would prefer that most generic stuff be controlled by the language,
> > thus reducing the ability for
> > people go off and create their own mini languages within the
> > language(which is the real problem with generics and templating)
>
> This can't be repeated often enough, and is perhaps the best argument
> against full blown generics and operator overloading.
>
> Every time I hear somebody claiming that they can
> build/bolt-on/hack-up a 'DSL' on top of an existing general purpose
> language by using generics, operator overloading, industrial amounts
> of syntactical sugar, etc., instead of writing a *real* DSL, I want to
> strangle them with my bare hands.
>
> C++ and specially Ruby developers are the biggest sinners in this.
> They have corrupted and distorted the concept of domain specific
> language far beyond recognition, and turned it from one of the most
> beautiful and powerful concepts in programming into a horrid
> Frankenstein.
>
> sed, make, /bin/sh, TeX are all DSLs.

Mathematical operators (+, -, etc) and the rules associated with using
them (precedence, syntax) are also a DSL. Yet, this DSL is embedded in
many general purpose languages (counterexamples are Smalltalk and pure
Lisp). What is your interpretation of this?

unread,
Nov 4, 2010, 6:51:45 AM11/4/10
to golang-nuts
On Nov 3, 4:24 am, Andrew Gerrand <a...@google.com> wrote:
> * testing: add Benchmark (thanks Roger Peppe).

Why has been the type "testing.Benchmark" renamed to
"testing.InternalBenchmark". What is so "internal" about it? You could
easily name the new function "RunBenchmark()", instead of
"Benchmark()". In addition, to keep the naming consistent, shouldn't
be the type "testing.Test" renamed to "testing.InternalTest" now?

Please, revert it back, and rename the function "Benchmark()" to
"RunBenchmark()".

roger peppe

unread,
Nov 4, 2010, 6:59:50 AM11/4/10
to ⚛, golang-nuts
On 4 November 2010 10:51, ⚛ <0xe2.0x...@gmail.com> wrote:
> On Nov 3, 4:24 am, Andrew Gerrand <a...@google.com> wrote:
>> * testing: add Benchmark (thanks Roger Peppe).
>
> Why has been the type "testing.Benchmark" renamed to
> "testing.InternalBenchmark". What is so "internal" about it? You could
> easily name the new function "RunBenchmark()", instead of
> "Benchmark()". In addition, to keep the naming consistent, shouldn't
> be the type "testing.Test" renamed to "testing.InternalTest" now?

i think i tend to agree with you, but i chose the names on russ's suggestion,
and names are ever a tricky issue. i had an interim version that used
the names you suggest. russ?

Russ Cox

unread,
Nov 4, 2010, 1:47:03 PM11/4/10
to ⚛, golang-nuts
> Why has been the type "testing.Benchmark" renamed to
> "testing.InternalBenchmark". What is so "internal" about it?

No hand-written code outside the testing package should refer to it.
If it weren't for the auto-generated code that comes out of gotest
it would be called benchmark with a lower case b. Although it has
to be public, it doesn't have to be a pretty name, and it doesn't
have to tie up a name that is more useful for something else.

It got renamed to make room for the function called Benchmark,
which hand-written code might actually call.

> You could
> easily name the new function "RunBenchmark()", instead of
> "Benchmark()". In addition, to keep the naming consistent, shouldn't
> be the type "testing.Test" renamed to "testing.InternalTest" now?

Sure. http://golang.org/doc/contribute.html

> Please, revert it back, and rename the function "Benchmark()" to
> "RunBenchmark()".

No thanks.

Russ

unread,
Nov 5, 2010, 4:14:16 AM11/5/10
to golang-nuts
On Nov 4, 6:47 pm, Russ Cox <r...@golang.org> wrote:
> > Why has been the type "testing.Benchmark" renamed to
> > "testing.InternalBenchmark". What is so "internal" about it?
>
> No hand-written code outside the testing package should refer to it.
> If it weren't for the auto-generated code that comes out of gotest
> it would be called benchmark with a lower case b.  Although it has
> to be public, it doesn't have to be a pretty name, and it doesn't
> have to tie up a name that is more useful for something else.
>
> It got renamed to make room for the function called Benchmark,
> which hand-written code might actually call.
>
> > You could
> > easily name the new function "RunBenchmark()", instead of
> > "Benchmark()". In addition, to keep the naming consistent, shouldn't
> > be the type "testing.Test" renamed to "testing.InternalTest" now?
>
> Sure.  http://golang.org/doc/contribute.html

Why would I contribute to a project backed by a multi-billion dollar
company? Wouldn't my contribution increase its power even further?

If Google wants something get done it can easily hire (any conceivable
number of) developers, whatever the intent and purpose of the project
might be. Bad, good, pointless, groundbreaking - it doesn't matter.
The developers are given commands, and perform them. Quite simple. In
contrast to that, I am unable to do such a thing, whatever the intent
and purpose of my project is.

What would be the logical basis for contributing to Go? I don't see
Google or the Go team contributing any code to me, or helping me in
any way. In this situation, contributing code to Go appears to be
illogical.

Abdulla Kamar

unread,
Nov 5, 2010, 4:19:10 AM11/5/10
to ⚛, golang-nuts
What would be the logical basis for contributing to Go? I don't see
Google or the Go team contributing any code to me, or helping me in
any way. In this situation, contributing code to Go appears to be
illogical.

Aren't they contributing to your code by giving you all these tools? On a more selfish level, by making these changes, aren't you helping yourself?

--
Abdulla

unread,
Nov 5, 2010, 4:21:41 AM11/5/10
to golang-nuts
On Nov 5, 9:19 am, Abdulla Kamar <abdulla.ka...@gmail.com> wrote:
> > What would be the logical basis for contributing to Go? I don't see
> > Google or the Go team contributing any code to me, or helping me in
> > any way. In this situation, contributing code to Go appears to be
> > illogical.
>
> Aren't they contributing to your code by giving you all these tools?

No.

Uriel

unread,
Nov 5, 2010, 4:47:11 AM11/5/10
to ⚛, golang-nuts
On Fri, Nov 5, 2010 at 9:14 AM, ⚛ <0xe2.0x...@gmail.com> wrote:
> What would be the logical basis for contributing to Go? I don't see
> Google or the Go team contributing any code to me, or helping me in
> any way.

If you don't find Go useful in any way, why are you here?

> In this situation, contributing code to Go appears to be
> illogical.

Same claim has been applied by some to contributions to any open source project.

If you don't understand the concepts of collaboration and shared goals
there isn't much to discuss.

uriel

unread,
Nov 5, 2010, 6:01:42 AM11/5/10
to golang-nuts
On Nov 5, 9:47 am, Uriel <ur...@berlinblue.org> wrote:
> On Fri, Nov 5, 2010 at 9:14 AM, ⚛ <0xe2.0x9a.0...@gmail.com> wrote:
> > What would be the logical basis for contributing to Go? I don't see
> > Google or the Go team contributing any code to me, or helping me in
> > any way.
>
> If you don't find Go useful in any way, why are you here?

What if, hypothetically, Go would be my competitor in a certain way?
Would you find that a viable explanation?

> >  In this situation, contributing code to Go appears to be
> > illogical.
>
> Same claim has been applied by some to contributions to any open source project.
>
> If you don't understand the concepts of collaboration and shared goals
> there isn't much to discuss.

I don't think that's the issue. I can only repeat what I wrote before:

<start repeat>
Why would I contribute to a project backed by a multi-billion dollar
company? Wouldn't my contribution increase its power even further?

If Google wants something get done it can easily hire (any conceivable
number of) developers, whatever the intent and purpose of the project
might be. Bad, good, pointless, groundbreaking - it doesn't matter.
The developers are given commands, and perform them. Quite simple. In
contrast to that, I am unable to do such a thing, whatever the intent
and purpose of my project is.

What would be the logical basis for contributing to Go? I don't see
Google or the Go team contributing any code to me, or helping me in
any way. In this situation, contributing code to Go appears to be
illogical.
<end repeat>

Cory Mainwaring

unread,
Nov 5, 2010, 6:13:34 AM11/5/10
to ⚛, golang-nuts
The developers at Google think it's fine the way it is. If you want Go to be more to your specific liking, contribute. If not, let them mold it to theirs.

André Moraes

unread,
Nov 5, 2010, 7:22:37 AM11/5/10
to golang-nuts
You can contribute because you want the change. This is what all
open/free software project is: Freedom to adapt to your needs.

If you don't want to give back that contribution to Go you can just
fork it (Mercurial does that), put in you private server, make the
change and be forever happy with a language that only you can
maintain.

And, another really important question:

What is the problem with RunBenchmark?

Another thing, I really don't see the need for Generics in Go, using
interface{} is more than fine, and the type assertions and switch can
handle almost everything that generics does. Another thing, In Go you
don't need to reimplement a list to every type, just use the default
List and make the casts for your type.

Any language feature don't replace good programmers, you can have the
most feature full language and a bad programmer still can make really
bad programs.

--
André Moraes
http://andredevchannel.blogspot.com/

Ian Lance Taylor

unread,
Nov 5, 2010, 10:15:48 AM11/5/10
to ⚛, golang-nuts
⚛ <0xe2.0x...@gmail.com> writes:

> Why would I contribute to a project backed by a multi-billion dollar
> company? Wouldn't my contribution increase its power even further?

Go is an open source project. Open source projects work via
collaboration by all interested developers.


> If Google wants something get done it can easily hire (any conceivable
> number of) developers, whatever the intent and purpose of the project
> might be. Bad, good, pointless, groundbreaking - it doesn't matter.
> The developers are given commands, and perform them. Quite simple. In
> contrast to that, I am unable to do such a thing, whatever the intent
> and purpose of my project is.

It's a natural mistake to confuse Google, the company, with the team
working on Go. Google, the company, does have a lot of power when it
comes to writing software. However, while the company can do almost any
specific thing in that area, it can not do everything in that area. It
must make choices. Google could decide to put 100 developers on Go.
However, so far, it has not made that choice. The Go team at Google is
fairly small. While the Go team has the luxury of focusing full-time on
the language, in numbers it is dwarfed by the external, presumably
mostly part-time, contributors to Go.


> What would be the logical basis for contributing to Go? I don't see
> Google or the Go team contributing any code to me, or helping me in
> any way. In this situation, contributing code to Go appears to be
> illogical.

Google has contributed the entire Go language and libraries to you.
That may not help you, but it's silly for you to say that Google has not
contributed anything. You're quite right that if Go does not help you,
there is no reason for you to help the Go project. But you actually are
helping the Go project simply by commenting on the mailing list. Why
are you spending time on that?

Ian

Sven Engelhardt

unread,
Nov 5, 2010, 10:43:13 AM11/5/10
to ⚛, golang-nuts

2010/11/5 ⚛ <0xe2.0x...@gmail.com>

Why would I contribute to a project backed by a multi-billion dollar
company? Wouldn't my contribution increase its power even further?

I'm tempted to recommend you look at D. It's got templates and overloading and all the other fine language features you won't find in Go. It has plenty of competing run-time libraries and split-up community resources that come with it. It's probably underfunded enough to address your anxiety adequately. Things won't progress as fast though because of that.

On the contrary Go is still a very young language and one of the first things I learned about it was that it is still unstable both as a language and the library. Keeping track of such changes however has never been a problem thus far. The introduction of append was by far the biggest change yet, and took me a mere 30 minutes to get 30k lines of code cleaned up from using containers and reslicing. We may or may not get generics some day, I'm not sure they will make (my) code easier to comprehend, which is one of the most outstanding features of Go as we speak, and I'm happy to see Russ is actually paying attention to keeping things that way. And I don't think we need generics. If your algorithms are really type agnostic, interfaces will work just fine and if they are not interfaces will force you to think adequately about how to address specific types in your code. In this case Go will force you to do some excessive casting, which is usually a sign of you doing something very very wrong. And I think it's kind of cool how the language provides such feedback straight into my fingertips.

-Sven


Michael Jones

unread,
Nov 5, 2010, 2:40:15 PM11/5/10
to ⚛, golang-nuts
This seems a really unusual question, or at least a question from a really unusual point of view. Others answered it well, but I want to try because the implied statements fascinate me. Let's explore them!

On Fri, Nov 5, 2010 at 1:14 AM, ⚛ <0xe2.0x...@gmail.com> wrote: 
 :
Why would I contribute to a project backed by a multi-billion dollar
company? Wouldn't my contribution increase its power even further?

You would voluntarily contribute to something because doing so pleases you. Your reason might be the rare in anyone's lifetime opportunity to associate with heroes of computer science (Ken Thompson, Rob Pike, et al.) and exchange thoughtful ideas with them. Perhaps you are curious how programming languages come to life and want to watch a new language blossom (or wither) and study the process. Maybe you have been programming and thought, "if I ever cerate a language it will have X" and sense that helping the Go team add X or at least address the issue that you wanted X to solve is a realization of those dreams. Maybe having been drawn to Go by these ideas or others you discover that the community of developers is a place you feel comfortable and the intellectual association is more rewarding than the language itself. You might think that Go would be great for you if only a few things were changed--and you have the skill to make those changes. There are also the thousands of reasons why people contribute to open source software generally, like using skills where many will benefit, professional esteem, and curiosity. These are reasons why people contribute.

Are these reasons changed when the people who had the ideas are all now working at the same company (Google) or that company happens to be successful ("multi-billion dollar") or when people around the world rely on that company for something important ("power")? Not for those active here, obviously, but maybe for you.

Do you see that this is the same situation as when many of these same engineers worked at AT&T, which earned more billions and was more powerful. From AT&T's Bell Telephone Laboratories we now have UNIX, ed, grep, C, AWK, YACC, LEX, SCCS, pipes, C, C++, make, shell variables and iteration, Plan 9, and literally thousands of other innovations. Would you be happier contributing to Go if the founding authors worked for different and unsuccessful companies? For little-known and powerless companies? For a university? If so, there are many other language projects that you might find more appealing.

You suggest something further by your comment. "Wouldn't my contribution increase its power even further?" You don't mean Go but Google. If Go is better or more successful will that make Google more powerful? I like Go but Google's power does not derive on Go. Do you mean that a big and successful thing like Google or NEC or Daimler-Benz would be better weakened than strengthened just because of its success and respect? It sounds like you may be saying this but it is not clear. Hope not.

If Google wants something get done it can easily hire (any conceivable
number of) developers, whatever the intent and purpose of the project
might be. Bad, good, pointless, groundbreaking - it doesn't matter.
The developers are given commands, and perform them. Quite simple. In
contrast to that, I am unable to do such a thing, whatever the intent
and purpose of my project is.

It is true that Google has the resources to hire any conceivable number of developers and command them to work. 

Neither of these powers is relevant to the development of Go. What Go or any design needs, ideally, is for insightful people with different skills and experience to implement real, complicated, useful projects to validate or repudiate design decisions, implementation choices, and style preferences. Go does not need an army of dutiful soldiers marching/coding to the General's orders. It needs a group of smart people who argue for and against, who try and demonstrate, who share and improve, and who add their informed opinion to the discussion. Drawing this group from around the globe, from diverse interests (cryptography, graphics, database, web serving, embedded, ...), from volunteers whose continuing and growing interest measures correctness, and generally from people immune to company pressure, management demands, or financial motivation means that you get the best Go that humans are smart enough to craft.

That is the goal, it seems to be working, and if you study the changes from the first day you can already see that it is a group effort with hundreds of meaningful contributors.
 
What would be the logical basis for contributing to Go?

That you want to help make something good be greater, if the resulting goodness benefits you, or if the act of helping benefits you. If any of these three applies to you, and you don't choose to engage, that would seem illogical.
 
I don't see
Google or the Go team contributing any code to me, or helping me in
any way. In this situation, contributing code to Go appears to be
illogical.

It is true that the Go team is not on its way to your town to paint your house, wash your car's windows, or write code specifically for your project. It is true that they have compressed a lifetime of famous, celebrated experience into a programming language with a new and interesting point of view. It is true that their employer pays their salaries yet allows all the work to be open source and contributed to the Computer Science community worldwide. It is true that thousands have joined to make the design better, the documentation better, the samples better, the implementation better, and the discussion of all of this richly educational. It is also true that every byte of this work, every word of documentation, and every moment of thought has been made freely yours. As such all of the Go developers and users have contributed code to you and helped you in every way they could.

The question is if you recognize the value and spirit of their gift. Do you?

--

Michael T. Jones

   Chief Technology Advocate, Google Inc.

   1600 Amphitheatre Parkway, Mountain View, California 94043

   Email: m...@google.com  Mobile: 650-335-5765  Fax: 650-649-1938

   Organizing the world's information to make it universally accessible and useful


fango

unread,
Nov 5, 2010, 8:49:33 PM11/5/10
to golang-nuts
>> What would be the logical basis for contributing to Go?
> That you want to help make something good be greater,

Very much touched. Thanks for venting that out.

Fango

Joseph Poirier

unread,
Nov 5, 2010, 9:00:58 PM11/5/10
to ⚛, golang-nuts
On Fri, Nov 5, 2010 at 5:01 AM, ⚛ <0xe2.0x...@gmail.com> wrote:
> <start repeat>
> Why would I contribute to a project backed by a multi-billion dollar
> company? Wouldn't my contribution increase its power even further?

You shouldn't. And no.

> If Google wants something get done it can easily hire (any conceivable
> number of) developers, whatever the intent and purpose of the project
> might be. Bad, good, pointless, groundbreaking - it doesn't matter.
> The developers are given commands, and perform them. Quite simple.

I think you're misinformed on how things work in the real world.

> In
> contrast to that, I am unable to do such a thing, whatever the intent
> and purpose of my project is.

Sounds like a personal problem/situation, why bring it up here.

> What would be the logical basis for contributing to Go?

That's something you'll need to sort out on your own.

> I don't see
> Google or the Go team contributing any code to me, or helping me in
> any way.

Are you sure; you don't sound 100% confident.

> In this situation, contributing code to Go appears to be
> illogical.

It seems you do have it figured out. Good.

-joe

Skip Tavakkolian

unread,
Nov 5, 2010, 10:36:05 PM11/5/10
to ⚛, golang-nuts
> What would be the logical basis for contributing to Go? I don't see
> Google or the Go team contributing any code to me, or helping me in
> any way. In this situation, contributing code to Go appears to be
> illogical.

for some it is for altruistic reasons (which may have evolutionary
benefits for the altruist). for the majority, it is because they
believe Go will provide them an efficient and elegant way to write
sophisticated distributed systems without the need for massive code or
software teams.

-Skip

andrey mirtchovski

unread,
Nov 5, 2010, 10:48:20 PM11/5/10
to golang-nuts
just found out that I can now skip the initial guesswork of how many
elements a slice must have since I am allowed to do this with append
now:

package main

import "fmt"

func main() {
z := []byte(nil)
z = append(z, []byte("test")...)
fmt.Println(string(z[0:4]))
}

any gotchas i'm missing? of particular importance to me is that i must
return a slice of length 0 if nothing ever is appended to it. will
this always be true?

Rob 'Commander' Pike

unread,
Nov 5, 2010, 11:36:27 PM11/5/10
to andrey mirtchovski, golang-nuts


not sure what you're driving at. []byte("test") already does the counting.

you could do
z := append([]byte(nil), []byte("test")...)
but
z := []byte("test")[:]
is simpler. or you could go with
z := [...]byte{1,2,3,4,5}[:]

-rob

andrey mirtchovski

unread,
Nov 6, 2010, 12:06:18 AM11/6/10
to Rob 'Commander' Pike, golang-nuts
I think what I was trying to say is that I almost never need to use
"make" anymore -- I can just append to a nil slice. that saves me a
lot of make() calls when I'm processing an unknown number of elements
(which number may be 0). the way i did it before usually meant that
i'm overcommitting memory to a slice that will end up not being filled
in. append may also overcommit in the end, but i trust it to be doing
it more elegantly than i would.

I can see myself wanting to have File.ReadBlock() (or something more
aptly named) that takes no arguments but returns however much data it
could gobble in a single attempt, which could also be the
optimum-sized block for single reads for that particular OS/network
connection/interconnect/etc. That will go away with all the pesky
"bytes read" returns. Who knows, it may even make EOF redundant :)

GreatOdinsRaven

unread,
Nov 6, 2010, 2:06:51 PM11/6/10
to golang-nuts
> What if, hypothetically, Go would be my competitor in a certain way?
> Would you find that a viable explanation?

If Go is your "competitor", should we then actually do the exact
opposite of what you suggest in order for Go to succeed? ;-)
No generics it is then, for the glory of Go!

On Nov 5, 4:01 am, ⚛ <0xe2.0x9a.0...@gmail.com> wrote:
> On Nov 5, 9:47 am, Uriel <ur...@berlinblue.org> wrote:
>
> > On Fri, Nov 5, 2010 at 9:14 AM, ⚛ <0xe2.0x9a.0...@gmail.com> wrote:
> > > What would be the logical basis for contributing to Go? I don't see
> > > Google or the Go team contributing any code to me, or helping me in
> > > any way.
>
> > If you don't find Go useful in any way, why are you here?
>

>

deepak

unread,
Nov 26, 2010, 1:55:15 AM11/26/10
to golang-nuts
hi @uriel,
can you give a concrete example of how ruby does not let you write
good DSL's
and how do you define a good DSL

cheers,
deepak

On Nov 4, 8:55 am, Uriel <ur...@berlinblue.org> wrote:
> On Thu, Nov 4, 2010 at 1:18 AM, Jessta <jes...@jessta.id.au> wrote:
Reply all
Reply to author
Forward
0 new messages