Google de­vel­ops Grumpy to trans­late Python code into Go pro­grams

OpenSource For You - - Foss Bytes -

With a view to over­com­ing some ma­jor lim­i­ta­tions of Python, Google has brought out its transcom­pil­ing tool called Grumpy. The new open source project is de­signed to trans­late Python code into Go pro­grams to ad­dress the con­cur­rency is­sue, and run the tran­spiled pro­grams seam­lessly within the Go run­time.

Google’s YouTube and var­i­ous YouTube APIs are the finest ex­am­ple of Python-based so­lu­tions by the com­pany. The front-end of YouTube runs on

CPython 2.7. Though the high-level pro­gram­ming lan­guage brought about fruit­ful re­sults to the video stream­ing web­site, it was re­strict­ing the achieve­ments on con­cur­rent work­loads. This led to the de­mand for an al­ter­na­tive run­time that was op­ti­mised for real-time serv­ing, and ul­ti­mately took the shape of Grumpy.

“We are ex­cited about the prospects for Grumpy. Although it is still al­pha soft­ware, most of the lan­guage con­structs and many core built-in types work like you would ex­pect,” YouTube en­gi­neer Dy­lan Trotter wrote in a blog post.

The al­pha state of Grumpy lim­its its us­age. The tool does not have sup­port for C ex­ten­sion mod­ules and is not op­er­a­ble as an in­ter­preter. How­ever, it uses Go’s garbage col­lec­tion for ob­ject life­time man­age­ment and has the po­ten­tial to scale more smoothly over Cpython.

Google does not seem set to leave Python at this mo­ment. In­stead, Grumpy is be­ing backed to bring out a model of ‘Python in Go’ and en­able in­ter­op­er­abil­ity in its ma­jor Python de­vel­op­ments.

In the near fu­ture, Google is ex­pected to im­prove Grumpy and will soon con­vert some of its ma­jor Python code into a Go pro­gram us­ing the lat­est model. The present re­lease has some ar­eas for im­prove­ment around built-in types and func­tions. Also, the hy­brid ap­proach is yet to be sup­ported by a large num­ber of Python de­vel­op­ers.

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.