bisayawa
v0.1.0
Published
A small Cebuano-inspired programming language and interpreter.
Maintainers
Readme
Bisayawa
Bisayawa is a small interpreted programming language with Cebuano-inspired keywords. It is written in Go and is designed to be easy to read, run, and extend.
Run it
Run the included example:
go run . examples/hello.bsyStart the interactive REPL:
go run .You can also pipe source code into the interpreter:
printf 'butang x = 2 + 3\nsulat(x)\n' | go run .Use it from npm
After installing the published package, run a Bisayawa file with:
npx bisayawa examples/hello.bsyOr install it globally:
npm install --global bisayawa
bisayawa examples/hello.bsyThe npm package includes prebuilt interpreter binaries for Linux x64, macOS x64/ARM64, and Windows x64.
Language guide
# Comments start with # or //.
butang ngalan = "Bisayawa"
butang edad = 2 + 3 * 4
butang andam = tinuod ug dili bakak
butang numero = [1, 2, 3]
numero[0] = 10
sulat("Kumusta,", ngalan)
kung edad >= 10 {
sulat("dako na")
} lain {
sulat("gamay pa")
}
trabaho greet(persona) {
balik "Maayong adlaw, " + persona
}
sulat(greet(ngalan))Keywords and built-ins
| Bisayawa | Meaning |
| --- | --- |
| butang | declare a variable |
| kung | conditional |
| lain | alternative branch |
| tinuod / bakak | true / false |
| ug / o | and / or |
| dili | not |
| trabaho | define a function |
| balik | return a value from a function |
| sulat(...) | print values |
| gawas | exit the REPL |
Supported values are numbers, strings, booleans, and arrays. Variables can be
reassigned, and array items can be read or changed with an index such as
numero[0]. User-defined functions support parameters and return values.
The interpreter supports arithmetic (+ - * /), comparisons
(< <= > >= == !=), parentheses, unary operators, comments, and nested
expressions.
Development
go test ./...
gofmt -w *.goThe official Bisayawa source-file extension is .bsy.
This project is intentionally local. No GitHub commit or push is performed by the development workflow.
