{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":470516909,"defaultBranch":"v0","name":"continuation","ownerLogin":"thefrontside","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2022-03-16T09:36:48.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/223096?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1709309322.0","currentOid":""},"activityList":{"items":[{"before":"51402446277daf3be0785358f12f77b720b25e22","after":null,"ref":"refs/heads/jsr","pushedAt":"2024-03-01T16:08:42.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"}},{"before":"0e2e1f9f7ff18a1f3a773fe833641077de3f017b","after":"582994ee12915a99d55216408daff69efebbdc14","ref":"refs/heads/v0","pushedAt":"2024-03-01T16:08:41.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"Merge pull request #17 from thefrontside/jsr\n\nAdd support for JSR","shortMessageHtmlLink":"Merge pull request #17 from thefrontside/jsr"}},{"before":null,"after":"51402446277daf3be0785358f12f77b720b25e22","ref":"refs/heads/jsr","pushedAt":"2024-03-01T14:50:59.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"Add support for JSR\n\nhttps://jsr.io","shortMessageHtmlLink":"Add support for JSR"}},{"before":null,"after":"0bce0aa42d154364626d1966d1fbabe6bbdaba9c","ref":"refs/heads/structural-soundness","pushedAt":"2024-02-16T20:36:32.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"Add test cases for structural soundness","shortMessageHtmlLink":"Add test cases for structural soundness"}},{"before":"365f070619c12f2b4f6093ab8b145c3c9db2d4bd","after":null,"ref":"refs/heads/experimental-tail-only-optimized","pushedAt":"2024-02-16T19:53:28.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"}},{"before":"82bde9bd3a9956df202f2808e58523ff5023d9ff","after":"0e2e1f9f7ff18a1f3a773fe833641077de3f017b","ref":"refs/heads/v0","pushedAt":"2024-02-16T19:53:27.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"Merge pull request #16 from thefrontside/experimental-tail-only-optimized\n\nUnify stack reduction","shortMessageHtmlLink":"Merge pull request #16 from thefrontside/experimental-tail-only-optim…"}},{"before":"3c538641d07560282451d24cc9f84c136acbab22","after":"365f070619c12f2b4f6093ab8b145c3c9db2d4bd","ref":"refs/heads/experimental-tail-only-optimized","pushedAt":"2024-01-27T03:57:03.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"Unify stack reduction\n\nCurrently there are two codepaths for resuming computations: `k()` and\n`k.tail()` where the first hase a return value, but is recursive and\nis subject to stack overflow, while `k.tail()` is not allowed to have\na return value, but has a more resilient stack. There are a number of\nproblems with this.\n\nThe first is the cognitive overhead on the API side. You have to\nconstantly remember that you need to call `k.tail()` instead of `k()`\nor you might just introduce a stack overflow bug. The second is the\ncomplexity of the implementation. In order to make the `k.tail()`\nwork, we needed to manage the call stack to be weirdly re-entrant with\na separate `Stack` object, and a check to see if the stack was\ncurrently reducing (Stack.reducing). This also comes with a _memory\ncomplexity_ penalty because we're creating a lot of intermediate\nobjects in the form of the stack itself, and also in the form of the\nthunks that we are pushing and popping off the stack. There was also\nmemory overhead in creating four continuation functions (`k()`,\n`k.tail()`, `reject()` and `reject.tail()`) instead of just two.\n\nThis avoids all that complexity by making the entire `evaluate()`\nmethod into a single while loop that only takes up one native\nJavaScript stack frame to execute no matter how deeply nested the\ncomputation you want to run is. However, this does require a key\nbreaking change:\n\n`k()` is a Computation, not a callback\n===\n\nthe `k()` passed to `shift()` is of type `(value) => Compuation`\ninstead of `(value) => T`. This means that in order to use it, you\nhave to either `yield* k()` or re-enter a reduction with evaluate. In\nother words, reduction stacks must be explicitly created with\n`evaluate()` in order to use them, for example, from a `setTimeot()`.\n\nOtherwise, they can be used seamlessly if you are already inside of a\ndelimited continuation:\n\n```ts\nlet result = evaluate(function* run() {\n let sum = 0;\n for (let i = 0; i < 100_000; i++) {\n sum += yield* shift<1>(function* incr(k) {\n return yield* k(1);\n });\n }\n return sum;\n});\n\nconsole.dir({ result });\n```\n\nthe above will print => `{ result: 10000 }`;\n\nThe tradeoff for this breaking change is drastically reduced\ncomplexity of implementation.","shortMessageHtmlLink":"Unify stack reduction"}},{"before":null,"after":"3c538641d07560282451d24cc9f84c136acbab22","ref":"refs/heads/experimental-tail-only-optimized","pushedAt":"2024-01-26T20:39:41.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"Unify stack reduction\n\nCurrently there are two codepaths for resuming computations: `k()` and\n`k.tail()` where the first hase a return value, but is recursive and\nis subject to stack overflow, while `k.tail()` is not allowed to have\na return value, but has a more resilient stack. There are a number of\nproblems with this.\n\nThe first is the cognitive overhead on the API side. You have to\nconstantly remember that you need to call `k.tail()` instead of `k()`\nor you might just introduce a stack overflow bug. The second is the\ncomplexity of the implementation. In order to make the `k.tail()`\nwork, we needed to manage the call stack to be weirdly re-entrant with\na separate `Stack` object, and a check to see if the stack was\ncurrently reducing (Stack.reducing). This also comes with a _memory\ncomplexity_ penalty because we're creating a lot of intermediate\nobjects in the form of the stack itself, and also in the form of the\nthunks that we are pushing and popping off the stack. There was also\nmemory overhead in creating four continuation functions (`k()`,\n`k.tail()`, `reject()` and `reject.tail()`) instead of just two.\n\nThis avoids all that complexity by making the entire `evaluate()`\nmethod into a single while loop that only takes up one native\nJavaScript stack frame to execute no matter how deeply nested the\ncomputation you want to run is. However, this does require a key\nbreaking change:\n\n`k()` is a Computation, not a callback\n===\n\nthe `k()` passed to `shift()` is of type `(value) => Compuation`\ninstead of `(value) => T`. This means that in order to use it, you\nhave to either `yield* k()` or re-enter a reduction with evaluate. In\nother words, reduction stacks must be explicitly created with\n`evaluate()` in order to use them, for example, from a `setTimeot()`.\n\nOtherwise, they can be used seamlessly if you are already inside of a\ndelimited continuation:\n\n```ts\nlet result = evaluate(function* run() {\n let sum = 0;\n for (let i = 0; i < 100_000; i++) {\n sum += yield* shift<1>(function* incr(k) {\n return yield* k(1);\n });\n }\n return sum;\n});\n\nconsole.dir({ result });\n```\n\nthe above will print => `{ result: 10000 }`;\n\nThe tradeoff for this breaking change is drastically reduced\ncomplexity of implementation.","shortMessageHtmlLink":"Unify stack reduction"}},{"before":"ca6d4078851e5ad01d1c5a9c4c580167146bb791","after":null,"ref":"refs/heads/taras-patch-1","pushedAt":"2023-12-13T20:11:22.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"taras","name":"Taras Mankovski","path":"/taras","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/74687?s=80&v=4"}},{"before":"7304c518c4132a1b578ab3cb481e2f4c70ffc689","after":"82bde9bd3a9956df202f2808e58523ff5023d9ff","ref":"refs/heads/v0","pushedAt":"2023-12-13T20:11:21.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"taras","name":"Taras Mankovski","path":"/taras","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/74687?s=80&v=4"},"commit":{"message":"Merge pull request #15 from thefrontside/taras-patch-1\n\nFix markdown syntax","shortMessageHtmlLink":"Merge pull request #15 from thefrontside/taras-patch-1"}},{"before":null,"after":"ca6d4078851e5ad01d1c5a9c4c580167146bb791","ref":"refs/heads/taras-patch-1","pushedAt":"2023-12-13T20:07:02.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"taras","name":"Taras Mankovski","path":"/taras","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/74687?s=80&v=4"},"commit":{"message":"Fix markdown syntax\n\nI might have 💪 too hard in #14","shortMessageHtmlLink":"Fix markdown syntax"}},{"before":"dd38fa891958c691a782a02ce50a66741c9191fd","after":null,"ref":"refs/heads/taras-patch-1","pushedAt":"2023-12-13T20:06:05.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"taras","name":"Taras Mankovski","path":"/taras","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/74687?s=80&v=4"}},{"before":"c9009bf2cf16e8c93f174a5498812fef3162db09","after":"7304c518c4132a1b578ab3cb481e2f4c70ffc689","ref":"refs/heads/v0","pushedAt":"2023-12-13T20:06:04.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"taras","name":"Taras Mankovski","path":"/taras","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/74687?s=80&v=4"},"commit":{"message":"Merge pull request #14 from thefrontside/taras-patch-1\n\nAdd a link to wikipedia page","shortMessageHtmlLink":"Merge pull request #14 from thefrontside/taras-patch-1"}},{"before":null,"after":"dd38fa891958c691a782a02ce50a66741c9191fd","ref":"refs/heads/taras-patch-1","pushedAt":"2023-12-13T19:20:40.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"taras","name":"Taras Mankovski","path":"/taras","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/74687?s=80&v=4"},"commit":{"message":"Add a link to wikipedia page\n\nI'm referencing this page in Effection docs, so I want to make sure that it provides a trail to the definition of Delimited Continuation.","shortMessageHtmlLink":"Add a link to wikipedia page"}},{"before":"581e1e0d2ee2a01ff10028c546411087dc5205d9","after":null,"ref":"refs/heads/tree-shakable","pushedAt":"2023-04-06T14:51:59.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"}},{"before":"e528c8ff88a040cbf0a014a4832920419d0962c1","after":"c9009bf2cf16e8c93f174a5498812fef3162db09","ref":"refs/heads/v0","pushedAt":"2023-04-06T14:51:58.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"Merge pull request #13 from thefrontside/tree-shakable\n\n✨Make npm package tree shakeable","shortMessageHtmlLink":"Merge pull request #13 from thefrontside/tree-shakable"}},{"before":null,"after":"581e1e0d2ee2a01ff10028c546411087dc5205d9","ref":"refs/heads/tree-shakable","pushedAt":"2023-04-06T14:32:42.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"✨Make npm package tree shakeable\n\nFor those consuming from NPM, might be nice to tree shake","shortMessageHtmlLink":"✨Make npm package tree shakeable"}},{"before":"f2b57041170922b5f98a1b3430a1e5c24511741a","after":null,"ref":"refs/heads/release-0.1.5","pushedAt":"2023-03-20T19:54:52.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"}},{"before":"7a18808bd2aadf8bac7fa93196583910f7619ddf","after":"e528c8ff88a040cbf0a014a4832920419d0962c1","ref":"refs/heads/v0","pushedAt":"2023-03-20T19:54:50.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"Merge pull request #12 from thefrontside/release-0.1.5\n\nRelease 0.1.5","shortMessageHtmlLink":"Merge pull request #12 from thefrontside/release-0.1.5"}},{"before":"3f1416bb6d97ffd9b5795c9ede015ee774ed9fa4","after":null,"ref":"refs/heads/next-throw-v2","pushedAt":"2023-03-20T19:47:56.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"neurosnap","name":"Eric Bower","path":"/neurosnap","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1940365?s=80&v=4"}},{"before":"94e748f63cfecf8199cfb98dd8a71db095dbc35c","after":"7a18808bd2aadf8bac7fa93196583910f7619ddf","ref":"refs/heads/v0","pushedAt":"2023-03-20T19:47:55.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"neurosnap","name":"Eric Bower","path":"/neurosnap","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1940365?s=80&v=4"},"commit":{"message":"Merge pull request #11 from thefrontside/next-throw-v2\n\nprevent stack overflows with `k.tail()`","shortMessageHtmlLink":"Merge pull request #11 from thefrontside/next-throw-v2"}},{"before":"1beaa4356140c0bb27f9d7090c1ccded4e2f7126","after":"3f1416bb6d97ffd9b5795c9ede015ee774ed9fa4","ref":"refs/heads/next-throw-v2","pushedAt":"2023-03-20T19:46:49.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"neurosnap","name":"Eric Bower","path":"/neurosnap","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1940365?s=80&v=4"},"commit":{"message":"feat: preventing stack overflows with `k.tail()`\n\nPreviously inside a `shift()` instruction we would always return the\nvalue of `k()`. This caused another tick in the stack frame which\ncaused the stack to increase until an overflow was reached. Previously\nit only took about 1495 `shift()` calls inside a loop to cause a stack\noverflow.\n\nNow we provide the ability for the end-user to decide whether or not\nthey care about the return value of `k()` with the addition of\n`k.tail()` which will continue the same stack frame instead of creating\na new one, preventing the likely-hood of a stack overflow.\n\nThe reason why we started investigating this inside `continuation` was\nbecause of a previous issue in `redux-saga`:\nhttps://github.com/redux-saga/redux-saga/issues/1592\n\nCo-authored-by: Charles Lowell ","shortMessageHtmlLink":"feat: preventing stack overflows with k.tail()"}},{"before":null,"after":"f2b57041170922b5f98a1b3430a1e5c24511741a","ref":"refs/heads/release-0.1.5","pushedAt":"2023-03-20T19:38:34.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"Release 0.1.5","shortMessageHtmlLink":"Release 0.1.5"}},{"before":"22ebb23827e2b6b9f308cfc371c831e382357c68","after":"1beaa4356140c0bb27f9d7090c1ccded4e2f7126","ref":"refs/heads/next-throw-v2","pushedAt":"2023-03-20T19:29:49.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"neurosnap","name":"Eric Bower","path":"/neurosnap","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1940365?s=80&v=4"},"commit":{"message":"chore: remove unused type for continuation","shortMessageHtmlLink":"chore: remove unused type for continuation"}},{"before":"83e68a66a9dcd133ee958c478f8d00debc3f98de","after":"22ebb23827e2b6b9f308cfc371c831e382357c68","ref":"refs/heads/next-throw-v2","pushedAt":"2023-03-20T18:52:33.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"♻️collapse finally into a `for` loop","shortMessageHtmlLink":"♻️collapse finally into a for loop"}},{"before":"5dc32838b733044e1b0750a193c489ea5779705a","after":"83e68a66a9dcd133ee958c478f8d00debc3f98de","ref":"refs/heads/next-throw-v2","pushedAt":"2023-03-20T18:49:27.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"neurosnap","name":"Eric Bower","path":"/neurosnap","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1940365?s=80&v=4"},"commit":{"message":"changes","shortMessageHtmlLink":"changes"}},{"before":"479f488d17c7744e985a6e28113b8290c8e90950","after":"5dc32838b733044e1b0750a193c489ea5779705a","ref":"refs/heads/next-throw-v2","pushedAt":"2023-03-20T16:18:58.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"neurosnap","name":"Eric Bower","path":"/neurosnap","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1940365?s=80&v=4"},"commit":{"message":"revert tick changes","shortMessageHtmlLink":"revert tick changes"}},{"before":"f58eb0afea99a23cc99d58fc77b4662b88258520","after":"479f488d17c7744e985a6e28113b8290c8e90950","ref":"refs/heads/next-throw-v2","pushedAt":"2023-03-20T16:11:22.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"cowboyd","name":"Charles Lowell","path":"/cowboyd","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4205?s=80&v=4"},"commit":{"message":"♻️More lightly couple the tail error test","shortMessageHtmlLink":"♻️More lightly couple the tail error test"}},{"before":"874c6c4f42af569493733a1d0f300d35d8e3a5b8","after":"f58eb0afea99a23cc99d58fc77b4662b88258520","ref":"refs/heads/next-throw-v2","pushedAt":"2023-03-20T15:33:26.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"neurosnap","name":"Eric Bower","path":"/neurosnap","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1940365?s=80&v=4"},"commit":{"message":"chore: address comments","shortMessageHtmlLink":"chore: address comments"}},{"before":"8ffc155f2ddca679d9046e66330138a685baa9b9","after":"874c6c4f42af569493733a1d0f300d35d8e3a5b8","ref":"refs/heads/next-throw-v2","pushedAt":"2023-03-20T15:31:32.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"neurosnap","name":"Eric Bower","path":"/neurosnap","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/1940365?s=80&v=4"},"commit":{"message":"fix lint","shortMessageHtmlLink":"fix lint"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAECe8jewA","startCursor":null,"endCursor":null}},"title":"Activity · thefrontside/continuation"}