Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /archive/mlprof.1/doc/VERSION.14
ViewVC logotype

View of /archive/mlprof.1/doc/VERSION.14

Parent Directory Parent Directory | Revision Log Revision Log

Revision 4054 - (download) (annotate)
Wed Feb 4 20:42:42 2015 UTC (4 years, 5 months ago) by dbm
File size: 11065 byte(s)
Initial import of archive (of early versions of sml/nj)
Standard ML of New Jersey, Version 14
From Version 13
Changes: (tyj)

Modified environment calculation (makenv).

Fixed up dumpCore.

Parse.tdec was resetting anyErrors to false; bogus, so it was eradicated.

Fixed a minor initialization bug in the batch system:  Env.commit was not
called at startup, so an error in bootup would cause a marker lost exception
to be raised, rather than the proper exception.

Fixed load, compile, etc., to print "Load", "Compile", etc. on bootup.

Improved lambda printing.

Played around with error handling in the batch system.  Previously we
were getting run-on errors which never raised an exception; this has
been fixed, at the expense of parser error recovery.

Fixed the duplicate lvars problem by alpha-conversion of results
in the match compiler.  This allowed the codenv changes to work,
and they produced about a 6% performance improvement, probably due to
the single free variable analysis pass:
    (Old)                   (New)
    [summary()]             [summary()]
    16653 lines             16653 lines
    parse, 389.416673s      parse, 363.666671s
    translate, 15.866665s   translate, 15.900001s
    codeopt, 20.100003s     codeopt, 19.516668s
    codegen, 249.599997s    codegen, 234.933333s
    total 674.983338s       total 634.016673s

Integrated Andrew's if/then branch optimization.

Fixed a problem with InLine and equality:
 Integer equality was not being expanded inline.  This was due to the
 explicit signature match "structure InLine : INLINE = InLine" in PervFunc,
 which caused all InLine functions to lose their inline property (outside
 of PervFunc, inline functions except equality are accessed through
 overloads, which preserved the inline property).
 Instead, we now create a new InLine structure within PervFunc which
 is a constrained version of the old InLine structure.
The removal of this stupidity caused a 40% speedup in compile-time.
Fixed equal.sml to look for InLine equality functions on ATOMtycs.
Added fixities to InLine structure definition in prim.sml.
Got rid of initial.sig and inline.sig, and they are not loaded in invoke anymore.

Improved profiling analysis.

Fixed a problem with the definition of path length.
Abstracted things a bit: abstracted envs, removed printclose and
transform from CODENV sig, moved closure printing into makenv.

Renamed the closurecount flag to profile.

Moved the dumpCore flag to compile and made it default false.

Added a flag to nml: -g turns off garbage collection messages initially.

Minor changes to allow for the new flags.

Minor fix so that timing statistics and garbage collection times are
reset on startup from exportML.

Added a flag GCPROFILE and code to print out cumulative garbage collection
information as nml exits.

Fixed a closure printing bug.  Abstracted Env from codegen a bit more.

Changes (dbm)
 codegen/{opt,codenv,switcher,reopen}.sml, boot/prim.sml,
 build/{compile,invoke}.sml, boot/overloads.sml}
Major revision of the type checker, including adding an explicit polytype
case to the basics representation of types, streamlining representation
of type variables, tycons, etc.  Use tyfun (type function) datatype in the
representation of polytypes and type abbreviation tycons.  Put in slots
for Home structure in representation of type constructors and structures
to be used for more accurate printing, but don't define them properly yet
and therefore don't make use of them.  Fixed a couple type bugs in the
process, including the one involving "as" and flexrecord patterns.

{basics/typesutil.*, env/prim.sml}
Reorganized the type utilities and moved typesutil.* to basics from typing.
Moved prim.sml from boot to env, after rewritting to eliminate use of
envaccess functions to calculate slot numbers.

Minor bug fix to printTyc to add a newline.

Known bugs:

There is a bug involving constructor representation.  The compiler
examines the structure of the datatype and tries to determine an efficient
runtime representation for it.  For example, for the list datatype, nil
can be represented as an integer, and :: can just be a pointer to its
tuple argument (integers and tuples are distinct).  This fails in our system
at the structure level.  For example:
signature S = sig
    type 'a t
    datatype 'a list = nil | :: of 'a t
structure A : S = struct
    datatype 'a list = nil | :: of 'a t
    withtype 'a t = 'a * 'a list
Here the compiler can deduce the efficient representation for the
(local) list datatype in structure A; but this cannot be deduced in
the signature S (an object of type 'a t might not be a pointer).
This will break our system (a fix is in the works).

In the interactive mode, parser error recovery should be suppressed
(but isn't); the parser may continue to look for input after an error,
when the user would expect to be back at top level.

The behavior of the system when it reaches limits is sometimes bizarre.
For instance, on a Sun, if the system runs out of stack space it
will die with "Illegal instruction".  Note that the stack limit can
be changed with the limit command; and hopefully this particular bug will
disappear with the next version of the code generator.

Top level bindings should not report on exhaustiveness, but they do.

system, cd, and execute may need to raise exceptions (they don't).
execute is buggy.  Use with caution.

- 432E432;
Error: Real constant out of range
- it;
val it = uncaught exception Boxity

Poor error message on:
- fun f hd::tl = 4;
Error: expected EQUAL, found ID (::)
Error: nonfix-identifier expected
Error: unbound variable bogus
Error: type error: operator and operand don't agree
operator : ((??*?? list) -> ?? list)
operand : (??*('x1911A list -> 'x1911A list))
  bogus :: tl
The "unbound variable bogus" is confusing.

-          8.69169476570297E~309;	(* inaccurate real; *)
> val it = 8.69169476570301E~309 : real
-          8.69169476570301E~309;	(* possibly a printing error? *)
> val it = 8.69169476570305E~309 : real

Notes: (tyj)

Squash together CONpat and APPpat?

Exceptions do not print by name/value; only "-".  This cannot be fixed
 unless the runtime representation of exceptions is changed radically--
 it must be modified to include type information, and may not be
 worth the effort.
Also, a declaration "exception b = a" can be a bit deceiving; the runtime
 name of b will be that of a.  Fixing this would also require a significant
 change in the runtime format of exceptions.
What should the interactive system print when it catches an exception?  It
 knows about some exceptions like Float and Io_failure, so it could
 print their full values.  This would be confusing, though, since no
 other exceptions would be printed in full; a user would think there
 was something wrong with his exception when the name and not the value
 was printed.

Think about a cleaner machine interface.  Currently have:
		| Codegen |      Perv         |
		| Machine | Inline |          |
		+---------+--------+ Assembly |
		|       Coder      |          |
Possibly Assembly could be built on coder or machine.  There would be macros
for system calls, etc.  This might make sense for register allocation.
Also we would like to be able to handle machine dependencies better.  For
example, some machines require software emulation of floats, others have
hardware functions for sin, cos, etc.  Right now there is no clean way
to do all of this at once, for some functions and not others, etc.

Printing of types needs to be cleaned up: <hidden> and paths are needed;
 attention to precedence of "->", etc., would reduce the number of parens;
 it would be nice if the compiler spit out the signature of a structure as
 it was parsed or opened.
Should the compiler force the capitalization convention for constructor names
 as well as exception names?  Should it discourage all other capitalized values?
 Right now it only complains if an exception is uncapitalized.  Maybe it
 should complain if a capitalized variable is introduced in a pattern.
The construct "val _ =" turns up all the time, so the match compiler has
 been changed so that _ counts as a variable in a pattern (the "binding
 contains no variables" message won't turn up).  It would be nice to unhack
 this by providing a "do" declaration, since "val _"  isn't very intuitive.
Maybe testcase_string should be changed.  Right now an equality function
 is generated for each case.  Perhaps inline string equality; can the
 offset be found by name?
Printing of infixes is slightly hacked because of the way infix is
 implemented; fixity is a lexical/syntactic property with scope rather than
 a property of a dataconstructor/value.
Timers will act strangely across exports.

Notes: (dbm)

Bad error messages

* message for circular type unification, as in "fun f x = f;"


* no checking for duplicated specifications in signatures.  this should be done
  when building the signature symbol table

Optimizations and simplifications

* stupid expansion of simple function definitions into case form (FUNdec
  in Absyn).  E.g.

    fun f x = x  ==>
    val rec f = fn arg => case arg of x => x

* fix type abbreviations so that in simple cases the name is bound to the
  old type constructor (or a copy) rather than to type function.

* string hashing primitive in Assembly


* eliminate nonexhaustive/redundant matches

* binding functions in EnvAccess are inconsistent in what they return.  Some
  return unit, others the variable that is bound.

* in envaccess.sml, iter... functions are trying to catch Notfound_Table
  exceptions raised by lookup functions, but these functions will not
  raise that exception.

ViewVC Help
Powered by ViewVC 1.0.0