Slashdot Mirror


Google Boosts Python By Turning It Into Go (infoworld.com)

An anonymous reader quotes InfoWorld: Grumpy, an experimental project from Google, transpiles Python code into Go, allowing Python programs to be compiled and run as static binaries using the Go toolchain... In a blog post announcing the open source release, Google stated the project stemmed from its efforts to speed up the Python-powered front end for YouTube. But Google hit an obstacle that's familiar to folks who've deployed Python in production: It's hard to get CPython -- the default Python interpreter written in C -- to scale efficiently. "We think Grumpy has the potential to scale more gracefully than CPython for many real world workloads," writes Google...

Because it doesn't support C extensions, Grumpy doesn't have CPython's Global Interpreter Lock, which is commonly cited as a roadblock to running Python concurrent workloads smoothly. Grumpy also uses Go's garbage collection mechanisms to manage memory under the hood, instead of CPython's. Grumpy creates close interoperation between Python and Go by allowing Go packages to be imported and used with the same syntax as Go modules.

7 of 129 comments (clear)

  1. It's all just noise to me... by Anonymous Coward · · Score: 1, Insightful

    What are they talking about? Stop inventing new shit all the fucking time, and just fucking stick to what fucking works and is stable. You never let anything settle. You constantly crave change for the sake of change. Fuck off. Slow the fuck down. My Windows 10 hasn't even updated to Anniversary Edition yet, and there are already multiple major updates since. It's insanity. Stop changing everything. Go back to the UI of Windows 95 and start over from there. Stop making new programming languages. Stop doing all this stupid shit.

  2. Re: Except it doesn't work properly by Anonymous Coward · · Score: 0, Insightful

    Yeah, all those Java developers really got screwed as time went on.

    Go ahead and learn Go and all the other fad languages, and maybe one of them will actually be something a lot of employers are interested in. Or, you could wait and learn the winner, if there ever is one.

    If you know Java, C#, and any interpreted language you're fine. But go ahead, rewrite all your code into a fad language and see who's going to be able to maintain it in five years. Or is job security with a shitty dead language your plan?

  3. Re: Just another f***ing kludge to get around by CQDX · · Score: 4, Insightful

    A craftsman can write good code in any language.

    Everyone else writes crap in every language.

  4. Try JPython by aberglas · · Score: 4, Insightful

    It should use the Java JIT compiler to run much faster than any byte code interpreter.

    That said, I do not know why anybody would even think of using a programming language without static typing. Not for performance, but rather for sanity when writing and (more importantly) maintaining code. With type inference it costs virtually no extra typing.

  5. Re:Just another f***ing kludge to get around by johannesg · · Score: 2, Insightful

    Gee, scripting languages being good at quick and dirty, but then failing to deal with high loads. Who would have guessed.

  6. Re: Except it doesn't work properly by DrXym · · Score: 4, Insightful

    Go offers nothing that an established language can't already do. It'll die just because Google supports it...because Google has no issues with throwing away stuff as soon as they lose interest, no matter how many people are invested in it.

    Pretty much every established language can do the stuff the new languages do. It doesn't mean they do them well, or that they can't be improved upon or that we should simply live with the flaws in those languages even if they cause untold numbers of errors in production code. A simple example would be C and C++'s never ending supply of bugs related to dangling pointers, memory leaks etc., many of which are caused by inherent default choices in the language.

    While I don't program Go myself it clearly demonstrates a number of advantages for writing multi-threaded, high availability, high performance applications than some other languages. It compiles to a native standalone executable, it's portable, it has garbage collection, it doesn't carry the baggage of a runtime around with it. Performance wise it sits somewhere between C and Java. I've found tools written in Go such as Prometheus to be remarkably stable and reliable.

  7. Re: Except it doesn't work properly by Wrath0fb0b · · Score: 4, Insightful

    it has garbage collection, it doesn't carry the baggage of a runtime around with it

    Sigh. Of course it has a runtime. Where else would the garbage collection that you just mentioned be implemented? Or GoRoutines. Or reflection.

    I think you're confusing not having a runtime with having the Go compiler statically link the runtime into each executable. That has some benefits that you were alluding to (e.g. "no baggage") but it also has drawbacks such as increased executable size, increased memory usage (with a dynamic runtime, different instances all share the same library in memory), decreased cache usage (since if you have two Go executables, they are constantly evicting each others runtimes from cache, even though they are identical and could be shared) and the maintenance issues having to recompile to take advantage of security/bug/performance improvements in the runtime itself.

    I have no issue if you claim that in some (your) use cases the advantages of a statically compiled runtime are worth the disadvantages. But that's not the same as claiming that either the runtime doesn't exist or that it's always advantageous.