greg
2021-1-29 17:04:13

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.



sorawee
2021-1-29 17:15:37

@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.


samth
2021-1-29 17:15:52

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.


greg
2021-1-29 17:19:38

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.


sorawee
2021-1-29 17:21:49

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/


samth
2021-1-29 17:22:15

yes, that email thread is from 5 years after parameters were added to Racket


greg
2021-1-29 17:25:41

@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


greg
2021-1-29 17:26:17

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


sorawee
2021-1-29 17:27:02

That’s a lot of with-continuation-mark interleaved with continuation-mark-set->list


greg
2021-1-29 17:27:06

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.


sorawee
2021-1-29 17:28:25

(current-continuation-marks) probably should be replaced with #f to improve performance, but it might not matter that much


samth
2021-1-29 17:28:45

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


greg
2021-1-29 17:29:11

@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


greg
2021-1-29 17:30:26

(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.)


greg
2021-1-29 17:31:08

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.


samth
2021-1-29 17:34:44

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


greg
2021-1-29 17:38:37

I love how the pendulum swings to both ends before settling in the middle. It is very Hegelian. :slightly_smiling_face:


greg
2021-1-29 17:38:50

“Goto” -> “Goto considered harmful.” -> “Well, first-class continuations ain’t all bad.”


greg
2021-1-29 17:39:06

“Dynamic scope” -> “Only static scope is sane” -> “Wouldn’t it be neat if we take fluid-let and…”.


greg
2021-1-29 17:39:58

Maybe also dynamic and static types… and so on…


sorawee
2021-1-29 17:48:44

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:


yilin.wei10
2021-1-29 17:52:37

~Security~ Safety through obscurity?


greg
2021-1-29 18:02:37

“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:


sorawee
2021-1-29 18:17:42

What’s the middle of paren syntax and non-paren syntax?


kellysmith12.21
2021-1-30 06:49:08

Honu, maybe?