Files
mercury/compiler/notes/TODO
Tyson Dowd 57f3d8506a Add two new items to the TODO list.
Estimated hours taken: 0.05

Add two new items to the TODO list.

compiler/notes/TODO:
	- Add extended DCGs to wish list, and removing limitation on
	  monomorphic higher order terms to TODO list.
1997-02-27 02:28:28 +00:00

290 lines
7.8 KiB
Plaintext

*******************************************************************************
TODO LIST:
----------
For more information on any of these issues, contact mercury@cs.mu.oz.au.
type system
-----------
- allow a module exporting an abstract type to specify that other modules
should not be allowed to test two values of that type for equality (similar
to Ada's limited private types). This would be useful for e.g. sets
represented as unordered lists with possible duplicates.
[this is a subset of the functionality of type classes]
- remove limitation that higher-order terms are monomorphic.
mode analysis
-------------
- extend the mode system to allow known aliasing.
This is needed to make partially instantiated modes and unique modes work.
[will be done by fjh]
- report an error if two mode declarations for a predicate
specify identical modes
- detect incorrect usage of `bound(...)' insts.
That is, make sure that all of the functors in a bound(...) inst
are valid functors for the type.
- split construct/deconstruct unifications into their atomic
"micro-unification" pieces when necessary.
(When is it necessary?)
determinism analysis
--------------------
- allow overloading of nondet/multidet and cc_nondet/cc_multidet
determinism for the same mode of a predicate.
unique modes
------------
- handle unique mode overloading better -
don't depend on the order of the mode declarations.
- handle overloading of unique and mostly_unique modes.
Currently in modes.m we always pick the unique version, and then in
unique_modes.m, if it turns out out to be mostly_unique, we report an
error. We should changed unique_modes.m to also look for a
mostly_unique version before reporting an error.
code generation
---------------
- take advantage of unique modes to do compile-time garbage collection
and structure reuse.
- floating point registers
- allow floating point fields of structures without boxing
(need multi-word fields)
module system
-------------
- check that the interface for a module is type-correct
independently of any declarations or imports in the implementation
section
- implement a use_module directive
(like import_module, except that everything must be explicitly
module qualified).
- imports should not be transitive
(currently we get this right for predicates, constants, and functors,
but wrong for types, insts, and modes).
- produce warnings for imports that are not needed
[done by stayl]
- produce warnings for imports that are in the wrong place
(in the interface instead of the implementation, and vice versa)
[done by stayl]
C interface
-----------
- nondeterministic C code
- exporting things for manipulating Mercury types from C
- better support for types defined in C, and documentation
general
-------
- coroutining and parallel versions of Mercury
[being worked on by conway]
- implement streams (need coroutining at least)
*******************************************************************************
WISH LIST
---------
type-system
-----------
- allow explicit type qualifications `X : Type'
[being done by stayl]
- type classes
- existential types (possibly)
- subtypes
- optimisation of type representation and manipulation (possibly
profiler guided)
- fold/unfolding of types
mode analysis:
--------------
- implement mode inference
[being worked on by pets]
- handle polymorphic modes (some research issues?)
- handle abstract insts in the same way abstract types are handled
(a research issue - is this possible at all?)
- implement `willbe(Inst)' insts?
[will be done by conway]
- mode segments & high-level transformation of circularly moded programs.
determinism analysis:
---------------------
- propagate information about bindings from the condition of an if-then-else
to the else so that
(if X = [] then .... else X = [A|As], ...)
is considered det.
- turn chains of if-then-elses into switchs where possible.
higher-order preds:
-------------------
- implement single-use higher-order predicate modes.
Single-use higher-order predicates would be allowed to bind curried
arguments, and to have unique modes for curried arguments.
- allow taking the address of a predicate with multiple modes
(This would require mode inference.)
code generation:
----------------
- The generated code should include some more profiling hooks.
In particular, we should add a version of the heap allocation
macro which takes an extra string parameter identifying which
routine allocated the memory. Then we can do heap-allocation
profiling to identify which routines use up all the bloody memory.
- inter-procedural register allocation
- stack allocation of structures
- retarget code generator to Java VM
source-level transformations
----------------------------
- more work on module system, separate compilation, and the multiple
specialisation problem
- deforestation
- extended DCGs
- transform non-tail-recursive predicates into tail-recursive form
using accumulators
[being worked on by jammb]
- partial deduction
[being worked on by stayl]
low-level optimizations
-----------------------
- reduce the overhead of higher-order predicate calls (avoid copying
the real registers into the fake_reg array and back)
- tail recursion optimization using pass-by-reference argument conventions
[being worked on by jammb]
- other specializations, e.g. if argument is known to be bound to
f(X,Y), then just pass X and Y in registers
- trim stack frames before making recursive calls, to minimize stack usage
[this would probably be a pessimization much of the time - zs]
compilation speed
-----------------
- improve efficiency of the expansion of equivalence types (currently O(N^2))
(e.g. this is particularly bad when compiling live_vars.m.)
- improve efficiency of the module import handling (currently O(N^2))
- improve the efficiency of mode checking very large facts
(e.g. this is particularly bad when compiling eliza.m.)
- improve the efficiency of the type_to_term and term_to_type implementation
so that we can enable them in the standard distribution of the Mercury
compiler
better diagnostics
------------------
- optional warning for any implicit quantifiers whose scope is not
the entire clause (the "John Lloyd" option :-).
- give a better error message for the use of if-then without else.
- give a better error message for the use of `<=' instead of `>='
(but how?)
- give a better error message for type errors involving higher-order pred
constants (requested by Bart Demoen)
- give better error messages for syntax errors in lambda expressions
general
-------
- implement a very fast turn-around bytecode compiler/interpreter/debugger,
similar to Gofer
- implement a new backend which compiles to high-level C that can
be debugged at the Mercury source code level using gdb
[a start has been made by fjh]
- implement "accurate" garbage collection
[being worked on by trd]
- implement parallel garbage collection
- implement user-defined operators:
Add a new construct `:- op(Pred, Type, Op).' as in Prolog;
change prog_io.m to parse this construct and call io__op
accordingly. But how does this fit in with the module system?
- support for easier formal specification translation (eg a Z library,
or Z to Mercury).
- improve support for constraint programming
- implement a source visualisation tool
- distributed Mercury
- improved development environment
- additional software engineering tools
- coverage analysis
- automatic testing
- literate Mercury
- implement a GUI library (eg Hugs - Fudgets)
- profiling guided optimisations
- use profiling information to direct linker for optimal
code placement (Alpha has a tool for this).
- attribute grammars
*******************************************************************************