๐ฏ typescript
Rusty TypeScript Core Compiler & Runtime ๐ฆโก๏ธ
๐ Introduction
This is the core compiler package for Rusty TypeScript, providing full TypeScript compilation and execution capabilities. It integrates the complete compilation pipeline from lexical analysis and parsing to IR transformation and virtual machine execution.
โจ Core Features
| Module | Description | Status |
|---|---|---|
| ๐ค Lexer/Parser | Oak-based lexical and syntax analysis | โ Ready |
| ๐ IR | Intermediate representation transformation | โ Ready |
| ๐ฏ VM | Virtual machine execution engine | โ Ready |
| ๐ Type Checker | Type checking system | ๐ง In Development |
| ๐ค Codegen | Code generation | ๐ง In Development |
| ๐ FFI/NAPI | Node.js integration | โ Ready |
| ๐๏ธ GC | Garbage collector | โ Ready |
๐ Quick Start
Add Dependency
[]
= { = "../compilers/typescript" }
Basic Usage
use TypeScript;
N-API Integration (Node.js)
const = require;
// Create runtime
const runtime = ;
// Execute code
const result = runtime.;
console.log;
๐ง Advanced Usage
Custom Global Variables
use TypeScript;
use ;
let mut ts = new;
// Inject custom function
ts.register_global;
Error Handling
match ts.execute_script
๐งช Testing
# Run all tests
# Run specific test
# Debug mode
๐ Dependencies
- typescript-types - Type definitions
- typescript-ir - Intermediate representation
- oak-typescript - Parser (external)
- oak-core - Parsing core (external)
- napi - Node.js bindings
- napi-derive - NAPI macros
๐ค Contributing
We welcome issues and PRs! Please ensure:
- โ
Code passes
cargo clippychecks - โ
Code is formatted with
cargo fmt - โ
All tests pass with
cargo test - โ Necessary documentation comments are added
๐ License
MIT License - see LICENSE
๐ฆ Built with Rust, optimized for performance โก๏ธ