Cat is a general-purpose programming language that combines:
- ✅ Python/Java-like syntax
- ✅ C-level performance
- ✅ Cross-platform
- ✅ Smart optimization per task
# Build the compiler
make
# Run a Cat program
./catc run examples/hello.cat
# Compile to executable
./catc compile examples/hello.cat -o hello
./hello
# Tokenize (debug)
./catc lex examples/hello.cat
# Parse (debug)
./catc parse examples/hello.cat// Hello World
say "Hello, World!"
// Variables
name is "Cat"
age is 5
// Functions
add(a, b) = a + b
// Classes
class Person {
name: string
}
See examples/ for more:
hello.cat— Hello Worldfib.cat— Fibonacciguess_game.cat— Number guessing game
Source (.cat) → Lexer → Tokens → Parser → AST → Sema → CodeGen → C → GCC → Executable
cat-it/
├── include/ # Header files
├── src/ # Compiler source
├── lib/ # Standard library
├── examples/ # Example programs
└── tests/ # Test suite
MVP in development. Current features:
- Lexer (tokens, keywords, strings, numbers)
- Parser (expressions, statements, classes, enums, interfaces)
- Semantic analysis (symbol table, scope)
- Code generation (Cat → C transpiler)
- Runtime library
- CLI (compile, run, lex, parse)
- Full standard library
- Package manager
- LSP support
© 2024 Cat Programming Language