- Total Source Files: 629 C++ files (.cpp/.h)
- Documentation Files: 70 README.md files
- Built Executables: Console, TestCore, TestPi, TestRho, TestTau, TestConsole
- Project Size: 108MB comprehensive codebase
- Build System: CMake with C++23, Clang++ default compiler
- Test Coverage: 200+ individual test cases across all systems
KAI is a sophisticated distributed object model that enables:
- Multi-Language Programming: Pi (stack-based), Rho (infix), Tau (IDL)
- Distributed Computing: Seamless object and computation distribution
- Console Networking: Real-time console-to-console communication
- Incremental Garbage Collection: Smooth memory management
- Network Transparency: Remote objects appear local
- All objects managed through central Registry
- Type-safe object creation and lifecycle management
- Reflection and introspection capabilities
- Incremental tri-color garbage collection
- Stack-based virtual machine (Executor)
- Continuations as first-class objects
- Uniform execution model across all languages
- Support for distributed computation
- Common AST and translation pipeline
- Rho compiles to Pi, Pi executes directly
- Tau generates C++ proxy/agent code
- Cross-language variable and function access
- P2P architecture without central servers
- Objects and computations distribute seamlessly
- ENet-based reliable communication
- Automatic peer discovery and connection management
- Registry: Object factory and lifecycle manager
- Memory Management: Incremental garbage collection
- Type System: Dynamic typing with reflection
- Serialization: Network-transparent object transmission
- Virtual Machine: Stack-based execution engine
- Console: Interactive REPL with networking
- Continuations: First-class execution objects
- Operation Set: Complete instruction set for all languages
- Pi: Stack-based postfix language (like Forth)
- Rho: Python-like infix language
- Tau: Interface Definition Language for networking
- CommonLang: Shared infrastructure (lexer, parser, translator)
- Nodes: P2P network participants
- Domains: Distributed computing contexts
- Proxies/Agents: Remote object representation
- Logger: Network diagnostics and monitoring
- Console: Main interactive application
- Window: GUI application (optional)
- NetworkTest: Network validation tools
- NetworkGenerate: Code generation utilities
- Real-time Communication: Console-to-console messaging
- Command Execution: Remote command execution (
/@peer command) - Broadcasting: Multi-peer command distribution (
/broadcast command) - Language Switching: Cross-language communication
- Network Commands: Complete set of networking operations
- Pi: Stack operations, labels, continuations, shell integration
- Rho: Functions, control flow, expressions, Pi embedding
- Tau: Interfaces, structs, namespaces, code generation
- Modern C++: C++23 standard with Clang++ default
- Parallel Building: Ninja generator with multi-core compilation
- Modular Design: Component-based library structure
- Cross-Platform: Linux, Windows, macOS support
- Comprehensive Coverage: 200+ test cases
- Multiple Categories: Unit, integration, performance tests
- Language Testing: File-based script validation
- Network Testing: P2P communication validation
- Console Testing: Interactive feature validation
./b # Build with Clang++, C++23, Ninja
./b --gcc # Build with GCC
./b --reconfigure # Force reconfigurationScripts/run_all_tests.sh # Complete test suite
./Bin/Test/TestPi # Pi language tests
./Bin/Test/TestRho # Rho language tests
./Bin/Test/TestConsole # Console feature tests./Bin/Console # Start interactive console
pi> /network start 14600 # Enable networking
pi> 2 3 + 4 * # Pi calculations
pi> rho # Switch to Rho language
rho> a = 5; print(a) # Rho programming./demo_console_communication.sh # Interactive demo
# Creates tmux session with two communicating consoles- Static Analysis: Clang compiler warnings enabled
- Modern C++: C++23 features, smart pointers, RAII
- Consistent Style: Standardized naming and formatting
- Comprehensive Documentation: 70 README files
- Multi-Level Testing: Unit, integration, system tests
- Language Coverage: All language features tested
- Network Validation: P2P communication verified
- Performance Testing: Memory and execution benchmarks
- Dependency Management: Proper CMake configuration
- Platform Support: Cross-platform compatibility
- Error Handling: Graceful failure modes
- Security: Configurable shell command execution
The architecture supports extension in several directions:
- New Languages: Common translation pipeline enables new language front-ends
- Network Protocols: Modular network layer supports additional transport protocols
- Platform Support: Cross-platform design enables new target platforms
- Application Types: Flexible console and window applications as examples
- Memory Management: Incremental GC with low pause times
- Execution Speed: Efficient stack-based virtual machine
- Network Performance: UDP-based reliable communication
- Scalability: P2P architecture scales horizontally
This comprehensive system demonstrates advanced C++ programming techniques, distributed systems design, and multi-language programming environment implementation.