-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQUASHED: ubg-notes,
- Loading branch information
Showing
8 changed files
with
219 additions
and
85 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
demos/stefan/active-expressions/aexpr-diss-check-ast-nodes/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Number of AST Nodes | ||
|
||
|
||
<script> | ||
import sloc from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm' | ||
|
||
function countNodes(srcCode) { | ||
let nodeCount = 0 | ||
srcCode.traverseAsAST({ | ||
enter(path) { | ||
nodeCount++; | ||
} | ||
}) | ||
return nodeCount | ||
} | ||
|
||
// const srcURL = lively4url + '/../active-expressions/src/'; | ||
// function skip(fileURL) { | ||
// return fileURL.endsWith('utils.js') | ||
// } | ||
// const srcURL = lively4url + '/../aexpr-ticking/src/'; | ||
// function skip(fileURL) { | ||
// return fileURL.endsWith('utils.js') | ||
// } | ||
const srcURL = lively4url + '/../aexpr-interpretation/src/'; | ||
function skip(fileURL) { | ||
return false && fileURL.includes('babelsberg') || fileURL.endsWith('utils.js') | ||
} | ||
// const srcURL = lively4url + '/../aexpr-source-transformation-propagation/src/'; | ||
// function skip(fileURL) { | ||
// return false | ||
// } | ||
// const srcURL = lively4url + '/../babel-plugin-aexpr-source-transformation/'; | ||
// function skip(fileURL) { | ||
// return !fileURL.endsWith('./index.js') | ||
// } | ||
const { contents: files } = await fetch(srcURL, { | ||
method: "OPTIONS", | ||
headers: {filelist: "true"} | ||
}).then(r => r.json()) | ||
|
||
// lively.files.visualizeFileTreeMap(srcURL) | ||
|
||
|
||
const metrics = [] | ||
for (let file of files) { | ||
const fileURL = srcURL + file.name; | ||
if (fileURL.endsWith('.js') && !skip(fileURL)) { | ||
const code = await fileURL.fetchText(); | ||
const numNodes = countNodes(code) | ||
const sLoc = sloc(code, 'js').source | ||
metrics.push([fileURL, `${numNodes} (${sLoc})`]) | ||
} | ||
} | ||
|
||
<table>{...metrics.map(([file, numNodes]) => <tr><td>{file}</td><td>{numNodes}</td></tr>)}</table> | ||
</script> |
69 changes: 69 additions & 0 deletions
69
demos/stefan/active-expressions/aexpr-diss-check-ast-nodes/results.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Convention | ||
- ast nodes 136 = 18 + 118 | ||
- sloc (29) = (1) + (28) | ||
|
||
[aexpr-ticking](https://github.com/active-expressions/aexpr-ticking.git) | ||
e9b4034 | ||
e9b4034606dd286ac494f20293cf7e7e9649e0ac | ||
|
||
- https://lively-kernel.org/lively4/aexpr/../aexpr-ticking/src/./aexpr-ticking.js 18 (1) | ||
- https://lively-kernel.org/lively4/aexpr/../aexpr-ticking/src/./ticking/ticking-active-expressions.js 118 (28) | ||
|
||
# Interpretation | ||
- ast nodes 787 = 12+182+224+369 | ||
- sloc (170) = (1)+(43)+(51)+(75) | ||
|
||
[aexpr-interpretation](https://github.com/active-expressions/aexpr-interpretation.git) | ||
46d1d17 | ||
46d1d175b4cb040bda636fe871ef5d2f70f5e3e8 | ||
|
||
- https://lively-kernel.org/lively4/aexpr/../aexpr-interpretation/src/./aexpr-interpretation.js 12 (1) | ||
- https://lively-kernel.org/lively4/aexpr/../aexpr-interpretation/src/./interpretation/property-accessor.js 182 (43) | ||
- https://lively-kernel.org/lively4/aexpr/../aexpr-interpretation/src/./interpretation/listener.js 224 (51) | ||
- https://lively-kernel.org/lively4/aexpr/../aexpr-interpretation/src/./interpretation/interpretation-active-expressions.js 369 (75) | ||
|
||
# Compilation | ||
- ast nodes 2281 = 730+1551 | ||
- sloc (471) = (169)+(302) | ||
|
||
[aexpr-source-transformation-propagation](https://github.com/active-expressions/aexpr-source-transformation-propagation.git) | ||
3154d05 | ||
3154d05af0ce410b041eb312ba57f7d32a6e7672 | ||
|
||
- https://lively-kernel.org/lively4/aexpr/../aexpr-source-transformation-propagation/src/./aexpr-source-transformation-propagation.js 730 (169) | ||
|
||
[babel-plugin-aexpr-source-transformation](https://github.com/active-expressions/babel-plugin-aexpr-source-transformation.git) | ||
54a712a | ||
54a712a45175f98c0f0a627770ae811759b195da | ||
|
||
- https://lively-kernel.org/lively4/aexpr/../babel-plugin-aexpr-source-transformation/./index.js 1551 (302) | ||
|
||
--- | ||
|
||
--- | ||
|
||
2820 + null | ||
|
||
all ref | ||
5794 = 1707 + 1267 + 2820 | ||
|
||
all aexpr | ||
3038 = 274 + 672 + 2092 | ||
|
||
interpret aexpr | ||
926 = 787 + 139 | ||
|
||
sum aexprs | ||
3964 = 3038 + 926 | ||
|
||
1707 - 274 | ||
1267 - 672 | ||
2820 - 2092 | ||
|
||
subsec:impl_comparison | ||
subsec:impl_complexity | ||
subsec:impl_qualitative_analysis | ||
subsec:impl_quantitative_analysis | ||
|
||
|
||
3018 = 2092 + 787 + 139 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/client/reactive/babel-plugin-sample-data-bindings/scribbles.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const target = document.getElementById('target'); | ||
|
||
target.style.width <~ that.style.width | ||
|
||
|
||
|
||
|
||
|
||
|
||
ae(that.style.width).onChange(v => target.style.width = v) | ||
import { AExprRegistry } from 'src/client/reactive/active-expression/ae-registry.js' | ||
AExprRegistry.allAsArray().last.dispose() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters