Idle curiosity about the history, which is true: 1. Continuation marks came first, then parameters. 2. Parameters came first, then got re-implemented in terms of continuation marks, later. 3. Both added at about the same time.
These posts are really helpful for me to understand cont marks - http://jeapostrophe.github.io/2012-07-16-cont-mar-post.html - http://jeapostrophe.github.io/2012-07-25-cont-mar-post.html - http://jeapostrophe.github.io/2012-07-30-cont-mar-post.html
@greg I think parameters came first. See https://srfi.schemers.org/srfi-39/srfi-39.html. The original proposal consumes space linear to the depth of recursion though.
The HISTORY file says “Added thread-savy parameterization system” for v45 in November 1996; that’s the first mention of parameters in the HISTORY. The entry “Added with-continuation-mark and current-continuation-marks, but these have not yet been documented because their semanticses are not yet finalized” is for v53, July 1998. They were finished for v100 in 1999.
Thanks! So IIUC it’s a cool example of exposing a mechanism for user programs, and also, “dog-fooding” it to re-implement a primitive language feature.
Oh, yup, the email thread does suggest that it’s already been implemented in Racket before the proposal: https://srfi-email.schemers.org/srfi-39/msg/2784373/
yes, that email thread is from 5 years after parameters were added to Racket
@sorawee Pretty recently I was staring at this use of continuation marks in racket/trace
and just utterly baffled: https://github.com/racket/racket/blob/c6b3f337e90db20bf93053b2bbb684de57c0a9f8/racket/collects/racket/trace.rkt#L217-L263
Eventually, I think I figured it out, and added some comments to my own variation of that, for something I’ve been playing around with: https://github.com/greghendershott/vestige/blob/master/vestige-lib/vestige/private/tracing/wrap.rkt#L29-L77
That’s a lot of with-continuation-mark
interleaved with continuation-mark-set->list
I’m not 100% sure those comments are correct, but they captured by brain state at a point where I think I figured it out. :slightly_smiling_face: In case that’s useful or interesting.
(current-continuation-marks)
probably should be replaced with #f
to improve performance, but it might not matter that much
I think that parameters were in Chez Scheme before 1996 and that there’s some document about them, but I can’t find it off-hand
@sorawee In my version I tried to optimize that, e.g. see tail?
function below: https://github.com/greghendershott/vestige/blob/master/vestige-lib/vestige/private/tracing/wrap.rkt#L91-L123
(I’d be happy to submit that as a PR back to racket/trace
eventually but this is just a couple weeks old and I’m still faffing about with it.)
Also I’m not sure if people really use racket/trace
much, except for “light” ad hoc temporary exploring? It might not matter. I was thinking about an application where it might matter, more.
Here’s the key idea for parameter
in 1987 in a tech report by Matthias and Dan Friedman and Bruce Duba: https://legacy.cs.indiana.edu/ftp/techreports/TR220.pdf
I love how the pendulum swings to both ends before settling in the middle. It is very Hegelian. :slightly_smiling_face:
“Goto” -> “Goto considered harmful.” -> “Well, first-class continuations ain’t all bad.”
“Dynamic scope” -> “Only static scope is sane” -> “Wouldn’t it be neat if we take fluid-let and…”.
Maybe also dynamic and static types… and so on…
My feeling is that goto is bad because it allows people to write bad code easily, and it’s so easy to use goto.
First class continuation also allows people to write bad code easily, but it’s so damn difficult for people to understand how to use it, so it’s not as harmful :slightly_smiling_face:
~Security~ Safety through obscurity?
“It’s hard to follow the logic in assembly language” -> “Structured programming” -> “Inversion of control web frameworks”. Oops, the pendulum didn’t stop in the middle it swung all the way back. :shrug:
What’s the middle of paren syntax and non-paren syntax?
Honu, maybe?