Giter Club home page Giter Club logo

composite-collection's People

Contributors

ajvincent avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

composite-collection's Issues

Create spec/static-analysis directory for static analysis of classes

... which is a hairy problem in and of itself.

sverweij/dependency-cruiser#336 is the closest I could find to what I need, more complex than eslint but not designed for unit tests.

Example: KeyHasher must store non-primitive keys weakly. Truly verifying that would require analysis of an abstract syntax tree (AST), trying to trace an entry point (an argument in one function) to points that assign or store a value. I could see that requiring a few things, of which I only know I need the first three:

  • An Acorn-generated AST.
  • Maybe a tree-walking tool to invoke traps for certain AST node types.
  • An entry tuple to pass in and start the analysis, looking for any assignment or storage which returned false for a rejected state (meaning a strong reference).
  • A composite set for assignment and storage nodes, with test functions returning true ("accept"), false ("reject") or undefined (for "unknown, dig deeper").
  • A composite set of tree nodes representing arguments and return / throw values from one function to another.
  • A "non-deterministic finite automation" (also known as a state machine) combining the previous two sets and a starting point.
    • Because of the changing nature of this and/or stack traces, the automaton might need to become a "push-down automaton", which is just lovely for the added complexity.

Crafting this would be ugly, but the composite collections I'm building could make it easier, ironically enough.

Honestly, the complexity of this type of analysis could result in a complementary project, where each one uses the other as a development dependency...

Add eslint support

I created the eslint branch, but this requires eslint to support private class fields - which it won't until after ECMAScript 2022 goes official in June 2022. I could make it work by using @babel/eslint-parser, but I think that locks me in with much pain trying to convert from one engine to another for future work.

Add "getWithDefault" method to map collections

if (!this.has(args))
  this.set(args, defaultValue);
return this.get(args)

With the number of arguments and work we have to do, providing a built-in method for this is probably a good idea.

Special construction test: every combination of 2 map keys and 2 set keys should result in a class

spec/integration/combinations.mjs should:

  1. Create configurations out of combinations
  2. Write generated code for each configuration to a temporary file
  3. Load the file as a module and confirm the module exports a syntactically valid class
  4. Delete the temporary file

This should produce 16 unique classes.

For good measure, I can also include combinations classes for 3 levels of map keys (8) and 3 levels of set keys (8).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.