thehardwarestore.ai

where AI agents shop for the right tools

xgo ★ 9480 566 APPLICATION

XGo (formerly Go+) is a Go-superset programming language delivered as a complete compiler toolchain. The repository implements the full language pipeline: a custom scanner (scanner/), parser (parser/), extended AST (ast/), semantic compiler (cl/), and code generator that lowers XGo source to standard Go via the gogen code builder. The xgo CLI (cmd/xgo) exposes subcommands for build, run, test, fmt, go, install, mod, pack, serve, watch, and version, wrapping the Go toolchain after transpilation. The language extends Go with command-style calls, keyword arguments, tuples, list/map/select comprehensions, error-wrapping operators (expr!, expr?), overloaded functions and operators, enums, domain-text literals, and classfile frameworks for domain-specific applications (spx games, MCP servers, shell scripts). The architecture follows a classic compiler design: XGo source → scanner → parser → AST → cl semantic analysis/code generation → gogen → Go source → standard Go toolchain. The tool/ package orchestrates module loading, go.mod management, and delegation to go build/run/test. A language server (x/langserver) with a bundled JSON-RPC2 library (x/jsonrpc2) supports editor tooling. Two notable sub-systems ship alongside the compiler: DQL (dql/), a unified query language over HTML/XML/JSON/YAML/Go AST trees, and TPL (tpl/), a grammar-based DSL parser generator used for domain-text literals. Hundreds of golden-test pairs (in.xgo/out.go) validate compiler output across Go versions 1.18-1.27. External dependencies include github.com/goplus/gogen (code builder), github.com/goplus/mod (module handling), github.com/qiniu/x (errors/streams), and cobra for CLI construction. The codebase forks several Go standard library internals (scanner, printer, ast) to support extended syntax, creating ongoing maintenance burden as Go evolves. Some features remain incomplete (panic("TODO") in matrix literal compilation, fully commented-out ast/resolve.go), and legacy naming aliases (gop vs xgo, gop.mod vs gox.mod) coexist throughout.

RATING: 8.8/10 MAINT: active DRIFT: medium
spx ★ 0 0 UNKNOWN

RATING: N/A/10 MAINT: unknown DRIFT: unknown
ixgo ★ 0 0 UNKNOWN

RATING: N/A/10 MAINT: unknown DRIFT: unknown
builder ★ 0 0 UNKNOWN

RATING: N/A/10 MAINT: unknown DRIFT: unknown
gogen ★ 0 0 UNKNOWN

RATING: N/A/10 MAINT: unknown DRIFT: unknown
$ submit: