A multi-paradigm, adaptive programming language that evolves with your coding style.
Write in Python, JavaScript, C++, or Java syntax—or mix them all together. Chameleon adapts to YOU.
Chameleon is designed to be:
- ✨ Adaptive: Understands multiple syntactic patterns (Python, JavaScript, C++, Java)
- � Multi-Syntax: Use
let,var,const,int,string, or any combination - 🎯 Type-Aware: Optional explicit typing with validation and inference
- 📦 Modular: Full Python and C++ style import/include support with file resolution
- 🔍 Intelligent Linting: Enhanced static analysis with cyclomatic complexity detection
- ⚡ Fast Interpretation: Pure Python implementation with efficient AST traversal
- 🌍 Cross-platform: Runs on Windows, macOS, and Linux
- 🎨 IDE Integration: Full VS Code extension with syntax highlighting, linting, formatting
No installation needed! Just have Python 3.x installed.
# Run a Chameleon file
python chameleon_cli.py run your_file.cham
# Start interactive REPL
python chameleon_cli.py repl
# Lint a file
python chameleon_cli.py lint your_file.cham
# Format a file
python chameleon_cli.py format your_file.cham
# Or use VS Code: Ctrl+Shift+R (run), Ctrl+Shift+L (lint), Ctrl+Alt+F (format)let name = "World"
print("Hello, " + name + "!")
def greet(String greeting, int count):
for i in range(count):
print(greeting + ", " + name)
greet("Hi", 3)
- DOCUMENTATION.md - Complete language documentation, features, and usage
- EXAMPLES.cham - Comprehensive examples showcasing all language features
- docs/design_spec.md - Detailed design specifications
# Multi-syntax variable declarations
let x = 10 # Python style
var y = 20 # JavaScript style
int z = 30 # C++/Java style
String name = "Alice" # Typed parameter
# All syntaxes work together
if x < y and y < z:
print("Python logic!")
elif x < y && y < z { # C++ style if/braces
cout << "C++ logic!";
}
# Functions with typed parameters
def greet(String name, int age):
print(name + " is " + age + " years old")
# Mixed print styles
greet("Bob", 25)
console.log("Done!")
cout << "Goodbye" << endl;
See EXAMPLES.cham for comprehensive examples of all features.
Chameleon consists of six main components:
- Lexer (
lexer.py) — Tokenizes source code with multi-syntax awareness - Parser (
parser.py) — Builds Abstract Syntax Trees (AST) with dual block syntax - Linter (
linter.py) — Static code analyzer with enhanced rules - Interpreter (
interpreter.py) — Executes code via AST traversal - Formatter (
formatter.py) — Normalizes and beautifies code - Runtime (
runtime.py) — Manages scopes, functions, and built-ins
chameleon/
├── src/ # Core language implementation
│ ├── lexer.py # Tokenization (multi-syntax)
│ ├── parser.py # AST generation with dual syntax
│ ├── ast_nodes.py # AST node definitions
│ ├── interpreter.py # Execution engine
│ ├── runtime.py # Runtime environment & built-ins
│ ├── linter.py # Enhanced static code analyzer
│ ├── formatter.py # Code formatter
│ ├── repl.py # Interactive shell
│ └── main.py # Core entry point
├── vscode-extension/ # VS Code extension
│ ├── src/extension.ts # Extension implementation
│ ├── syntaxes/ # Syntax highlighting rules
│ ├── icons/ # File icons
│ └── package.json # Extension manifest
├── tests/ # Test suite
│ ├── test_lexer.py
│ ├── test_parser.py
│ ├── test_interpreter.py
│ ├── test_linter.py
│ └── test_formatter.py
├── docs/ # Design specifications
├── chameleon_cli.py # CLI interface
├── DOCUMENTATION.md # Complete language documentation
├── EXAMPLES.cham # Comprehensive examples
├── chameleon.png # Language icon
└── README.md # This file
Phase 1: Python Prototype ✅ COMPLETE
Core Features Implemented:
- ✅ Multi-syntax lexer and parser (Python, JavaScript, C++, Java)
- ✅ Dual block syntax (
:indentation and{}braces) - ✅ Full AST interpreter with proper scoping
- ✅ Interactive REPL with multi-line support
- ✅ Enhanced Static Linter with:
- Cyclomatic complexity analysis
- Unused parameter detection
- Naming convention checking
- False positive elimination for parameter usage
- ✅ Code Formatter with 2-space indentation and operator normalization
- ✅ Module/Import System:
- Python
import/fromstatements with file resolution - C++
#includestatements with path resolution
- Python
- ✅ Type System: Explicit typing with validation (int, float, string, bool, List, Dict)
- ✅ Function Keywords:
fn,def,function,voidwith optional typed parameters - ✅ VS Code Extension with:
- Syntax highlighting for all supported styles
- Live linting with inline diagnostics
- Code execution and formatting via CLI
- File icon integration
- Terminal auto-clear on run/format
- ✅ CLI tool with multiple commands
- ✅ Comprehensive test suite
Phase 2 (Planned): Production Hardening & Performance
- Package manager and standard library
- Debugging support with breakpoints
- Documentation generator
- Performance optimizations
- Error recovery and better diagnostics
See DOCUMENTATION.md for complete language documentation, features, syntax reference, and usage guides.
MIT License - See LICENSE file for details
Created by Sohmtee | Building the future of adaptive programming 🚀
