-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathNOTES
75 lines (61 loc) · 1.85 KB
/
NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Structure of the Racket virtual machine model:
5 "registers" for the machine
V - the most recent evaluated value
S - the machine stack (it is a stack machine so all variables are stored and referenced here)
H - the machine heap (this is where all the boxed data and closures go)
T - text segment with the bodies of program segments and bytecode cycles
C - command register, set of instructions to be run, this gets reloaded from the text segment)
The commands are:
i --> e
| (swap n)
| (reorder i (e m) ...)
| (set n)
| (set-box n)
| (branch e e)
| framepop
| framepush
| (call n)
| (self-call x)
where e is
e --> (loc n)
| (loc-noclr n)
| (loc-clr n)
| (loc-box n)
| (loc-box-noclr n)
| (loc-box-clr n)
| (let-one e e)
| (let-void n e)
| (let-void-box n e)
| (boxenv n e)
| (install-value n e e)
| (install-value-box n e e)
| (application e e ...)
| (seq e e e ...)
| (branch e e e)
| (let-rec (l ...) e)
| (indirect x)
| (proc-const (t ...) e)
| (case-lam l ...)
| l
| v
| (self-app x e_0 e_1 ...)
| (primval ---)
and l is
l --> (lam n (n ...) x)
and v is
v --> number
void
'variable
b
undefined
(clos x)
Ideas for abstracting this:
1. Follow the abstracting abstract machines approach, but apply it directly to
the abstract machine that describes Racket. This is the approach Kimball is
taking (it was my first thought too, but Matt seems to think it is a step a
little too far off of the main abstracting abstract machines path).
2. Try to encode the byte code into a CESK machine and then follow the
abstracting abstract machines approach.
In doing #2: The value register is a bit of a strange artifact of the stack
machine, maybe try to see if anyone has already converted a stack machine into
a CESK machine.