hello
sayMyName "Hello from BBLang"
BB stands for Breaking Bad. Someone built a programming language where you
sayMyName to print stuff and callSaul instead of else.
Files end in .bb. You run them with bbc.
Mess up the syntax and the error message sends you to Saul Goodman. That's the bit people actually remember.
alias name = "Heisenberg"
when name == "Heisenberg" {
sayMyName "You're goddamn right."
} callSaul {
sayMyName "Better call Saul."
}
Four steps. Nothing fancy.
.bb file
Text file. Use sayMyName to print, cook for functions,
when / callSaul for branches. Normal programming, weird words.
bbc run hello.bb
bbc is the CLI. Install once with npm, then use it like you'd use node.
BBLang reads your file and converts it to JS behind the scenes. You don't edit the JS.
Happens every time you run bbc run.
sayMyName shows up in your terminal. Break something and you get the Saul error
instead of a normal parse error.
.bb → bbc → JavaScript → terminal
Variables, printing, if/else, loops, functions, user input. The usual beginner-language stuff. Won't replace Python for your day job. Good for messing around if you watched the show.
sayMyName "hi" and say_my_name("hi") both work for printing.
| normal | BBLang | does |
|---|---|---|
sayMyName | print to terminal | |
| input | askWalter | wait for typed input |
| function | cook | define a function |
| return | walkAway | return from function |
| if | when | if true, run this block |
| else | callSaul | otherwise run this |
| loop 5 times | repeat 5 | run block 5 times |
| while | keepCooking | loop while condition true |
| integer | grams | whole numbers |
| decimal | precise | numbers with a dot |
| string | alias | text in quotes |
| boolean | fact, yes/no | true/false |
| array | batch | list in [ ] |
| random | flipCoin() | random number |
| length | countEvidence() | string/array length |
| upper / lower | lawyerUp / layLow | change case |
| sleep | waitForIt() | pause (ms) |
Save as whatever.bb, then bbc run whatever.bb.
sayMyName "Hello from BBLang"
alias name = "Jesse"
grams purity = 99
sayMyName name
sayMyName purity
cook add(a, b) {
walkAway a + b
}
sayMyName add(5, 3)
grams age = 20
when age >= 18 {
sayMyName "empire business"
} callSaul {
sayMyName "call Saul"
}
Use else by mistake and you get this:
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:
else
Tip: Say my name.
Yeah. callSaul, not else.
Node 18+. Paste in terminal:
clone + build
git clone https://github.com/godstark82/bblang.git
cd bblang
npm install
npm run build
npm install -g .
new project
bbc init
bbc run src/main.bb
or run bundled example
bbc run examples/hello.bb
bbc run file.bb
run the file
bbc compile file.bb
write a .js file
bbc watch file.bb
re-run on save
bbc init
create src/main.bb in current dir
bbc repl
type code interactively
A small open-source language for Breaking Bad fans. You write .bb files,
run them with bbc, and the syntax uses show quotes instead of boring keywords.
Prints to the terminal. Same job as print in Python or console.log in JavaScript.
Write sayMyName "hello" or say_my_name("hello").
The else branch. Pair it with when (if). Mess up and the compiler
literally tells you to call Saul Goodman.
Clone bblang on GitHub,
run npm install, npm run build, then npm install -g ..
Needs Node 18+.
No. Fan project. Not affiliated with AMC, Sony, or anyone who owns the show.