fix: C backend String functions, record type aliases, docs cleanup
- Add String.fromChar, chars, substring, toUpper, toLower, replace, startsWith, endsWith, join to C backend - Fix record type alias unification by adding expand_type_alias and unify_with_env functions - Update docs to reflect current implementation status - Clean up outdated roadmap items and fix inconsistencies - Add comprehensive language comparison document Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,8 +9,10 @@ Lux should compile to native code with zero-cost effects AND compile to JavaScri
|
||||
| Component | Status |
|
||||
|-----------|--------|
|
||||
| Interpreter | Full-featured, all language constructs |
|
||||
| C Backend | Complete (functions, closures, pattern matching, lists, RC) |
|
||||
| JS Backend | Complete (full language, browser & Node.js, DOM, TEA) |
|
||||
| JIT (Cranelift) | Integer arithmetic only, ~160x speedup |
|
||||
| Targets | Native (via Cranelift JIT) |
|
||||
| Targets | Native (via C), JavaScript, JIT |
|
||||
|
||||
## Target Architecture
|
||||
|
||||
@@ -296,45 +298,33 @@ Tree increment(Tree tree) {
|
||||
|
||||
## Milestones
|
||||
|
||||
### v0.2.0 - C Backend (Basic)
|
||||
- [ ] Integer/bool expressions → C
|
||||
- [ ] Functions → C functions
|
||||
- [ ] If/else → C conditionals
|
||||
- [ ] Let bindings → C variables
|
||||
- [ ] Basic main() generation
|
||||
- [ ] Build with GCC/Clang
|
||||
### C Backend - COMPLETE
|
||||
- [x] Integer/bool expressions → C
|
||||
- [x] Functions → C functions
|
||||
- [x] If/else → C conditionals
|
||||
- [x] Let bindings → C variables
|
||||
- [x] Basic main() generation
|
||||
- [x] Build with GCC/Clang
|
||||
- [x] Strings → C strings
|
||||
- [x] Pattern matching → Switch/if chains
|
||||
- [x] Lists → Linked structures
|
||||
- [x] Closures
|
||||
- [x] Reference counting (lists, boxed values)
|
||||
|
||||
### v0.3.0 - C Backend (Full)
|
||||
- [ ] Strings → C strings
|
||||
- [ ] Records → C structs
|
||||
- [ ] ADTs → Tagged unions
|
||||
- [ ] Pattern matching → Switch/if chains
|
||||
- [ ] Lists → Linked structures
|
||||
- [ ] Effect compilation (basic)
|
||||
### JavaScript Backend - COMPLETE
|
||||
- [x] Basic expressions → JS
|
||||
- [x] Functions → JS functions
|
||||
- [x] Effects → Direct DOM/API calls
|
||||
- [x] Standard library (String, List, Option, Result, Math, JSON)
|
||||
- [x] DOM effect (40+ operations)
|
||||
- [x] Html module (type-safe HTML)
|
||||
- [x] TEA runtime (Elm Architecture)
|
||||
- [x] Browser & Node.js support
|
||||
|
||||
### v0.4.0 - Evidence Passing
|
||||
- [ ] Effect analysis
|
||||
- [ ] Evidence vector generation
|
||||
- [ ] Transform effect ops to direct calls
|
||||
- [ ] Handler compilation
|
||||
|
||||
### v0.5.0 - JavaScript Backend
|
||||
- [ ] Basic expressions → JS
|
||||
- [ ] Functions → JS functions
|
||||
- [ ] Effects → Direct DOM/API calls
|
||||
- [ ] No runtime bundle
|
||||
|
||||
### v0.6.0 - Reactive Frontend
|
||||
- [ ] Reactive primitives
|
||||
- [ ] Fine-grained DOM updates
|
||||
- [ ] Compile-time dependency tracking
|
||||
- [ ] Svelte-like output
|
||||
|
||||
### v0.7.0 - Memory Optimization
|
||||
- [ ] Reference counting insertion
|
||||
- [ ] Reuse analysis
|
||||
- [ ] FBIP detection
|
||||
- [ ] In-place updates
|
||||
### Remaining Work
|
||||
- [ ] Evidence passing for zero-cost effects
|
||||
- [ ] FBIP (Functional But In-Place) optimization
|
||||
- [ ] WASM backend (deprioritized)
|
||||
|
||||
## References
|
||||
|
||||
|
||||
Reference in New Issue
Block a user