Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/KirkMartinez/cbm-scheme

Simple Scheme interpreter for Commodore (and other 6502) machines
https://github.com/KirkMartinez/cbm-scheme

Last synced: about 2 months ago
JSON representation

Simple Scheme interpreter for Commodore (and other 6502) machines

Lists

README

        

Herein ye shall find a Scheme interpreter for the Commodore 128.

I have included a disk image (scheme.d64) in the repo in case you don't want to bother with compiling and just use Scheme with VICE or your Commodore straight away.

If you want to build the Scheme interpreter you will need:
1. The VICE emulator (to generate .d64 disk image)
http://vice-emu.sourceforge.net
2. The cc65 C compiler, assembler, linker
http://cc65.github.io/cc65/

You can probably use other platforms supported by cc65.
Just change the SYS target platform in the Makefile.

To build the Scheme interpreter:
make CC65_HOME=/path/to/cc65

The create a disk image (scheme.d64):
make disk

------------------------

The Scheme implementation is based on Peter Michaux's Scheme from
Scratch article:
http://peter.michaux.ca/articles/scheme-from-scratch-introduction

I made some changes to the Scheme syntax to suit the CBM:
- Character literals are expressed using #% instead of #\
- You can quote double-quotes in a string using percent (%", not \")
- Use #%newline and #%space for newline and space in strings
- Symbols can only be up to 10 characters long
- Built-in procedure names have been shorteded to fit the 10 char limit

TODO:
- Provide line history/navigation in interpreter using arrow keys
- Provide a way to read Scheme source from a text file

BUGS:
- Memory is never freed, even when re-running the program.
I guess this has something to do with how cc65 implements malloc...

Enjoy!
Kirk Martinez