@fed1/jsos
v1.0.0-preview.11
Published
WARNING: DO NOT USE! This library does not have a stable release yet.
Readme
JS Object System (JSOS)
WARNING: DO NOT USE! This library does not have a stable release yet.JSOS enables you to write type-safe, extensible JavaScript without a compiler.
It accomplishes this goal using type-based multiple dispatch and a reified type system.
This library is gratis and open source, licensed under the MIT No Attribution License (MIT-0).
Features
- Multimethods inspired by Common Lisp
- Type-based dispatch
- Class-based dispatch
- Trait-based dispatch
- Structual (deep equality) dispatch¹
- Predicate dispatch¹
- Qualified methods: around, before, after
- Method combinators: progn, list, pipe, plus, custom
- "Call next method" support
- Contracts to enforce input and output types
- Type system inspired by Julia
- Abstract types with multiple inheritance
- Parametric struct types
- Dependent types
- Type unions and intersections
- Traits inspired by Rust
- Traits that bundle multimethods
- Can be implemented by types and other traits
- Typed alternatives to JS's Array, Map, Set
- Immutable by default
- Mutable versions are observable
- Adds covariant tuples
¹: Optional, can be enabled on a per-multimethod basis
See examples in the docs to get a feel for how these features work together.
Installation
npm i @fed1/jsosDocumentation
You can find the documentation at:
To help edit the documentation, checkout the docs branch and read the README
there.
Contributing
We welcome your ideas, bug reports, and contributions. Please read the CONTRIBUTING.md file if you want to get involved.
