20 April 2022
- embedded workers from blob object URLs - create worker scripts dynamically from blob urls to manage actions off the main thread
- canceling async processes - workers w/URL.revokeObjectURL, await response pattern, etc.
- pseudocode notation for algorithms - klepmann post, behavioral programming paper
- observables vs. streams
- iterators and generators are for data, not actions
- Krasimir's banica library uses generators to manage action sequences - https://krasimirtsonev.com/blog/article/javascript-pattern-of-the-year-handle-async-like-a-boss
- generators can be "paused" in that they yield data, then await
.next(input)calls - observables and streams are structures or functions for handling data sequences
- observables and streams can be paused, resumed, written, not just populated and processed
- iterators and generators are for data, not actions
- observable es6 proposal test suite - like String#test
- CSS grid properties for Tab traversal - from sam calculator blog demo
- prototype pollution - sources, detection, defenses ( in progress... )
- validating HTML vs asserting the DOM (or enforcing by CSS, i.e., no selector matches)
- state transition tuples
- Using given-when-then or a sequential state transition ( see https://github.com/atomicojs/store ) testing or management function to check specs or models; continued from posts.md ( see https://gist.github.com/dfkaye/01537c58e425ef3480f2844eb4a65580 ).
- A unit test is a single check of a model's state change.
- Model checking means generating multiple inputs for multiple changes, potentially.
- Multiple inputs can be generated using generator functions.
- Start with initial value, iterate over a range, assert correctness or expected failures, and invariants.
- At an error, ask the generator to return the range of inputs so far, plus the last problematic
input, using
generator.next("status" or "complete"). - We could even pass the unit to the generator and let the generator do the work until it fails in a try-catch and return the range of passing inputs and the failing input.
- Instead of generating everything incrementally, proceed with fibonacci or fractal input, square roots, basically leaps until a failure occurs, then restrict the range between the last passing input and the failing input.
- Mocha + BDD use
describe(name, function)semantics. A model checker should instead use the function repeatedly against the generator's proposals (SAM pattern sneaking in) and iterate at smaller steps. So instead of describe() we have check(name, function) where function receives the different inputs from the generator and asserts the unit under test returns or transitions safely, fairly, or eventually, or all three (TLA+ sneaking in). - Re-visit Matt Baker's reactive.js ( https://github.com/mattbaker/reactive.js ), particularly the README section on cells and spreadsheets; specifically, a value is an expression dependent on one or more values at any point in time.
- Logicless templates
- re-visit
String.prototype.template("stateless components") gist ( https://gist.github.com/dfkaye/2d5cbd87f6bbf4976762 ) - and stringtemplate ( see https://github.com/antlr/stringtemplate4/blob/master/doc/introduction.md )
- re-visit
- console.test
- gist ( https://gist.github.com/dfkaye/c3add6603d1d3d6d2b7f9269dd896b2d )
String.prototype.test( https://gist.github.com/dfkaye/0461d4805817c21a5609 )