cisco / ChezScheme

Chez Scheme
Apache License 2.0
6.95k stars 982 forks source link

Document in-memory layout of Scheme values (and reasoning) #654

Closed lambdadog closed 9 months ago

lambdadog commented 2 years ago

This would be quite valuable for new contributors and as a resource for porting Chez to a new platform, as well as learning resource for anyone implementing a compiler and wanting to see how (and why) Chez does things the way they do.

melted commented 2 years ago

If you haven't seen it there is a talk by @akeep at the Scheme Workshop that goes into some of that. It would be nice to have such things written down. Where is the best place to put documentation about internals?

lambdadog commented 2 years ago

Perhaps CONTRIBUTING.md? Not sure, honestly. The talk is brilliant though, I had not seen it.

jltaylor-us commented 2 years ago

The GitHub wiki is a convenient (for some definition of "convenient") place to dump documentation, hints, etc. that aren't part of Chez Scheme proper (even if they perhaps should be).

Some details of the internals are documented in the literature, but good luck knowing which ones unless you're an academic steeped in the PL literature already. You could trawl through Kent's publications, but I don't know which ones have details that you might be interested in (other than ones explicitly mentioned in CSUG).

LiberalArtist commented 1 year ago

The Racket fork has a file https://github.com/racket/ChezScheme/blob/8d134111b5a12ff9d0fecfcdb65e1a7ca64ad5e2/IMPLEMENTATION.md that gives some of this information. In particular, the "Scheme Objects" section is relevant the in-memory layout of Scheme values.

Note that some of the details in that file are different in the Racket fork than upstream (but I think the memory layout is the same).

mflatt commented 9 months ago

Closing now that "IMPLEMENTATION.md" is here (and matches the implementation here).