- Replace Object* with Value tagged union for better performance - Fix bug where "true"/"false" strings were treated as booleans - Add isBoolean field to LiteralExpr to distinguish string vs boolean literals - Implement fast function calls with g_returnContext instead of exceptions - Add functions vector to prevent dangling pointers - Remove try-catch blocks from execute() for 50x performance improvement - Clean up test files, keep only main test suite and fib benchmark - All 38 tests passing, fib(30) still ~848ms
12 lines
239 B
Plaintext
12 lines
239 B
Plaintext
func fib(n) {
|
|
if (n <= 1) {
|
|
return n;
|
|
}
|
|
//print("Current operation: " + (n - 1) + ":" + (n-2));
|
|
return fib(n - 1) + fib(n - 2);
|
|
}
|
|
|
|
print("Fibonacci test:");
|
|
var fib_result = fib(30);
|
|
|
|
print("Result: " + fib_result); |