goplus /xgo

XGo is a programming language that reads like plain English. But it's also incredibly powerful — it lets you leverage assets from C/C++, Go, Python, and JavaScript/TypeScript, creating a unified software engineering ecosystem. Our vision is to enable everyone to become a builder of the world.

★ 9,494⑂ 566👁 163⑃ 2,245● 646▤ 140
GoApache-2.0Created 2015-12-12xgo.dev
下载:v1.7.5v1.7.5 ↓1.7.52026-07-22
+0
日增长
9,494
stars
566
forks
163
watchers
2,245
prs
646
issues
140
releases

README

The XGo Programming Language


xgo.dev | Docs | XGo vs. Go | Tutorials | Playground | XGo REPL (iXGo) | Contributing & compiler design












XGo is a programming language that reads like plain English. But it's also incredibly powerful — it lets you leverage assets from C/C++, Go, Python, and JavaScript/TypeScript, creating a unified software engineering ecosystem.


XGo := C  Go  Python  JavaScript + Scratch


Our vision is to enable everyone to become a builder of the world.

 Easy to learn

 Simple and easy to understand
 Smaller syntax set than Go and Python in best practices

 Ready for large projects

 Integrate C/C++, Go, Python, and JavaScript/TypeScript into a unified ecosystem
 Derived from Go and easy to build large projects from its good engineering foundation

The XGo programming language is designed for engineering, STEM education, and data science.

 For engineering: working in the simplest language that can be mastered by children.
 For STEM education: studying an engineering language that can be used for work in the future.
 For data science: communicating with engineers in the same language.

For more details, see Quick Start.


 Key Features of XGo

 Approaching natural language expression and intuitive (see How XGo simplifies Go's expressions).
 Smallest but Turing-complete syntax set in best practices (see The XGo Mini Specification).
 Fully compatible with Go and can mix Go/XGo code in the same package (see The XGo Full Specification and Go/XGo Hybrid Programming).
 Integrating with the C ecosystem including Python/JavaScript and providing limitless possibilities based on LLGo (see Importing C/C++ and Python libraries).
 Does not support DSL (Domain-Specific Languages), but supports SDF (Specific Domain Friendliness) (see XGo Classfiles and Domain Text Literals).


 How XGo simplifies Go's expressions

Different from the function call style of most languages, XGo recommends command style code:

coffee
println "Hello world"


To emphasize our preference for command style, we introduce echo as an alias for println:

coffee
echo "Hello world"


For more discussion on coding style, see https://tutorial.xgo.dev/hello-world.

Code 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:

| Go code | XGo code | Note |
| ---- | ---- | ---- |
| package mainimport "fmt"func main() {    fmt.Println("Hi")} | import "fmt"fmt.Println("Hi") | Program structure: XGo allows omitting package main and func main |
| fmt.Println("Hi") | echo("Hi") | More builtin functions: It simplifies the expression of the most common tasks |
| 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 |
| name := "Ken"fmt.Printf(  "Hi %s\n", name) | name := "Ken"echo "Hi ${name}" | Goodbye printf, use ${expr} in string literals |
| a

Top issues

Discussions

Latest release

v1.7.5 v1.7.5 2026-07-22
What's Changed

feature enum type:
 cl compileType: support enum type decl in func by @xushiwei in https://github.com/goplus/xgo/pull/2782
 cl loadConsts: if not untyped, convert value to the enum type by @xushiwei in https://github.com/goplus/xgo/pull/2784
 cl: allow same names across different enum types (2787) by @xushiwei in https://github.com/goplus/xgo/pull/2790

feature static member:
 ast: add ValueSpec.HasStatic (2513) by @xushiwei in https://github.com/goplus/xgo/pull/2785
 ast: mv methods by @xushiwei in https://github.com/goplus/xgo/pull/2789
 feat(syntax): add static val

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON