scrying technical notes
Table of Contents
scrying technical notes
schemes
mini-scheme
memory hack
- uses structures so not so easy.
- but structures are abstracted apart from some cell pointer arithmetic
flat string storage
/* cell structure */ struct cell { unsigned short _flag; union { struct { char *_svalue; short _keynum; } _string; struct { long _ivalue; } _number; struct { struct cell *_car; struct cell *_cdr; } _cons; } _object; };
translates into svalue,keynum,ivalue,car,cdr
GC
We use algorithm E (Knuth, The Art of Computer Programming Vol.1, sec.3.5) for marking.
primitives
should be easy
notes
very easy to read
dispatching
2450 lines
short op = (short) OP_LOAD; // as first operation
marks 8/10
tiny scheme
notes
can't compile. too messy with dynload and other stuff though similar in some respects to minischeme
marks 2/10
icbins
memory hack
typedef int obj; static obj heap[2 * heap_size]; static char marks[heap_size]; static int hp = heap_size; /* heap pointer */ static obj stack[stack_size]; static int sp = 0; /* stack pointer */
translates to:
heap, marks, stack
so very simple.
GC
unsure of this
primitives
notes
simple memory, messy implementation with some features missing
marks 5/10
own
notes
plus: memory abstraction, knowledge of code, simple base
minus: much to fix and add, GC to add, reader code is messy(could be abstracted further)
others of note: xs, actornet,,
actornet
file:sync/root/projects/scryer/lisps/ActorNet-1.0/ActorNet/eval.c::eval c
interesting in terms of actors and mobile code, but builds on tinyOS so can't use, is also harder to follow code
also has virtual memory VM management with cached pages from serial flash which could be useful
where is GC?
file:sync/root/projects/scryer/lisps/ActorNet-1.0/ActorNet/data.c::data c
XS
file:sync/root/projects/scryer/lisps/XS/xs/eval.c::
looks very messy
conclusion
try to make own interpreter more readable and attempt to iron out basic bugs
failing this consider adapting either minischeme or actornet
PC side
using Emacs / M-x serial-term allows for serial terminal access with no extras
[ok for quick debugging]
what we want?
Outside Emacs we can use:
cat example.scm | socat -u - /dev/ttyUSB0,raw,echo=0,crnl
readline up and down arrow prompts
also:
socat READLINE /dev/ttyUSB0,echo=0,crnl
but there is some strange stuff with CR
scrying buffer with commands to send regions
(make-serial-process :port "/dev/ttyS0" :speed 9600)
(process-send-region process start end)
see: file:~/scrying/scrying/scrying.el::make serial process port dev ttyUSB0 speed 9600 name scrying
possibly tab completion
other/hardware
- sleep?
- to come: transceiver, fm, local resonance amp, random bit additions (white noise)
- test charging
- test solar
- to signal that GPS signal is locked
- recreate lost kicad->svn,
- cywm antenna
- visualisation
data visualisation
some tests with mapped GPS under Octave/gnuplot
Date: 2009-12-31 15:51:10 GMT
HTML generated by org-mode 6.31trans in emacs 23