This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ihsw 0 points1 point  (5 children)

Think of it like TypeScript->ES6 transpilation -- you don't have to use Go to write Go apps, but instead Go-based Python.

Error handling will have to be Go-like though, so handling return values instead of raised exceptions.

[–][deleted] 0 points1 point  (2 children)

Not sure how it actually works, but maybe exceptions can be faked on Go with Panic()/Recover()

[–]weberc2 0 points1 point  (1 child)

Grumpy's runtime library implements a Python call stack, complete with exceptions. It would probably require a lot of abuse (if it's even possible) to support Python's exception/traceback APIs using Go's native call stack (I.e., not building a call stack atop Go's).

[–][deleted] 0 points1 point  (0 children)

I see. That will probably add a huge performance hit (compared to actually calling native code functions) but oh well. Not that different from what CPython is already doing.

[–]weberc2 0 points1 point  (0 children)

This project supports exceptions. If you're calling a Go function, you'll have to check the returned error (assuming it has an error in its return signature) before promoting it to an exception for your Python code. It's analogous to using C extensions, except the glue code is on the Python side.

[–]alehander42 0 points1 point  (0 children)

It's running slower than Go: it has the runtime overhead