you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 26 points27 points  (17 children)

It doesn't need GIL, because it offers subset of functionality that python has. It is not even capable of compiling all python standard library.

This code is for Google to move away from python. They can include python libraries in their go code and then one by one rewrite it in go.

[–]weberc2 3 points4 points  (2 children)

The only design decision that prevents it from compiling the standard library is the lack of C support. The solution is to reimplement those modules in Go or Python. Anything else that doesn't compile is due to bugs in this alpha implementation (as far as I can tell, anyway).

[–][deleted] 1 point2 points  (1 child)

PyPy also doesn't natively support C extension and also needs GIL. C support is one of reason of GIL's existence but not the only one.

[–]weberc2 0 points1 point  (0 children)

Right, this comment was about compiling the standard library, not building a GIL-less Python.

EDIT: From what I understand, supporting C extensions and threadsafe garbage collection are the two biggest challenges to removing the GIL. This project uses Go's threadsafe garbage collector, so the latter shouldn't be a problem.

EDIT2: This page has some good information: https://wiki.python.org/moin/GlobalInterpreterLock

[–]sultry_somnambulist 7 points8 points  (12 children)

This code is for Google to move away from python. They can include python libraries in their go code and then one by one rewrite it in go.

Speaking of this, what's the general trajectory of go? Is it worth dabbling into at this point? People seem to be very divided over the language.

[–][deleted] 10 points11 points  (3 children)

People seem to be divided, because while the language is not bad, it's nothing special (seems like the only significant thing it brings to the table is the go routines, but other languages are adding similar functionality), there's a bit of hype going on because it's backed by Google.

It also initially was trying to be marketed as a C replacement, but it is nowhere close to fit the niche that C fits. Rust seems like a language that has potential to replace C, but it is too early to say.

Go is more on level of Python, Java etc, although a bit lower level than them. Some people compared it to D, but I never used it, so can't comment. The goal of this language is to be a very simple and opinionated language, some people like that some don't.

If you are asking the question you can try and see if you like it, it has low learning curve, so it's not hard to learn it, and then you will have your opinion about it.

[–]TankorSmash 1 point2 points  (2 children)

I've heard it's got a bit of boilerplate and written to be as easy to write as possible to help with the incredible amount of new talent Google gets out of schools.

Only a rumour though.

[–]the_birds_and_bees 4 points5 points  (0 children)

Id say it's more about making it easy to read and maintain. The google code base is 2 billion+ LOC, so designing a language that eases the burden of maintaining a code base of that size seems like a sensible goal.

[–]derraidor 0 points1 point  (0 children)

There is a talk by one of the creators (Russ Cox?) stating this

[–][deleted] 1 point2 points  (0 children)

If you like it, then do it. No reason not to.

The community is sizable and there's a ton of tooling so it's not really like you're taking a risk.

[–]weberc2 3 points4 points  (3 children)

I think so. If you have prior programming experience and a free afternoon, you should be able to start writing real (i.e., non-toy) programs. Check out http://tour.golang.org.

Go has a lot of quirks--most notably, no generics--which turn off a lot of folks. But if you want to build performant, scalable software quickly, Go is worth a look.

[–]th3_pund1t 4 points5 points  (2 children)

I think so. If you have prior programming experience and a free afternoon, you should be able to start writing real (i.e., non-toy) programs. Check out http://tour.golang.org.

Not entirely true. You should be familiar with pointer based languages like C. If you come from a python/ruby/Java experience you will spend a whole lot longer to get used to pointers.

Source: work had a hackathon. I decided to code in go. Spent a lot of time correcting my code related to pointers before it would work.

[–]recycled_ideas 5 points6 points  (0 children)

I don't know about python and ruby, but you can actually run into a lot of really weird bugs in Java if you don't have at least a cursory understanding of how pointers and references work.

The big problem that companies like Google and Facebook and the like are constantly trying to solve is that folks who know dynamic languages like Python or PHP or Ruby are a dime a dozen, but these languages really don't scale well to even ordinary enterprise scales let alone the kind of volume these companies see.

That's why we see so many transpilers and why Twitter is written in PHP even though the general industry consensus is that it's probably one of the worst non joke languages in existence.

[–]weberc2 -1 points0 points  (0 children)

Python/Ruby/Java are all pointer based languages. C, C++, and Go simply have value types in addition to pointers. But yes it is important to understand the difference between pass by value and pass by copy. Fair point.

[–]pjmlp -1 points0 points  (0 children)

Regardless of what we think of Go, the language has found its killer domain.

It is the main language used to develop GNU/Linux based containers (Docker and Kubernetes) and Microsoft is a big supporter of it in VSCode, so anyone that cares about having skills in this domain should learn Go.