| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Fix VM borrowing for OOP methods (HashMap, HashSet, StringBuilder) Implement interior mutability for VM data structures using RefCell wrapper pattern, enabling mutable method calls on stored instances. Changes: - Universe.vm_refs: HashMap<usize, RefCell<Box<dyn Any>>> - Add get_vmref_ref() for safe mutable access through borrow_mut() - Update all VM methods to use downcast_ref/downcast_mut pattern - Fix VmFunction signatures (single Value vs Vec<Value>) - Complete HashMap, HashSet, StringBuilder implementations Resolves plan 038-fix-vm-borrowing.md Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> | 9 个月前 | |
Allow type names in dot expressions for static method calls Update parser check_symbol() to recognize Type::User types in dot expressions (e.g., HashMap.new()), allowing static method call syntax. This fixes the parser error "Left name not found" when parsing TypeName.method() for VM registry methods. The evaluator will route these calls to the VM registry. Note: Type definition files (hashmap.at, etc.) still need to be loaded to register the types in the universe before static method calls will work. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> | 9 个月前 | |
fix(stdlib): resolve compilation errors and cleanup legacy code - Fix byte/u8 vs char type mismatch in list.at and dstr.at - Add #[pub] visibility to stdlib methods - separate io.at interface from io.c.at implementation - disable legacy may.at, result.at, option.at files - clean up cmd_a2c_stdlib.rs | 9 个月前 | |
fix(stdlib): resolve compilation errors and cleanup legacy code - Fix byte/u8 vs char type mismatch in list.at and dstr.at - Add #[pub] visibility to stdlib methods - separate io.at interface from io.c.at implementation - disable legacy may.at, result.at, option.at files - clean up cmd_a2c_stdlib.rs | 9 个月前 | |
Reimplement Phase 3: HashMap/HashSet using C FFI approach User feedback: Implement in AutoLang with C transpilation, not pure C Changed approach: - hashmap.c.at: AutoLang FFI declarations (fn.c bindings) - hashmap.h: C header with full API definitions - hashmap.c: C implementation using dynamic arrays - HashMap: key-value pairs with string keys - HashSet: unique string values - AutoLang API through C FFI (like StringBuilder) HashMap API: - HashMap_new() - Create new hash map - HashMap_insert(map, key, value) - Insert/update entry - HashMap_get(map, key) - Get value by key (returns NULL if not found) - HashMap_contains(map, key) - Check if key exists (returns 0/1) - HashMap_remove(map, key) - Remove and return value - HashMap_size(map) - Get entry count - HashMap_clear(map) - Clear all entries - HashMap_drop(map) - Free map and all entries HashSet API: - HashSet_new() - Create new hash set - HashSet_insert(set, value) - Insert value - HashSet_contains(set, value) - Check if value exists - HashSet_remove(set, value) - Remove value - HashSet_size(set) - Get entry count - HashSet_clear(set) - Clear all entries - HashSet_drop(set) - Free set and all entries Technical Details: - Dynamic array-based storage (auto-expanding) - strdup() for key/value ownership - Linear search O(n) (can be optimized to proper hash table later) - Proper memory management with free/drop - Compatible with AutoLang C transpilation This is the CORRECT approach: AutoLang API with C backend implementation that transpiles cleanly, following the same pattern as StringBuilder. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> | 9 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 9 个月前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 9 个月前 |