Live data from Hacker News

What Python developers need to know before migrating to Go

blog.repustate.com

11–20 of 117 posts

Re: What Python developers need to know before migrating to Go

#11
I can't help but feel like criticisms along the lines of "you have to be more precise with what you want, because unlike python it won't let you get away with blah" and praise like "it seems to run correctly as soon as it compiles" are two sides of the same coin.

Re: What Python developers need to know before migrating to Go

#12

I can't help but feel like criticisms along the lines of "you have to be more precise with what you want, because unlike python it won't let you get away with blah" and praise like "it seems to run correctly as soon as it compiles" are two sides of the same coin.

They are, for sure. The difference, I'd say, is that compared to most other mostly-static compiled languages, Go generally feels a bit more velvet glove about it, rather than iron fist. The language principle of warnings are errors really helps here, as you tend to figure out potential issues sooner rather than later, and via a clear error message rather than subtle misbehavior.

Re: What Python developers need to know before migrating to Go

#14

Any HN readers of this post have any similar experience? I know the bright team over at bit.ly made a successful switch from python to go-- anyone else? The more I hear about go, the more I like it.

I've been messing around with it for some internal infrastructure. I like it so far. Excellent performance characteristics, and the tooling is supremely good, making the dev workflow much less painful than traditional compiled languages.

Re: What Python developers need to know before migrating to Go

#15
post #8

>> No built-in type for sets (have to use maps and test for existence) Is there any particular reason for this? Sets are so fundamental to mathematics and beyond that I am concerned right away about this. Sure you could use a map as a replacement, but what happens to "user experience"? I do not get this for other languages as well. Data structures that are present in nearly all computer science books are often not bu…

In Java, sets are merely wrappers around a map that maps to a dummy. I guess Go just left off the wrapper.

Re: What Python developers need to know before migrating to Go

#16
post #8

>> No built-in type for sets (have to use maps and test for existence) Is there any particular reason for this? Sets are so fundamental to mathematics and beyond that I am concerned right away about this. Sure you could use a map as a replacement, but what happens to "user experience"? I do not get this for other languages as well. Data structures that are present in nearly all computer science books are often not bu…

Every possible way to represent a set is a very thin wrapper around an existing data structure that is commonly implemented. There isn't a generally applicable way to represent a set. All sets are simply existing structures (BitVectors, Linked Lists, BST, or HashTables) with functions like Union and Intersection being tacked on and all have very different performance considerations.

Basically there really isn't a general purpose way to make a set and it’s not a fundamental component of programming, it is a modified HashTables or what ever. So I argue sets don’t actually exist in CS because you can’t represent one as it exists mathematically. You are simply tacking union and intersect to an existing data structure.

Re: What Python developers need to know before migrating to Go

#17
post #8

>> No built-in type for sets (have to use maps and test for existence) Is there any particular reason for this? Sets are so fundamental to mathematics and beyond that I am concerned right away about this. Sure you could use a map as a replacement, but what happens to "user experience"? I do not get this for other languages as well. Data structures that are present in nearly all computer science books are often not bu…

The real reason is almost always "We didn't feel like it. So =P"

Re: What Python developers need to know before migrating to Go

#20
post #19

Has anyone tried to integrate Go with Python? Right now, optimizing Python code by replacing critical sections with C works really well and isn't too hard to write or distribute. How well would tooling around doing the same thing with Go work?

That won't help you much with concurrency problems, however "multiprocessing" does.
Post reply on HN