help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] GNU Smalltalk 3.1 released


From: Paolo Bonzini
Subject: [Help-smalltalk] GNU Smalltalk 3.1 released
Date: Sun, 19 Oct 2008 14:09:55 -0400
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

GNU Smalltalk 3.1 has been released at

  ftp://ftp.gnu.org/gnu/smalltalk/smalltalk-3.1.tar.gz

Changes between 3.0.5 and 3.1 include the following.


New base class features:

* BlockClosure methods #cull:, #cull:cull:, #cull:cull:cull: evaluate
blocks removing parameters that are not accepted by the block.

** Thanks to this new functionality, the parameter to  #on:do: and
#ifNotNil: can be omitted.

** RegexResults method #ifMatched:ifNotMatched:, and other similar
methods, also accept either zero or one-argument blocks.  In 3.0,
#ifMatched: accepted a one-argument block, while #ifNotMatched: accepted
a zero-argument block.

* Collections and Streams have a common superclass, Iterable.  The
user-visible aspect of this is that Streams now enjoy a wider range of
iteration methods, such as #anySatisfy:, #detect: and #count:.

* CObjects can be backed with garbage-collected (as opposed to
heap-allocated) storage.  Using this is not always possible, for example
for CObjects stored by external libraries or passed to functions that
call back to Smalltalk or otherwise may cause garbage collections.  If
it is, however, it is easier to use, faster and more predictable than
finalization.  As an added benefit, accesses to are bounds-checked.

Garbage-collected CObjects are created by sending #gcNew instead of #new
to instances of CType.

* It is possible to create C call-outs that are not attached to a
function that the VM knows about, using the method CCallable
class>>#for:returning:withArgs:.  The returned object can then be used
to create CompiledMethods using CompiledMethod
class>>#cCall:numArgs:attributes:.

The address however is reset to NULL on image restart and it is up to
the user to reinitialize it.  You can also subclass CCallable and
override the #link method (the existing CFunctionDescriptor class is now
implemented on top of this).

* ObjectMemory>>#snapshot and ObjectMemory>>#snapshot: return false in
the instance of GNU Smalltalk that produced the snapshot, and true in
the instance of GNU Smalltalk that was restored from the snapshot.  Note
that this does not apply to CallinProcesses, since those are stopped in
saved images.

* Packages can specify start/stop scripts.  Start scripts can be
activated with gst-load, while both start and stop scripts are supported
by the new tool gst-remote (see below).

* Processes support thread-local variables, which are accessed through a
special dictionary returned by ProcessorScheduler>>#processEnvironment.

* Streams have a set of new methods that allow to eliminate useless
copies when moving data from stream to stream, as well as to eliminate
useless creation of collections to store the data read from a stream.
Besides the standard methods #next, #nextPut: and #atEnd, three more
methods can be implemented by Stream subclasses in order to achieve
better performance on block transfers, namely
#nextAvailable:into:startingAt:, #nextAvailable:putAllOn: and
#next:putAll:startingAt:.

Another set of new methods was added to Stream, in order to provide an
easier to use API on top of the basic block-streaming API described
above; you should not need to override them.  These are
#next:into:startingAt:, #next:putAllOn:, #nextAvailable:,
#nextAvailable:putAllOn:, #nextAvailablePutAllOn:.



New environment/language features:

* Error backtraces include line numbers and filenames.

* Imports were added to namespaces (via the <import: ...> pragma, as for
classes).  Unlike the superspace, imports are not made visible through
#at:.  The design and implementation of this feature was done by Stephen
Compall.

* The order for searching pool dictionaries changed.  The new order,
codenamed "TwistedPools", builds on three ideas: 1) the environment of a
class always has lower priority than the imports, so the environment is
always excluded from the imports if the environment is a superspace of
the imports; 2) apart from this, the imports are visited in topological
order, so that if two imports have a superspace in common, the imports
are always visited before the superspace; 3) each class in the
inheritance order is visited separately, so the imports of a superclass
have lower priority than the environment of the subclass.

The design and implementation of this feature was also done by Stephen
Compall.

* The source code for methods loaded from Streams that are not
FileStreams is stored directly in the image.


Incompatible changes:

* FileDescriptor and FileStream raise an exception if #next: cannot
return the given number of bytes.

* FileDescriptor is now a subclass of Stream.

* Halt is now a subclass of Exception (rather than Error).

* ObjectDumper now accepts normal String streams.  The class ByteStream
has been removed.

* Stream>>#nextHunk was removed.  Applications can use #nextAvailable:
or, better, should be rewritten to use new stream-to-stream protocol
such as #nextAvailablePutAllOn:.

* The VFS subsystem was rewritten.  Virtual filesystems are now
accessible via special methods on File (such as File>>#zip, for example
"(File name: 'abc.zip') zip") and not anymore with special filenames
that could conflict with real files.

This caused a few incompatible changes.  The most important are: 1)
methods like `File image' and `Directory kernel' return a File object,
not a String; 2) Directory objects are not created anymore and instead
File objects also support the Directory protocol; 3) Directory>>#do:
passes File objects rather than file names to the block; 4)
Directory>>#contents is now called Directory>>#entryNames.

* The semantics of #on:do: were changed: executing off the end of an
exception handler will always return from the associated #on:do:.  Older
versions of GNU Smalltalk either returned or resumed depending on the
resumability of the exception.


New VM features:

* Functions gst_async_signal and gst_async_signal_and_unregister are now
thread-safe, *not* async-signal-safe.  This is more useful, and is a
feature more than an incompatible change.  To trap signals from
Smalltalk, you have to use ProcessorScheduler>>#signal:onInterrupt:.

* If possible, the installation is made relocatable.  To this end, the
following conditions should be satisfied: 1) the exec-prefix and prefix
should be identical; 2) the installation should reside entirely within
the prefix; 3) on Windows, the bindir and libdir should be the same or
shared libraries should be disabled; 4) if neither on Windows nor under
a glibc-based system, shared libraries should be disabled.

If the above conditions are satisfied, and you want a relocatable
install, it is suggested that you configure with a non-existent prefix
such as "--prefix=/nonexistent".  To move the installation, you can
install into a staging area and move it from there.

      ./configure --prefix=/nonexistent
      make
      make install DESTDIR=`pwd`
      (cd nonexistent && tar cvf - .) | (cd $HOME && tar xvf -)
      (cd nonexistent && tar cvf - .) | (cd /usr/local && tar xvf -)

In order to support relocatable installation, libgst clients should call
gst_set_executable_path *before* gst_initialize.  Failure to do so won't
cause any problem, except that relocatable installation will be disabled
and the program will look for its files only in the configured prefix.



Packages changes:

* DBI:

** DBI supports querying tables for schema information, and is
integrated with the "ROE" (Relational Object Expression) package by Avi
Bryant.  ROE support is present for all back-ends (MySQL, PostgreSQL,
SQLite).

** The SQLite backend supports stored procedures (contributed by Daniele
Sciascia).

* Sockets (formerly TCP):

** IPv6 and AF_UNIX sockets.  IPv6 support is transparent if your system
is configured appropriately.  In order to use AF_UNIX sockets, just
specify the socket name as the "port" and "Sockets.UnixAddress
uniqueInstance" as the host.

** The sockets package (and the namespace it is installed in) was
renamed from TCP to Sockets.  While the old namespace is still available
for backwards compatibility, it is suggested to use the Sockets
namespace instead.

** Unbuffered sockets available from class Sockets.StreamSocket.


New goodies:

* A new installed tool gst-remote allows remote control of a GNU
Smalltalk VM via a TCP socket, possibly via ssh.

* Bindings to Cairo and LibSDL provided by Michael Bridgen, Tony
Garnock-Jones and Brad Watson.

* Bindings to OpenGL and GLUT contributed by Olivier Blanc.

* Magritte object-model description framework by Lukas Renggli.

* ROE (see above).

* Seaside application server/web framework by Avi Bryant, Julian
Fitzell, Philippe Marschall, Lukas Renggli and others.  The version of
Seaside included is a snapshot of 2.9 from last February, which is
similar to 2.8 except for some deprecated APIs; a new release of GNU
Smalltalk 3.1.x will be published supporting 2.9 final when it comes out.

* Swazoo web server by Bruce Badger, Janko Mivsek and others.



Thanks to the above-mentioned contributors, and to Thomas Girard for
testing of the prereleases.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]