Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐱 Cat Programming Language

Cat is a general-purpose programming language that combines:

  • ✅ Python/Java-like syntax
  • ✅ C-level performance
  • ✅ Cross-platform
  • ✅ Smart optimization per task

Quick Start

# 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

Examples

// 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 World
  • fib.cat — Fibonacci
  • guess_game.cat — Number guessing game

Architecture

Source (.cat) → Lexer → Tokens → Parser → AST → Sema → CodeGen → C → GCC → Executable

Project Structure

cat-it/
├── include/     # Header files
├── src/         # Compiler source
├── lib/         # Standard library
├── examples/    # Example programs
└── tests/       # Test suite

Status

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

License

© 2024 Cat Programming Language

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages