Comments (4)
The idea is generally making sense. However, we should take the lazy evaluation way. By using eager evaluation, the cfront
aggressively computes all the expressions, that would cause unexpected work. Instead, once we keep the operands (and expressions) in the stack, we can then evaluate right before code generation.
from shecc.
once we keep the operands (and expressions) in the stack, we can then evaluate right before code generation.
I think stack using in read_expr
is for generating proper order to evaluate right expression and I don't think it now can be determined before code generation. Also, in some test case, register will run out when code is generating.
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?
from shecc.
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 shecc
might be bootstrapped, which implies less efficient evaluations (and sometimes, buggy).
from shecc.
Drop this issue in favor of #84
from shecc.
Related Issues (20)
- Integrate with semu HOT 5
- Parse syntax for include macro in parser.c HOT 5
- Uninitialized variable: pred HOT 2
- The peephole optimization breaks the macro expansion HOT 2
- Declare variables where needed
- Fail to self-host HOT 1
- Support macros defined in <stdbool.h> HOT 5
- Unable to self compile stage 1 HOT 1
- Fail to pass stage1 HOT 6
- For a coding question: about parser HOT 3
- Error on make: /bin/sh: line 1: 21530 Segmentation fault out/shecc --dump-ir -o out/shecc-stage1.elf HOT 7
- Support conversion specifier ā%cā inside printf HOT 1
- Support mmap on shecc HOT 2
- Improve intermediate representation and also register allocation
- Handle non-zero integers in if statements HOT 1
- Thoughts on cfront's potential improvements HOT 11
- Determine the factors contributing to unexpected slowdowns during self-hosting HOT 2
- Eliminate compilation warnings
- Implement basic optimizations HOT 3
- High branch-miss rate when hosting shecc on the Raspberry Pi 3B
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shecc.