-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Editie zonder geavanceerde vuilnisophaler
- Loading branch information
1 parent
bd8db04
commit 377f807
Showing
7 changed files
with
2,337 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Dit is een minimalistische Lisp-implementatie, geheel geschreven in x86_64-assembly en deze Lisp zelf. | ||
Het project is geïnspireerd op Jones Forth, een editie van Forth geheel geschreven in (32-bits) x86-assembly, | ||
en een mooi voorbeeld van literate programming. | ||
|
||
Zie lisp.nasm voor de implementatie van de basistaal, | ||
en swail.lisp voor de code die dit uitbreidt tot een volwaardige Lisp. | ||
De Makefile geeft je de volgende commando's: | ||
$ make # Maak de executable lisp-nasm. | ||
$ make doe # Geef een prompt die Lisp kan uitvoeren. | ||
$ make kever # Start lisp-nasm in binnen GDB, met nuttige commando's voor het ontkeveren (zie lisp_gdb.py). | ||
$ make proef # Voer een paar zelftests uit. | ||
|
||
Benodigdheden: | ||
- Een computer met x86_64-processor en Linux. | ||
- Een niet te oude versie van NASM, de Netwide Assembler. Versie 2.13 is modern genoeg. | ||
- Een linker, bijvoorbeeld `ld` die meegeleverd is met GCC. | ||
- (GNU) Make | ||
- Optioneel: GDB, the GNU Debugger, met Python3-support, voor ontkevering. | ||
|
||
Voorzien van: | ||
- Minimalisme | ||
- Basissysteem geheel x86_64-assembly | ||
- Dynamische scopes | ||
- Vuilnisophaling | ||
- Configureerbare primitieven |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
lisp-nasm: lisp-nasm.o | ||
ld -nostdlib -static -o lisp-nasm lisp-nasm.o | ||
|
||
doe: lisp-nasm | ||
cat swail.lisp - | ./lisp-nasm | ||
|
||
kever: lisp-nasm | ||
gdb -x gdb-lisp ./lisp-nasm | ||
|
||
proef: lisp-nasm | ||
cat swail.lisp proeven.lisp | ./lisp-nasm | ||
|
||
lisp-nasm.o: lisp.nasm | ||
nasm -f elf64 -g -o lisp-nasm.o lisp.nasm | ||
|
||
lisp: lisp.S | ||
gcc -m64 -nostdlib -static -gstabs+ -o lisp lisp.S | ||
|
||
.PHONY: doe kever proef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set disassemble-next-line on | ||
set disassembly-flavor intel | ||
source lisp_gdb.py | ||
break foutmelding | ||
break kever.klaar_1 | ||
echo \n | ||
echo Lisp-ontkeveraar opgestart.\n | ||
echo Runnen met standaardbieb: `(gdb) run <swail.lisp`.\n | ||
echo Hulpcommando's voor datainspectie: `(gdb) lisp <iets>`.\n |
Oops, something went wrong.