5 ms·
Show HN: Gsubpy, an interpreter for subset of Python, written in Go
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.
- manfre 3y agoIt'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.
- yi_xuan 3y agoFor 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.
- wepple 3y agoThis is based on the interpreter-in-go book by thorsten ball, right? Might want to give a little credit there
- yi_xuan 3y agoYeah, definitely I should, thanks remind me of this.
- lima 3y agoYou might also want to take look at Starlark, which has a Go implementation: https://github.com/google/starlark-go https://github.com/google/starlark-go
- pineapple_sauce 3y agoNot sure how they compare, but: https://github.com/facebookexperimental/starlark-rust/ https://github.com/facebookexperimental/starlark-rust/
- lima 3y agoSame thing, different implementation language :) Starlark is used in a number of production systems so there's good support.
- samanator 3y agoAnother python implementation in golang: https://github.com/go-python/gpython https://github.com/go-python/gpython