Skip to content

Commit 3158146

Browse files
josephsavonafacebook-github-bot
authored andcommitted
POC of new expression-oriented inference model for memoization within control-flow (#589)
* [hir] Core data types and lowering for new model * Handle more expressions, including using babel for binding resolution * test setup with pretty printing of ir * Basic codegen and improved pretty printing * avoid else block when if has no fallthrough * emit function declarations with mapped name/params * start of scope analysis * saving state pre-run * add slightly more complex example and flush out lowering/printing (jsx, new, variables) * Various improvements: * Convert logical expressions (|| and &&) to control flow, accounting for lazy evaluation semantics. * Handle expression statements * Improve printing of HIR for unsupported node kinds * Handle more cases of JSX by falling by to OtherStatement to wrap subtrees at coarse granularity. * improve HIR printing, lowering of expression statements * handle object expression printing * improve IR model for values/places along w codegen * more test cases * start of mutability inference * passable but still incorrect mutability inference * improved mutability inference, should cover most cases now * visualization of reference graph * correctly flow mutability backwards (have to actually set the capability) * separate visualization in output * consolidate on frozen/readonly/mutable capabilities * cleanup * conditional reassignment test (not quite working) * hack to output svg files for debugging * handle conditional reassignment * improve capture analysis * treat jsx as (interior) mutable; handle memberexpression lvalues * lots of comments; hook return is frozen * update main comment * inference for switch, which reveals a bug * fix yarn.lock
1 parent a33c0b8 commit 3158146

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+8895
-6
lines changed

compiler/forget/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@
2626
"devDependencies": {
2727
"@babel/core": "^7.19.1",
2828
"@babel/generator": "^7.19.0",
29+
"@babel/parser": "^7.19.1",
2930
"@babel/plugin-syntax-typescript": "^7.18.6",
3031
"@babel/plugin-transform-block-scoping": "^7.18.9",
3132
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
3233
"@babel/preset-react": "^7.18.6",
3334
"@babel/preset-typescript": "^7.18.6",
35+
"@babel/traverse": "^7.19.1",
3436
"@babel/types": "^7.19.0",
37+
"@hpcc-js/wasm": "^1.15.0",
3538
"@testing-library/react": "^13.4.0",
3639
"@tsconfig/node16-strictest": "^1.0.3",
3740
"@types/invariant": "^2.2.35",

0 commit comments

Comments
 (0)