mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 06:14:59 +00:00
Estimated hours taken: 32
Branches: main
Move toward the proposed structures for representing type class information at
runtime by adding code for generating the structures corresponding to
base_typeclass_infos. The structures corresponding to typeclass_infos will
be added in a later change.
Register the new data structures in a table at runtime.
Add four new mdb developer commands for checking the contents of the new
type class table, as well as the contents of the existing type constructor
table: class_decl, type_ctor, all_class_decls and all_type_ctors.
compiler/rtti.m:
Add the data types required to represent the new runtime data
structures that will eventually replace base_typeclass_infos
inside the compiler.
Add the required function symbols to the data types representing both
the new RTTI data structures themselves and those representing
references to them.
Make the required changes to the predicates operating on the modified
data types, and add some required new predicates.
compiler/rtti_out.m:
Add code to write out the new data structures for the LLDS backend.
Make some changes in existing predicates to allow them to be used
in the new code.
compiler/layout_out.m:
Factor out some code that is now common with rtti_out.m.
compiler/type_class_info.m:
A new module to generate the new RTTI data structures.
compiler/backend_libs.m:
Include the new module.
compiler/options.m:
Add a new option, --new-type-class-rtti, to control whether we
invoke the top level predicate of type_class_info.m to generate
the new type class RTTI structures. We still generate and use
base_typeclass_infos regardless of the value of this option.
compiler/mercury_compile.m:
Invoke the code of the new module if --new-type-class-rtti is given.
compiler/opt_debug.m:
Add code to dump descriptions of the new rtti_ids.
compiler/mlds_to_gcc.m:
compiler/rtti_to_mlds.m:
Handle the new alternatives in the rtti data types, mostly by throwing
exceptions. The actual code should be written later by Fergus.
compiler/pseudo_type_info.m:
Module qualify the names of builtin types when generating
pseudo-typeinfos for them. This makes the naming scheme more regular.
compiler/base_typeclass_info.m:
compiler/notes/type_class_transformation.html:
Document the impending obsolescence of these files.
compiler/notes/work_in_progress.html:
List type class RTTI as work in progress.
library/list.m:
Add a utility predicate for use by compiler/rtti_out.m.
runtime/mercury_typeclass_info.h:
Make some changes in the C data types representing type class
information that I discovered to be necessary or advantageous
in the process of generating values of those types automatically.
Rename some types to make their names be better documentation.
Change some arrays of pointers to structures into arrays of structures,
where the structures at different array indexes are the same size.
Removing consts that rtti_out.m supplies automatically avoids
duplicate const errors from the C compiler.
Add #includes to make the file namespace clean.
Protect against multiple inclusion.
runtime/mercury_typeclass_info_example.c:
Remove this file. After the changes to mercury_typeclass_info.h, its
contents are no longer correct examples of the structures in
mercury_typeclass_info.h, and since the compiler can now generate
those structures automatically, hand-written examples no longer serve
any useful pupose.
runtime/mercury_types.h:
Add a new type, MR_CodePtr, for use in mercury_typeclass_info.h.
The compiler predicate tc_rtti_name_type wants single-word names
for types.
runtime/mercury_imp.h:
#include mercury_typeclass_info.h.
runtime/mercury_type_tables.[ch]:
Add functions to register and to look up type class declarations and
type class instances.
Add the functions and data structures required to look up all type
constructors and all type classes. The debugger uses these to support
the commands that let the programmer check the contents of these
tables.
Eventually, we should be able to use the type class tables to test
whether a vector of types is a member of a given type class.
runtime/mercury_wrapper.c:
runtime/mercury_type_info.[ch]:
Move the array of type_ctor_rep names from the mercury_wrapper module
to the mercury_type_info module, and make it always-defined and public;
the debugger also needs access to it now.
runtime/Mmakefile:
Add mercury_typeclass_info.h to the list of header files that other
files depend on.
trace/mercury_trace_internal.c:
Add four new mdb commands: class_decl, type_ctor, all_class_decls
and all_type_ctors.
Make some existing code follow our coding conventions.
doc/user_guide.texi:
doc/mdb_categories:
Document the four new mdb commands.
doc/reference_manual.texi:
Document (in a comment) the compiler's reliance on each type in an
instance declaration containing exactly one type constructor.
tests/debugger/class_decl.{m,inp,exp}:
A new test case to test the new mdb commands.
tests/debugger/Mmakefile:
tests/debugger/Mercury.options:
Add the new test case.
tests/debugger/completion.exp:
Expect the new commands to appear in the command name completion.
tests/debugger/mdb_command_test.inp:
Test the documentation of the new mdb commands.
Expect the new commands to appear in the command name completion.
127 lines
4.3 KiB
HTML
127 lines
4.3 KiB
HTML
<html>
|
|
<head>
|
|
<title>
|
|
Work In Progress
|
|
</title>
|
|
</head>
|
|
|
|
<body bgcolor="#ffffff" text="#000000">
|
|
|
|
<hr>
|
|
<!---------------------------------------------------------------------------->
|
|
|
|
The compiler contains some code for the following features,
|
|
which are not yet completed, but which we hope to complete
|
|
at some time in the future:
|
|
<p>
|
|
|
|
<ul>
|
|
<li> There is a
|
|
<a href="http://www.cs.mu.oz.au/mercury/dotnet.html">`--target il'</a>
|
|
option, which generates MSIL code for Microsoft's new
|
|
<a href="http://msdn.microsoft.com/net/">.NET Common Language Runtime</a>.
|
|
We're still working on this.
|
|
|
|
<li> There is a `--target java' option, which generates Java.
|
|
We still need to add support for Java foreign language interfacing,
|
|
and implement the Mercury standard library for Java.
|
|
|
|
<li> Thread-safe engine (the `.par' grades).
|
|
|
|
<li> Independent AND-parallelism (the `&' parallel conjunction operator).
|
|
See Tom Conway's PhD thesis.
|
|
|
|
<li>
|
|
We have incomplete support for a new, more expressive design for representing
|
|
information about type classes and type class instances at runtime. When
|
|
complete, the new design would allow runtime tests of type class membership,
|
|
it would allow the tabling of predicates with type class constraints,
|
|
and it would allow the debugger to print type_class_infos.
|
|
|
|
<li> We have added support for dynamic link libraries (DLLs) on Windows.
|
|
This is not yet enabled by default because it has not yet been tested
|
|
properly.
|
|
|
|
<li> There is a new `--optimize-constructor-last-call' option
|
|
which identifies opportunities for LCO where a call
|
|
is followed only by some constructor invocations.
|
|
However, these opportunities are not exploited yet.
|
|
|
|
<li> There is a new garbage collector that does accurate garbage
|
|
collection (hlc.agc grade). See the comments in
|
|
compiler/ml_elim_nested.m and the paper on our web page for more details.
|
|
|
|
<li> Mercury is now the official programming language for Melbourne University's
|
|
<a href="http://www.cs.mu.oz.au/aditi">Aditi deductive database system</a>.
|
|
The Mercury compiler includes incomplete support for interfacing to Aditi.
|
|
In particular, the support for executing ordinary Mercury code within
|
|
Aditi queries is currently poor.
|
|
|
|
<li> The Mercury debugger (mdb) now includes support for declarative
|
|
debugging. There are still some limitations to be dealt with, and
|
|
some improvements are yet to be made. See the
|
|
<a href="http://www.cs.mu.oz.au/mercury/information/doc-latest/user_guide_toc.html">Mercury User's Guide</a>
|
|
for further details.
|
|
|
|
<li> There is a `--generate-bytecode' option, for a new back-end
|
|
that generates bytecode. The bytecode generator is basically
|
|
complete, but we don't have a bytecode interpreter.
|
|
</ul>
|
|
<p>
|
|
|
|
We also have some code that goes at least some part of the way towards
|
|
implementing the features below. However, for these features, the
|
|
code has not yet been committed and thus is not part of the standard
|
|
distribution.
|
|
|
|
<p>
|
|
|
|
<ul>
|
|
<li> A new implementation of the mode system using constraints.
|
|
This is on the "mode-constraints" branch of our CVS repository.
|
|
|
|
<li> Support for aliasing in the mode system.
|
|
This is on the "alias" branch of our CVS repository.
|
|
|
|
<li> Support for automatic structure reuse (reusing old data
|
|
structures that are no longer live, rather than allocating
|
|
new memory on the heap) and compile time garbage collection
|
|
This is on the "reuse" branch of our CVS repository.
|
|
|
|
<li> Better support for inter-module analysis and optimization.
|
|
|
|
<li> Support for GCC 3.3 in the native code back-end.
|
|
This is on the "gcc_3_3" branch of our CVS repository.
|
|
|
|
</ul>
|
|
|
|
<hr>
|
|
<!-------------------------->
|
|
<h2>
|
|
Work Not In Progress
|
|
</h2>
|
|
|
|
The compiler also contains some code for the following features,
|
|
but work on them has stopped, since finishing them off would be
|
|
quite a bit more work, and our current priorities lie elsewhere.
|
|
Still, these could make interesting and worthwhile projects
|
|
if someone has the time for it.
|
|
<p>
|
|
|
|
<ul>
|
|
<li> A SOAP interface.
|
|
|
|
<li> A bytecode interpreter, for use with the `--generate-bytecode' option.
|
|
|
|
<li> Sequence quantification (see the
|
|
<a href="http://www.cs.mu.oz.au/research/mercury/information/reports/minutes_15_12_00.html">description</a> from the meeting minutes).
|
|
</ul>
|
|
</html>
|
|
|
|
<hr>
|
|
<!-------------------------->
|
|
|
|
Last update was $Date: 2003-10-23 02:02:17 $ by $Author: zs $@cs.mu.oz.au. <br>
|
|
</body>
|
|
</html>
|