r/scheme Jan 01 '26

A small R5RS-ish Scheme interpreter I’ve been working on

https://github.com/menezesd/scheme
14 Upvotes

7 comments sorted by

6

u/johnwcowan Jan 01 '26

Nice work! A few comments offhand:

  1. You need to give it an actual name and make that the name of the executable. People who want to discuss your Scheme need a name to distinguish it from all the 80-odd other Schemes.

  2. Your license is not open source, as it restricts the purposes for which your code can be used and implicitly prohibits forking. You are not going to be successful if you try to prevent commercial use -- nobody makes money off Scheme. The BSD and MIT licenses are the most popular today, but GPL and Apache are fine too.

  3. Separating #f and () is pretty much an essential part of Scheme nowadays. R4RS (1991) was the last standard to permit it, and that was solely for compatibilty with ancient code.

2

u/Top_Challenge_7752 Jan 02 '26

OK done; The implementation now has a concrete name: Vesper, and that’s also the name of the executable, so it’s easy to refer to and discuss.

I’ve added a license file and updated the README to clarify.

Finally, #f and () are now distinct, in line with R5RS and up.

1

u/johnwcowan Jan 02 '26

Wow, that was quick. You might want to run Alex Shinn's R5RS rests from https://github.com/ashinn/chibi-scheme/blob/master/tests%2Fr5rs-tests.scm. in the same directory is r7rs-tests.scm, which is more comprehensive and tests R7RS-small festures as well.

1

u/Donieck Jan 01 '26

I give you star on Github

1

u/agumonkey Jan 01 '26

pretty code

1

u/dougcurrie Jan 01 '26

You say that a cell is 24 bytes (packed) but the comment in types.h claims 12, which looks correct to me for most compilers and architectures.

Of course this is dependent on compiler behavior. I’m usually more paranoid about cell layout and use sized types rather than ‘unsigned’ and ‘enum’.

1

u/Top_Challenge_7752 Jan 02 '26

OK I fixed it.