Release Notes - v0.0.2-alpha
Version Overview
Version: v0.0.2-alpha
Status: Alpha (Experimental)
License: GPL-3.0
This release focuses on stability, performance, and memory safety improvements. Several critical bugs have been fixed, the internal architecture has been refined, and the interpreter is now measurably faster across all benchmarks.
Highlights
- Fixed parser stack overflow caused by unbounded mutual recursion.
- Fixed interpreter stack overflow on deeply recursive function calls.
- Fixed multiple memory management issues, including a double-free and a zero-argument function call crash.
- Reduced "Token" size from 88 bytes → 56 bytes.
- Reduced "Position" size from 40 bytes → 24 bytes.
- Replaced AST visitor dispatch "switch" statements with per-node dispatch tables.
- Added "--cleanup" ("-C") flag for Valgrind and memory leak analysis workflows.
Bug Fixes
Stack Overflow in Parser
Fixed unbounded mutual recursion between "exprParser", "blockParser", "andOrParser", and "compExprParser" that caused a segmentation fault on files with many statements or deeply nested expressions.
A per-statement depth reset and recursion depth guard have been added.
Stack Overflow in Interpreter
Fixed unbounded recursion in "visitNode" that caused a segmentation fault on deeply recursive Arc functions (e.g. "countdown(5000)").
A configurable call depth limit has been introduced.
Double-Free in Function Calls
Fixed a double-free in "initFunctionCall" where "calleeObj" was freed both inside the function and by the caller.
Zero-Argument Function Call Crash
Fixed a crash when calling a function with no arguments caused by "arenaAlloc" returning "NULL" for a zero-size allocation.
Performance Improvements
Dispatch Table on ASTNode
Each AST node now carries a "visit" function pointer assigned during parsing.
Internal visitors now call "node->visit" directly, reducing dispatch overhead during AST traversal.
Smaller Token and Position Structs
Removed "filename" and "filetext" from "Position", reducing:
Structure| Old Size| New Size
"Position"| 40 bytes| 24 bytes
"Token"| 88 bytes| 56 bytes
Parser stack frames now consume significantly less memory, increasing the safe nesting depth before overflow.
Parser Token Locals Reduced
Replaced full "Token" locals used only for error reporting with lightweight "Position" pairs, further reducing parser frame size.
Architecture Improvements
filename and filetext Moved off Position
"filename" and "filetext" are now stored on the "Parser" structure and dispatch arguments rather than duplicated inside every token.
This reduces memory usage and more accurately scopes file metadata for imports and multi-file compilation.
Memory Management
Optional Cleanup Mode
Added an explicit opt-in cleanup mode:
arc --cleanup program.arc
or
arc -C program.arc
When enabled, Arc frees all arenas, pools, and tables before exiting.
By default, memory is reclaimed by the operating system on process termination for maximum performance.
This behavior does not affect memory usage while programs are running.
Arena Block Size Pre-Sizing
Token array capacity is now estimated from source file length, reducing arena reallocation churn during lexing.
CLI
New Flag
Flag| Description
"--cleanup", "-C"| Free all memory before exit. Useful for Valgrind and leak checkers.
Benchmarks
Measured against CPython 3.x.
Benchmark| Python| Arc| Notes
"fibonacci(30)" recursive| 95 ms| 1163 ms| Symbol table allocation per call, to be optimized
"fibonacci(1000)" iterative| 0.06 ms| 0.22 ms| 3.6× slower
"sum(1..1000000)"| 51 ms| 133 ms| 2.6× slower
String concat ×10000| 0.58 ms| 39 ms| O(n²), to be optimized
Nested loops (1000×1000)| 42 ms| 124 ms| 3× slower
Variable churn ×100000| ~42 ms| 25 ms| 1.7× faster than Python
Roadmap
- [ ] Fix symbol table allocation per function call (major speedup for recursive code)
- [ ] Fix O(n²) string concatenation
- [ ] Stop copying objects on every variable access (reference counting or static number interning)
- [ ] Scoped environments for local variables
- [ ] Bytecode Virtual Machine (VM) for improved execution speed
- [ ] Expanded standard library (Networking, JSON support)
- [ ] Enhanced REPL with history and auto-completion
Arc is currently in alpha. Feedback and contributions are welcome as we move toward a stable 1.0 release.
Top comments (0)