tock-mirror/fco2/TODO

96 lines
3.0 KiB
Plaintext

To-do list for Tock
-------------------
## General
## Data structures
Think about simplifying the subscript types -- just have a single data type
that takes several expressions.
(Multi-subscript expressions like a[x][y] currently get pulled up into an array
slice, which is inefficient.)
The show instance for types should produce occam-looking types.
ParseState should be called something more sensible, since most of it has
nothing to do with parsing.
## Support code
Types needs cleaning up and Haddocking.
Many of the "lookup" lists should actually be Maps.
## Driver
Add an option for whether to compile out overflow/bounds checks.
## Parser
Record literals aren't implemented.
Inline C code should be supported; say something like "INLINE "C"" and the
block indented inside that gets passed through to the C source, with local
names in it replaced appropriately.
## Passes
Come up with an approach to combining simple passes to avoid multiple tree
walks (for example, giving passes a "next thing to try" parameter).
Expression simplification -- this should use generics, so that we can have a
default behaviour that simplifies expressions inside another one.
Output item expressions should be pulled up to variables.
Before code generation, have a pass that resolves all the DATA TYPE .. IS
directives to their real types.
Pass to turn complicated conversions into simpler ones (currently done in
GenerateC).
Have a final pass that checks all the mangling has been done -- i.e. function
calls have been removed, and so on.
In the PAR wrapping pass, wrapper procs should not be generated for things that
are already PROC calls.
## C backend
We could have genSpec generate {} around specs if it's not immediately inside
another spec (which'd require some extra boolean arguments to find out).
If the assembler-analysis approach to working out process sizes works, then we
can put the sizes in variables in a separate object file and only
generate/compile that after we've done the main one.
IF could detect, like CASE, whether it's got a TRUE branch.
IF could generate a simple if ... else ... without the gotos and label when
there's no replication or specs.
genParRep uses a C99 dynamic array for a dynamic PAR count, which may turn out
to be a bad idea for very large counts (since I assume it'll allocate off the
stack). We should probably do a malloc if it's not determinable at compile
time.
Real-to-integer conversions don't work correctly.
Slice checks should not be generated if the slice is known to be safe.
PLACE should work.
## Long-term
If we have constant folding, we're three-quarters of the way towards having an
occam *interpreter*.
Matt suggested that the TDS C compiler could be used to produce Transputer
bytecode from Tock's output (if Tock could be persuaded to generate ANSI C).
There should be a CIF interface to the Transterpreter runtime.
It would be possible to support GUY/ASM blocks on top of the Transterpreter
runtime, although I'm not sure how useful that really is.