| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Mon, 22 Dec 2025 07:54:52 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100131125932
location: https://web.archive.org/web/20100131125932/https://github.com/cmatei/yalfs
server-timing: captures_list;dur=1.496976, exclusion.robots;dur=0.099600, exclusion.robots.policy;dur=0.073825, esindex;dur=0.020393, cdx.remote;dur=41.003636, LoadShardBlock;dur=370.014613, PetaboxLoader3.datanode;dur=225.226346, PetaboxLoader3.resolve;dur=82.261085
x-app-server: wwwb-app227-dc8
x-ts: 302
x-tr: 491
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app227; 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 07:54:52 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Sun, 31 Jan 2010 12:59:32 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "a6a7c4763b1bcc01f5845f6390f46742"
x-archive-orig-x-runtime: 93ms
x-archive-orig-content-length: 37297
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: Sun, 31 Jan 2010 12:59:32 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_14_20100131094628_crawl103-c/52_14_20100131125808_crawl101.arc.gz
server-timing: captures_list;dur=0.513119, exclusion.robots;dur=0.017161, exclusion.robots.policy;dur=0.008495, esindex;dur=0.010001, cdx.remote;dur=5.626357, LoadShardBlock;dur=180.937367, PetaboxLoader3.resolve;dur=138.042460, PetaboxLoader3.datanode;dur=154.075284, load_resource;dur=132.662340
x-app-server: wwwb-app227-dc8
x-ts: 200
x-tr: 382
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
cmatei's yalfs at master - GitHub
This service is courtesy of Pledgie.
cmatei / yalfs
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
-
Branches (1)
- master ✓
- Tags (0)
Sending Request…
Enable Donations
Pledgie Donations
Once activated, we'll place the following badge in your repository's detail box:
Yet Another Lisp From Scratch — Read more
yalfs /
README.TXT
Object representation
=====================
We have:
Direct objects:
fixnums
characters
pairs
Indirect objects:
booleans
symbols
strings
byte strings
vectors
Direct Objects
--------------
These are objects that look like heap pointers, but aren't really.
The lowest two bits are a data type tag.
I've tagged fixnums with 00 so addition works without shifts.
Tag values:
00 - fixnum
01 - character (unicode in raw representation ?)
10 - pair
11 - indirect
Fixnums and characters are really their own value shifted
arithmetically to the left.
Pairs are represented as two consecutive words in the heap (the car
and cdr respectively). The pair object is a pointer to them, but due
to the tag, it's off by 2 bytes. Note that the heap is aligned at word
boundaries (4 bytes on 32 bit) so the pair actually points somewhere
in the middle of the car.
Everything else is an indirect object. Tagged as indirect, points to
a structure on the heap which has the actual type and a variable length.
Regarding characters, they're a bit waste of space, but at least they
allow for all unicode, including the astral planes :-)
Indirect objects
----------------
An indirect object has at least one word on the heap. This word may
contain an immediate value (e.g. the two booleans), or the length of
the object in words (not including this initial one).
The first bits (LSb) of this word are of course the type tag. The tag
is not fixed in bit length. The idea is that for certain types, where
we might need a large length field, we can use the remaining bits in a
fixnum-like manner.
x00 - byte strings
x01 - vectors
x10 - strings
x11 - the others
11111111 - empty list
01111111 - booleans
10111111 - symbols
00111111 - foreign pointer
11011111 - primitive procedure
01011111 - interpreted procedure
10011111 - port
00011111 - end-of-file
11101111 - unspecified value
Syntactic Extensions (Macros)
=============================
There are only a few primitive expression types in R5RS: variables,
literal expressions, procedure calls, lambda, if, set! and define.
Everything else is derived syntax and can be defined using macros
(cond, let, and, or, etc). There are also no reserved keywords.
Implementing syntactic expressions (primitive or derived) straight
into the interpreter as special evaluation rules has the problem that
it forever "fixes" their meaning, and does not allow them to be
rebound.
My solution is to bind the identifiers used as syntactic keywords in
the initial environment as primitive procedures, which are however not
meant to be ever actually applied. Instead, when the evaluator sees
such a binding for an "application", it knows it must apply the
special evaluation rules.
When the evaluator sees an expression, it follows these rules:
- is it a constant ? return it
- is it a variable ? look it up in the environment
- it must be an application-thingie then.
evaluate the operator in the environment
is it bound to primitive_if?
evaluate if_predicate, then tail call for the consequent/alternate
is it bound to primitive_cond?
transform the expression to nested ifs, then tail call for them
[...]
is it a macro?
TBD (macroexand then tail call to eval it)
is it really an application?
apply it
Lexical scoping should then take care of potential redefinitions.
What this also allows me is to actually use a proper scheme as
implementation language for the macro facilities.
