News for hackers. Stuff that matters.
Re:Clojure core.async Channels by cgag on Friday June 28, 2013 @10:43PM (#5961335)
A more detailed explanation on how those IoC threads work would be awesome too if someone's going to be explaining things to children would be great.
Re:Clojure core.async Channels by snprbob86 on Friday June 28, 2013 @11:23PM (#5961407)
The IoC threads work by converting park-able functions into Single-Static Assignment (SSA) form [1] and then compiled to a state machine. Essentially, each time a function is "parked", it returns a value indicating where to resume from. These little state machine functions are basically big switch statements that you don't need to write by hand. This design is inspired by C#'s async compilation strategy. See the EduAsync Series [2] on John Skeet's blog, and the compilation post [3] in particular. Once you have these little state machines, you just need some external code to turn the crank.

[1]: http://en.wikipedia.org/wiki/Static_single_assignment_form

[2]: http://msmvps.com/blogs/jon_skeet/archive/tags/Eduasync/defa...

[3]: http://msmvps.com/blogs/jon_skeet/archive/2011/05/20/eduasyn...

Re:Clojure core.async Channels by cgag on Saturday June 29, 2013 @12:57AM (#5961540)
These are all excellent, that wiki page is surprisingly easy to understand. Thanks.
Re:Clojure core.async Channels by ufo on Saturday June 29, 2013 @02:22AM (#5961624)
My impression is that the IOC threads spare you from needing to write continuation-passing-style code by hand and let you program in a more idiomatic style instead. This would be specially useful if you have lots of jumps in your control flow such as loops, return and break statements.