kal
continuation
kal | continuation | |
---|---|---|
2 | 4 | |
396 | 26 | |
- | - | |
10.0 | 4.5 | |
almost 10 years ago | 2 months ago | |
JavaScript | TypeScript | |
MIT License | - |
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.
kal
-
Internals of Async / Await in JavaScript
It's obsolete now, but before async/await was part of JS proper I worked on a compile-to-JS language that handled this by compiling to callbacks: https://github.com/rzimmerman/kal
It included try/catch support and fancy stuff, like loops. The source may be interesting for anyone interested in compilers: https://github.com/rzimmerman/kal/blob/master/source/generat...
The Kal compiler is written in Kal, but it's supposed to be easy to read. Surprisingly the browser demo still works: http://rzimmerman.github.io/kal/demo.html
- Please Put Units in Names
continuation
-
A more natural API for JavaScript generators
Further, there is a delimited continuation library that effection uses: https://github.com/thefrontside/continuation
-
Bun, JavaScript, and TCO
While working on effection (https://github.com/thefrontside/effection) we spent a bunch of time ensuring that our delimited continuations could handle deep recursive call stacks in Deno.
PR: https://github.com/thefrontside/continuation/pull/11
TCO would have definitely simplified this issue.
What’s worse is hitting maximum memory callstack exception is very tricky to catch and is not reliable across runtimes. So when a user hits it it can be tricky to track down.
-
Internals of Async / Await in JavaScript
- https://github.com/thefrontside/continuation
- https://github.com/thefrontside/effection/tree/v3
- https://github.com/neurosnap/starfx
The last one intends to replace redux-saga using DCs.
Here’s a presentation I gave recently talking about DCs in typescript: https://youtu.be/uRbqLGj_6mI?si=XI0JNMKMoO2VHMvM
-
Philosophy of Coroutines
These libraries rely on deliminited continuations:
https://github.com/thefrontside/continuation
Because of this tiny implementation we are able to express any async flow construct with less code than relying on something like async/await or callbacks.
What are some alternatives?
NodaTime - A better date and time API for .NET
assembly - assembly projects
phpmnd - PHP Magic Number Detector
myproxy - MySQL proxy
SI - A header only C++ library that provides type safety and user defined literals for physical units
redux-saga - An alternative side effect model for Redux apps
durationcheck - Go linter to detect erroneous multiplication of duration values
starfx - A modern approach to side-effect and state management for web apps.
Unchained - A fully type safe, compile time only units library.
libcommon - Library of reusable C++ code
effection - Structured concurrency and effects for JavaScript