{"id":13416701,"url":"https://github.com/goplus/gop","last_synced_at":"2025-05-14T22:02:41.031Z","repository":{"id":37012078,"uuid":"47859258","full_name":"goplus/gop","owner":"goplus","description":"The Go+ programming language is designed for engineering, STEM education, and data science. Our vision is to enable everyone to become a builder of the world.","archived":false,"fork":false,"pushed_at":"2025-05-07T18:06:42.000Z","size":24932,"stargazers_count":9170,"open_issues_count":43,"forks_count":552,"subscribers_count":177,"default_branch":"main","last_synced_at":"2025-05-07T21:12:10.439Z","etag":null,"topics":["data-science","engineering","golang","gop","goplus","low-code","programming-language","scientific-computing","stem","stem-education"],"latest_commit_sha":null,"homepage":"https://goplus.org","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goplus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-12-12T01:21:39.000Z","updated_at":"2025-05-07T16:13:10.000Z","dependencies_parsed_at":"2023-07-13T07:17:39.275Z","dependency_job_id":"5b69cd6e-57d9-4e30-8eb5-ae92c6651f3c","html_url":"https://github.com/goplus/gop","commit_stats":{"total_commits":3020,"total_committers":43,"mean_commits":70.23255813953489,"dds":0.5201986754966887,"last_synced_commit":"0d9105af2308e9bd23506aacb24439e9cebd4d11"},"previous_names":["qiniu/goplus","qiniu/qlang","goplus/goplus"],"tags_count":148,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goplus%2Fgop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goplus%2Fgop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goplus%2Fgop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goplus%2Fgop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goplus","download_url":"https://codeload.github.com/goplus/gop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235685,"owners_count":22036962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","engineering","golang","gop","goplus","low-code","programming-language","scientific-computing","stem","stem-education"],"created_at":"2024-07-30T22:00:20.415Z","updated_at":"2025-05-14T22:02:36.016Z","avatar_url":"https://github.com/goplus.png","language":"Go","funding_links":[],"categories":["Popular","Go","HarmonyOS","开源类库","Uncategorized","Open source library","Golang"],"sub_categories":["Windows Manager","编译器","Uncategorized","Translator"],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\n    \u003cimg width=\"80\" src=\"https://goplus.org/favicon.svg\"\u003e\n\u003c/p\u003e\n\u003ch1\u003eThe Go+ Programming Language\u003c/h1\u003e\n\n[goplus.org](https://goplus.org) | [Docs](doc/docs.md) | [Go+ vs. Go](doc/goplus-vs-go.md) | [Tutorials](https://tutorial.goplus.org/) | [Playground](https://play.goplus.org) | [Go+ REPL (iGo+)](https://repl.goplus.org/) | [Contributing \u0026 compiler design](doc/contributing.md)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003c!--\n[![VSCode](https://img.shields.io/badge/vscode-Go+-teal.svg)](https://github.com/gopcode/vscode-goplus)\n[![Discord](https://img.shields.io/discord/983646982100897802?label=Discord\u0026logo=discord\u0026logoColor=white)](https://discord.gg/mYjWCJDcAr)\n[![Interpreter](https://img.shields.io/badge/interpreter-iGo+-seagreen.svg)](https://github.com/goplus/igop)\n--\u003e\n\n[![Build Status](https://github.com/goplus/gop/actions/workflows/go.yml/badge.svg)](https://github.com/goplus/gop/actions/workflows/go.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/goplus/gop)](https://goreportcard.com/report/github.com/goplus/gop)\n[![Coverage Status](https://codecov.io/gh/goplus/gop/branch/main/graph/badge.svg)](https://codecov.io/gh/goplus/gop)\n[![GitHub release](https://img.shields.io/github/v/tag/goplus/gop.svg?label=release)](https://github.com/goplus/gop/releases)\n[![Discord](https://img.shields.io/badge/Discord-online-success.svg?logo=discord\u0026logoColor=white)](https://discord.com/invite/mYjWCJDcAr)\n\n\u003c/div\u003e\n\nOur vision is to **enable everyone to become a builder of the world**.\n\n#### Easy to learn\n\n* Simple and easy to understand\n* Smaller syntax set than Python in best practices\n\n#### Ready for large projects\n\n* Derived from Go and easy to build large projects from its good engineering foundation\n\nThe Go+ programming language is designed for engineering, STEM education, and data science.\n\n* **For engineering**: working in the simplest language that can be mastered by children.\n* **For STEM education**: studying an engineering language that can be used for work in the future.\n* **For data science**: communicating with engineers in the same language.\n\nFor more details, see [Quick Start](doc/docs.md).\n\n\n## Key Features of Go+\n\n* Approaching natural language expression and intuitive (see [How Go+ simplifies Go's expressions](#how-go-simplifies-gos-expressions)).\n* Smallest but Turing-complete syntax set in best practices (see [The Go+ Mini Specification](doc/spec-mini.md)).\n* Fully compatible with [Go](https://github.com/golang/go) and can mix Go/Go+ code in the same package (see [The Go+ Full Specification](doc/spec.md) and [Go/Go+ Hybrid Programming](doc/docs.md#gogo-hybrid-programming)).\n* Integrating with the C ecosystem including Python and providing limitless possibilities based on [LLGo](https://github.com/goplus/llgo) (see [Importing C/C++ and Python libraries](#importing-cc-and-python-libraries)).\n* Does not support DSL (Domain-Specific Languages), but supports SDF (Specific Domain Friendliness) (see [Go+ Classfiles](#go-classfiles) and [Domain Text Literal](doc/domian-text-lit.md)).\n\n\n## How Go+ simplifies Go's expressions\n\nDifferent from the function call style of most languages, Go+ recommends command style code:\n\n```coffee\nprintln \"Hello world\"\n```\n\nTo emphasize our preference for command style, we introduce `echo` as an alias for `println`:\n\n```coffee\necho \"Hello world\"\n```\n\nFor more discussion on coding style, see https://tutorial.goplus.org/hello-world.\n\nCode style is just the first step. We have made many efforts to make the code more intuitive and closer to natural language expression. These include:\n\n| Go code | Go+ code | Note |\n| ---- | ---- | ---- |\n| package main\u003cbr\u003e\u003cbr\u003eimport \"fmt\"\u003cbr\u003e\u003cbr\u003efunc main() {\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;fmt.Println(\"Hi\")\u003cbr\u003e} | import \"fmt\"\u003cbr\u003e\u003cbr\u003efmt.Println(\"Hi\")\u003cbr\u003e | Program structure: Go+ allows omitting `package main` and `func main` |\n| fmt.Println(\"Hi\") | echo(\"Hi\") | More builtin functions: It simplifies the expression of the most common tasks |\n| fmt.Println(\"Hi\") | echo \"Hi\" | Command-line style code: It reduces the number of parentheses in the code as much as possible, making it closer to natural language |\n| a := []int{1, 2, 3} | a := [1, 2, 3] | List literals |\n| a = append(a, 4)\u003cbr\u003ea = append(a, 5, 6, 7) | a \u003c- 4\u003cbr\u003ea \u003c- 5, 6, 7 | Append values to a list |\n| a := map[string]int{\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"Monday\": 1,\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"Tuesday\": 2,\u003cbr\u003e} | a := {\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"Monday\": 1,\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"Tuesday\": 2,\u003cbr\u003e} | Mapping literals |\n| OnStart(func() {\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;...\u003cbr\u003e}) | onStart =\u003e {\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;...\u003cbr\u003e} | Lambda expressions |\n| type Rect struct {\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Width\u0026nbsp; float64\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Height float64\u003cbr\u003e}\u003cbr\u003e\u003cbr\u003efunc (this *Rect) Area() float64 { \u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;return this.Width * this.Height\u003cbr\u003e} | var (\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Width\u0026nbsp; float64\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Height float64\u003cbr\u003e)\u003cbr\u003e\u003cbr\u003efunc Area() float64 { \u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;return Width * Height\u003cbr\u003e} | [Go+ Classfiles](doc/classfile.md): We can express OOP with global variables and functions. |\n\nFor more details, see [The Go+ Mini Specification](doc/spec-mini.md).\n\n\n## Importing C/C++ and Python libraries\n\nGo+ can choose different Go compilers as its underlying support. Currently known supported Go compilers include:\n\n* [go](https://go.dev/) (The official Go compiler supported by Google)\n* [llgo](https://github.com/goplus/llgo) (The Go compiler supported by the Go+ team)\n* [tinygo](https://tinygo.org/) (A Go compiler for small places)\n\nCurrently, Go+ defaults to using [go](https://go.dev/) as its underlying support, but in the future, it will be [llgo](https://github.com/goplus/llgo).\n\nLLGo is a Go compiler based on [LLVM](https://llvm.org/) in order to better integrate Go with the C ecosystem including Python. It aims to expand the boundaries of Go/Go+, providing limitless possibilities such as:\n\n* Game development\n* AI and data science\n* WebAssembly\n* Embedded development\n* ...\n\nIf you wish to use [llgo](https://github.com/goplus/llgo), specify the `-llgo` flag when initializing a Go+ module:\n\n```sh\ngop mod init -llgo YourModulePath\n```\n\nThis will generate a `go.mod` file with the following contents (It may vary slightly depending on the versions of local Go+ and LLGo):\n\n```go\nmodule YourModulePath\n\ngo 1.21 // llgo 1.0\n\nrequire github.com/goplus/lib v0.2.0\n```\n\nBased on LLGo, Go+ can import libraries written in C/C++ and Python.\n\nHere is an example (see [chello](demo/_llgo/chello/hello.gop)) of printing `Hello world` using C's `printf`:\n\n```go\nimport \"c\"\n\nc.printf c\"Hello world\\n\"\n```\n\nHere, `c\"Hello world\\n\"` is a syntax supported by Go+, representing a null-terminated C-style string.\n\nTo run this example, you can:\n\n```sh\ncd YourModulePath  # set work directory to your module\ngop mod tidy       # for generating go.sum file\ngop run .\n```\n\nAnd here is an example (see [pyhello](demo/_llgo/pyhello/hello.gop)) of printing `Hello world` using Python's `print`:\n\n```go\nimport \"py/std\"\n\nstd.print py\"Hello world\"\n```\n\nHere, `py\"Hello world\"` is a syntax supported by Go+, representing a Python string.\n\nHere are more examples of Go+ calling C/C++ and Python libraries:\n\n* [pytensor](demo/_llgo/pytensor/tensor.gop): a simple demo using [py/torch](https://pkg.go.dev/github.com/goplus/lib/py/torch)\n* [tetris](demo/_llgo/tetris/tetris.gop): a tetris game based on [c/raylib](https://pkg.go.dev/github.com/goplus/lib/c/raylib)\n* [sqlitedemo](demo/_llgo/sqlitedemo/sqlitedemo.gop): a demo using [c/sqlite](https://pkg.go.dev/github.com/goplus/lib/c/sqlite)\n\nTo find out more about LLGo/Go+'s support for C/C++ and Python in detail, please refer to homepage of [llgo](https://github.com/goplus/llgo).\n\n\n## Go+ Classfiles\n\n```\nOne language can change the whole world.\nGo+ is a \"DSL\" for all domains.\n```\n\nRob Pike once said that if he could only introduce one feature to Go, he would choose `interface` instead of `goroutine`. `classfile` (and `class framework`) is as important to Go+ as `interface` is to Go.\n\nIn the design philosophy of Go+, we do not recommend `DSL` (Domain Specific Language). But `SDF` (Specific Domain Friendliness) is very important. The Go+ philosophy about `SDF` is:\n\n```\nDon't define a language for specific domain.\nAbstract domain knowledge for it.\n```\n\nGo+ introduces `classfile` and `class framework` to abstract domain knowledge.\n\n* [What's Classfile?](doc/classfile.md#whats-classfile)\n* [Dive into Go+ Classfiles](doc/classfile.md)\n\nSound a bit abstract? Let's see some Go+ class frameworks.\n\n* STEM Education: [spx: A Go+ 2D Game Engine](https://github.com/goplus/spx)\n* AI Programming: [mcp: A Go+ implementation of the Model Context Protocol (MCP)](https://github.com/goplus/mcp)\n* AI Programming: [mcptest: A Go+ MCP Test Framework](https://github.com/goplus/mcp/tree/main/mtest)\n* Web Programming: [yap: Yet Another HTTP Web Framework](https://github.com/goplus/yap)\n* Web Programming: [yaptest: A Go+ HTTP Test Framework](https://github.com/goplus/yap/tree/main/ytest)\n* Web Programming: [ydb: A Go+ Database Framework](https://github.com/goplus/yap/tree/main/ydb)\n* CLI Programming: [cobra: A Commander for modern Go+ CLI interactions](https://github.com/goplus/cobra)\n* CLI Programming: [gsh: An alternative to write shell scripts](https://github.com/qiniu/x/tree/main/gsh)\n* Unit Test: [test: Unit Test](doc/classfile.md#class-framework-unit-test)\n\n\n### yap: Yet Another HTTP Web Framework\n\nThis classfile has the file suffix `.yap`.\n\nCreate a file named [get.yap](https://github.com/goplus/yap/blob/main/demo/classfile2_hello/get.yap) with the following content:\n\n```go\nhtml `\u003chtml\u003e\u003cbody\u003eHello, YAP!\u003c/body\u003e\u003c/html\u003e`\n```\n\nExecute the following commands:\n\n```sh\ngop mod init hello\ngop get github.com/goplus/yap@latest\ngop mod tidy\ngop run .\n```\n\nA simplest web program is running now. At this time, if you visit http://localhost:8080, you will get:\n\n```\nHello, YAP!\n```\n\nYAP uses filenames to define routes. `get.yap`'s route is `get \"/\"` (GET homepage), and `get_p_#id.yap`'s route is `get \"/p/:id\"` (In fact, the filename can also be `get_p_:id.yap`, but it is not recommended because `:` is not allowed to exist in filenames under Windows).\n\nLet's create a file named [get_p_#id.yap](https://github.com/goplus/yap/blob/main/demo/classfile2_hello/get_p_%23id.yap) with the following content:\n\n```coffee\njson {\n\t\"id\": ${id},\n}\n```\n\nExecute `gop run .` and visit http://localhost:8080/p/123, you will get:\n\n```\n{\"id\": \"123\"}\n```\n\nSee [yap: Yet Another HTTP Web Framework](https://github.com/goplus/yap) for more details.\n\n\n### spx: A Go+ 2D Game Engine\n\n![Screen Shot1](https://github.com/goplus/spx/blob/main/tutorial/01-Weather/1.jpg) ![Screen Shot2](https://github.com/goplus/spx/blob/main/tutorial/01-Weather/2.jpg)\n\nThrough this example you can learn how to implement dialogues between multiple actors.\n\nHere are some codes in [Kai.spx](https://github.com/goplus/spx/blob/main/tutorial/01-Weather/Kai.spx):\n\n```coffee\nonStart =\u003e {\n\tsay \"Where do you come from?\", 2\n\tbroadcast \"1\"\n}\n\nonMsg \"2\", =\u003e {\n\tsay \"What's the climate like in your country?\", 3\n\tbroadcast \"3\"\n}\n```\n\nWe call `onStart` and `onMsg` to listen events. `onStart` is called when the program is started. And `onMsg` is called when someone calls `broadcast` to broadcast a message.\n\nWhen the program starts, Kai says `Where do you come from?`, and then broadcasts the message `1`. Who will recieve this message? Let's see codes in [Jaime.spx](https://github.com/goplus/spx/blob/main/tutorial/01-Weather/Jaime.spx):\n\n```coffee\nonMsg \"1\", =\u003e {\n\tsay \"I come from England.\", 2\n\tbroadcast \"2\"\n}\n```\n\nYes, Jaime recieves the message `1` and says `I come from England.`. Then he broadcasts the message `2`. Kai recieves it and says `What's the climate like in your country?`.\n\nThe following procedures are very similar. In this way you can implement dialogues between multiple actors.\n\nSee [spx: A Go+ 2D Game Engine](https://github.com/goplus/spx) for more details.\n\n\n### gsh: Go+ DevOps Tools\n\nYes, now you can write `shell script` in Go+. It supports all shell commands.\n\nLet's create a file named [example.gsh](https://github.com/qiniu/x/blob/main/gsh/demo/hello/example.gsh) and write the following code:\n\n```coffee\nmkdir \"testgsh\"\n```\n\nDon't need a `go.mod` file, just enter `gop run ./example.gsh` directly to run.\n\nSee [gsh: Go+ DevOps Tools](https://github.com/qiniu/x/tree/main/gsh) for more details.\n\n\n## How to install\n\nNote: Requires go1.19 or later\n\n### on Windows\n\n```sh\nwinget install goplus.gop\n```\n\n### on Debian/Ubuntu\n\n```sh\nsudo bash -c ' echo \"deb [trusted=yes] https://pkgs.goplus.org/apt/ /\" \u003e /etc/apt/sources.list.d/goplus.list'\nsudo apt update\nsudo apt install gop\n```\n\n### on RedHat/CentOS/Fedora\n\n```sh\nsudo bash -c 'echo -e \"[goplus]\\nname=Go+ Repo\\nbaseurl=https://pkgs.goplus.org/yum/\\nenabled=1\\ngpgcheck=0\" \u003e /etc/yum.repos.d/goplus.repo'\nsudo yum install gop\n```\n\n### on macOS/Linux (Homebrew)\n\nInstall via [brew](https://brew.sh/)\n\n```sh\n$ brew install goplus\n```\n\n### from source code\n\n```bash\ngit clone https://github.com/goplus/gop.git\ncd gop\n\n# On mac/linux run:\n./all.bash\n# On Windows run:\nall.bat\n```\n\n## Go+ Applications\n\n### 2D Games powered by Go+\n\n* [A Go+ 2D Game Engine for STEM education](https://github.com/goplus/spx)\n* [Aircraft War](https://github.com/goplus/AircraftWar)\n* [Flappy Bird](https://github.com/goplus/FlappyCalf)\n* [Maze Play](https://github.com/goplus/MazePlay)\n* [BetaGo](https://github.com/xushiwei/BetaGo)\n* [Gobang](https://github.com/xushiwei/Gobang)\n* [Dinosaur](https://github.com/xushiwei/Dinosaur)\n\n### Web Programming\n\n* [yap: Yet Another HTTP Web Framework](https://github.com/goplus/yap)\n* [yaptest: HTTP Test Framework](https://github.com/goplus/yap/tree/main/ytest)\n* [ydb: Database Framework](https://github.com/goplus/yap#ydb-database-framework)\n\n### DevOps Tools\n\n* [gsh: Go+ DevOps Tools](https://github.com/qiniu/x/tree/main/gsh)\n\n### Data Processing\n\n* [hdq: HTML DOM Query Language for Go+](https://github.com/goplus/hdq)\n\n\n## IDE Plugins\n\n* vscode: [Go/Go+ for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=goplus.gop)\n\n\n## Contributing\n\nThe Go+ project welcomes all contributors. We appreciate your help!\n\nFor more details, see [Contributing \u0026 compiler design](doc/contributing.md).\n\n\n## Give a Star! ⭐\n\nIf you like or are using Go+ to learn or start your projects, please give it a star. Thanks!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoplus%2Fgop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoplus%2Fgop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoplus%2Fgop/lists"}