News for hackers. Stuff that matters.
Re:Cyclone Scheme – Cheney on the MTA with Native Threads by justinethier on Thursday August 04, 2016 @09:31PM (#12229564)
Here is a basic introduction to the stack and heap, with examples in C: http://gribblelab.org/CBootcamp/7_Memory_Stack_vs_Heap.html

This might help with continuations: https://en.wikipedia.org/wiki/Continuation

Here is a really simple example of simulating a C return using call/cc:

  (display
    (call/cc
      (lambda (return)
        (display "hello ")
        (return "world")
        (display "never reached"))))
Re:Cyclone Scheme – Cheney on the MTA with Native Threads by qwertyuiop924 on Friday August 05, 2016 @06:44AM (#12231226)
For continuations, I would actually recomend "LAMBDA: The Ultimate Imperative" (http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-...). It's not exactly light reading, but it gives the best explanation of continuations that I've seen.

If you just want the simple explanation: A continuation is a copy of the return stack at the instant it was captured. When a continuation is invoked, that copy replaces the stack.

Re:Cyclone Scheme – Cheney on the MTA with Native Threads by gtoast on Friday August 05, 2016 @04:26PM (#12235517)
This is perfect! Thank you!
Re:Cyclone Scheme – Cheney on the MTA with Native Threads by gtoast on Friday August 05, 2016 @04:27PM (#12235519)
Thanks!