| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Mon, 22 Dec 2025 23:24:41 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100715124517
location: https://web.archive.org/web/20100715124517/https://github.com/petermichaux/bootstrap-scheme
server-timing: captures_list;dur=1.149049, exclusion.robots;dur=0.091106, exclusion.robots.policy;dur=0.067935, esindex;dur=0.019215, cdx.remote;dur=5.555348, LoadShardBlock;dur=189.670974, PetaboxLoader3.datanode;dur=69.224345, PetaboxLoader3.resolve;dur=97.266659
x-app-server: wwwb-app221-dc8
x-ts: 302
x-tr: 240
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app221; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Mon, 22 Dec 2025 23:24:41 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Thu, 15 Jul 2010 12:45:17 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "b0cc19390f474c816ce04a5a71d5a056"
x-archive-orig-x-runtime: 173ms
x-archive-orig-content-length: 29630
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Thu, 15 Jul 2010 12:45:17 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_16_20100715123845_crawl101_IndexOnly-c/52_16_20100715124434_crawl101.arc.gz
server-timing: captures_list;dur=0.747311, exclusion.robots;dur=0.025495, exclusion.robots.policy;dur=0.010666, esindex;dur=0.012686, cdx.remote;dur=7.259745, LoadShardBlock;dur=133.803338, PetaboxLoader3.datanode;dur=71.635595, PetaboxLoader3.resolve;dur=266.283031, load_resource;dur=267.714391
x-app-server: wwwb-app221-dc8
x-ts: 200
x-tr: 499
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
petermichaux's bootstrap-scheme at v0.21 - GitHub
petermichaux / bootstrap-scheme
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
v0.21
click here to add a description
click here to add a homepage
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Tue Jan 05 20:43:48 -0800 2010 | Initial commit: an REPL for integers. [petermichaux] |
| |
CHANGES | Sun Jan 24 15:21:26 -0800 2010 | change file [petermichaux] |
| |
LICENSE | Tue Jan 05 20:43:48 -0800 2010 | Initial commit: an REPL for integers. [petermichaux] |
| |
Makefile | Tue Jan 05 20:43:48 -0800 2010 | Initial commit: an REPL for integers. [petermichaux] |
| |
README | Sun Jan 24 14:42:42 -0800 2010 | add error primitive. Fix bug in recent commit f... [petermichaux] |
| |
scheme.c | Sun Jan 24 15:13:44 -0800 2010 | add read-char and peek-char [petermichaux] |
| |
stdlib.scm | Mon Jan 25 10:33:39 -0800 2010 | add standard library file [petermichaux] |
README
Bootstrap Scheme is a quick and very dirty Scheme interpreter. Its *only* intended use is to compile a self-compiling
Scheme-to-Assembly or Scheme-to-C compiler the first time.
Bootstrap Scheme doesn't have many features a Scheme system usually has. It doesn't have numbers other than integers. It
doesn't have vectors. It definitely doesn't have a module system, call/cc, macros, dynamic-wind or any other advanced
Scheme features.
Bootstrap Scheme is slow. The implementation is an abstract syntax tree node walker with no optimizations. There is no
point in making a node walking interpreter any better than the absolute base necessity as the fundamental design of a
node walker would never be used in production. Small, easy to read source code is far more important than anything else.
Bootstrap Scheme revels in the opportunity to be very dirty Scheme.
----
Example build and use.
$ cd bootstrap
$ make
cc -Wall -ansi -o scheme scheme.c
$ ./scheme
Welcome to your Scheme REPL. Use ctrl-c to exit.
> #t
#t
> -123
-123
> #\c
#\c
> "adsf"
"asdf"
> (quote ())
()
> (quote (0 . 1))
(0 . 1)
> (quote (0 1 2 3))
(0 1 2 3)
> (quote asdf)
asdf
> (define a 1)
ok
> a
1
> (set! a 2)
ok
> a
2
> (if #t 1 2)
1
> (+ 1 2 3)
6
> +
#<procedure>
> ((lamba (x) x) 1)
1
> (define (add x y) (+ x y))
ok
> (add 1 2)
3
> add
#<procedure>
> (define c ((lambda (x) (lambda () x)) 3))
ok
> (c)
3
> (begin 1 2)
2
> (cond (#f 1)
((eq? #t #t) 2)
(else 3))
2
> (let ((x (+ 1 1))
(y (- 5 2)))
(+ x y))
5
> (and 1 2 #f 3)
#f
> (or #f #f 3 #f)
3
> (apply + '(1 2 3))
6
> (define env (environment))
ok
> (eval '(define z 25) env)
ok
> (eval 'z env)
25
> (define out (open-output-port "asdf.txt"))
ok
> (write-car #\c out)
ok
> (close-output-port out)
ok
> (load "program.scm")
program-loaded
> (error "bad move")
"bad move"
exiting
$
----
For more information see:
https://peter.michaux.ca/articles/scheme-from-scratch-introduction
----
See the LICENSE file for legal information.
