Commit Graph

5 Commits

Author SHA1 Message Date
91e4eb734e feat: 使用Computed Goto优化指令分发机制和算术运算处理 2026-03-07 21:33:55 +08:00
6dbecbbdc0 feat: 重构编译器以支持函数定义和调用,添加新的字节码以支持函数调用
另外,我很高兴地宣布,fib(40) 递归法 在我的平台, i5-13490f,只需要 6600ms, fib(30) 56ms
这是历史性的一刻!
2026-03-07 00:34:52 +08:00
852dd27836 feat: 优化表达式解析器,添加终止符重置功能及代码格式调整 2026-02-23 15:03:53 +08:00
abdb1d2fb0 feat: 添加跳转指令支持及条件语句编译实现 2026-02-20 17:02:13 +08:00
2631f76da1 feat: Implement compiler and virtual machine for Fig language
- Added Compiler class with methods for compiling programs, statements, and expressions.
- Introduced Proto structure to hold compiled bytecode and constants.
- Implemented expression compilation including literals, identifiers, and infix expressions.
- Developed statement compilation for variable declarations and expression statements.
- Created a VM class to execute compiled bytecode with support for arithmetic and comparison operations.
- Added Object and Value classes for handling different data types and memory management.
- Implemented String and Struct objects for enhanced data representation.
- Established a parser for parsing variable declarations and statements.
- Included tests for the VM and object representations.
2026-02-20 14:05:56 +08:00