-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do we need to change how shecc evaluate expression? #28
Comments
The idea is generally making sense. However, we should take the lazy evaluation way. By using eager evaluation, the |
I think stack using in And I am curious about why eager evaluation cause unexpected work? We need to evaluate it anyway, what is difference to do it in advance? |
Lazy evaluation (or call-by-need) delays evaluating an expression until it is actually needed; when it is evaluated, the result is saved so repeated evaluation is not needed. This technique can make some algorithms easier to express compactly or much more efficiently, or both. The binary of |
Drop this issue in favor of #84 |
The way recent
shecc
evaluating local expression is generating relative arithmetic instruction and calculating in run-time. I think we can change the scheme into evaluating in compile time.Although it will increase compile time, there're still lots of benefits:
driver.sh
(expr 210 "1 + (2 + (3 + (4 + (5 + (6 + (7 + (8 + (9 + (10 + (11 + (12 + (13 + (14 + (15 + (16 + (17 + (18 + (19 + 20))))))))))))))))))"
)The text was updated successfully, but these errors were encountered: