bblang
v2.0.0
Published
BBLang — sayMyName instead of print
Maintainers
Readme
BBLang
BB = Breaking Bad. This is a small language where you sayMyName instead of print, use callSaul instead of else, and get told to call Saul Goodman when you typo something.
Docs site: godstark82.github.io/bblang
npm install -g bblang # after building from source
bbc run hello.bbsayMyName "I am the one who knocks."What's the point?
Same ideas as any beginner language — variables, if/else, loops, functions — but the keywords are pulled from the show. cook for functions. walkAway for return. askWalter for input. That's the whole gimmick.
Fair warning: a lot of this repo was written with AI help — the compiler, the docs site, examples, error messages, even chunks of this README. It was edited afterward, but if something reads stiff or too neat, that's probably why. PRs to fix weird wording are welcome.
Word swap cheat sheet
| usual | BBLang |
|-------|--------|
| print | sayMyName / say_my_name() |
| input | askWalter |
| function | cook |
| return | walkAway |
| if / else | when / callSaul |
| loop N times | repeat |
| while | keepCooking |
| int / float / string / bool / array | grams / precise / alias / fact / batch |
| true / false | yes / no |
| random / length / upper / lower / sleep | flipCoin / countEvidence / lawyerUp / layLow / waitForIt |
Errors
When you mess up:
I don't know what happened. You may call Saul Goodman for help.
Scene: line 4, column 1
Heisenberg expected:
callSaul or closing brace }
But Gus found:
elseInstall
Need Node 18+.
git clone https://github.com/godstark82/bblang.git
cd bblang
npm install
npm run build
npm install -g .bbc init
bbc run src/main.bb
# or
bbc run examples/hello.bbCLI
| command | does |
|---------|------|
| bbc run file.bb | run it |
| bbc compile file.bb | write .js (or -t c for rough C output) |
| bbc watch file.bb | re-run when you save |
| bbc init | drops src/main.bb + bbconfig.json in cwd |
| bbc repl | REPL, prompt is Heisenberg> |
Syntax samples
// variables
grams purity = 99
alias name = "Heisenberg"
fact cooked = yes
// output
sayMyName "Hello"
say_my_name("knocks")
// input
askWalter username
// if/else
when age >= 18 {
sayMyName "empire business"
} callSaul {
sayMyName "call Saul"
}
// loops
repeat 5 {
sayMyName "again"
}
grams i = 0
keepCooking i < 10 {
sayMyName i
i = i + 1
}
// function
cook add(a, b) {
walkAway a + b
}How the code is laid out
.bb file → tokenizer → parser → JS output → node runs itSource lives in src/. Examples in examples/. Tests: npm test.
Roadmap (loose)
- v1 — JS + CLI (now)
- v2 — bytecode VM maybe
- v3 — C output that actually works
- v4 — jit, if anyone still cares by then
License
MIT. Fan project, not affiliated with AMC/Sony.
