Commit Graph

14 Commits

Author SHA1 Message Date
Zoltan Somogyi
404abb0c57 Another step towards RTTI in Mercury.
Estimated hours taken: 32
Branches: main

Another step towards RTTI in Mercury.

This step redefines the representation of type_ctor_infos inside the compiler
to be identical to the representation we will need for efficient interpretation
of RTTI data structures in Mercury, following on from an earlier step which
did the same for (pseudo)typeinfos.

Instead of the type_ctor_info being broken down into its components in
type_ctor_info.m, the breakdown process is now performed in rtti_out.m (for the
LLDS backend) and rtti_to_mlds.m (for the MLDS backend). Eventually, the IL and
Java backends will stop using rtti_to_mlds.m for this purpose, and will instead
write out the type_ctor_data structures as static data to be interpreted
directly.

We now predefine the C types representing type_info and pseudo_type_infos
for types of arity up to 20 for the LLDS C backend as well as for the
MLDS C backend. The LLDS backend can define them for higher arities
on demand; the MLDS backend (for now) still cannot.

runtime/mercury_type_info.h:
	To be able to represent all the kinds of types we now support

	- add a data structure for converting values of reserved_addr types
	  from their printable representation to their internal representation
	  (it was previously missing), and

	- add a type_ctor_rep to represent foreign types.

	Add missing MR_ prefixes on some field names.

	Add typedefs for all the types that the rtti_names can refer to.
	There were already such typedefs in runtime/mercury.h for the MLDS
	grades, we now have them for the LLDS grades too.

	Predefine the C types representing type_info and pseudo_type_infos
	for types of arity up to 20. There were already such typedefs in
	runtime/mercury.h for the MLDS grades, we now have them for the
	LLDS grades too.

runtime/mercury.h:
	Delete the typedefs that are now in mercury_type_info.h.

runtime/mercury.h:
	Delete the definitions of the C types representing type_info and
	pseudo_type_infos, since these are now in mercury_type_info.h.
	#include mercury_type_info.h.

compiler/rtti.m:
	Add new, purely Mercury data structures for representing
	type_ctor_infos and their components, designed both for efficient
	interpretation and as a source for the generation of static data
	structures in C.

	This entailed deleting most of the alternatives of the rtti_data type
	while preserving their rtti_name equivalents; the deleted alternatives
	represent tables are no longer created in type_ctor_info.m but which
	are created dynamically in rtti_out.m and rtti_to_mlds.m (which need
	a way for one table to refer to another).

	Centralize the correspondence between rtti_names and the C and Java
	types of the corresponding structures (the C and Java names differ in
	prefixes only). Among other things, this remove the double maintenance
	problem we have previously with the LLDS and MLDS backends maintaining
	their own maps of the correspondence.

	Add utility predicates on the new data structures for use by both
	rtti_out.m and rtti_to_mlds.m.

compiler/hlds_module.m:
	Always store the ids of unification and comparison procedures in
	type_ctor_gen_infos, to simplify their handling.

compiler/type_ctor_info.m:
	Generate the new data structures for representing type_ctor_infos.

	Conform to the changed data structures for type_ctor_gen_infos.

compiler/rtti_out.m:
compiler/rtti_to_mlds.m:
	Rewrite substantial parts of these modules to convert the new data
	structures for representing type_ctor_infos to sets of discrete
	structures dynamically.

	Most of the dynamically created structures are unique by construction,
	but this is not true for typeinfos and pseudo-typeinfos. Therefore
	add mechanisms to ensure that we don't generate redundant structures
	representing typeinfos and pseudo-typeinfos.

compiler/mlds_to_c.m:
compiler/mlds_to_java.m:
	Use the standard mechanisms for creating C and Java type names.

compiler/mlds_to_gcc.m:
	Conform to the changed data structures in rtti.m and
	mercury_type_info.h.

compiler/opt_debug.m:
	Conform to the changed data structures in rtti.m.

compiler/dead_proc_elim.m:
	Conform to the changed data structures for type_ctor_gen_infos.

compiler/pseudo_type_info.m:
	Add a predicate to construct a representation of a type that may or may
	not be ground.

compiler/mlds_to_gcc.m:
java/runtime/TypeCtorRep.java:
library/private_builtin.m:
library/rtti_implemenation.m:
runtime/mercury_mcpp.{cpp,h}:
	Add the type_ctor_rep for foreign types to the lists of type_ctor_reps.

library/construct.m:
library/deconstruct.m:
	Add missing MR_ prefixes on field names.

runtime/mercury_construct.c:
runtime/mercury_deconstruct.c:
runtime/mercury_deep_copy_body.h:
runtime/mercury_ml_expand_body.h:
runtime/mercury_tabling.c:
runtime/mercury_type_info.c:
runtime/mercury_unify_compare_body.h:
	Handle the type_ctor_rep for foreign types.

	Add missing MR_ prefixes on field names.

library/list.m:
	Add two utility predicates, is_empty and is_not_empty, for use with
	higher order code.

NEWS:
	Mention the new predicates in list.m. Delete a duplicate entry.
2002-08-01 11:52:29 +00:00
Peter Ross
1fd2a43d9f Allow the library to compile in the grade il (high level data).
Estimated hours taken: 120
Branches: main

Allow the library to compile in the grade il (high level data).

compiler/ml_util.m:
	Add more types which need to be represented using the low level
	representation because of how they are handled in the library.

compiler/mlds_to_il.m:
	Remove an XXX which is no longer necessary.
	Add the heap_pointer type to the list of types whose RTTI is defined
	by hand.

library/exception.m:
	Move the definition of Exception from the runtime to the local module.
	This is needed for when univ/0 is no longer represented as a low level
	type.

runtime/mercury_mcpp.cpp:
	Remove the implementation of Exception that is now in exception.m.

library/Mmakefile:
	The lowlevel Exception type is now defined in the library not the
	runtime, so add rules to ensure that the foreign code is built in
	the correct order.

library/io.m:
	Reimplement io__stream as a foreign_type.  This makes the code more
	type safe and avoids problems with the different representation of
	the io__stream type when using high and low level data.
	Change io__command_line_arguments so that it throws an exception
	when we use high level data, as I am yet to work out how to access
	high level lists.

library/rtti_implementation.m:
	Add a comment that get_subterm doesn't work with high level data.
	Fix some bugs with the default versions of type_ctor_compare_pred and
	type_ctor_unify_pred.

library/sparse_bitset.m:
	Remove the foreign_proc implementation of make_bitset_elem as it
	will not work with both data representations and their is a Mercury
	implementation.

library/string.m:
	Remove the foreign_proc implementation of all the predicates which
	manipulate lists as they all have a Mercury implementation, as I am yet
	to work out how to access high level lists.
	Add a Mercury implementation for string__join_list.

runtime/mercury_mcpp.h:
library/array.m:
library/builtin.m:
library/private_builtin.m:
library/type_desc.m:
	Define and use typedefs where appropiate for type_info/0, type_info/1,
	comparison_result/0 and univ/0, as there representation may change in
	the future between using high level and low level data.
2002-07-23 08:26:30 +00:00
Zoltan Somogyi
62c3375f5d Fix the RTTI of type_descs and type_ctor_descs.
Estimated hours taken: 40
Branches: main

Fix the RTTI of type_descs and type_ctor_descs. Make comparisons between
type_ctor_descs and type_ctor_infos (and therefore between type_descs and
type_infos) more predictable and consistent across backends by basing them
on programmer-visible attributes instead of accident of location in the
executable.

runtime/mercury_type_desc.[ch]:
	Implement unification and comparison functions for type_ctor_descs.
	(The unification and comparison functions for type_infos also double
	as the unification and comparison functions for type_descs.)

	Make the comparison function work on the module name, type name and
	arity instead of the address of the type_ctor_info structure. This
	ensures consistency across back ends.

	Add some useful macros.

runtime/mercury_type_info.[ch]:
	Make the comparison function on type_ctor_infos also work on module
	name, type name and arity. Since this makes comparison slower, add
	specialized unification functions for type_infos and type_ctor_infos.

runtime/mercury_type_info.h:
runtime/mercury_mcpp.{h,cpp}:
runtime/mercury.h:
library/private_builtin.m:
library/rtti_implementation.m:
java/runtime/TypeCtorRep.java:
compiler/mlds_to_gcc.m:
	Add type_ctor_reps for type_descs and type_ctor_descs. Type_ctor_descs
	definitely need it, since their representation is very low level and
	not shared with anything else. Type_descs could use the type_ctor_rep
	of type_infos, since type_descs and type_infos share the same
	representation at the moment. However, we add a new one because
	profiling cares about the conceptual distinction between type_infos
	and type_descs.

library/type_desc.m:
	Delete the Mercury "definition" of type_desc, because it is misleading.
	Implement it as a builtin type.

runtime/mercury.[ch]:
	Implement type_ctor_desc as a builtin type.

	Add missing implementations of unify/compare on type_ctor_infos.

runtime/mercury_deconstruct.c:
runtime/mercury_ml_expand_body.h:
	Implement deconstruction for type_descs and type_ctor_descs.

runtime/mercury_ho_call.c:
runtime/mercury_unify_compare_body.h:
	Implement unify and compare for type_descs and type_ctor_descs.

	Implement unify for type_infos, type_ctor_infos, type_descs and
	type_ctor_descs by calling the relevant unification function,
	not the relevant comparison function, since the unification
	function will be faster.

runtime/mercury_deep_copy_body.h:
runtime/mercury_construct.c:
runtime/mercury_tabling.c:
	Minor changes to handle type_descs and type_ctor_descs.

trace/mercury_trace_vars.c:
	Enable the printing of type_descs and type_ctor_descs.

tests/debugger/type_desc_test.{m,inp,exp,exp2}:
	New test case to check the printing of type_descs and type_ctor_descs.

tests/debugger/Mmakefile:
	Enable the new test case.

tests/hard_coded/type_ctor_desc_manip.{m,exp}:
	New test case to check the deconstruction and comparison of type_descs
	and (especially) type_ctor_descs. Before this change, we got different
	results for comparisons of type_ctor_descs, results that were
	inconsistent with the results of comparisons of the type_descs
	that the type_ctor_descs were derived from.

tests/hard_coded/Mmakefile:
	Enable the new test case.
2002-03-27 05:18:58 +00:00
Zoltan Somogyi
2b559ad054 Move the RTTI-related parts of std_util.m to three new modules in the standard
Estimated hours taken: 8
Branches: main

Move the RTTI-related parts of std_util.m to three new modules in the standard
library, and (in the case of embedded C code) to new modules in the runtime.
The main reason for this is to allow a reorganization of some of the
RTTi-related functionality without breaking backward compatibility. However,
the new arrangement should also be easier to maintain.

Use a separate type_ctor_rep for functions, to distinguish them from predicates
for RTTI code. (At one point, I thought this could avoid the need for the
change to the initialization files mentioned below. It can't, but it is a good
idea in any case.)

library/std_util.m:
	Remove the functionality moved to the new modules, and replace them
	with type equivalences and forwarding code. There are no changes in
	the meanings of the user-visible predicates, with two exceptions.

	- First, the true, equivalence-expanded names of what used to be
	  std_util:type_desc and std_util:type_ctor_desc are now
	  type_desc:type_desc and type_desc: type_ctor_desc.
	- Second, deconstructing a function term now yields
	  "<<function>>" instead of "<<predicate>>".

	The intention is that the RTTI predicates in std_util.m will continue
	to work in a backwards-compatible manner for the near future, i.e. as
	the new modules are updated, the code in std_util will be updated to
	maintain the same functionality, modulo improvements such as avoiding
	unwanted exceptions. When the RTTI functionality in the other modules
	has stabilised, the RTTI predicates in std_util.m should be marked
	obsolete.

	The exported but non-documented functionality of std_util has been
	moved to one of the new modules without forwarding code, with one
	of the moved predicates being turned into the function it should have
	been in the first place.

library/construct.m:
library/deconstruct.m:
library/type_desc.m:
	Three new modules for the code moved from std_util.m.

library/library.m:
compiler/modules.m:
	Record the names of the three new library modules.

runtime/mercury.[ch]:
compiler/mlds_to_il.m:
	Record that type_desc is now in type_desc.m, not std_util.m.

compiler/static_term.m:
	Import the deconstruct module, since we are using its undocumented
	facilities.

runtime/Mmakefile:
	Mention the two new modules.

runtime/mercury_construct.[ch]:
runtime/mercury_type_desc.[ch]:
	Two new modules holding the C functions that used to be in foreign_code
	in std_util, now using MR_ instead of ML_ prefixes, and being more
	consistent about indentation.

runtime/mercury_type_info.h:
	Add a new type_ctor_rep for functions, separate from predicates.
	(It reuses the EQUIV_VAR type_ctor_rep, which hasn't been used
	in ages.)

	Use type_ctor_reps to distinguish between the type_ctor_infos of
	pred/0 and func/0. However, to create higher order typeinfos, we
	still need to know the addresses of the type_ctor_infos for
	pred/0 and func/0, and we still need to know the address of the
	type_ctor_info for tuples to create typeinfos for tuples. Since
	these three type_ctor_infos are defined in the library,
	we cannot access them directly from the runtime. We therefore need
	to access them indirectly in the usual manner, via address_of
	variables initialized by mkinit-generated code.

library/builtin.m:
library/private_builtin.m:
library/rtti_implementation.m:
runtime/mercury.c:
runtime/mercury_mcpp.{h,cpp}:
java/TypeCtorRep.java:
	Updates to accommondate the new function type_ctor_rep.

runtime/mercury_type_info.[ch]:
	Add some functions from foreign_code in std_util that fit in best here.

runtime/mercury_ml_expand_body.h:
runtime/mercury_tabling.h:
runtime/mercury_unify_compare_body.h:
	Delete the code for handling EQUIV_VAR, and add code for handling
	functions.

runtime/mercury_init.h:
runtime/mercury_wrapper.[ch]:
	Add three variables holding the address of the type_ctor_infos
	representing functions, predicates and tuples.

util/mkinit.c:
	Fill in these three variables.

tests/general/accumulator/construct.{m,exp}:
tests/general/accumulator/deconstruct.{m,exp}:
tests/hard_coded/construct.{m,exp}:
	Rename these tests by adding a _test at the ends of their names,
	in order to avoid collisions with the names of the new standard library
	modules. The test cases have not changed, with the exception of the :-
	module declaration of course.

tests/general/accumulator/Mmakefile:
tests/general/accumulator/INTRODUCED:
tests/hard_coded/Mmakefile:
	Record the name changes.

tests/hard_coded/existential_float.exp:
	Updated the expected output to reflect that deconstructions now print
	"<<function>>" instead of "<<predicate>>" when appropriate.

tests/hard_coded/higher_order_type_manip.exp:
	Updated the expected output to reflect the new name of what used to be
	std_util:type_desc.

trace/mercury_trace_browse.c:
trace/mercury_trace_external.c:
trace/mercury_trace_help.c:
	#include type_desc.h instead of std_util.h, since the C functions
	we want to call are now defined there.

trace/mercury_trace_vars.c:
	Update to account for the movement of type_desc from std_util to
	type_desc, and ensure that we don't refer to any type_ctor_infos
	in MLDS grades.
2002-01-30 05:09:13 +00:00
Zoltan Somogyi
228ddfdd0b Fix a bug by distinguishing the type_ctor_reps of type_infos and
Estimated hours taken: 12
Branches: main

Fix a bug by distinguishing the type_ctor_reps of type_infos and
type_ctor_infos. The type_ctor_infos of types with nonzero arity
cannot be printed, copied etc like type_infos; any attempt to do so
causes a core dump.

For similar reasons, add a separate type_ctor_rep for
base_typeclass_infos separate from typeclass_infos.

runtime/mercury_type_info.h:
runtime/mercury_mcpp.h:
compiler/mlds_to_gcc.m:
library/rtti_implementation.m:
java/TypeCtorRep.java:
	Add new type_ctor_reps for type_ctor_infos and base_typeclass_infos.

library/private_builtin.m:
runtime/mercury.c:
	Use the new type_ctor_reps in the type_ctor_infos of the builtin types
	type_ctor_info and base_typeclass_info.

runtime/mercury_type_info.[ch]:
	Add a function for comparing type_ctor_infos.

	Move some interface documentation from the source file to the header
	file.

runtime/mercury_deep_copy_body.h:
	Add code to handle the new type_ctor_reps.

	Simplify some code.

	Make the whole file use 4-space indentation.

library/std_util.m:
runtime/mercury_ml_expand_body.h:
runtime/mercury_unify_compare_body.h:
runtime/mercury_ho_call.c:
runtime/mercury_tabling.c:
	Add code to handle the new type_ctor_reps.
2002-01-28 17:28:01 +00:00
Tyson Dowd
ed3e5c22fa Implement string__append_list and various formatting functions
Estimated hours taken: 6
Branches: main

library/string.m:
	Implement string__append_list and various formatting functions
	in C#.
	Implement a very simple (and incomplete) conversion of printf style
	formatting to .NET formatting.  It is probably a better idea to
	implement printf formatting in Mercury in future, as neither
	.NET nor Java provides printf.

runtime/mercury_mcpp.cpp:
	Add some code to manipulate Mercury lists in the low-level data
	representation.
2001-08-28 12:48:52 +00:00
Tyson Dowd
5a58162a4f Implement exceptions in the .NET backend.
Estimated hours taken: 20
Branches: main

Implement exceptions in the .NET backend.
(sorry, model_det exceptions only at the moment).

compiler/mlds_to_il.m:
	Wrap two exception handlers around the Mercury code -- one that
	prints out any uncaught user exceptions (Mercury exceptions,
	that is) using ML_report_uncaught_exception, and one that
	catches any system exceptions (anything else) and prints them
	using the system exception printing mechanism.

library/exception.m:
	Implement exceptions in C#.
	try and catch call try_impl and catch_impl, which by default
	call builtin_trd and builtin_catch, but we provide a
	foreign_proc definition that implements them in C# on the .NET
	backend.
	We also implement ML_call_goal in Mercury, renaming the
	hand-coded versions appropriately.

library/math.m:
	Throw domain_error(string) for domain errors.

runtime/mercury_mcpp.cpp:
	Fix the implementation of mercury.runtime.Exception -- now we
	store the Mercury exception so you can retrieve it later.

	Create a new class for Mercury runtime system exceptions, which
	are generated by SORRY and fatal_error.  We can't expect to
	print these exceptions using ML_report_uncaught_exception (at
	the moment ML_report_uncaught_exception generates such
	exceptions!) so we print them as normal .NET exceptions instead.
2001-08-27 12:15:36 +00:00
Tyson Dowd
ffa5f22345 Add tuple to this list of hand-coded type_infos (so that we look
Estimated hours taken: 14
Branches: main

compiler/mlds_to_il.m:
	Add tuple to this list of hand-coded type_infos (so that we look
	in the cpp code module to find the type_info).

library/builtin.m:
	Add a type_ctor_info for tuple.

library/std_util.m:
        Call into rtti.m to compare type_infos.

runtime/mercury_il.il:
        Add some IL code to get the type_ctor_info from a type_info.
        (It's hard to write this code in MC++ or C#, and there seems to
        be a bug in the IL interface that stops me writing IL
        foreign_proc for it at the moment).

runtime/mercury_il.il:
	Add helper functions to get the function pointers for tuple
	compare and unify procedures.

runtime/mercury_mcpp.cpp:
runtime/mercury_mcpp.h:
	Add tuple to the type_ctor_rep.

runtime/mercury_type_info.h:
	Mention that changes in the type_ctor_rep might require changes
	in mercury_mcpp.{h,cpp}.
2001-08-16 15:04:15 +00:00
Tyson Dowd
404e633644 The MC++ interface for functions is buggy.
Estimated hours taken: 10
Branches: main

The MC++ interface for functions is buggy.
This change generates errors in most cases where a function is
implemented in MC++, and removes all the occurances of such functions
from the library.

compiler/mlds_to_il.m:
        Abort if a function is implemented in MC++.  We don't catch the
        case of functions that return int, as it is difficult to be sure
        this isn't just a semidet predicate (which works and is used).
        However this catches a lot of cases where we were silently
        generating bad code so it is better than nothing.

library/Mmakefile:
	Add flags to control debugging (commented out for the moment).
	Move the .NET flags together.

library/builtin.m:
library/float.m:
library/io.m:
library/math.m:
library/sparse_bitset.m:
library/std_util.m:
library/string.m:
	Implement functions in C#, as functions don't work when a
	foreign_proc is MC++.
	This fixes several latent bugs in the library.

runtime/Mmakefile:
	Add support for debugging (commented out for the moment).

runtime/mercury_mcpp.cpp:
	Add code to manipulate low level data structures (so we can do
	this from C# as well as MC++).
2001-08-14 10:19:02 +00:00
Tyson Dowd
e9d95ada12 Change calls to mercury::runtime::convert to System::Covert.
Estimated hours taken: 2
Branches: main

library/builtin.m:
library/private_builtin.m:
library/sparse_bitset.m:
library/string.m:
	Change calls to mercury::runtime::convert to System::Covert.
	Use __box instead of mercury::runtime::Convert::ToObject

runtime/Mmakefile:
	Add a rule to remove the DOTNET_DLLS for clean_local.

runtime/mercury_il.il:
	Remove ConvertImpl class, use unbox and ldobj instead of ToInt32.

runtime/mercury_mcpp.cpp:
	Remove Convert class.

runtime/mercury_mcpp.h:
	Use __box instead of mercury::runtime::Convert::ToObject

scripts/Mmake.rules:
	Put the local include directory before the installed one when
	compiling with MC++.
	Also fix the rule for .cpp.dll to be the same as the subdir
	rule.
2001-07-31 10:08:03 +00:00
Tyson Dowd
23bec4d91e Updates to the runtime and library for .NET backend.
Estimated hours taken: 5
Branches: main

Updates to the runtime and library for .NET backend.

These changes mean the runtime and library will no longer work for Beta 1.
If you want to use Beta 1, you will have to use mercury 0.10.x.

library/.cvsignore:
	Add .cpp .dll and .il files.

runtime/.cvsignore:
	Add .dll files.

library/Mmakefile:
	Add an assembly search patch to the MS_CLFLAGS
	Work around bugs in the assembly cache installer by generating one
	big .il file for the library.
	Generate a strong name file and use it.

library/array.m:
	Update the code to work correctly -- the MC++ compiler is now a bit
	stricter about type casts.

library/exception.m:
	Stop using an enum and use #defines -- the enum has stopped working.
	(I don't have time to figure out why just now).

library/float.m:
library/math.m:
	Some of the mathematical functions have changed names.

library/io.m:
	Use an ascii encoder to generate ASCII output by default.
	Without this we get Unicode UTF output, and it seems to like to
	insert a BOM (byte-order-mark) which means Hello World doesn't work
	anymore.
	Add a stream reader and writer to the MercuryFileStruct.

library/library_strong_name.sn:
	The strong name for this library.

runtime/mercury_il.il:
	Insert .publickeytoken to identify the mercury assembly and mscorlib.
	Add ['mscorlib'] assembly refs to System.Object and ['mercury'] for
	mercury code.
	Use box and unbox instructions instead of our hand-hacked boxing
	classes.  Remove the old conversion classes.
	Add a missing return to mercury.Init::init_runtime()

runtime/mercury_mcpp.cpp:
	Minor fix: s/Exception/System.Exception/

runtime/mercury_mcpp.h:
	Fix the definition of MR_Array.
	Use array syntax for macros that manipulate arrays.
2001-05-02 14:49:08 +00:00
Tyson Dowd
92f2a6ffff Get floating point working in the .NET backend.
Estimated hours taken: 1

Get floating point working in the .NET backend.

compiler/mlds_to_il.m:
	Implement the floating point operations.

runtime/mercury_il.il:
runtime/mercury_mcpp.cpp:
	Add code for boxing and unboxing floats.
2001-01-22 04:20:41 +00:00
Thomas Conway
de80683489 This change makes univ a user-defined type (in std_util.m) rather than
Estimated hours taken: 10

This change makes univ a user-defined type (in std_util.m) rather than
a builtin type.

The rationale for this is that the code for builtin types needs to be
maintained by hand when the execution model is changed (eg introducing
a new backend), but code for user defined types is modified implicitly.

Note that the semantics of deconstruct/4 have changed. See the NEWS file
for details.

NEWS:
	Document the changed semantics of deconstruct/4.

browser/browse.m:
	Fix the calls to deconstruct/4 to reflect the changed semantics
	of deconstruct.

library/io.m:
	Remove the special handling of univ for io__write.
	Fix the calls to deconstruct/4 to reflect the changed semantics
	of deconstruct.

library/private_builtin.m:
	Implement typed_unify and typed_compare in terms of type_of and
	unsafe_type_cast instead of univ, so that preds/funcs operating
	on univs can be implemented in terms of typed_unify.

	Add a new impure predicate var/1 which succeeds/fails depending on the
	instantiation of its argument. This is used to implement bidirectional
	predicates that require different code for different modes
	(cf type_to_univ/2).

	This is *not* mentioned in the NEWS file because it should only
	be used by implementors. (Well, actually, anyone who wants to do
	bidirectional code involving existential types may need it, but
	we don't exactly want to encourage its use ;-).

library/std_util.m:
	Implement univ/0 as a user-defined type rather than a hand coded
	builtin type.

	Removed the foreign language code to implement the operations on
	univs (include unify/2 and compare/3).

	The implementations of deconstruct, et al, now call back to Mercury
	to construct/deconstruct univs, so the code of these has changed.

	Note that there has been an implicit change in the semantics of
	deconstruct/4, which had non-orthogonal handling of univ inputs.
	It now handles them orthogonally: deconstruct of a univ yields the
	functor "univ_cons" and its one argument which will be the wrapped
	value. The non-orthogonal behaviour wasn't documented before, so
	deconstruct/4 now behaves as its documentation describes it.

library/term.m:
	Fix the call to deconstruct/4 to reflect the changed semantics
	of deconstruct.

runtime/mercury.c:
runtime/mercury_deep_copy_body.h:
runtime/mercury_mcpp.h:
runtime/mercury_tabling.c:
runtime/mercury_type_info.h:
runtime/mercury_unify_compare_body.h:
	Remove declarations and definitions for univ since it is now a
	user level type rather than a builtin type.

trace/mercury_trace_declarative.h:
trace/mercury_trace_external.h:
trace/mercury_trace_internal.h:
	Replace the hand-coded constructions of univs with call backs
	to ML_construct_univ.
2001-01-09 23:30:26 +00:00
Tyson Dowd
f33212971c First implementation of the standard library in managed C++.
Estimated hours taken: 200

First implementation of the standard library in managed C++.

configure.in:
	Autodetect the .NET SDK, and set MS_DOTNET_SDK_DIR based on it.
	Find the IL assembler, and set ILASM.

compiler/inlining.m:
	Turn off inlining of pragma_foreign_code with the IL backend.

compiler/mlds_to_c.m:
	Add a comment questioning the foreign language interfacing still to be
        done in this backend, and remove the "inline target code" from
        this list (since it has been completed).

compiler/mlds_to_il.m:
	Generate code for :- external.  We generate a forwarding
	function to the expected implementation in
	<modulename>__c_code.cpp

	Rename all the classes to use MixedCase, and to put them in the
	mercury.runtime namespace.

compiler/mlds_to_ilasm.m:
	Don't use the System or mercury namespaces by default.
	Change the names of the runtime cpp files to mercury_mcpp.dll
	and mercury_il.dll.
	Use c_util to output unops and binops.

doc/user_guide.texi:
	Document MS_CL_NOASM, MS_CLFLAGS and EXTRA_MS_CLFLAGS.

library/*.m:
	Rename pragma c_code as pragma foreign_code("C", ...).
	Add pragma foreign_code for MC++.
	Only a fraction of the predicates are implemented, everything
	else simply throws and exception when called.
	Implementations of predicates marked with :- external are
	provided as pragma foreign_code, but are commented out.

library/Mmakefile:
runtime/Mmakefile:
	Add targets for building the dlls for the library.

runtime/mercury_mcpp.cpp:
runtime/mercury_mcpp.h:
	Implementation of the runtime.

runtime/mercury_il.il:
	This file mainly implements things that can't be written in
	managed C++ (e.g. function pointers).

scripts/Mmake.rules:
scripts/Mmake.vars.in:
        Add rules for generating .dlls and .exes from .ils and .cpps.
2001-01-01 15:05:40 +00:00