<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: cowboyd</title><link>https://news.ycombinator.com/user?id=cowboyd</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Wed, 08 Apr 2026 01:36:22 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=cowboyd" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by cowboyd in "You can't cancel a JavaScript promise (except sometimes you can)"]]></title><description><![CDATA[
<p>I think writing an effect library yourself is a tough ask, but some of them have gotten really, really good. And they get you things that are simply not possible with promise. Check out Effection if you want a more vanilla javascript syntax, or Effect if you're really into expressing things functionally.</p>
]]></description><pubDate>Tue, 07 Apr 2026 19:41:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=47680369</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=47680369</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47680369</guid></item><item><title><![CDATA[New comment by cowboyd in "You can't cancel a JavaScript promise (except sometimes you can)"]]></title><description><![CDATA[
<p>Is it safe to just "stop calling next() on a generator?" like the post suggest?<p>To me that sounds like dropping the task on the floor. Specifically, this will not invoke any finally {} blocks:<p>More correctly, you should invoke `return()` on the generator. Otherwise, you won't provide execution guarantees. This is how Effection does it. There is no equivalent in async functions, so it sounds like the same problem would apply to the GC technique.</p>
]]></description><pubDate>Tue, 07 Apr 2026 18:45:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=47679629</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=47679629</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47679629</guid></item><item><title><![CDATA[New comment by cowboyd in "Delimited Generators – A more natural API for JS generators"]]></title><description><![CDATA[
<p>JavaScript generators are unmined gold! We've done a lot of usage of JavaScript generators as delimited continuations; using them to implement the classic shift/reset operations in JavaScript. <a href="https://github.com/thefrontside/continuation">https://github.com/thefrontside/continuation</a><p>Built on those delimited continuations is structured concurrency for JavaScript (<a href="https://frontside.com/effection" rel="nofollow">https://frontside.com/effection</a>)</p>
]]></description><pubDate>Sun, 05 May 2024 21:57:42 +0000</pubDate><link>https://news.ycombinator.com/item?id=40268868</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=40268868</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40268868</guid></item><item><title><![CDATA[New comment by cowboyd in "Show HN: Starfx – A modern approach to side-effect and state management in UI"]]></title><description><![CDATA[
<p>> yes but what do I say to my colleagues when they realize they need to learn generators (it's a non-trivial hurdle for many people)<p>Just tell them that they already know them.<p>`yield*` is<p>- a superset of `await` so if you understand `await`, you understand `yield*`<p>- infinitely more powerful because it can handle any effect, not just Promise resolution.<p>- It's just javascript syntax that predates `await`</p>
]]></description><pubDate>Fri, 01 Mar 2024 17:16:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=39563993</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=39563993</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39563993</guid></item><item><title><![CDATA[Effection 3.0 – Structured Concurrency and Effects for JavaScript]]></title><description><![CDATA[
<p>Article URL: <a href="https://frontside.com/blog/2023-12-18-announcing-effection-v3/">https://frontside.com/blog/2023-12-18-announcing-effection-v3/</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=38685475">https://news.ycombinator.com/item?id=38685475</a></p>
<p>Points: 6</p>
<p># Comments: 2</p>
]]></description><pubDate>Mon, 18 Dec 2023 17:28:15 +0000</pubDate><link>https://frontside.com/blog/2023-12-18-announcing-effection-v3/</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=38685475</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38685475</guid></item><item><title><![CDATA[New comment by cowboyd in "The Await Event Horizon in JavaScript"]]></title><description><![CDATA[
<p>JavaScript’s async/await constructs have a critical lack of power which makes them unsuitable to implement structured concurrency.</p>
]]></description><pubDate>Mon, 11 Dec 2023 19:57:20 +0000</pubDate><link>https://news.ycombinator.com/item?id=38604685</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=38604685</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38604685</guid></item><item><title><![CDATA[The Await Event Horizon in JavaScript]]></title><description><![CDATA[
<p>Article URL: <a href="https://frontside.com/blog/2023-12-11-await-event-horizon/">https://frontside.com/blog/2023-12-11-await-event-horizon/</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=38604684">https://news.ycombinator.com/item?id=38604684</a></p>
<p>Points: 6</p>
<p># Comments: 2</p>
]]></description><pubDate>Mon, 11 Dec 2023 19:57:20 +0000</pubDate><link>https://frontside.com/blog/2023-12-11-await-event-horizon/</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=38604684</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38604684</guid></item><item><title><![CDATA[New comment by cowboyd in "Structured Concurrency"]]></title><description><![CDATA[
<p>For those interested in exploring Structured Concurrency in JavaScript, there is <a href="https://frontside.com/effection" rel="nofollow">https://frontside.com/effection</a></p>
]]></description><pubDate>Mon, 21 Mar 2022 09:19:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=30751942</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=30751942</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=30751942</guid></item><item><title><![CDATA[New comment by cowboyd in "Structured Concurrency"]]></title><description><![CDATA[
<p>I think the simplest expression of the idea of structured concurrency that I've come across is this: The scope of any concurrent process is the same as the <i>lexical</i> scope of the function that created it. This has profound implications.<p>Let's say, for example that I call `doTasks()` with 10 separate tasks. Before any of them can complete, one of them fails. What happens to the other 9? In your example, they are "leaked" because they will continue running, even though the scope that was awaiting their results in gone. Using a "worker pool" as in the example, it might go something like this:<p><pre><code>  async function doTasks(tasks = []) {
    let workerpool = new WorkerPool();
    try {
      for (let task of tasks) {
        workerpool.exec("my task", task);
      }
      let results = await workerpool.all();
      // do stuff with results
    } finally {
      // no matter the outcome, nothing outlives this scope.
      await workerpool.destroy();
    }
  }
</code></pre>
It should be noted that cancellation, i.e. the ability to "destroy" a concurrent task is a necessary primitive for structured concurrency. You can think of it as the equivalent of automatically releasing memory at the end of a lexical scope.<p>There is already an implementation of Structured Concurrency for JavasScript here <a href="https://frontside.com/effection" rel="nofollow">https://frontside.com/effection</a></p>
]]></description><pubDate>Mon, 21 Mar 2022 09:11:40 +0000</pubDate><link>https://news.ycombinator.com/item?id=30751892</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=30751892</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=30751892</guid></item><item><title><![CDATA[New comment by cowboyd in "Effection: For When Async/Await Is Not Enough"]]></title><description><![CDATA[
<p>> I'm not sure I buy the premise for the library's existence, at least with how the author describes it.<p>Just do a google search for "structured concurrency". These ideas did not come out of a vacuum, but instead from years of research in language communities ranging from C/C++ to Java, Swift, and Python. Effection is just these same ideas projected into the world of JavaScript.<p>You may find the following resources are helpful<p>- <a href="https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/" rel="nofollow">https://vorpus.org/blog/notes-on-structured-concurrency-or-g...</a><p>- <a href="https://elizarov.medium.com/structured-concurrency-722d765aa952" rel="nofollow">https://elizarov.medium.com/structured-concurrency-722d765aa...</a><p>- <a href="https://openjdk.java.net/jeps/8277129" rel="nofollow">https://openjdk.java.net/jeps/8277129</a><p>- <a href="https://www.wwdcnotes.com/notes/wwdc21/10134/" rel="nofollow">https://www.wwdcnotes.com/notes/wwdc21/10134/</a></p>
]]></description><pubDate>Tue, 23 Nov 2021 10:16:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=29316247</link><dc:creator>cowboyd</dc:creator><comments>https://news.ycombinator.com/item?id=29316247</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=29316247</guid></item></channel></rss>