Release notes: Version 4.1.1 Development

New features and Changes

Windows™ interface
This release includes structures to allow Windows graphical programs to be written in Poly/ML.  See the Windows Programming in Poly/ML and  Windows Interface Reference for more information.

Extensions to the Symbolic Debugger.
The symbolic debugger introduced in version 4.1 has been extended.  There are additional functions to step over a function and to step out.  The debugger attempts to print the source line when it stops at a breakpoint.  For this to work the source must have been compiled using a full path name or the debugger must be run in the same directory that the source was compiled in.  The debugger now displays values from opened structures and in abstype declarations.

Printing top-level exceptions.
When an exception is raised at the top-level the compiler now prints the parameters in the exception packet if the exception is declared at the top-level or in any top-level structure.  Previously it would only print the parameters if the exception was declared unqualified at the top-level.
This is particularly useful for exceptions raised by the Standard Basis Library such as IO.Io and OS.SysErr.  Previously if, for example, TextIO.openIn failed to open a file the only information available was that the Io exception had been raised.  Now the parameters will be printed giving much more useful information.

Large databases.
Previous versions of Poly/ML had limits on the size of the database of around 63Mbytes.  This remains the default limit but larger databases are now possible, up to around 400Mbytes.  To increase the limit it is necessary to run the disc garbage collector and specify the -S option.
e.g. poly -d -S 250 ML_dbase
This will compact the database and set the maximum size to 250Mbytes.  Attempts to set the size to a value which is too large will fail with the message "Not enough address spaces".  The limit on the size depends on the current maximum database size (the larger the current size the smaller the new size may be) and is reduced if the database is a child database.
There are actually two limits on the size of a database: the mutable data size (space for refs and arrays) and the immutable data size (everything else) and a database cannot be expanded if either of these limits is reached.  The space available is divided between these two in the ratio 1:8.  There is currently no way of changing this.

CInterface structure
Added unsigned integer conversions.  Added functions to convert between Word8Vector.vector and C arrays.  toCchar and fromCchar now convert between the ML char type and C char rather using the ML string type.

Bugs fixed

Changes to representation of datatypes.
There was a potential bug in the way datatypes were implemented.  Previously the representation of a datatype was implemented using static information about the number of constructors and their types.  Various optimisations are possible if, for example, it is known that the only non-nullary constructor takes a tuple as an argument.   These optimisations are not always possible if a datatype can be passed as an argument to a functor.  Simon Finn pointed out that datatype replication could result in a datatype being passed into a functor in circumstances that was not possible in ML90.   Rather than remove the optimisation the handling of datatypes has been changed so that constructors are passed as arguments to a functor.  In practice these are optimised away if functors are expanded inline (the default setting).  Because it is now possible to use the optimised representation in all cases the code is likely to be faster than before.

Correctly converts negative hexadecimal numbers
Previously values such as ~0x1 were always converted as zero.

Correctly prints singleton records
Singleton records (e.g. {a=1}) were previously printed as {...}.

Some functions with side-effects were not evaluated if their results were not used
For example, fun f s = (print s; true); fun p s = not (f s); val _ = p "OK\n"; did not work correctly in 4.1.  This has been fixed.

Changes to allow compilation on Solaris 6.
There was a problem compiling the sources in older versions of Solaris.

 

Release notes: Version 4.1 Experimental

Bugs fixed

Exception matching in val bindings.
Previous releases contained a bug in the processing of val bindings when the pattern was an exception constructor.

Closing Standard Output.
Closing standard output caused an infinite loop in previous versions.

Changes since Version 4.0 Release

Source Level Debugger.
This release includes a source level debugger which allows the use to set and clear breakpoints and view local variables.  Code compiled for use with the debugger can be freely mixed with other code.  See here for a full description.  A PolyML.Debug structure has been added and a PolyML.Compiler.debug flag.

Free type variables.
The language definition says that no free type variables may enter the basis but leaves it to the implementer whether to refuse elaboration or instead replace the type variables by monotypes.  Version 4.0 refused to elaborate expressions such as
fun f () = raise Fail "error"; f();
Version 4.1 allows it to elaborate but produces a warning message.  The result is bound to a unique monotype distinct from any other type in the basis.

Substantial changes to the optimiser.
The optimiser has been substantially changed so that many more cases can be compiled in-line.  Small tail-recursive functions, such as List.foldl, are now compiled as while-loops within the calling functions.   Small recursive functions which are not tail-recursive, such as List.map, are compiled as specialised functions so that the function being mapped is inserted into the specialised function.   When mapping a small function over a list this can produce big improvements by avoiding the need for a function call for each element of the list.  Applying these optimisations and a few others within the compiler itself has produced a substantial speed up.

Formatting of pretty-printed output.
The format used when printing top-level expressions, particularly structures and functors, has been improved to give a more consistent appearance.

Tuples as results.
Previous versions of the compiler allocated memory to contain tuples returned from functions or even from an if-expression.  This version now allocates store on the stack to receive the results, reducing the load on the garbage collector.

Improvement to TextIO.
The TextIO structure is defined as imperative operations on top of the functional IO layer.  Implementing it in this way, though, turned out to be inefficient if the functional layer was not used.  TextIO has now been rewritten so that if TextIO.getInstream is never called on a stream it can be handled entirely within the imperative layer.

Specialised equality functions.
Previous releases contained specialised code for equality for a few built-in types such as int and string but defaulted to the general structure equality in more general cases.   The compiler now generates functions for equality in most cases.  Because of the changes to the optimiser these will usually be compiled in-line even when operating on recursive types such as lists.  This is most successful when the compiler has specific type information so the addition of a cast may well speed up a function.   

X-Windows/Motif - new functions.
The following functions have been added to the Motif structure:

val XtGetApplicationResources: Widget -> (string * string * XmRType) list -> Arg list
val XtAddEventHandler: > Widget -> XWindows.EventMask list -> bool -> (Widget * 'a XWindows.XEvent -> unit) -> unit
val XmMenuPosition: Widget -> 'a XWindows.XEvent -> unit

Assignment to references in the database.
Older versions of the compiler always made calls to the run-time system to handle assignment.  In version 4.0 this was changed so that the assignment operation was compile in-line, speeding up imperative functions when the reference being updated was local.  If the reference was in the database assignment involved a trap and the assignment was emulated by the run-time system.  This has now been changed so that there is only a trap the first time a reference is updated.  More specifically, references in the database are packed into pages and if any of the references in a page are updated the whole page is marked "dirty" and no further traps will occur for that page.
The format of a database has changed slightly as a result so version 4.1 databases may only be used with a run-time system built for this version.

Low-level code-generation.
Various changes have been made to the low-level code-generators, particularly in the handling of constants and calls to functions which are known at compile-time.  The code-generators now generate code for more functions such as Word.* which previously required calls to the run-time system.   Functions now contain information about the registers they modify to reduce the need to save registers across calls.

Mac OS/X
Real number rounding control (IEEEReal.getRoundingMode and IEEEReal.setRoundingMode) has now been added to the Mac OS/X version  of Poly/ML 4.1.  This version has been tested with the release version of Mac OS/X.  The foreign function interface (CInterface structure), time profiling (PolyML.profiling 1) and polling (OS.IO.poll) do not work in Mac OS/X.

Update on 25th April 2001.  Slow "commit" and database compaction in Linux and Solaris
There was a problem with writing to the database which appeared in some versions of Unix.   This was particularly noticeable on machines with slow discs or where the database was accessed over a network.  A revised version of the driver sources has now been installed to correct this problem.

Update on 3rd May 2001.  Bug fix: Corrupted parent database file name.
When running the disc garbage collector on a child database in Mac OS X the parent file name became corrupted.

Update on 3rd May 2001.  Fix to allow compilation on Mac OS X with X-Windows/Motif.

Release notes: Version 4.0 Release

Bugs fixed since Version 4.0 beta1

Negative integers printed strangely.
Bug in Version 4.0 beta1: Negative numbers printed as large positive numbers.

Files were created with execute permission.
The default creation mask for files was 777 (read, write and execute permission).   This has been changed to 666 (read and write permission).

i386 code-generator bug.
A bug was found in the i386 code-generator which among other things caused Poly/ML to crash when given an integer in hexadecimal (e.g. 0x1).

Linux:  Typing control-C would sometimes cause a crash.
Poly/ML would sometimes crash if control-C was pressed.   This was highly timing-dependent and occurred only if the SIGINT arrived at the same time as another signal such as a SIGSEGV used to indicate a garbage-collection or arbitrary-precision emulation trap.

 

Changes since Version 4.0 beta1

The default for print depth is now 100.
The default value for PolyML.print_depth is now 100 instead of 1.

Power architecture version now fully supported.
The Power architecture is now supported under MacOS-X beta and LinuxPPC.

Removed various exceptions from the PolyML structure.
The Interrupt, Div, Bind, Match, Size, Overflow, Underflow and Subscript exceptions have been removed from the PolyML structure.  These are either free in the basis or are in the SML90 structure.

X-Windows/Motif now compiles with LessTif and OpenMotif.

Sparc/Solaris: Removed check that the whole of the address space was available.
The Sparc/Solaris version attempts to reserve a very large region of memory to prevent any other library from allocating within the area that Poly/ML might use for its heap.   This caused problems if there was a limit on the amount of virtual memory that a program could reserve and has been removed.

Links as "discgarb" and "changeParent" now work for path names.
For backwards compatibility it is possible to create a link to the poly executable called "discgarb" and invoke the program through that rather than specify the -d option to poly.  This previously worked only if the program was invoked as "discgarb" not as, for example, "/usr/bin/discgarb".  This has now been changed so that only the last component of the name is examined.

 

Release notes: Version 4.0 beta1

Bugs fixed since Beta 4.0

"InternalError: equality - Overloadset found raised while compiling"
This message was produced when compiling certain combinations of overloaded functions and equality.

Failed to compile properly on RedHat 6.2 and other recent versions of Linux
The SRPM version of the 4.0 beta release would compile on RedHat 6.2, provided a few changes were made to the sources but the resulting binary crashed.

StringCvt.padLeft and padRight crashed when applied to single character strings
These functions caused a page fault when applied to strings containing a single character.

Changes since Beta 4.0

Introduced the POLYPATH environment variable to allow databases to be found using a path.
When searching for a database, whether given on the command line or to find the parent of a child database, poly searches using the path given in the POLYPATH environment variable.   On most platforms it defaults to ".:/usr/lib/poly:./usr/local/lib/poly" meaning that when searching for a database called "dbase" it will first look in the current directory and if that fails look for /usr/lib/poly/dbase and finally /usr/local/lib/poly/dbase before giving up.  Setting the POLYPATH to an explicit path allows the user to specify where databases are to be found.

As a result of this change poly now defaults to searching for a database called ML_dbase in the path if no database is given on the command line.   The restriction that a child database can only be created if the parent path name is fully specified has been removed.

Removed discgarb and changeParent.
The discgarb and changeParent programs have been removed and the functionality incorporated into the poly program.  New options have been added to poly.  The '-d' option compacts a database in the manner of discgarb.  An additional option '-c' can be used to run the
common-expression elimination phase.  The '-p' option changes the parent of a database as with changeParent.   The old behaviour can be retained by creating links to the poly binary called discgarb and changeParent and invoking the binary through these names.

Changed TextIO.stdOut to use line buffering.
In Beta 4.0 this was unbuffered.

Added interruptConsoleProcesses to the Process structure.
Process.interruptConsoleProcesses() causes all console process to be sent the SML90.Interrupt exception.   Usually there will only be one console process, the top-level loop which runs the compiler and executes the code.

 

Version 4.0 beta

Features and changes in this release.

Supports ML97

The revised definition of Standard ML (ML97) introduced a   number of changes.  Poly/ML now implements this version of the language.   Some of the old (ML90) features are available by setting PolyML.Compiler.ml90 to true.  The major changes include value polymorphism, which removes the need for imperative type variables and changes to the way structure sharing is handled.  Type abbreviations in signatures and datatype replication are also included.

Supports the Standard Basis Library

The Standard Basis Library is a suite of modules which provides a standard set of functions for many purposes as well as access to many operating system facilities. 

Other changes

Linux: supports larger database size.
Values are printed in alphabetical order.
Various code-generator changes and fixes.
Windows: the console is replaced by a Windows-style console.
Signal structure allows signals to be handled or blocked.

Last updated: 06 August 2001 by David Matthews.