3 ms·
Also from David A. Wheeler's 6502 Language Implementation Approaches (archive.org-ified to the time the links were written, or best approximation): https://web
by DonHopkins 7y ago
Also from David A. Wheeler's 6502 Language Implementation Approaches (archive.org-ified to the time the links were written, or best approximation):
https://web.archive.org/web/20181112182918/https://dwheeler.com/6502/ https://web.archive.org/web/20181112182918/https://dwheeler....
Lisp/LOGO
The "skimp" page also includes a list of several 8-bit LISP implementations, including several for the 6502 [1]. This discussion lists more [2]. One useful implementation discussion (of many!) is R. Kent Dybvig's "Three Implementation Models for Scheme". University of North Carolina Computer Science Technical Report 87-011 [Ph.D. Dissertation], April 1987 [3].
neslisp [4] is a small subset of Lisp that generates 6502 code (NES); the as of version 0.1 it is released under the GPLv2 license (and thus is open source software). An older version is available via neslisp on Google code [5].
Picobit [6] (GPLv3) looks interesting. You program in Lisp (specifically a variant of Scheme) on a larger system; it then compiles to a VM that runs on the target. Currently it does not support the 6502, but the system is designed to be portable and it looks to me that it'd be relatively easy to port to a 6502.
Lysp [7] (MIT license) is another small implementation of Lisp. It doesn't directly support 6502 and is in C, but it's small... so it might not be hard to transliterate. A related program from the same developer is Maru [8], which can self-host. This could be a reasonable starting point for creating a 6502 Lisp.
Turning the Apple //e into a lisp machine, part 1 [9] refers to this Lisp interpreter for the Apple //e [10] (MIT license). They also show a clever bootstrap approach: they send code via the audio jack (!).
There's more that can be done; Lisp was originally developed in 1965, on even smaller systems. The book "Lisp in Small Pieces", Program Transformation in Lisp [11], this Scheme page [12] and these details on implementation [13] are all of interest. R. Kent Dybvig's "Three Implementation Models for Scheme" [14] shows how to implement Scheme while still keeping most stuff on the stack. Tagging could be difficult, but an alternative (that I believe was done for early Lisp implementations) is to partition the memory into regions; to determine the tag, just check which memory region it is in. It might be possible to start with PicoLisp [15] to create a 6502 version. There is a trivial ACL2 implementation of Lisp (GPL) [16] that I converted into Common Lisp ( compiler [17], run-time [18]; See Wolfgang Goerigk's "Compiler Verification Revisited" [19] for more).
I know that there was an "InterLISP 65" available for Atari's 6502-based line.
Various full LOGO implementations were available as well.
[1] skimp: http://web.archive.org/web/20100131151915/http://www.ip9.org/munro/skimp/ http://web.archive.org/web/20100131151915/http://www.ip9.org...
[2] discussion: [missing]
[3] Three Implementation Models for Scheme: https://web.archive.org/web/20160817185323/http://www.cs.indiana.edu/~dyb/pubs/3imp-abstract.html https://web.archive.org/web/20160817185323/http://www.cs.ind...
[4] neslisp: https://web.archive.org/web/20160319025751/http://gomez.yellowcouch.org/lisp/ https://web.archive.org/web/20160319025751/http://gomez.yell... sources: https://web.archive.org/web/20160619185108/http://gomez.yellowcouch.org/lisp/src/neslisp-0.1.tar.gz https://web.archive.org/web/20160619185108/http://gomez.yell...
[5] google code nelisp: [missing]
[6] Picobit: https://web.archive.org/web/20150106110223/https://github.com/stamourv/picobit https://web.archive.org/web/20150106110223/https://github.co... current: https://github.com/stamourv/picobit https://github.com/stamourv/picobit
[7] Lysp: https://web.archive.org/web/20180929064442/http://piumarta.com/software/lysp/ https://web.archive.org/web/20180929064442/http://piumarta.c... source: browse: https://web.archive.org/web/20170507045957/http://www.piumarta.com/software/lysp/lysp-1.1/ https://web.archive.org/web/20170507045957/http://www.piumar... download: https://web.archive.org/web/20180929064442/http://piumarta.com/software/lysp/lysp-1.1.tar.gz https://web.archive.org/web/20180929064442/http://piumarta.c...
[8] Maru: https://web.archive.org/web/20181206222700/http://piumarta.com/software/maru/ https://web.archive.org/web/20181206222700/http://piumarta.c... source: browse: https://web.archive.org/web/20181206222700/http://piumarta.com/software/maru/maru-2.4/ https://web.archive.org/web/20181206222700/http://piumarta.c... download: https://web.archive.org/web/20181206222700/http://piumarta.com/software/maru/maru-2.4.tar.gz https://web.archive.org/web/20181206222700/http://piumarta.c...
[9] Turning the Apple //e into a lisp machine, part 1: https://web.archive.org/web/20190109003417/http://blog.nullspace.io/apple-2-lisp-part-1.html https://web.archive.org/web/20190109003417/http://blog.nulls...
[10] google code turtles: https://web.archive.org/web/20180611002847/https://github.com/hausdorff/turtles https://web.archive.org/web/20180611002847/https://github.co... current: https://github.com/hausdorff/turtles https://github.com/hausdorff/turtles
[11] Program Transformation in Lisp: http://www.findinglisp.com/blog/2004/06/program-transformation-in-lisp.html http://www.findinglisp.com/blog/2004/06/program-transformati...
[12] this Scheme page: [missing]
[13] these details on implementation: https://web.archive.org/web/20180801195133/http://library.readscheme.org/page8.html https://web.archive.org/web/20180801195133/http://library.re...
[14] Three Implementation Models for Scheme: https://web.archive.org/web/20190503102138/https://cs.indiana.edu/~dyb/papers/3imp.pdf https://web.archive.org/web/20190503102138/https://cs.indian...
[15] PicoLisp: https://web.archive.org/web/20181124064229/http://www.software-lab.de/down.html https://web.archive.org/web/20181124064229/http://www.softwa...
[16] ACL2 implementation of Lisp (GPL): https://web.archive.org/web/20090217043459/http://www.cs.utexas.edu/users/moore/acl2/v3-1/distrib/acl2-sources/books/workshops/1999/compiler/ https://web.archive.org/web/20090217043459/http://www.cs.ute...
[17] compiler: https://web.archive.org/web/20160320015734/http://www.dwheeler.com/trusting-trust/lisp-demo/mycompiler.cl https://web.archive.org/web/20160320015734/http://www.dwheel...
[18] runtime: [missing]
[19] Compiler Verification Revisited: [missing] citation: https://dl.acm.org/citation.cfm?id=369101 https://dl.acm.org/citation.cfm?id=369101 buy chapter: https://link.springer.com/chapter/10.1007/978-1-4757-3188-0_15 https://link.springer.com/chapter/10.1007/978-1-4757-3188-0_...