HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
macabeus
js-proposal-algebraic-effects
JavaScript2019–2024
macabeus / js-proposal-algebraic-effects

js-proposal-algebraic-effects

📐Let there be algebraic effects in JS

3Distinct people
4Mentions
0Explicit recommenders
182GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

📐Let there be algebraic effects in JS

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:03:16 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year4 dated mentions

Observed mentions: 2019-12-24 07:48:51 UTC to 2024-04-05 10:15:52 UTC.

0122019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC211
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

What Hacker News says

4 sources
I have to admit: you're perfectly right here. React of course always relied on mutable state in it's implementation – just so we don't have to. I derailed a lot here to keep this funny thread going ;) I'm still not with you on your definition of "functional", since you treated it synonymously with "purely functional". Functional means just made by applying and composing functions, and react UI is created exactly like that. There is an awesome algebraic effects proposal[1], which will hopefully will be added to JavaScript one day, then react will make use of it to become purely functional. 1: https://github.com/macabeus/js-proposal-algebraic-effects
In A proposal to add signals to JavaScript
Ok I was wrongly assuming that panic was expecting an error type, in fact it's an interface{}. > Your use of exceptions for flow control (i.e. goto) is considered harmful Exceptions are a way to delegate error handling to the caller by giving them informations about the unexpected behavior. It implies that the expected behavior is the "happy path" (everything went well) and any deviations (errors) is unexpected. This is far from a goto because you can have `try/finally` blocks without catch (or defer in golang). Also, exceptions are just a kind of algebraic effects that do not resume. There was a proposal to JS for this: https://github.com/macabeus/js-proposal-algebraic-effects This is also easier to test. assertRaises(ErrorType, func() { code... }) Almost every Go library I've seen just return an error (which is just a string), you'd nee
Read the rest
d to parse it to assert that the correct error is returned in special conditions.
In Go Replaces Interface{} with 'Any'
Yeah. We need to ensure that we have a handler to catch the effect (there is an issue about that: https://github.com/macabeus/js-proposal-algebraic-effects/is...) For user, it could be useful to separate what from the how. For example, we could have a function that launches effects to manipulate the file system, and for test/mock purpose we could catch this effects with handlers that mock the file system. I know that the pattern dependency injection solve the same problem, but with effects you could do it with a more natural code.
In Ask HN: JavaScript Proposal – Algebraic Effects?
macabeus·Dec 24, 2019Submission

Ask HN: JavaScript Proposal – Algebraic Effects?

Hey guys, I'm writing a Babel plugin to be able to use algebraic effects in JS https://github.com/macabeus/js-proposal-algebraic-effects No more function color! Yes one-shot delimited continuation! What the hell?! Well... I really recommend that you read this blog post by Dan Abramov explaining algebraic effects - and how it could be very useful on our JavaScript code: https://overreacted.io/algebraic-effects-for-the-rest-of-us/ This project is a runnable POC with a Babel's "plugin", so you could write some code and taste this new concept in JavaScript. Its features, syntax, and goals are very inspired by Dan Abramov's blog post mentioned above. In short, with algebraic effects, you could separate what from the how and have fewer refactors. What do you think? Would that be a good feature for JS?
7 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.