<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Google Go: Good For What?</title>
	<atom:link href="http://www.lessonsoffailure.com/software/google-go-good-for-nothing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lessonsoffailure.com/software/google-go-good-for-nothing/</link>
	<description>Humans + Software Development = Always Interesting</description>
	<lastBuildDate>Mon, 12 Dec 2011 21:05:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: RogerV</title>
		<link>http://www.lessonsoffailure.com/software/google-go-good-for-nothing/comment-page-1/#comment-51</link>
		<dc:creator>RogerV</dc:creator>
		<pubDate>Sat, 26 Dec 2009 20:56:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.lessonsoffailure.com/?p=234#comment-51</guid>
		<description>What has attracted me to Go is the feature of goroutines and channels as an abstraction approach to programming concurrency - especially with the potential of concurrent routines being so cheap (i.e., many goroutines multiplexed to relatively few OS native threads).

The only other two languages that offer something comparable to this and have enough of an established following that I might bother to learn them are Erlang and Scala (I don&#039;t pay much attention to the Microsoft camp of F# et al languages.) Erlang, despite CouchDB having been written it it, is rather too odd. Scala I started getting into and then got bogged down in the functional programming side of that language. Overall it&#039;s a rather complex language with a lot of turf to cover.

Then when I came across Go - well, it was a much simpler language to learn. Having programmed a good deal in C in bygone years, there was a lot about Go that had a sort of C sensibility about it.

It is a very young language, though. The one area that grates the most (coming from a Java background) is the lack of exception handling constructs. There is no way to catch and handle exceptions like dereferencing a nil pointer, divide by zero, array index violation.

So it is not possible to write an app server in a Java-like manner where all code runs in a single process (including loaded beans). Instead, one would need to rely on the POSIX fork() system call to launch any worker code as a child process and have the parent process monitor it in watch dog fashion. If any child processes panic fault then the parent process would detect and restart the process.

So far Go only supports unix/linux/Mac-OS-X OS where fork is natively supported. Windows API doesn&#039;t expose fork() but it is available on the Windows POSIX dll. Hence Go will probably be better suited implemented on top of one of the various Windows POSIX runtimes.</description>
		<content:encoded><![CDATA[<p>What has attracted me to Go is the feature of goroutines and channels as an abstraction approach to programming concurrency &#8211; especially with the potential of concurrent routines being so cheap (i.e., many goroutines multiplexed to relatively few OS native threads).</p>
<p>The only other two languages that offer something comparable to this and have enough of an established following that I might bother to learn them are Erlang and Scala (I don&#8217;t pay much attention to the Microsoft camp of F# et al languages.) Erlang, despite CouchDB having been written it it, is rather too odd. Scala I started getting into and then got bogged down in the functional programming side of that language. Overall it&#8217;s a rather complex language with a lot of turf to cover.</p>
<p>Then when I came across Go &#8211; well, it was a much simpler language to learn. Having programmed a good deal in C in bygone years, there was a lot about Go that had a sort of C sensibility about it.</p>
<p>It is a very young language, though. The one area that grates the most (coming from a Java background) is the lack of exception handling constructs. There is no way to catch and handle exceptions like dereferencing a nil pointer, divide by zero, array index violation.</p>
<p>So it is not possible to write an app server in a Java-like manner where all code runs in a single process (including loaded beans). Instead, one would need to rely on the POSIX fork() system call to launch any worker code as a child process and have the parent process monitor it in watch dog fashion. If any child processes panic fault then the parent process would detect and restart the process.</p>
<p>So far Go only supports unix/linux/Mac-OS-X OS where fork is natively supported. Windows API doesn&#8217;t expose fork() but it is available on the Windows POSIX dll. Hence Go will probably be better suited implemented on top of one of the various Windows POSIX runtimes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.lessonsoffailure.com/software/google-go-good-for-nothing/comment-page-1/#comment-50</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 25 Dec 2009 20:16:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.lessonsoffailure.com/?p=234#comment-50</guid>
		<description>@RogerV:
&lt;blockquote&gt;
&lt;em&gt;a language that compiles and links far faster than C or C++&lt;/em&gt;
&lt;/blockquote&gt;

Yes, Go does this.  The benefit, however, is questionable.  Is it more valuable to get a car off the assembly line 50% faster if it&#039;s still slower than the one I waited longer for?

&lt;blockquote&gt;
&lt;em&gt;You really do make too much of the syntax issue by far, BTW. Adobe ActionScript3, which is used in Flex programming, has the same declaration style as Go.&lt;/em&gt;
&lt;/blockquote&gt;

My experience with teaching students from C to C++ (1995-1997) and C++ to Java (1998-2005) shows about 25% will struggle and reject the language on this basis alone.  And that&#039;s with a language that is already very similar in syntax.  Forward declarations are but one aspect of Go&#039;s different approach, and perhaps the most benign.  

I don&#039;t think your language example underscores the significance of the syntax between the two.  &lt;a href=&quot;http://en.wikipedia.org/wiki/ActionScript&quot; rel=&quot;nofollow&quot;&gt;ActionScript&#039;s heritage is much closer to Java&lt;/a&gt; than Go&#039;s is to C++.  Compare these two blocks of code:

&lt;code&gt;SexprParserRef := MakeRef();
ManySexprs := Action(Many(SexprParserRef, 1), new(VectAction));
ListParser := Second(Seq([]Parser { Lp, ManySexprs, Rp }));
Sexpr := Alt([]Parser{ ListParser, SymParser });
SexprParserRef.SetTarget(Sexpr);
&lt;/code&gt;
To this one:
&lt;code&gt;void main()
{    int i;
	char *inp;
	clrscr();
	printf(&quot;enter the regular expression :&quot;);
	gets(inp);
	nfa(1,0,inp);
	printf(&quot;\nstate  input  state\n&quot;);
	for(i=0;i      %d\n&quot;,ret[i],ret[i+1],ret[i+2]);
	printf(&quot;\n&quot;);
	getch();
}&lt;/code&gt;

As far as the goroutines go, you said:
&lt;blockquote&gt;
&lt;em&gt;You still need to know what you&#039;re doing...&lt;/em&gt;
&lt;/blockquote&gt;
Which simply reiterates the point I made about the dangers of concurrent programming with Java.  You still get free reign to do dumb things, like addressing local variables, because the Go language doesn&#039;t preemptively stop you from shooting yourself, nor does it educate you why not to.  If the purpose of moving away from C++ to Go is to get safety, this is a poor move.  I&#039;d love to see numbers on the goroutines you mention--an actual code example that fires those up and doesn&#039;t bring the OS down.  No one has addressed that to date.  

And finally, I think you make a very compelling point:  Go probably was created as a special-purpose language to run Google&#039;s own server farms.  But that is a far cry from a general purpose systems programming language, which is the argument I made above.</description>
		<content:encoded><![CDATA[<p>@RogerV:</p>
<blockquote><p>
<em>a language that compiles and links far faster than C or C++</em>
</p></blockquote>
<p>Yes, Go does this.  The benefit, however, is questionable.  Is it more valuable to get a car off the assembly line 50% faster if it&#8217;s still slower than the one I waited longer for?</p>
<blockquote><p>
<em>You really do make too much of the syntax issue by far, BTW. Adobe ActionScript3, which is used in Flex programming, has the same declaration style as Go.</em>
</p></blockquote>
<p>My experience with teaching students from C to C++ (1995-1997) and C++ to Java (1998-2005) shows about 25% will struggle and reject the language on this basis alone.  And that&#8217;s with a language that is already very similar in syntax.  Forward declarations are but one aspect of Go&#8217;s different approach, and perhaps the most benign.  </p>
<p>I don&#8217;t think your language example underscores the significance of the syntax between the two.  <a href="http://en.wikipedia.org/wiki/ActionScript" rel="nofollow">ActionScript&#8217;s heritage is much closer to Java</a> than Go&#8217;s is to C++.  Compare these two blocks of code:</p>
<p><code>SexprParserRef := MakeRef();<br />
ManySexprs := Action(Many(SexprParserRef, 1), new(VectAction));<br />
ListParser := Second(Seq([]Parser { Lp, ManySexprs, Rp }));<br />
Sexpr := Alt([]Parser{ ListParser, SymParser });<br />
SexprParserRef.SetTarget(Sexpr);<br />
</code><br />
To this one:<br />
<code>void main()<br />
{    int i;<br />
	char *inp;<br />
	clrscr();<br />
	printf("enter the regular expression :");<br />
	gets(inp);<br />
	nfa(1,0,inp);<br />
	printf("\nstate  input  state\n");<br />
	for(i=0;i      %d\n",ret[i],ret[i+1],ret[i+2]);<br />
	printf("\n");<br />
	getch();<br />
}</code></p>
<p>As far as the goroutines go, you said:</p>
<blockquote><p>
<em>You still need to know what you&#8217;re doing&#8230;</em>
</p></blockquote>
<p>Which simply reiterates the point I made about the dangers of concurrent programming with Java.  You still get free reign to do dumb things, like addressing local variables, because the Go language doesn&#8217;t preemptively stop you from shooting yourself, nor does it educate you why not to.  If the purpose of moving away from C++ to Go is to get safety, this is a poor move.  I&#8217;d love to see numbers on the goroutines you mention&#8211;an actual code example that fires those up and doesn&#8217;t bring the OS down.  No one has addressed that to date.  </p>
<p>And finally, I think you make a very compelling point:  Go probably was created as a special-purpose language to run Google&#8217;s own server farms.  But that is a far cry from a general purpose systems programming language, which is the argument I made above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seifsallam</title>
		<link>http://www.lessonsoffailure.com/software/google-go-good-for-nothing/comment-page-1/#comment-49</link>
		<dc:creator>seifsallam</dc:creator>
		<pubDate>Thu, 24 Dec 2009 18:53:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.lessonsoffailure.com/?p=234#comment-49</guid>
		<description>i don&#039;t think anyone should switch to go from c or c++, BUT for students and programming newbies they should definitely go for it</description>
		<content:encoded><![CDATA[<p>i don&#8217;t think anyone should switch to go from c or c++, BUT for students and programming newbies they should definitely go for it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SMiGL</title>
		<link>http://www.lessonsoffailure.com/software/google-go-good-for-nothing/comment-page-1/#comment-48</link>
		<dc:creator>SMiGL</dc:creator>
		<pubDate>Thu, 24 Dec 2009 15:01:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.lessonsoffailure.com/?p=234#comment-48</guid>
		<description>Intresting information</description>
		<content:encoded><![CDATA[<p>Intresting information</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kent</title>
		<link>http://www.lessonsoffailure.com/software/google-go-good-for-nothing/comment-page-1/#comment-47</link>
		<dc:creator>Kent</dc:creator>
		<pubDate>Thu, 24 Dec 2009 14:47:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.lessonsoffailure.com/?p=234#comment-47</guid>
		<description>Go is a boring offering.  Just because you hire the Programming Forefathers doesn&#039;t mean that everything they produce is going to be gold. The free &quot;marketplace&quot; will decide whether Go (or any other technology) is worthy of use.  Every programming language that gets used extensively does so by making some aspect of development easier for the programmer.  Go seems to be nothing more than just Java-izing C/C++, or C-ifying Java. (features, not syntax)  New languages do deserve consideration to see if they solve some pain point in the development process without introducing an unacceptable amount of new pain.  Go doesn&#039;t seem to introduce too much new pain, but since it doesn&#039;t bring anything new to the table, what&#039;s the point?  Unless Google&#039;s name itself is supposed the be killer feature...</description>
		<content:encoded><![CDATA[<p>Go is a boring offering.  Just because you hire the Programming Forefathers doesn&#8217;t mean that everything they produce is going to be gold. The free &#8220;marketplace&#8221; will decide whether Go (or any other technology) is worthy of use.  Every programming language that gets used extensively does so by making some aspect of development easier for the programmer.  Go seems to be nothing more than just Java-izing C/C++, or C-ifying Java. (features, not syntax)  New languages do deserve consideration to see if they solve some pain point in the development process without introducing an unacceptable amount of new pain.  Go doesn&#8217;t seem to introduce too much new pain, but since it doesn&#8217;t bring anything new to the table, what&#8217;s the point?  Unless Google&#8217;s name itself is supposed the be killer feature&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RogerV</title>
		<link>http://www.lessonsoffailure.com/software/google-go-good-for-nothing/comment-page-1/#comment-45</link>
		<dc:creator>RogerV</dc:creator>
		<pubDate>Thu, 24 Dec 2009 02:52:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.lessonsoffailure.com/?p=234#comment-45</guid>
		<description>Google is initially aiming Go at their server farms. They want to write certain server software in a language that compiles and links far faster than C or C++. This Go does.

Secondly, the goroutines and channels will let them write concurrent/parallel software that will tend to be more correct than such software written with threads. Sure, you can pass an object pointer over a channel to another goroutine. But if one goroutine sets up the object on behalf of the next stage of processing (tiered execution pipelines), then it&#039;s no big deal. The next tier will have exclusive use of what they&#039;re handed over the pipeline. Yeah, you have to be more aware of what you&#039;re doing - but it&#039;s still preferable than trying to rendezvous on shared memory via locks. And you can always choose to send copies of data instead of pointers to data.

Another advantage of goroutines is that you can have massive numbers of them. This is something you failed completely to discuss. Your only distinction of messaging vs Java threads was the locking of shared memory of the latter. Yet goroutines are designed to be used in a single process to the order of tens of thousands. Threads of languages like Java, C#, or Scala are based on underlying native OS threads. An OS these days can have hundreds, and even a few thousand threads, but eventually performance and resource consumption causes performance to drop off precipitously. Forms of concurrency that rely on fewer OS native threads can scale much better. This is where Go looks to triumph as Google has an example program that starts 100,000 goroutines in a single process and harvest a value from each one. That much concurrency activity (within a single process) would be tough to do in other languages other than Erlang.

You really do make too much of the syntax issue by far, BTW. Adobe ActionScript3, which is used in Flex programming, has the same declaration style as Go - variable name followed by type (as does Pascal and PL/SQL). Java programmers that take up ActionScript3 programming (and gobs of them have become Flex developers in last 2 or 3 years) just about never voice this an issue.

Also, in Go, 90% of the time you just declare variable name and &#039;:=&#039; assignment operator, which does type inference, like so:

parts := Split(&quot;bob,jane,fred,sally&quot;,&quot;,&quot;,0)

instead of:

var parts []string = Split(&quot;bob,jane,fred,sally&quot;,&quot;,&quot;,0)

and then something like:

for part := range parts {
  fmt.Println(part)
}

instead of:

for var part string = range parts {...

IOW, the syntax of Go is actually very convenient, very, very easy to learn, and just not a big deal at all as you make it out to be. Tons of Java/Flex developers in enterprise development demonstrate the fact of just how utterly trivial the matter is.

Because you&#039;re so far off on this syntax matter, and yet put a big deal of emphasis on it, it is cause to more deeply question your other analysis points. And so indeed, the fact you so missed the distinction of goroutine concurrency/parallelism relative to threading based on one-to-one native OS threads of other languages is yet another such question mark of your overall critique.

Okay, I&#039;ve got some Go code executing 6 times slower than comparable C++ code, yet my C++ process can fire up a maybe a few thousands threads, but then brings the OS to a standstill. My Go program, in contrast, cheerfully fires up tens of thousands of goroutines. Think of the context of what Google does on those back-end data center servers. Which is truly being the most performant language in terms of solving the problem?

I really think your concluding remark to this piece is therefore flippant without having earned the right to be so. Some of your points were just too weak.</description>
		<content:encoded><![CDATA[<p>Google is initially aiming Go at their server farms. They want to write certain server software in a language that compiles and links far faster than C or C++. This Go does.</p>
<p>Secondly, the goroutines and channels will let them write concurrent/parallel software that will tend to be more correct than such software written with threads. Sure, you can pass an object pointer over a channel to another goroutine. But if one goroutine sets up the object on behalf of the next stage of processing (tiered execution pipelines), then it&#8217;s no big deal. The next tier will have exclusive use of what they&#8217;re handed over the pipeline. Yeah, you have to be more aware of what you&#8217;re doing &#8211; but it&#8217;s still preferable than trying to rendezvous on shared memory via locks. And you can always choose to send copies of data instead of pointers to data.</p>
<p>Another advantage of goroutines is that you can have massive numbers of them. This is something you failed completely to discuss. Your only distinction of messaging vs Java threads was the locking of shared memory of the latter. Yet goroutines are designed to be used in a single process to the order of tens of thousands. Threads of languages like Java, C#, or Scala are based on underlying native OS threads. An OS these days can have hundreds, and even a few thousand threads, but eventually performance and resource consumption causes performance to drop off precipitously. Forms of concurrency that rely on fewer OS native threads can scale much better. This is where Go looks to triumph as Google has an example program that starts 100,000 goroutines in a single process and harvest a value from each one. That much concurrency activity (within a single process) would be tough to do in other languages other than Erlang.</p>
<p>You really do make too much of the syntax issue by far, BTW. Adobe ActionScript3, which is used in Flex programming, has the same declaration style as Go &#8211; variable name followed by type (as does Pascal and PL/SQL). Java programmers that take up ActionScript3 programming (and gobs of them have become Flex developers in last 2 or 3 years) just about never voice this an issue.</p>
<p>Also, in Go, 90% of the time you just declare variable name and &#8216;:=&#8217; assignment operator, which does type inference, like so:</p>
<p>parts := Split(&#8220;bob,jane,fred,sally&#8221;,&#8221;,&#8221;,0)</p>
<p>instead of:</p>
<p>var parts []string = Split(&#8220;bob,jane,fred,sally&#8221;,&#8221;,&#8221;,0)</p>
<p>and then something like:</p>
<p>for part := range parts {<br />
  fmt.Println(part)<br />
}</p>
<p>instead of:</p>
<p>for var part string = range parts {&#8230;</p>
<p>IOW, the syntax of Go is actually very convenient, very, very easy to learn, and just not a big deal at all as you make it out to be. Tons of Java/Flex developers in enterprise development demonstrate the fact of just how utterly trivial the matter is.</p>
<p>Because you&#8217;re so far off on this syntax matter, and yet put a big deal of emphasis on it, it is cause to more deeply question your other analysis points. And so indeed, the fact you so missed the distinction of goroutine concurrency/parallelism relative to threading based on one-to-one native OS threads of other languages is yet another such question mark of your overall critique.</p>
<p>Okay, I&#8217;ve got some Go code executing 6 times slower than comparable C++ code, yet my C++ process can fire up a maybe a few thousands threads, but then brings the OS to a standstill. My Go program, in contrast, cheerfully fires up tens of thousands of goroutines. Think of the context of what Google does on those back-end data center servers. Which is truly being the most performant language in terms of solving the problem?</p>
<p>I really think your concluding remark to this piece is therefore flippant without having earned the right to be so. Some of your points were just too weak.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

