Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Gsubpy, an interpreter for subset of Python, written in Go (github.com/realyixuan)
65 points by yi_xuan on April 21, 2023 | hide | past | favorite | 8 comments
Recently, I write an interpreter for subset of Python using Go. I haven't seen source code of CPython, all is just written according to my understanding of Python so there may be some unusual things. Hope you can play fun with it. Any suggestion is welcome, glad to get some feedback.


You might also want to take look at Starlark, which has a Go implementation: https://github.com/google/starlark-go



Same thing, different implementation language :)

Starlark is used in a number of production systems so there's good support.


It's such a small subset that it would more accurately be described as a scripting language with syntax similar to python for single file scripts.


For now, it's indeed too small subset, more features will be added later though, I want to make sure all the code that gsubpy can interprete can be intepreted by CPython. So, the a subset of Python is the most accurate name I can think of right now.


This is based on the interpreter-in-go book by thorsten ball, right? Might want to give a little credit there


Yeah, definitely I should, thanks remind me of this.


Another python implementation in golang:

https://github.com/go-python/gpython




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: