News for hackers. Stuff that matters.
Re:Grumpy: Go running Python by tedmielczarek on Wednesday January 04, 2017 @03:00PM (#13321541)
Given the failure of their unladen-swallow work to make it into CPython, I think Google is probably tired of trying to make Python faster. Some of their stated goals with Go were to be a faster, compiled Python, so this makes a lot of sense for their use case. They face the choice of fixing all their existing Python code to run in Python 3 (which won't make anything faster), or just porting everything to a different language. They chose the latter, and this lets them incrementally convert Python code to Go. I don't know that this makes sense for anyone but Google, just like Hack probably doesn't make sense for most PHP development that's not at Facebook.
Re:Grumpy: Go running Python by derefr on Wednesday January 04, 2017 @03:59PM (#13321983)
> I don't know that this makes sense for anyone but Google

I'm not sure; as a Go developer, I kind of like the idea of having access to the Python library ecosystem from Go, without being forced to create an IPC bridge and building up the requisite release-management and deploy-time goop.

Plus, I'm just not a Python developer; in the case where the only library that exists to do something is written in Python, I'd much rather write Go that calls that Python library than Python that calls that Python library.

Re:Grumpy: Go running Python by SureshG on Wednesday January 04, 2017 @07:15PM (#13323474)
IIUC, it's not about accessing python libs from go. It's for accessing go libs from your python program and transpiling that python code to go source and compile it with go tool chains.

Eg: python code (from blog post)

  from __go__.net.http import ListenAndServe, RedirectHandler

  handler =  RedirectHandler('http://github.com/google/grumpy', 303)
  ListenAndServe('127.0.0.1:8080', handler)
Re:Grumpy: Go running Python by sfifs on Wednesday January 04, 2017 @11:46PM (#13324825)
sure but the reverse should be equally feasible. It's transpiling Python to Go, so theoretically we should be able to (eventually) "convert" Python libs to Go and call them from Go. A lot of utility libs are available in Python... the Go library ecosystem is relatively sparse
Re:Grumpy: Go running Python by golanggeek on Thursday January 05, 2017 @08:43AM (#13327010)
I'm not sure if it is already possible? Is it.
Re:Grumpy: Go running Python by kibwen on Wednesday January 04, 2017 @05:36PM (#13322765)
> I kind of like the idea of having access to the Python library ecosystem from Go

I'd like to see an example of this, because from the blog post I get the impression that this mostly allows accessing the Go ecosystem from Python, rather than the other way around. For example, how would Python classes be handled from Go?

Re:Grumpy: Go running Python by jwillp on Friday January 06, 2017 @03:04AM (#13334666)
embed a cpython interpreter into the Go runtime as an embedded interpreter?
Re:Grumpy: Go running Python by therein on Friday January 06, 2017 @05:58AM (#13335418)
Statically linked Python interpreter sounds pretty great to be honest.