News for hackers. Stuff that matters.
Re:Google Go: The Good, the Bad, and the Meh by tptacek on Monday February 11, 2013 @11:05AM (#5201428)
Plus side: I had no idea about "go run foo.go" and it has changed my life.

Downside: couldn't read past "And what’s up with all the languages that claim all you need are linked lists? I’m sorry, this is not 1958, and you are not John McCarthy".

Did I miss anything amazing in the rest of the article? Thanks in advance.

Re:Google Go: The Good, the Bad, and the Meh by coldtea on Monday February 11, 2013 @11:09AM (#5201446)
>Did I miss anything amazing in the rest of the article? Thanks in advance.

Yes, you missed the fact that quitting articles or conversations because of some remark (which could even be tongue-in-cheek) doesn't make you any smarter and that "I stopped reading where he said" is not something to brag about.

Re:Google Go: The Good, the Bad, and the Meh by niggler on Monday February 11, 2013 @11:14AM (#5201474)
"quitting articles or conversations because of some remark"

This is the problem with the internet and with political discourse in the 21st century: as soon as someone says something that seems off-kilter, even if it is technically correct, people stop listening/reading.

Re:Google Go: The Good, the Bad, and the Meh by tptacek on Monday February 11, 2013 @11:21AM (#5201506)
It's not correct. He's making an allusion to lisp and imputing to it the notion that everything is a linked list, which is not true. The article is a comparative discussion of programming languages. Earlier, it calls critics of the focal language in the article "idiots". That was OK with me while the author had credibility. It simply lost credibility for me at the point where it asserted that Lisp programmers don't use hash tables.

Apparently, I missed that Go could have, but didn't, support a syntax with shell shebangs at the tops of files so it could be used for utility scripts. I feel like I probably made the right call stopping where I did. ;)

Re:Google Go: The Good, the Bad, and the Meh by coldtea on Monday February 11, 2013 @11:26AM (#5201546)
>Earlier, it calls critics of the focal language in the article "idiots".

No, he only calls critics of SPECIFIC aspects of the language (aspects inconsequential and prone to bike-shedding) idiots.

>It simply lost credibility for me at the point where it asserted that Lisp programmers don't use hash tables.

You weren't supposed to read his article as coming from a Lisp expert, seeing that Lisp wasn't the main focus at all.

Heck, you weren't even expected to read the article as coming from a Go expert. Just as an article from a guy that tried Go and shares what he thinks of it.

>It simply lost credibility for me at the point where it asserted that Lisp programmers don't use hash tables.

Would an article by Einstein on relativity "lose credibility" for you if he makes some ignorant remarks about some aspects of mathematics in it?

Re:Google Go: The Good, the Bad, and the Meh by klibertp on Monday February 11, 2013 @01:29PM (#5202321)
I thought about it some more and now I know why I was irritated by this remark. I just felt this remark was exactly the same thing as some jerks bulling a kid with glasses (or the fat one) in school.

There is that social situation where you're new to the group and don't really know what's expected of you, what you should do. But you'd like to fit in. It's after initial introductions and you know the group's members names, but they're not that happy about you hanging around them. Some of them seem hostile, others just indifferent. So naturally you want to avert their attention and, if possible, show them that you have much in common.

And that's when this unpopular, fat or whatever, kid happens to fall just in front of you. Of course you will be laughing, at the very least, and it's quite possible that you'll be calling the kid an idiot with others. You know, maybe you're not fully accepted into the group yet, but at least you're not him. And you can laugh with your buddies, this matters too.

I find this remark exactly the same kind of thing. I read it as: "ok, so you may use PHP, or maybe Java, that's all cool because hey, at least we're not lispers! We're all one big, happy programming family (except for the lispers, of course, who don't even know what a hash is)!"

I don't like this. I wrote "PHP" because it's a popular target of the same bullying tactic. And Java, too, just in the other circles. I don't like it in these cases either, despite the fact that I don't use either PHP nor Java and frankly I don't think they're great. They may not be, but bullying is a bit below what I want to see in a technical article - or in real life.

Re:Google Go: The Good, the Bad, and the Meh by tptacek on Monday February 11, 2013 @02:31PM (#5202744)
In fairness, Lisp is the goofy looking kid everyone bullied in school who had secretly trained at a Shaolin monastery.
Re:Google Go: The Good, the Bad, and the Meh by coldtea on Monday February 11, 2013 @11:33AM (#5201587)
Well, lots of important contributions in some fields have erroneous and ignorant remarks on other fields.

If that (instead of careful consideration on their own merits and in their main focus) makes them "lose credibility", then well, I guess you should have more patience and tolerance for errors.

Re:Google Go: The Good, the Bad, and the Meh by spacemanaki on Monday February 11, 2013 @03:16PM (#5202957)
But it was an article about the merits of one programming language, in which the author made erroneous and ignorant remarks about another programming language, and other ignorant remarks about programming language features (mild ones like associating static typing with verbosity). It's not as if they made some flawed remarks about mathematics or electrical engineering, which truly are different fields. For me, it detracted from the author's credibility, because they apparently don't have a breadth of experience with programming languages, so why should I take their opinions about this one particular language very seriously?
Re:Google Go: The Good, the Bad, and the Meh by tptacek on Monday February 11, 2013 @11:28AM (#5201559)
Uh, yes? EXTREMELY yes?
Re:Google Go: The Good, the Bad, and the Meh by kenko on Monday February 11, 2013 @06:56PM (#5204263)
"You weren't supposed to read his article as coming from a Lisp expert, seeing that Lisp wasn't the main focus at all."

Then why did he make snide, ignorant allusion to Lisp?

"You shouldn't hold that comment against him; he doesn't know what he's talking about and you shouldn't expect him to" is an odd defense.

Re:Google Go: The Good, the Bad, and the Meh by earthboundkid on Thursday February 14, 2013 @05:22AM (#5218796)
(Author here.) I find it odd that everyone thinks the remark is a criticism of Lisp. It's a criticism of Haskell. Lisp had a good excuse for focusing on linked lists back in the day. Then Clojure improved on it by promoting hashes to first class constructs. But Haskell is stuck in the past, at least as far as first class syntax goes.
Re:Google Go: The Good, the Bad, and the Meh by FreeFull on Thursday February 14, 2013 @12:59PM (#5220767)
The only thing that elevates lists above other data structures in Haskell syntax-wise is the "" and [] sugar for constructing them. Haskell's type system allows you very easily to construct your own data types. For example, an unbalanced binary tree would be defined as

data Tree a = Leaf a | Branch a (Tree a) (Tree a) deriving (Eq, Show)

I admit that the easiest way to construct a hashmap, using fromList [(key,value),(otherkey,othervalue)], isn't as pretty as Clojure's syntax.

Re:Google Go: The Good, the Bad, and the Meh by Tloewald on Monday February 11, 2013 @07:50PM (#5204489)
The comparison with Einstein is a bit of a stretch. Surely Einstain has a fair aomount of credibility going in.
Re:Google Go: The Good, the Bad, and the Meh by earthboundkid on Thursday February 14, 2013 @05:17AM (#5218790)
(Author here.) Actually, the remark was a complaint about "Learn You a Haskell," which I have been working through, on the grounds that it's NOT Lisp, so they shouldn't pretend like head/tail are the holy grail of data structure design.
Re:Google Go: The Good, the Bad, and the Meh by tptacek on Monday February 11, 2013 @11:13AM (#5201468)
Did I miss anything else? This point isn't very interesting to me.
Re:Google Go: The Good, the Bad, and the Meh by coldtea on Monday February 11, 2013 @11:17AM (#5201488)
Well, it's impossible to tell without knowing what's interesting to you.

That said, I think the above point is more generic and important than anything Go specific the article could say.

Re:Google Go: The Good, the Bad, and the Meh by coldtea on Monday February 11, 2013 @11:28AM (#5201555)
>Never give up hope! One of these days, you'll leave a comment about people's refusal to read blog posts all the way through and by doing so change the world.

I agree. People having patience with other people and going through their argument thoroughly is much more important than someone complaining about another's remarks on his language of choice.

Of Go code I've written around 1000-1500 lines, merely to check the language out (a small server app and a logging utility). That said, Go itself was never the focus of this subthread.

Re:Google Go: The Good, the Bad, and the Meh by tptacek on Monday February 11, 2013 @11:37AM (#5201620)
What do you think of Go so far? (I've written ~10kloc).

Did this article in any way change your mind about it?

Re:Google Go: The Good, the Bad, and the Meh by coldtea on Monday February 11, 2013 @12:01PM (#5201790)
To be frank, no. The article pretty much sums up my conclusions too.

I generally like Go, but dislike some of the design decisions (like the lack of Generics, or the special casing of a few select structures). Not much sold on the error handling either.

But those would be minor gripes if it had real good performance, which it does not, considering it's a statically typed, compiled language. It's been around 2x faster than Python in most of my uses (which don't involve parallelism), which doesn't really tempt to use Go over Python. If it could get closer to C++/Java performance it would be nice.

I wish Google had devoted some hardcore compiler guys like it did with Dart and V8 on it, because the current old-school team, while very good at systems programming and with a long history, is not really up to it for a 2013 language.

In the meantime, I wait to see what happens with Rust.

Re:Google Go: The Good, the Bad, and the Meh by tptacek on Monday February 11, 2013 @12:14PM (#5201856)
This all makes a lot of sense. Thanks!

To me, there are two kinds of languages:

1. Languages that are fast enough that when I'm writing in them I can tell myself "no matter what I write, it can't possibly be slower than what Ruby would have done for me". C obviously falls into this class, as does Java, and Go.

2. Languages that are so slow, like Ruby and Python, that it doesn't matter what I do in them, short of picking the right problems to work on in them.

If I wrote a lot of kernel code, or games code, I'd probably have a third class of language that would admit C but not Go. Similarly, if I broke languages up by runtime footprint, I could make C work for embedded stuff for which neither Java or Go would work.

Obviously, this is all subjective.

Re:Google Go: The Good, the Bad, and the Meh by ansible on Monday February 11, 2013 @04:33PM (#5203426)
But those would be minor gripes if it had real good performance, which it does not, considering it's a statically typed, compiled language. It's been around 2x faster than Python in most of my uses (which don't involve parallelism), which doesn't really tempt to use Go over Python. If it could get closer to C++/Java performance it would be nice.

I haven't seen anything in the language design that would make further speed improvements especially difficult, so I'm hopeful that the speed of compiled code will improve as time goes by. I agree with you that if they get some more talented developers, that would really help.

As an aside, after reading about the LuaJIT trace compiler implementation, I am quite intimidated by the amount of knowledge and skill that is needed to write really fast code on modern processors (even embedded ones).

Re:Google Go: The Good, the Bad, and the Meh by papsosouid on Monday February 11, 2013 @12:56PM (#5202119)
>It's been around 2x faster than Python in most of my uses

You must have some very unusual uses for that to be true. The computer language shootout isn't perfect, but it includes a variety of uses, and python is at best 5 times slower than go on benchmarks actually written in python instead of C, and 20-30 times slower for most of them.

http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...

Go is in the same performance field as java, haskell, scala, lisp, C#, etc. The 2-5x slower than C group. Python is in the same field as php, perl, ruby, etc. They are 30-50x slower than C. That's a huge difference.

Re:Google Go: The Good, the Bad, and the Meh by dnu on Monday February 11, 2013 @01:45PM (#5202441)
That benchmark is for algorithms implemented in pure Python and in pure Go. But for real projects, a Python programmer might use several libraries which are written in C.
Re:Google Go: The Good, the Bad, and the Meh by igouy on Monday February 11, 2013 @04:37PM (#5203455)
>> That benchmark is for algorithms implemented in pure Python and in pure Go <<

Note that papsosouid needed to add the restriction "on benchmarks actually written in python instead of C" to avoid mentioning the 2 tasks where Python is shown as faster than Go ;-)

Re:Google Go: The Good, the Bad, and the Meh by papsosouid on Monday February 11, 2013 @01:52PM (#5202495)
I think programs that are 90% C and 10% python do constitute "unusual use cases".
Re:Google Go: The Good, the Bad, and the Meh by benaiah on Monday February 11, 2013 @03:23PM (#5202989)
That would be unusual, but 80% of a program's performance is generally tied up in 20% of its code. If you can replace the 20% with a couple widely-used C libraries, then you get vastly improved performance without actually having to write much C.

In most cases in Python, the part that one would consider the application proper is entirely written in Python, which use Python libraries that wrap around C libraries to do the intensive stuff.

Your comment was a non sequitur from what dnu said. Please refrain from attacking arguments with straw men - they add nothing to the discussion

Edited for tone: s/Quit with the straw man arguments/Please refrain from attacking arguments with straw men/

Re:Google Go: The Good, the Bad, and the Meh by papsosouid on Monday February 11, 2013 @03:40PM (#5203067)
>80% of a program's performance is generally tied up in 20% of its code

I've never seen any evidence to support this truthy sounding statement. In fact, my experience has been that it only holds true occasionally, and only for the very first initial profiling, seeing that some huge performance no-no was made. Once that is fixed, you have a pretty flat profile, with "the language is just slow" as your explanation, and no recourse.

>Your comment was a non sequitur from what dnu said.

No it wasn't. He responded to what I said. How could re-iterating what I said be a non-sequitur? Read the thread, I said python being only twice as slow as go "for my uses" would indicate some very unusual uses.

>In most cases in Python, the part that one would consider the application proper is entirely written in Python, which use Python libraries that wrap around C libraries to do the intensive stuff.

No, in the cases you want to put forth as representative because they support your belief that slow languages are good enough. Most applications don't have a convenient "intensive stuff" to do in C. Most applications are like django, just generally slow all over because they are written in a slow language.

>Quit with the straw man arguments - they add nothing to the discussion.

Neither do unwarranted accusations of straw man arguments.

Re:Google Go: The Good, the Bad, and the Meh by benaiah on Monday February 11, 2013 @04:39PM (#5203466)
It was a non sequitur, and a straw man - you said that python was 5 times slower than C at best and 30-50 times slower than C at worst on some benchmarks.

dnu pointed out that the benchmarks did not represent real-world Python code, since real-world code uses C libraries for performance-intensive stuff.

You responded by saying that programs that are 90% C and 10% Python are unrealistic.

Nobody ever suggested using programs that were 90% C and 10% Python, or said that that kind of usage was common. That didn't follow what dnu said at all. You weren't "reiterating" anything - you never said anything about "your uses", coldtea did, much farther up the thread. (If you're coldtea, then I understand your point, but if that's the case, you should have made that clear, as it vastly changes the context of what you were saying). You just brought up some benchmarks, which are not representative of how Python is used in the real world.

I see how you could have intended to imply that this was "your uses" by saying that coldtea must have unusual uses if he got go/2 performance out of Python, but this was hardly clear, if it is the case. Regardless, you totally misrepresented dnu's point.

As for your arguments against my points, the 80/20 rule, while obviously impossible to definitively prove, has far more authoritative supporters than it does detractors. If you haven't experienced that being the case, then that's good and well for you, but the experience of many others suggests that it usually is (in fact, it's usually stated as being closer to 90/10 than 80/20).

Your Django argument falls flat if you look at it more closely. Sure, Django might introduce some slowness, but the vast majority of web performance is in the networking and database layers, not the application layer. Your choice of language has little to no bearing on the networking aspect of things, but what do you think the database drivers are written in? C, or an equivalent. 10% of the code that has 90% of the performance impact - sound familiar? And you interact with database drivers most of the time exactly how I said - by using a Python library that wraps around a C library to run the database.

>>Quit with the straw man arguments - they add nothing to the discussion. >Neither do unwarranted accusations of straw man arguments.

I apologize if I come across as insulting - it is not my intention. My phrasing in the grandparent comment was overly antagonistic, and I'm about to edit it to fix that. But my accusations of straw man arguments were correct.

Re:Google Go: The Good, the Bad, and the Meh by papsosouid on Monday February 11, 2013 @04:51PM (#5203531)
>It was a non sequitur, and a straw man

It was neither, and repetition is not an argument. Let me paraphrase the conversation in the desperate hope you will at least read this since you refuse to read the thread you are discussing:

Me: if you are seeing 2x slower, then that seems like unusual uses of python. Him: I think some real world uses of python are 90% C libraries and 10% python Me: I feel the cases you are referring to are the unusual ones I spoke of.

>You weren't "reiterating" anything - you never said anything about "your uses"

Yes, I did: http://news.ycombinator.com/item?id=5202119

>You must have some very unusual uses for that to be true

Wow, its like I am really saying exactly what I told you I was saying!

>Your Django argument falls flat if you look at it more closely. Sure, Django might introduce some slowness, but the vast majority of web performance is in the networking and database layers, not the application layer

That is completely, and entirely false. Scripting language web frameworks like django, rails, zend, etc are dozens to hundreds of times slower than similar frameworks in compiled languages.

>But my accusations of straw man arguments were correct.

No, they were not. And your continued insistence that your arrogant and pointless accusation was correct is absurd. If you don't wish to read something, don't reply to it.

Re:Google Go: The Good, the Bad, and the Meh by benaiah on Monday February 11, 2013 @05:28PM (#5203777)
> Let me paraphrase the conversation in the desperate hope you will at least read this since you refuse to read the thread you are discussing

> ... your continued insistence that your arrogant and pointless accusation was correct is absurd. If you don't wish to read something, don't reply to it.

I'm attempting to keep the conversation civil (I have even gone back and changed some of my more inflammatory phrasings), and I hope you can do the same, without resorting to ad hominems such as these. I have read the entire thread several times over, and have quoted from it at length in my responses.

Prelude aside, my response.

---

> It was neither, and repetition is not an argument.

That's why I followed that statement with an entire page of argument. I didn't expect to convince you with the first sentence, only to state the subject of the argument that followed.

---

> Me: if you are seeing 2x slower, then that seems like unusual uses of python. Him: I think some real world uses of python are 90% C libraries and 10% python Me: I feel the cases you are referring to are the unusual ones I spoke of.

>> You weren't "reiterating" anything - you never said anything about "your uses"

> Yes, I did: http://news.ycombinator.com/item?id=5202119

>> You must have some very unusual uses for that to be true

> Wow, its like I am really saying exactly what I told you I was saying!

I actually mentioned what you said here in my previous argument:

> I see how you could have intended to imply that this was "your uses" by saying that coldtea must have unusual uses if he got go/2 performance out of Python, but this was hardly clear, if it is the case.

Your latest response makes it clear that this is, indeed, what you meant, but that wasn't clear from the initial conversation, even after reading it several times over.

---

> Me: if you are seeing 2x slower, then that seems like unusual uses of python. Him: I think some real world uses of python are 90% C libraries and 10% python Me: I feel the cases you are referring to are the unusual ones I spoke of.

Except dnu never said that "some" real world uses of Python are "90%" C libraries. He said, and I quote:

> for real projects, a Python programmer might use several libraries which are written in C.

That is, most real world uses of Python use some C libraries. He never suggested a ridiculous number like 90%. Your comment came across as a mockery of his argument, saying that Python could never achieve reasonable speed unless it was 90% C anyway. If this isn't what you intended, I apologize for insinuating that it was.

It came across that way because almost no real-world Python application uses 90% C, unless you want to count the entire kernel and OS it runs on.

---

>> Your Django argument falls flat if you look at it more closely. Sure, Django might introduce some slowness, but the vast majority of web performance is in the networking and database layers, not the application layer

> That is completely, and entirely false. Scripting language web frameworks like django, rails, zend, etc are dozens to hundreds of times slower than similar frameworks in compiled languages.

I think you misunderstand me. My point was that the parts of a web application that have the biggest impact on performance are the networking and database layers, not the application layer, and that language choice only affects the database and application layers. I was not arguing that Django, Rails, Zend, or other dynamic language based frameworks are as fast as compiled language based frameworks.

It may not seem like the database is that influential to performance at first - but imagine a database driver written in Python. It would be by far the slowest performing part of the application, because the database requires such enormous amounts of computation and is used so much. Thus, database drivers are written in C, so they perform quickly. But that 20% or less of the code, written in C for performance reasons, cuts down an 80% or greater slowdown which would occur if the database drivers were written in Python.

Also, as an aside, Django is hardly representative of Python as a whole. I haven't used it - I've done all my Python web development in Flask, so far, so my opinions on it aren't authoritative, and aren't intended to be so, but it seems to be an overly bloated framework whose performance is much slower than Python in general.

---

Again, I don't intend to be insulting and demeaning, and it is clear that the disagreement is due at least in part to some misunderstandings earlier in the conversation. I am happy to engage in technical discussion, even if it becomes somewhat heated, but I don't want to degrade the forum or make enemies by engaging in personal diatribe. I hope you share my desires on this subject.

Re:Google Go: The Good, the Bad, and the Meh by papsosouid on Tuesday February 12, 2013 @10:52AM (#5207507)
Perhaps in the future, rather than accuse people of non-sequiturs and logical fallacies, you might consider alternative explanations like "I misunderstood what was said". I asked several people to read the post you misunderstood, and it was completely clear to them. You are still insisting that your misunderstanding is my fault, and that does not at all indicate that you are interested in engaging in discussion.
Re:Google Go: The Good, the Bad, and the Meh by tptacek on Monday February 11, 2013 @11:23AM (#5201516)
Never give up hope! One of these days, you'll leave a comment about people's refusal to read blog posts all the way through and by doing so change the world.

Do you write a lot of Go code?

Re:Google Go: The Good, the Bad, and the Meh by incision on Monday February 11, 2013 @11:23AM (#5201519)
Too cool to finish reading an article that already "changed your life" so you ask some plebe to give you the tl;dr.

Grow up.

Re:Google Go: The Good, the Bad, and the Meh by tptacek on Monday February 11, 2013 @11:25AM (#5201531)
Do you write a lot of Go code?
Re:Google Go: The Good, the Bad, and the Meh by bcoates on Monday February 11, 2013 @03:37PM (#5203055)
Apparently "operator overloading, function/method overloading, [and] keyword arguments" are "bad for performance" so it's OK that Go doesn't have them.
Re:Google Go: The Good, the Bad, and the Meh by dexen on Monday February 11, 2013 @05:53PM (#5203932)
For performance of compilation. Go compiles crazy fast -- think two seconds for complete compiler and runtime on a notebook. This provides for rapid hack-compile-debug iterations.

http://www.youtube.com/watch?feature=player_embedded&v=r...

Re:Google Go: The Good, the Bad, and the Meh by gnuvince on Tuesday February 12, 2013 @12:42AM (#5205381)
D is a language with operator overloading and function overloading (no keyword arguments however), at it compiles even faster than Go.

    /tmp/dmd2/src/phobos/std$ wc -l *.d | grep total
     162688 total
    /tmp/dmd2/src/phobos/std$ time dmd -c *.d > /dev/null
    std.cpuid has been deprecated. It will be removed in January 2013. Please use core.cpuid instead.
    std.md5 is scheduled for deprecation. Please use std.digest.md instead
    std.perf has been deprecated. It will be removed in January 2013. Please use std.datetime instead.
    Notice: As of Phobos 2.055, std.regexp has been deprecated. Please use std.regex instead.
    
    real	0m1.210s
    user	0m1.016s
    sys	0m0.188s
1.2 second to compile 162k LOC. Not too shabby!
Re:Google Go: The Good, the Bad, and the Meh by klibertp on Monday February 11, 2013 @01:09PM (#5202193)
I stopped reading at the exact same place and I'm still considering going back to the article to read the rest of it. I don't know, maybe later - which means that I probably won't read it.

Calling people who disagree with a specific coding convention idiots was irritating, but it at least had a bit of merit - namely that 'readability counts' and that the code is more readable if it's written in consistent style.

The remark about linked lists in Lisps is both irritating and untrue. If even Schemes (I know. I just wrote a cute, little, hobby project in Racket and I used a list twice (by accident)) routinely deal with vectors and hashes then I can only imagine how many different builtin datastructures have CL (or Clojure) programmers at their disposal.

It probably was meant as a joke. Ok - it just isn't the sense of humor I share, that's all.