Live data from Hacker News

Why I went from Python to Go (and not node.js)

orel.li

161–170 of 202 posts

Re: Why I went from Python to Go (and not node.js)

#161
post #7

Lots of sentiment, not much substance. Concurrency support is possible in Python, without gevent-style monkey patching (or callback madness). Have a look at concurrent.futures and http://www.dabeaz.com/coroutines/index.html . It really needs a lot more work before it's part of the language's DNA, though. Also, pypy needs much wider adoption as quickly as possible, to address the speed problems (and its STM branch hol…

I wonder if parent has ever coded with Go? You have to maybe learn a new syntax (partially), but once you have its incredibly readable. for instance, encapsulation is handled by giving semantic significance to the case (upper or lower) of the first character in a variable name. So "myFunc" is local and not visible whereas "MyFunc" is publicly accessible. This and many other features make Go extremely readable for me at least, although I admit, I did have to read the docs and program some of my own projects before I really got accustomed to the syntax.

Re: Why I went from Python to Go (and not node.js)

#162
post #107

Earlier quoted context omitted.

since Python is a thoroughly mediocre language. Care to elaborate?

Is there anything to add? It's not very fast. It does not have any interesting abstraction. It doesn't push the envelope further. It doesn't allow any clever optimizations. It has a bunch of horrible gotchas (scoping, mutable default arguments, tuples of one element...). It isn't elegant--the grammar alone takes pages and it's just a loose collection of mostly orthogonal features with largely arbitrary (but, admitted…

> In short, it's a language best define by what it isn't: it isn't bad, but it also isn't good.

Exactly, as you point out in the end. It's a language for people who are deeply interested in getting shit done. Rather than people "being deeply interested in programming languages".

You are acting out the 2nd (tower type) stereotype so well I can almost believe you are a parody.

Re: Why I went from Python to Go (and not node.js)

#163
post #27
post #24

Earlier quoted context omitted.

ah, so, I don't think I wrote that section particularly well. I hold Erlang and Haskell in very high regard; I was really trying to mock my own superiority complex, which I think is fairly common in the Python community. I guess what I was really trying to get at is that Go is verymuch an industry language. Haskell I would argue against being an industry language not because it can't be used in industry; that's not a…

You're digging in. > Haskell I would argue against being an industry language FYI, the problems the Haskell community has been working on are things like scalability, performance and safety because they're critical to industrial problems . Toy approaches don't work at the scale we operate at -- you need real computer science. You want 1,000,000 Haskell threads in your app? You've got it. Want to write numerical model…

> you need real computer science.

Reality and PHP would disagree for 90 to 99% values of "you".

Re: Why I went from Python to Go (and not node.js)

#164
post #27
post #24

Earlier quoted context omitted.

ah, so, I don't think I wrote that section particularly well. I hold Erlang and Haskell in very high regard; I was really trying to mock my own superiority complex, which I think is fairly common in the Python community. I guess what I was really trying to get at is that Go is verymuch an industry language. Haskell I would argue against being an industry language not because it can't be used in industry; that's not a…

You're digging in. > Haskell I would argue against being an industry language FYI, the problems the Haskell community has been working on are things like scalability, performance and safety because they're critical to industrial problems . Toy approaches don't work at the scale we operate at -- you need real computer science. You want 1,000,000 Haskell threads in your app? You've got it. Want to write numerical model…

I too share the perception that Haskell is not an "industry language" although I play around with it in my free time and like it. I'd be interested to know if there are any really competitive i.e. not experimental or mediocre software packages for Haskell out there. For example, is there a server written in Haskell that can compare to nginx or apache? Anything like a MySQL, CouchDB, or Redis? What about web development? - any CMS's or Frameworks comparable to Rails or Django? Up till now everything I've found from the Haskell site just can't compete with the industry standard alternatives - unless of course you're a Haskell expert and can program everything yourself...

Re: Why I went from Python to Go (and not node.js)

#165
post #92

Earlier quoted context omitted.

After you've learned both, maybe. But that is beside the point. Haskell is more difficult to learn.

Probably not if that's what you start with. Carnegie Mellon now starts all CS students with ML, I believe. For those of us who learned to program in an imperative language first, the difficulty with learning functional programming is unlearning all of our bad habits.

At my college (www.ii.uib.no) they've restructured the "programming paradigms" course (basic compiler/language theory) from using Standard ML to using Haskell for the strongly typed functional bit. While I appreciate being forced to 'learn' Haksell -- I found Standard ML much easier than Haskell. I did manage to implement a small language for calculating numbers in both, in the end.

Re: Why I went from Python to Go (and not node.js)

#166
post #133
post #17

Earlier quoted context omitted.

Idiomatic Go: http://golang.org/doc/effective_go.html Idiomatic Python: http://python.net/~goodger/projects/pycon/2007/idiomatic/han... (doesn't cover a number of important things) When comparing the two, I'm not impressed with Go.

What makes you unimpressed? Why do you think that Python clearly wins? Do you think that the additional type safety, namespace safety, and ease of concurrency in Go are worth nothing? Or do you just think that Python has more that outweigh that? I know that I frequently kick myself in Python when I typo a name somewhere, and everything dies far beyond where I made the mistake because it goes along happily storing som…

This is what linting tools like pyflakes are for. Running it as a prerequisite to running the test suite means that I don't have to run all my tests just to find out that I misspelled a variable name.

Re: Why I went from Python to Go (and not node.js)

#167

Earlier quoted context omitted.

Sounds like a variation on George Carlin's line that everyone who drives slower than me is stupid and everyone who drives faster is crazy.

Wasn't it asshole/maniac?

It was idiot/maniac... one of the few times George opted for a repeatable joke to children.

Re: Why I went from Python to Go (and not node.js)

#168
post #27

Earlier quoted context omitted.

You're digging in. > Haskell I would argue against being an industry language FYI, the problems the Haskell community has been working on are things like scalability, performance and safety because they're critical to industrial problems . Toy approaches don't work at the scale we operate at -- you need real computer science. You want 1,000,000 Haskell threads in your app? You've got it. Want to write numerical model…

I too share the perception that Haskell is not an "industry language" although I play around with it in my free time and like it. I'd be interested to know if there are any really competitive i.e. not experimental or mediocre software packages for Haskell out there. For example, is there a server written in Haskell that can compare to nginx or apache? Anything like a MySQL, CouchDB, or Redis? What about web developme…

There are thousands packages on Hackage, http://hackage.haskell.org

Widely used web servers include http://snapframework.com/ and http://www.yesodweb.com/. There are widely available numbers and reviews of these systems. A new book by O'Reilly covers Yesod (http://www.yesodweb.com/book)

Re: Why I went from Python to Go (and not node.js)

#169
post #140

I keep hearing about go. I am new-ish to programming. Only really getting started on my first project, which depends on pyparsing, which depends on other things. Is go something a novice should be attacking real-world problems with?

it depends on what your goal is. A language is just one tool in your toolset. I love using Go very much, but I would recommend learning on Python. There's much more literature out there, more people you know will know it, and if you are looking for work, there are effectively zero entry-level programming jobs in Go. The reason you keep hearing about Go is that it just very recently hit its 1.0 release, so it it a com…

> People you know will know it

Actually, not without going out and meeting new people. I'm a physician, so meeting anyone who knows anything about IT is quite challenging. And the helpdesk folks at the hospital usually aren't in the mood to troubleshoot those kinds of errors!

Re: Why I went from Python to Go (and not node.js)

#170
post #142
post #68

Earlier quoted context omitted.

This is a very good example of the type of thing I'm talking about. Nobody prompted you to do so, but you gracefully handled the case of a DNS failure in your code, because the control path was obvious throughout. Go makes this type of error handling a topic very early on in the literature. I find this type of clarity when structuring concurrent code to be very helpful in minimizing subtle concurrency bugs.

On error handling in Go vs. Python: Lack of exceptions means the deeper the call stack the higher the proportion of error handling code relative to a normal (non-exceptional) code path. For example, if you decide to refactor some code from a bigger function into its own smaller function then all error handling code have to be repeated twice (first in the child function then in the parent that calls it). It introduces…

I was initially of the same opinion, but with time I came to understand that Go's error handling system is like vegetables; unpalatable, but good for you. Go's error handling works very well in practice, and my programs exhibit little to no unexpected behavior.
Post reply on HN