match-iz
A tiny pattern-matching library in the style of the TC39 proposal. (by shuckster)
Our great sponsors
proposal-operator-overloading | match-iz | |
---|---|---|
9 | 11 | |
612 | 132 | |
1.3% | - | |
3.1 | 6.6 | |
4 months ago | 14 days ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proposal-operator-overloading
Posts with mentions or reviews of proposal-operator-overloading.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-06-01.
-
I think Zig is hard but worth it
There's a not-very-active proposal to add operator overloading to JS which takes a similar scoped approach:
https://github.com/tc39/proposal-operator-overloading
-
Applying common operators (like +, *, -, /, etc.) to objects/arrays/lists?
There's a proposal to add operator overloading to the language, but AFAIK it never landed.
-
Immutability: what a monster...
An example of it would be the operator overloading proposal https://github.com/tc39/proposal-operator-overloading that would allow overriding === and it would also solve in one shot many other problems (like numeric types extension, pipeable operator, and all the ones listed in the proposal).
-
Is there a way to access native operations via class methods?
Kind of but not really. There is the concept of operator overloading that would let you specify how to handler uses of operators like - and + with your class instances, but this is not yet officially supported in JavaScript. There is an operator overloading proposal to maybe add it in the future (and if you're using QuickJS that has support built in), but right now there's not a whole lot you can do.
- Proposed Operator Overloading in JavaScript
-
Extending Built-ins with ES6 Classes
Though this is not possible now since operators always work on primitive values, there is a proposal for operator overloading that could potentially allow us to use operators on objects in the future. It's still very early, so its not something you can use today (or anytime soon, if ever at all). In the meantime, you'll need to use method calls to perform these kinds of operations.
-
[AskJS] Why does our community hate Operator Overloading?
I'm not sure who hates it, but I have seen it abused (which people don't like). But, quickjs has it now, and there's a proposal to have it added to the JS spec. The proposal is only stage 1, so who knows what will happen with it or when, but its not counted out.
-
ES2022 feature: class static initialization blocks
https://github.com/tc39/proposal-operator-overloading
There are still a couple issues that have to be solved. m2c: I hope that won't get to stage 3, though I like operator overloading in general, I think it's something that will complicate JS even more.
- TC39 proposal: operator overloading in JavaScript
match-iz
Posts with mentions or reviews of match-iz.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-04-08.
-
match-iz: a tiny pattern-matching library
Thank you, and it does!
-
Javascript futures and Result monads belong together
I do enjoy a bit of monad'ing. I often use this minimal Maybe in projects, inspired by Folktale and Crocks.
-
Defeating Javascript Obfuscation
I've done a little myself with eslint-plugins and codemods and found it useful for avoiding repetition and ?.. There's a TC39 proposal that's in the works, but I got impatient and wrote a small lib that tries to provide the same functionality.
-
Upcoming ECMAScript features I'm excited about
I'm doing my part, though!
-
[AskJS] favorite JavaScript library
Honestly, my own. Not that I can take credit for the fundamental shape of the API -- it's directly inspired by the TC39 pattern-matching proposal. Still, I use it all the time and can't wait for the day when I don't have to.
-
oxide.ts - my Rust-inspired Option/Result and match library - Version 1.0 Release
Slightly related is this pattern matching library I saw the other week, you might be interested: https://github.com/shuckster/match-iz
- match-iz: A tiny pattern-matching library in the style of the TC39 proposal
-
Does JavaScript have an equivalent for this?
JavaScript doesn't have that natively yet, but you can get close using a library:
-
[AskJS] Why does our community hate Operator Overloading?
While pattern-matching doesn't exist in the language yet, there are many libraries on NPM for it, and it looks applicable for your own use-cases. (Full disclosure: The above example is from my own.)
-
Pattern matching = switch++
After learning about the exciting, but sadly only Stage 1 proposal for pattern-matching in JavaScript, I felt compelled to write a library that tries to, erm, match it as closely as I could:
What are some alternatives?
When comparing proposal-operator-overloading and match-iz you can also consider the following projects:
ohm - A library and language for building parsers, interpreters, compilers, etc.
Zeronode - Zeronode - minimal building block for NodeJS microservices
quickjs - Public repository of the QuickJS Javascript Engine.
proposal-pattern-matching - Pattern matching syntax for ECMAScript
bhai-lang - A toy programming language written in Typescript
proposal-deep-path-properties-for-re
crocks - A collection of well known Algebraic Data Types for your utter enjoyment.
proposal-operator-overloading vs ohm
match-iz vs Zeronode
proposal-operator-overloading vs quickjs
match-iz vs proposal-pattern-matching
proposal-operator-overloading vs proposal-pattern-matching
match-iz vs bhai-lang
proposal-operator-overloading vs proposal-deep-path-properties-for-re
match-iz vs ohm
match-iz vs crocks