/\_____/\
/ o o \
( == ^ == )
) (
( )
( ( ) ( ) )
(__(__)___(__)__)
███╗ ███╗███████╗ ██████╗ ██╗ ██╗
████╗ ████║██╔════╝██╔═══██╗██║ ██║
██╔████╔██║█████╗ ██║ ██║██║ █╗ ██║
██║╚██╔╝██║██╔══╝ ██║ ██║██║███╗██║
██║ ╚═╝ ██║███████╗╚██████╔╝╚███╔███╔╝
╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚══╝╚══╝
The purrfect functional programming language 🐱
Meow is a cat-themed functional programming language that transpiles .nyan files into Go source code. It's a joke language — but one that actually works. Write real programs with cat words, compile them to native binaries, and run them at full speed.
nyan name = "Tama"
meow greet(who) {
bring "Hello, " + who + "!"
}
nya(greet(name))
$ meow run hello.nyan
Hello, Tama!
Features
- Cat-themed syntax — Every keyword is a cat word (
nyan, meow, sniff, purr, ...)
- Transpiles to Go — Generates clean, readable Go code
- Native binaries — Compiled output runs at full Go speed
- Dynamic typing — All values are boxed via
meow.Value interface
- First-class functions — Lambdas with
paw(x) { x * 2 }
- List operations —
lick (map), picky (filter), curl (reduce)
- Pattern matching —
peek expression with ranges and wildcards
- Pipe operator — Chain operations with
|=|
- Cat error messages —
Hiss! "x" is not defined, nya~
- Modern Go internals — Built with
iter.Seq, iter.Pull, generics, go:embed
Installation
Homebrew
brew install 135yshr/homebrew-tap/meow
From Source
git clone https://github.com/135yshr/meow.git
cd meow
go install .
Go Install
go install github.com/135yshr/meow@latest
Requires Go 1.26+
Quick Start
Create hello.nyan:
nyan name = "Tama"
nya("Hello, " + name + "!")
Run it:
meow run hello.nyan
# => Hello, Tama!
Or build a binary:
meow build hello.nyan -o hello
./hello
Language Reference
Variables
nyan x = 42
nyan greeting = "Hello!"
nyan pi = 3.14
nyan cats_are_great = yarn # true
nyan dogs_rule = hairball # false
nyan nothing = catnap # nil
Functions
meow add(a, b) {
bring a + b
}
nya(add(1, 2)) # => 3
Control Flow
# if / else
sniff (x > 0) {
nya("positive")
} scratch sniff (x == 0) {
nya("zero")
} scratch {
nya("negative")
}
# while loop
nyan i = 0
purr (i < 10) {
nya(i)
i = i + 1
}
Lambdas
nyan double = paw(x) { x * 2 }
nya(double(5)) # => 10
Lists
nyan nums = [1, 2, 3, 4, 5]
# map
lick(nums, paw(x) { x * 2 }) # => [2, 4, 6, 8, 10]
# filter
picky(nums, paw(x) { x % 2 == 0 }) # => [2, 4]
# reduce
curl(nums, 0, paw(acc, x) { acc + x }) # => 15
Error Handling
meow divide(a, b) {
sniff (b == 0) { hiss("division by zero") }
bring a / b
}
# Concise error recovery with ~>
nyan val = divide(10, 0) ~> 0
nya(val) # => 0
# With a handler function
nyan val2 = divide(10, 0) ~> paw(err) { 42 }
nya(val2) # => 42
# Verbose style with gag/isFurball
nyan result = gag(paw() { divide(10, 0) })
sniff (isFurball(result)) {
nya("caught:", result)
} scratch {
nya("ok:", result)
}
# => caught: Hiss! division by zero
Pattern Matching
nyan result = peek(score) {
0 => "zero",
1..10 => "low",
11..100 => "high",
_ => "off the charts"
}
# This is a line comment
-~ This is a
block comment ~-
Language Cheat Sheet
Full reference: docs/reference.md
Keywords
| Meow |
Meaning |
Example |
nyan |
Variable declaration |
nyan x = 42 |
meow |
Function definition |
meow add(a, b) { bring a + b } |
bring |
Return value |
bring x + 1 |
sniff |
If condition |
sniff (x > 0) { ... } |
scratch |
Else branch |
} scratch { ... } |
purr |
While loop |
purr (i < 10) { ... } |
paw |
Lambda (anonymous function) |
paw(x) { x * 2 } |
nya |
Print |
nya("Hello!") |
lick |
Map over list |
lick(nums, paw(x) { x * 2 }) |
picky |
Filter list |
picky(nums, paw(x) { x > 0 }) |
curl |
Reduce list |
curl(nums, 0, paw(a, x) { a + x }) |
peek |
Pattern match |
peek(v) { 0 => "zero", _ => "other" } |
hiss |
Raise error |
hiss("something went wrong") |
gag |
Catch errors |
gag(paw() { risky() }) |
isFurball |
Check if error |
isFurball(result) |
fetch |
Import (planned) |
— |
flaunt |
Export (planned) |
— |
yarn |
True (boolean literal) |
nyan ok = yarn |
hairball |
False (boolean literal) |
nyan ng = hairball |
catnap |
Nil (empty value) |
nyan nothing = catnap |
Operators
| Operator |
Meaning |
Example |
+ - * / % |
Arithmetic |
1 + 2, 10 % 3 |
== != |
Equality |
x == 0 |
< > <= >= |
Comparison |
x < 10 |
&& || ! |
Logical |
x > 0 && !done |
|=| |
Pipe |
nums |=| lick(double) |
~> |
Error recovery |
divide(10, 0) ~> 0 |
.. |
Range |
1..10 |
=> |
Match arm |
0 => "zero" |
= |
Assignment |
nyan x = 1 |
Literals & Delimiters
| Token |
Meaning |
42, 3.14 |
Integer / Float |
"hello" |
String |
( ) { } [ ] |
Parens / Braces / Brackets |
, |
Separator |
# |
Line comment |
-~ ... ~- |
Block comment |
CLI Usage
Meow Language Compiler
Usage:
meow run <file.nyan> Run a .nyan file
meow build <file.nyan> [-o name] Build a binary
meow transpile <file.nyan> Show generated Go code
meow <file.nyan> Shorthand for 'meow run'
Flags:
--verbose, -v Enable debug logging
How It Works
.nyan → [Lexer] → iter.Seq[Token] → [Parser] → AST → [Codegen] → .go → go build → Binary
The compiler pipeline:
- Lexer (
pkg/lexer) — Tokenizes source using iter.Seq[Token]
- Parser (
pkg/parser) — Pratt parser with iter.Pull for push-to-pull conversion
- Codegen (
pkg/codegen) — Transforms AST into Go source code
- Compiler (
compiler) — Orchestrates the pipeline, runs go build
- Runtime (
runtime/meowrt) — Provides Value interface, operators, and builtins
Examples
Check the examples/ directory:
Project Structure
meow/
├── main.go # CLI entry point
├── cmd/meow/ # Alternative CLI entry
├── compiler/ # Pipeline orchestration + E2E tests
├── pkg/
│ ├── token/ # Token types, keywords, positions
│ ├── lexer/ # iter.Seq-based tokenizer
│ ├── ast/ # AST node definitions + tree walker
│ ├── parser/ # Pratt parser (iter.Pull)
│ └── codegen/ # AST → Go source generation
├── runtime/meowrt/ # Runtime: Value, operators, builtins
├── examples/ # Sample .nyan programs
└── testdata/ # Golden file tests
Contributing
Contributions are welcome! Whether it's a bug fix, new feature, or just a better cat pun — we'd love your help.
- Fork the repository
- Create your feature branch (
git checkout -b feat/amazing-feature)
- Write tests for your changes
- Ensure all tests pass (
go test ./...)
- Commit your changes
- Push to the branch and open a Pull Request
Ideas for Contributions
- More cat-themed error messages
- String interpolation (
"Hello, {name}!")
-
fetch / flaunt (import/export) for multi-file support
- REPL mode (
meow repl)
- Syntax highlighting for popular editors
- Homebrew formula
- Playground website
Running Tests
# Run all tests
go test ./...
# Run with verbose output
go test ./... -v
# Update golden files
go test ./compiler/ -update
License
This project is licensed under the MIT License — see the LICENSE file for details.
/\_/\
( o.o ) Made with 🐱 and Go
> ^ <
If this project made you smile, consider giving it a ⭐