
Cyclone Scheme – Cheney on the MTA with Native Threads - ThatGeoGuy
http://justinethier.github.io/cyclone/index
======
qwertyuiop924
This is a pretty cool project, but it doesn't have the library support of
other schemes. Given CHICKEN's already Cheney based, I wonder if Felix could
somehow integrate this work? Green-Threaded pre-emptive cooroutines are all
well and good, but sometimes you want OS threads...

~~~
justinethier
Cyclone author here. R7RS libraries and SRFI's will help to some extent, for
example hashtable support was more or less plug and play. As Cyclone matures
it could potentially support R7RS-large which is going to include quite a bit.
But we'll have to see how much of that can handle "real" things like database,
graphics, etc.

It would require major changes to the CHICKEN runtime to support native
threads, but Cyclone does map out a potential solution.

~~~
qwertyuiop924
>R7RS libraries and SRFI's will help to some extent, for example hashtable
support was more or less plug and play. As Cyclone matures it could
potentially support R7RS-large which is going to include quite a bit. But
we'll have to see how much of that can handle "real" things like database,
graphics, etc.

Good news!

>It would require major changes to the CHICKEN runtime to support native
threads, but Cyclone does map out a potential solution

Oh well. Well, at least there is hope.

------
david-given
Metropolitan Transit Authority, apparently, and not Mail Transfer Agent as I
had originally thought. Although knowing this hasn't made anything clearer.

About five minutes of my life died to bring you this information.

~~~
qwertyuiop924
Cheney on the MTA is a strategy for efficiently implementing continuations,
TCO, and garbage collection, and allows you to create a continuation with no
immediate cost. It's a pun on the song "Charlie on the MTA" because of how
it's implemented, like Charlie, it "never returns." For more info, see "CONS
Should Not CONS Its Arguments Part II: Cheney On The MTA" By Henry Baker.

~~~
david-given
Yes, that was where I eventually tracked down the meaning (in the footnotes
where it was hard to find, although they were good enough to quote the verse).

The thing about pop culture is that firstly it dates _really badly_ , and
second is that it doesn't work across cultures. I'd never heard of the song
before now..

~~~
twoodfin
"Charlie on the MTA" isn't really "pop" culture, it's Boston (area) culture,
originating over 60 years ago. Not surprising that it ended up in technical
literature around Scheme.

~~~
qwertyuiop924
Boston area? I live in New England, and while not exactly the most common
thing, it's fairly well known.

I've seen more than a few people who thought the Boston T charged you on your
way out their first time in Boston because of this song.

------
jcl
I thought this might have had something to do with the Cyclone safety-oriented
C dialect, but apparently the similar name is coincidental.

[https://en.wikipedia.org/wiki/Cyclone_(programming_language)](https://en.wikipedia.org/wiki/Cyclone_\(programming_language\))

------
gtoast
Can anyone point me in the direction some call with continuation and stack and
heap explainer? It would be great if it was brief and visual but I'm willing
to read up. I just want to make sure that an explanation of call/cc is
forthcoming.

~~~
justinethier
Here is a basic introduction to the stack and heap, with examples in C:
[http://gribblelab.org/CBootcamp/7_Memory_Stack_vs_Heap.html](http://gribblelab.org/CBootcamp/7_Memory_Stack_vs_Heap.html)

This might help with continuations:
[https://en.wikipedia.org/wiki/Continuation](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"))))

~~~
qwertyuiop924
For continuations, I would actually recomend "LAMBDA: The Ultimate Imperative"
([http://repository.readscheme.org/ftp/papers/ai-lab-
pubs/AIM-...](http://repository.readscheme.org/ftp/papers/ai-lab-
pubs/AIM-353.pdf)). 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.

~~~
gtoast
This is perfect! Thank you!

