Write Go programs using your native language keywords, compiled by the official Go toolchain.
PolyGo is a multilingual Go language layer, not a Go fork.
- Go 1.25+
- Linux / macOS / Windows
go versiongo install github.com/newmizanur/poly-go/cmd/pgo@latestVerify:
pgo versionPolyGo supports multiple languages via keyword maps. Choose one and try:
Create a project:
mkdir hello-polygo
cd hello-polygo
go mod init hello-polygoCreate main.p.go:
প্যাকেজ main
আমদানি "fmt"
ফাংশন main() {
fmt.Println("হ্যালো PolyGo 👋")
}Run:
pgo run --lang=bn .Output:
হ্যালো PolyGo 👋
Create main.p.go:
paquete main
importar "fmt"
funcion main() {
fmt.Println("Hola PolyGo 👋")
}Run:
pgo run --lang=es .パッケージ main
インポート "fmt"
関数 main() {
fmt.Println("こんにちは PolyGo 👋")
}包 main
导入 "fmt"
函数 main() {
fmt.Println("你好 PolyGo 👋")
}For full examples, see the examples/ folder.
- Always run PolyGo from the project root
- You can mix:
.go(normal Go).p.go
pgo set bn
pgo run --lang=jp ./examples/jp.p.gopgo gen # generate Go files
pgo run . # generate + run
pgo test ./... # generate + test
pgo build . # generate + build
pgo clean # remove .pgo_genPolyGo is language-agnostic. Each language is defined by a JSON map:
bn.json → Bangla
es.json → Spanish
jp.json → Japanese
zh.json → Chinese
You can add your own language by creating a new map and example. Please open a pull request with:
lang/<locale>.jsonexamples/<locale>.p.go
Or fork and maintain your own language pack.
If a keyword conflicts with a variable name:
@型 := "this is a variable"
fmt.Println(型)@ means “do not treat this as a keyword”.
Marketplace:
https://marketplace.visualstudio.com/items?itemName=mizanur.polygo-vscode
Dev mode:
code --extensionDevelopmentPath ./vscode-extensionVSIX install:
cd vscode-extension
npm install
npm run compile
npm i -g @vscode/vsce
vsce package
code --install-extension polygo-vscode-0.0.1.vsixMIT (see LICENSE).