Rayo (read as rah-YOH) is a readable, Python-inspired programming language that transpiles to Golang. It emphasizes null safety, error handling, and clean syntax for building reliable applications.
- Readability-first: Python-like syntax with curly braces for blocks.
- Null Safety: Single
Nonevalue, optionals, safe navigation. - Error Handling:
try/except/finallyblocks. - Dicts and Objects: Flexible data structures with attribute access.
- Transpilation: Generates buildable Go 1.22+ code.
- Precise Spec: Well-defined grammar and semantics.
Raza's Python-inspired Language that transpiles to Golang :P
One command:
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/razpinator/rayo/main/install.sh | shThis installs the latest release to ~/.local/bin (or /usr/local/bin if needed). Ensure that directory is in your PATH; the script will remind you if not.
Verify:
rayo versionrayo run examples/web/api.ryo(Optional) Transpile to Go manually:
rayo transpile examples/web/api.ryo -o output.go
go run output.go- Manual download: Get the right archive from Releases (e.g.
rayo_0.2.0_Linux_x86_64.tar.gz), extract, and moverayoandrayocto a directory in yourPATH. - From source: Clone the repo, then run
./install-from-source.sh(requires Go).
If you prefer to build manually:
-
Install dependencies:
go mod tidy
-
Build the CLI:
make build
-
Use the local binary:
./build/rayo run examples/web/api.ryo
rayo [command]
Available Commands:
lex Lex source file
parse Parse source file
check Check semantics
run Transpile and run
transpile Transpile to Go
Flags:
-I, --include stringSlice Include paths
-o, --output string Output directory
-v, --verbose Verbose output
--emit-go Emit Go codeSee /examples/ for a cookbook of 10+ examples covering CLI tools, data processing, web APIs, error handling, and null safety.
Rayo is in active development. See the spec for implementation details.