Date : Sat, 28 Feb 1987 08:41:46 GMT
From : ubc-vision!alberta!myrias!cg@BEAVER.CS.WASHINGTON.EDU (Chris Gray)
Subject: More info on Draco
Many thanks to John S. Fisher for his comments on Draco. I'll reply to each
of his points in turn.
(1) bad code for read(ptr*) where ptr is 'ulong' - I haven't tried this,
but it sounds reasonable, and shouldn't be hard to fix. I'll do it
before long.
(2) lack of goto making a decision table hard to implement - I'm afraid I'm
a pretty strong fan of structured programming, so Draco is very unlikely
to acquire a goto construct. I'm not sure exactly what you mean by
decision tabled based, but can't they be done like state machines, which
usually go something like this:
type State_t = enum {st_start, st_end, st_nice, st_blue, ...};
State_t CurrentState;
CurrentState := st_start;
while CurrentState ~= st_end do
case CurrentState
incase st_start:
if blah blah blah then
CurrentState := st_nice;
else
blih blih blih
CurrentState := st_blue;
fi;
incase st_nice:
do something or other
CurrentState := st_end;
etc.
esac;
od;
(3) Wants fixed-format input capability - fixed format input can be read using
non-fixed format input, so long as there are delimiters of some kind. If
not, reading character arrays, adding a space to the end, and doing
memory-to-memory I/O works.
(4) lack of floating point - Yep, its a problem for those who need it. The
format the compiler uses is IBM-360/370 float format - sign bit, excess
64 hexadecimal exponent, and 24 bits of hex normalized fraction. The
linkage needed is exactly that described for operator types.
(5) Hmm, I guess I could have checked for sufficient TPA. The needs depend
on the complexity of your program, however (recursive descent parsing).
(6) how expensive is 'open' on character strings (memory to memory I/O)? - its
about 10 lines of Draco code in the run-time library, and the per-
character cost is considerably less than disk or console I/O.
(7) extending CRT library to handle input, special characters, etc. - sounds
like a good idea, but it would take a fair amount of thought and work.
Any volunteers?
(8) Support and source - I'm quite willing to fix any bugs found, but not to
extend the compiler or libraries (there's no memory space to extend the
compiler anyway). I'm not sure how to distribute updates, however. If some
individual wants to become a distribution site, I'm willing to send that
person the sources, and any fixes that are needed. I DON'T want the
sources widely distributed, however. The compiler is very tight code,
and most attempts to change anything will just result in a broken
compiler. If someone wants to become the distributer, send me a note
with your net connections, and a bit about your experience with 10,000
line programs.
and Jack Goldstein had some questions
- yes, Draco has conformant array parameters (any number of dimensions)
- no proper modules (it's high on my list of wants), but some sort-of ones
- constant declarations allow arbitrary compile-time expressions, including
if - expressions (same for array bounds, etc.)
- type, constant, external procedure and variable declarations can be freely
mixed, but must come before all procedures
- 'otherwise' clause on 'case' - yep, it's called 'default'
- register keyword as in C. Not on the 8080 version, since the way I did
things required all the registers in some cases. I plan on them for the
68000 version, however (all my 370 compilers had them).
- assert statements - nope, but you uglily do the same thing with
conditional compilation and 'exit'. Draco DOES have a compile-time
assert - as in 'if XSIZE < 10 then error("XSIZE not big enough") fi'.
- other ports - a friend has a Radio Shack 6000 Xenix box, and we've talked
about porting the 68K version there. Also to Mac and Atari. Nothing will
happen unless I have access to the machine, however. Meanwhile there is
the Amiga version (coming Real Soon Now).
Chris Gray (ubc-vision,sask,ihnp4)!alberta!myrias!cg