Estimated hours taken: 0.25
Branches: main
Fix a bug where the Mercury calls C++ sample was not linking with the
C++ library. This worked, because the sample didn't actually make use
of the C++ library, but failed as soon as users tried to extend the
sample to use with their real C++ programs.
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
Use the C++ standard library's stream I/O, rather than printf().
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
Make sure that we link with the C++ standard library.
Also, comment out the old hack that worked around a g++ 2.7 bug
which is fixed in g++ 2.95.
Estimated hours taken: 0.25
Branches: main
Fix a bug where the Mercury calls C++ sample was actually using C, not C++.
samples/c_interface/mercury_calls_cplusplus/cpp_main.c:
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
Rename cpp_main.c as cpp_main.cc, so that it gets compiled as C++
code rather than as C code. Add a dummy class declaration to its
source, to check that it is really C++ code.
Estimated hours taken: 6
Branches: main
Fix a performance bug where dead_pred_elim was taking a significant
amount of time to delete entries from the predicate_table. With this
change dead_pred_elim goes from 12 minutes to 55 seconds CPU time in
the IL grade when compiling accumulator.m with
--intermodule-optimization turned on.
compiler/hlds_module.m:
Implement a new predicate, predicate_table_restrict, which
restricts the predicate_table to include only a subset of the
predicates.
Rather than deleting all the non-needed entries, this
predicate builds the predicate_table from scratch again, hence
this predicate is only useful when the number of predicates to
keep is significantly less than the number of predicates to
delete.
Change predicate_table_do_insert so that it records in the
pred_info whether or not a predicate can only be accessed by
its fully qualified name, this is needed so that the
predicate_table can be rebuilt correctly.
compiler/dead_proc_elim.m:
Use predicate_table_restrict to restrict the set of pred_ids
in the predicate_table rather than module_info_remove_predicate
as the amount of predicates to keep is in general
significantly smaller than the number of predicates to keep.
compiler/hlds_pred.m:
Add a new pred_marker which indicates whether or not a
predicate can only be accessed by its fully qualified name.
compiler/hlds_out.m:
compiler/intermod.m:
Handle the new pred_marker.
Estimated hours taken: 3
Branches: main
Various fixes for the .NET back-end.
compiler/Mmakefile:
For IL grades, use editbin to set the stack size to 100M,
since the default (1M) is too small.
Also, don't try to build mlds_to_gcc in IL grades -- gcc.m won't
compile, because the IL grades don't support the C interface.
library/Mmakefile:
Add some missing dependencies.
profiler/Mmakefile:
deep_profiler/Mmakefile:
Conditionalize some dependencies that were bogus for IL grades.
library/.cvsignore:
compiler/.cvsignore:
profiler/.cvsignore:
deep_profiler/.cvsignore:
analysis/.cvsignore:
browser/.cvsignore:
samples/.cvsignore:
Various minor updates to ignore files produced when building in
IL grades.
Estimated hours taken: 0.25
Branches: main
Simplify the simpler_c_calls_mercury and
simpler_cplusplus_calls_mercury samples to
avoid explicit construction of the `ml' command line.
samples/c_interface/simpler_c_calls_mercury/c_main.c:
Renamed as main.c.
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
Renamed as main.cc.
samples/c_interface/simpler_c_calls_mercury/c_main.m:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.m:
Empty main modules, used to set the name executable
produced by mmake.
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
Handle file renamings.
Remove explicit rules to build executables.
Remove unnecessary header file dependencies.
Estimated hours taken: 0.1
Branches: main, release
samples/c_interface/cpluscplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_c/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
Use MLOBJS, not MLLIBS, to hold the names of the
non-Mercury object files.
Estimated hours taken: 4
Allow user-defined operator precedence tables for parser__read_term
and term_io__write_term.
library/ops.m:
Define a typeclass `op_table' with methods for accessing
operator precedence tables.
Define a type `ops__mercury_op_table', representing the
standard Mercury operator table.
Make `ops__mercury_op_table' an instance of `op_table'.
Define `ops__table' as equivalent to `ops__mercury_op_table'
(it's obsolete, but we can't mark types as obsolete).
Rename `ops__init_op_table' as `ops__init_mercury_op_table',
mark ops__init_op_table as obsolete
library/parser.m:
library/term_io.m:
Add variants of `parser__read_term' and `term_io__write_term'
which take an operator precedence table.
Don't hard-code the maximum priority and argument priority.
Use the `op_table' methods to find those.
Make the priority of operator terms (X `op` Y) 1, not 100.
The reference manual states that operator terms have
the highest precedence possible.
This change slows down a program which does nothing but
parse terms by a bit under 5%, less for writing.
library/hash_table.m:
Fix a few places where parentheses are required because
operator terms now have the lowest possible priority.
`rem' is an operator -- it doesn't need backquotes.
compiler/mercury_to_mercury.m:
library/io.m:
Rename `ops__init_op_table' to `ops__init_mercury_op_table'.
Pass the `op_table' to `ops__max_priority'.
NEWS:
doc/reference_manual.texi:
Document the changes.
Add operator terms to the operator table.
In the "Terms" section of the reference manual, use the same
terminology to describe operator terms as is used in the
"Builtin Operators" section.
samples/Mmakefile:
samples/README:
samples/calculator2.m:
An example program.
tests/hard_coded/term_io_test.exp:
tests/invalid/func_errors.err_exp:
tests/invalid/inst_list_dup.err_exp:
tests/invalid/predmode.err_exp:
tests/invalid/some_err.exp:
`term_io__write_term' now has the same argument priority
behaviour as `parser__read_term', so remove some unnecessary
parentheses from the output.
Estimated hours taken: 3
Branches: main
Change the list constructor from `./2' to `[|]/2'. `./2' will
eventually become the module qualification operator.
library/parser.m:
library/io.m:
library/sparse_bitset.m:
library/std_util.m:
library/term_io.m:
compiler/mercury_to_mercury.m:
compiler/prog_io_dcg.m:
compiler/prog_io_goal.m:
compiler/prog_io_pragma.m:
compiler/prog_io_typeclass.m:
compiler/prog_io_util.m:
browser/interactive_query.m:
extras/moose/grammar.m:
extras/moose/moose.m:
extras/morphine/source/generate_call_site_cov.m:
extras/xml/xml.encoding.m:
samples/muz/higher_order.m:
tests/debugger/declarative/app.m:
tests/dppd/transpose_impl.m:
tests/hard_coded/ground_dd.m:
tests/hard_coded/split_c_files.m:
Change all references to `./2' to use `[|]/2' instead.
compiler/typecheck.m:
Handle `./2' as a special case in `report_error_undef_cons'.
Warn about module list not being imported if `[|]/2' is undefined.
compiler/llds_out.m:
util/mdemangle.c:
profiler/demangle.m:
Add name conversions for `[|]' (f_cons) and `[]' (f_nil).
NEWS:
doc/reference_manual.texi:
w3/tutorial/lists-n-things.m4:
Document the changes.
tests/debugger/{,declarative}/*.exp*:
Update test case results. For some tests the output changed
because they output lists in the non-pretty format. For others,
the output changed because the alphabetical ordering of the
constructors of type `list/1' changed, so the numbering of
the switch branches in the goal paths changed.
Estimated hours taken: 0.5
Branches: main
Remove the RM_C mmake variable, which controlled whether the intermediate
`.c' files were removed (now they never are).
The implementation was buggy (it didn't work with parallel makes), and
made it difficult to avoid always recompiling the `.c' file with smart
recompilation.
Mmake.common.in:
configure.in:
README.AIX:
bindist/bindist.build_vars.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
compiler/modules.m:
tools/bootcheck:
tools/binary_step:
*/Mmakefile:
Remove references to RM_C, DEFAULT_RM_C and LIBRARY_RM_C.
compiler/modules.m:
The `.o' and `.pic_o' file now depends only on the `.c' file,
not on everthing the `.c' file depends on. The extra dependencies
were only needed because the intermediate `.c' file could
be removed by RM_C. This change is needed to avoid recompiling
unchanged `.c' files with smart recompilation.
Estimated hours taken: 0.5
samples/tests/*/runtests:
Specify the full pathname when source'ing Mmake.thisdir, since
the current directory is not always searched.
Estimated hours taken: 2
compiler/globals.m:
compiler/mode_errors.m:
compiler/mode_info.m:
compiler/transform_llds.m:
compiler/vn_order.m:
compiler/vn_verify.m:
samples/diff/globals.m:
Add missing `import_module' statements in the interface section.
(The current version of the compiler doesn't detect these errors.
I have a fix for that bug, but I plan to commit it separately.)
Estimated hours taken: 2.5
Fix some failing test cases in samples/c_interface.
This fixes SourceForge bug report #131053.
samples/c_interface/cplusplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
Fix several bugs:
- use $(MGNUC) rather than hard-coding mgnuc
- pass $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) to mgnuc
- pass $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) to ml
- s/*_REGS_H/MR_MACHDEPS_*_REGS_H/, to match
the renaming that was done a fair while back
in the runtime/machdeps/*.h.
samples/tests/c_interface/c_calls_mercury/Mmakefile:
Add an explicit dependency to ensure that runtests makes
the dependencies for the extra Mercury library used in
this test case.
Estimated hours taken: 0.33
Added a new rot13 implementation to the collection in samples/rot13.
samples/rot13/rot13_ralph.m:
Added.
samples/rot13/Mmakefile:
Added `rot13_ralph' to the list of build targets.
Estimated hours taken: 1
Fix some bugs in samples/c_interface/*/Mmakefile.
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
Use $(mercury_lib.os) rather than hard-coding mercury_lib.o,
so that it works if we compile mercury_lib to more than one
object file, as we do for the `--target asm' case.
samples/c_interface/c_calls_mercury/Mmakefile:
Pass $(ALL_GRADEFLAGS) to $(ML).
Also use $(ALL_MLFLAGS) rather than $(MLFLAGS).
Estimated hours taken: 3
samples/tests/Mmakefile:
The old version of this file had a bogus SUBDIRS list
and a lot of code duplication with Mmake.common.samples.
I rewrote it to use Mmake.common.samples.
samples/tests/Mmake.common.samples:
Add some documentation.
Add some missing dependencies for the dep_local target.
Automatically set the SUBDIRS variable to the correct value,
rather than always setting it to empty.
Fix a couple of other bugs (an `ifeq' should have been `ifneq'
and in the condition of that test `$(SUBDIRS)' should have
been `"$(SUBDIRS)"').
samples/tests/Mmake.common:
samples/tests/generate_exp:
Delete the code for making .exp files using NU-Prolog.
samples/tests/c_interface/c_calls_mercury/Mmakefile:
samples/tests/c_interface/cplusplus_calls_mercury/Mmakefile:
Fix a bug: add some extra dependencies to ensure that
it copies the right files before invoking mmc to make
the dependencies.
Estimated hours taken: 0.25
samples/diff/Mmakefile:
Fix a bug: it was passing `-O0' in MGNUCFLAGS, rather than CFLAGS.
This broke things if you tried to pass an mgnuc option such as
`--inline-alloc' in EXTRA_MGNUCFLAGS on the command-line.
Estimated hours taken: 0.5
samples/c_interface/c_calls_mercury/c_main.c:
samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
samples/c_interface/simpler_c_calls_mercury/c_main.c:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
Update the samples to use MR_ types and MR_ macros for
creating lists.
Estimated hours taken: 0.25
tests/Mmake.common:
samples/tests/Mmake.common:
Delete an obsolete comment about setting `GRADEFLAGS-foo_init'
(that isn't needed anymore, since Mmake handles it automatically --
you only need to set `GRADEFLAGS-foo'.)
Estimated hours taken: 15
Add a testing architecture for the samples directory.
The tests are in the "tests" subdirectory of the samples
directory. This keeps them close to the samples, but not close
enough to clutter up the samples.
It also means you don't have to worry about the issue of exactly where
the developer has checked out the CVS tests module.
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
Update this example to generate a .a file
instead of directly using $(mercury_lib.os)
samples/tests/*:
Test cases for all the samples.
Estimated hours taken: 1
Fix some problems in the samples.
samples/calculator.m:
Strip spaces from the input before using it.
I keep forgetting that spaces aren't allowed in the input
of this example, and I can only assume that new users get
confused over this.
samples/c_interface/c_calls_mercury/Mmakefile:
Use MLOBJS instead of MLLIBS for including .o files.
Add a missing dependency.
Remove an unnecessary dependency that MLOBJS takes care of.
samples/c_interface/mercury_calls_fortran/Mmakefile:
Use MLOBJS instead of MLLIBS for including .o files.
Use -lg2c instead of the old -lf2c for the fortran library.
(libf2c no longer exists)
Estimated hours taken: 0.25
samples/solutions/some_solutions.m:
Delete some crud at the end of this file
that I had somehow accidentally included there
when I committed it.
Estimated hours taken: 0.5
samples/c_interface/cplusplus_calls_mercury/mercury_lib.m:
Add a missing import of module `list'. Previous versions
of the Mercury compiler didn't detect this error.
Estimated hours taken: 0.1
samples/calculator.m:
samples/eliza.m:
samples/interpreter.m:
Add calls to `io__flush_output', so that the input and output
are interleaved properly when you run the programs with output
redirected to a pipe, e.g. "./calculator | tee logfile".
Estimated hours taken: 2
library/std_util.m:
Implement `do_while/4'.
samples/README:
samples/all_solutions.m:
samples/committed_choice.m:
samples/solutions/all_solutions.m:
samples/solutions/one_solution.m:
samples/solutions/some_solutions.m:
Move the all_solutions.m and committed_choice.m samples
into a new subdirectory `solutions', renaming committed_choice.m
as `one_solution.m', and add a new file `some_solutions.m'
illustrating the use of `do_while/4'.
(Also fix some documentation rot in samples/README.)
NEWS:
Mention the new predicate std_util__do_while/4.
tests/general/Mmakefile:
tests/general/do_while.m:
tests/general/do_while.exp:
A test case for the new feature.
Estimated hours taken: 0.75
Mmakefile:
*/Mmakefile:
*/*/Mmakefile:
*/*/*/Mmakefile:
Use `clean_local' instead of `clean' and `realclean_local' instead
of `realclean' where appropriate. This is necessary now that
`realclean' does not depend on `clean'.
Estimated hours taken: 60
User-guided type specialization.
compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/modules.m:
compiler/module_qual.m:
compiler/mercury_to_mercury.m:
Handle `:- pragma type_spec'.
compiler/prog_io_pragma.m:
Factor out some common code to parse predicate names with arguments.
compiler/hlds_module.m:
Added a field to the module_sub_info to hold information about
user-requested type specializations, filled in by make_hlds.m
and not used by anything after higher_order.m.
compiler/make_hlds.m:
For each `:- pragma type_spec' declaration, introduce a new predicate
which just calls the predicate to be specialized with the
specified argument types. This forces higher_order.m to produce
the specialized versions.
compiler/higher_order.m:
Process the user-requested type specializations first to ensure
that they get the correct names.
Allow partial matches against user-specified versions, e.g.
map__lookup(map(int, list(int)), int, list(int)) matches
map__lookup(map(int, V), int, V).
Perform specialization where a typeclass constraint matches a
known instance, but the construction of the typeclass_info is
done in the calling module.
Give slightly more informative progress messages.
compiler/dead_proc_elim.m:
Remove specializations for dead procedures.
compiler/prog_io_util.m:
Change the definition of the `maybe1' and `maybe_functor' types
to avoid the need for copying to convert between `maybe1'
and `maybe1(generic)'.
Changed the interface of `make_pred_name_with_context' to allow
creation of predicate names for type specializations which describe
the type substitution.
compiler/make_hlds.m:
compiler/prog_io_pragma.m:
Make the specification of pragma declarations in error
messages consistent. (There are probably some more to
be fixed elsewhere for termination and tabling).
compiler/intermod.m:
Write type specialization pragmas for predicates declared
in `.opt' files.
compiler/mercury_to_mercury.m:
Export `mercury_output_item' for use by intermod.m.
compiler/options.m:
Add an option `--user-guided-type-specialization' enabled
with `-O2' or higher.
compiler/handle_options.m:
`--type-specialization' implies `--user-guided-type-specialization'.
compiler/hlds_goal.m:
Add predicates to construct constants. These are duplicated
in several other places, I'll fix that as a separate change.
compiler/type_util.m:
Added functions `int_type/0', `string_type/0', `float_type/0'
and `char_type/0' which return the builtin types.
These are duplicated in several other places,
I'll fix that as a separate change.
library/private_builtin.m:
Added `instance_constraint_from_typeclass_info/3' to extract
the typeclass_infos for a constraint on an instance declaration.
This is useful for specializing class method calls.
Added `thread_safe' to various `:- pragma c_code's.
Added `:- pragma inline' declarations for `builtin_compare_*', which
are important for user-guided type specialization. (`builtin_unify_*'
are simple enough to go in the `.opt' files automatically).
compiler/polymorphism.m:
`instance_constraint_from_typeclass_info/3' does not need type_infos.
Add `instance_constraint_from_typeclass_info/3' to the
list of `typeclass_info_manipulator's which higher_order.m
can interpret.
NEWS:
doc/reference_manual.texi:
doc/user_guide.texi
Document the new pragma and option.
tests/invalid/Mmakefile:
tests/invalid/type_spec.m:
tests/invalid/type_spec.err_exp:
Test error reporting for invalid type specializations.
tests/hard_coded/Mmakefile:
tests/invalid/type_spec.m:
tests/invalid/type_spec.exp:
Test type specialization.
Estimated hours taken: 8
Add rot13 examples to the samples directory.
Note: Estimated time is time for contributors, mainly.
samples/README:
samples/c_interface/README:
Fix the README files, they were a little inaccurate in
describing some files and directories.
Estimated hours taken: 30
Modified files
--------------
samples/diff/Mmakefile:
Minor documentation update.
samples/diff/README:
samples/diff/TODO:
Update stuff that's now done, do a couple of minor wording
changes.
samples/diff/diff.m:
Fix case of identical filenames (which implicitly assumed
no_diff_implies_no_output). Add new match pass, call the
new diff algorithm.
samples/diff/diff_out.m:
Add --cvs-merge-conflict output style. Slight reorganisation
of top-level predicate. Lots of small fixes to use better
syntax (e.g. functional style for integer maths operations).
samples/diff/difftype.m:
Added first_mentioned_positions/3, last_mentioned_positions/3,
add_edit/4.
samples/diff/file.m:
Use io__read_line_as_string.
samples/diff/filter.m:
Minor syntax/wording changes.
samples/diff/options.m:
Update all the newly handled options.
New files
---------
samples/diff/myers.m:
New diff algorithm.
samples/diff/match.m:
New pass to match common lines in the files to be diffed.
Removed file
------------
samples/diff/lcss.m:
Functionality replaced by myers.m.
Estimated hours taken: 10
library/io.m:
library/io.nu.nl:
Implement io__read_line_as_string/{3,4}.
Also sneaked in here are some trivial whitespace fixes in some
of the pragma c_code which did not comply with our coding
standards (to do with type casting).
samples/cat.m:
samples/sort.m:
Use io__read_line_as_string.
tests/general/Mmakefile:
tests/general/read_line_as_string.exp:
tests/general/read_line_as_string.m:
Test case for io__read_line_as_string.
NEWS:
Mention the above change.
Estimated hours taken: 30
Modified files
--------------
samples/diff/README:
Info about this new version. Put the existing READMEs in
reverse order, so that they'll be in the most sensible order
for someone reading top-down.
samples/diff/Mmakefile:
Supply more detail about which bit of this program GCC 2.7.2
under Digital Unix 3.2 doesn't compile properly.
samples/diff/diff.m:
Slight reorganisation. Accept options, remove some high
coupling betweem diff__do_diff and lcss.m.
samples/diff/file.m:
Add support for attaching a filename to a file.
samples/diff/lcss.m:
Add more documentation, one slight performance improvement.
lcss__to_diff now works on the reversed LCSS, to avoid going
to the trouble of reversing it.
New files
---------
samples/diff/TODO:
Meaning should be obvious.
samples/diff/diff_out.m:
Replacement for diffs.m (which was never a very good name).
Now contains code to display a diff in lots more output
styles than previously supported.
samples/diff/difftype.m:
Replacement for lcsstype.m. Contains the type of a diff (but
not of an lcss, which is now local to lcss.m, hence the
renaming).
samples/diff/filter.m:
Contains code to filter a diff before being displayed. This
is only required if the user specified that they didn't want
to see part of the diff (e.g. with --ignore-blank-lines).
samples/diff/globals.m:
samples/diff/options.m:
Support for option handling.
Removed files
-------------
samples/diff/diffs.m:
Functionality moved to diff_out.m.
samples/diff/lcsstype.m:
Functionality moved to difftype.m.
Estimated hours taken: 0.1
extras/trailed_update/samples/interpreter.m:
New file. An example of the use of tr_store.m.
samples/interpreter.m:
Add pointer to extras/trailed_update/samples/interpreter.m.
extras/trailed_update/Mmakefile:
extras/trailed_update/samples/interpreter.inp:
extras/trailed_update/samples/interpreter.exp:
extras/trailed_update/samples/vqueens.exp:
New files. Some testing infrastructure.
Estimated hours taken: 0.1
Place various bits of sample code in the public domain.
extras/complex_numbers/samples/fft.m:
extras/graphics/samples/calc/calc.m:
extras/graphics/samples/maze/maze.m:
samples/ultra_sub.m:
place the source in the public domain.