https://github.com/oxfeeefeee/goscript Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} oxfeeefeee / goscript Public * Notifications * Star 414 * Fork 14 Go specs implemented as a scripting language in Rust. View license 414 stars 14 forks Star Notifications * Code * Issues 0 * Pull requests 2 * Actions * Projects 1 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code Latest commit @oxfeeefeee oxfeeefeee Update README.md ... 7e989d7 Sep 18, 2021 Update README.md 7e989d7 Git stats * 403 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time codegen "break" for "select" stmt Sep 18, 2021 engine test case Sep 18, 2021 parser fix parser of select stmt Sep 17, 2021 types clean up Sep 2, 2021 vm fix 'default' for 'select' stmt Sep 18, 2021 .gitignore hash Dec 21, 2020 Cargo.toml engine project Nov 19, 2020 LICENSE type checker finished Aug 14, 2020 README.md Update README.md Sep 18, 2021 View code [ ] Goscript The Goal How do I try Use Cases Rationale Implementation Progress Get in touch README.md Goscript A script language like Python or Lua written in Rust, with exactly the same syntax as Go's. The Goal * Runs most pure Go code, probably add some dynamic features if requested. How do I try The project "engine" is the entry/wrapper. there are test cases in here to browse through. * Make sure your Rust installation is up to date. * Clone this repository. * Go to goscript/engine * Run cargo test -- --nocapture Use Cases * As an embedded language like Lua. * As a glue language like Python. Rationale * A scripting language that can be embedded in Rust. * Go is popular and easy(even as a scripting language), why invent new grammars? * In some cases, when your project gets big: + If Go were an embedded language it would be better than Lua. + If Go were a glue language it would be better than Python, in terms of project maintainability. * I found a new hammer(Rust) that I like, and decided to use it on a nail(Go) that I like. Implementation * There are five projects: + parser -- a port of the official implementation that comes with the Go installer. + type checker -- a port of the official implementation that comes with the Go installer. + codegen -- generates the bytecode. + vm -- runs the bytecode. + engine -- the wrapper. Progress * Language: Feature complete (except the features that are so insignificant that I forgot -_-) Some of the features are, probably for the first time, implemented in a script language, like Select/Defer/Pointer/Interface/Struct. * Standard library: just got started. * Production readiness: far from. The parser and the type checker are probably ok because they were ported and passes the test cases comes with the original code. The backend has a lot of rough edges, and we need much more test cases. * Next step: no new features for now, polish then work on the standard library. Get in touch * email: pb01005051 at Gmail. * wechat: oxfeeefeee About Go specs implemented as a scripting language in Rust. Topics python rust golang parser vm lua scripting-language programing-language Resources Readme License View license Releases No releases published Packages 0 No packages published Contributors 3 * @oxfeeefeee oxfeeefeee * @MakotoE MakotoE Makoto * @NNBnh NNBnh NNB Languages * Rust 93.6% * Go 6.4% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.