1. New Features and Changes

This file explains the differences between Dr. Tim Budd's original Little Smalltalk and this version.

1.1 Copyright Changes

Dr. Budd has indicated to me that he is abandoning the restrictions of the original copyright. The message follows:

Return-path: 
Received: from mta2.snfc21.pbi.net (mta2-pr.snfc21.pbi.net)
 by sims1.snfc21.pbi.net
 (Sun Internet Mail Server sims.3.5.1999.07.30.00.05.p8) with ESMTP id
 <0FOD00GRP4FHP6@sims1.snfc21.pbi.net> for kyroha@sims-ms-daemon; Fri,
 14 Jan 2000 21:55:00 -0800 (PST)
Received: from ghost.CS.ORST.EDU ([128.193.38.105])
 by mta2.snfc21.pbi.net (Sun Internet Mail Server sims.3.5.1999.09.16.21.57.p8)
 with ESMTP id <0FOD007LF46V36@mta2.snfc21.pbi.net> for
 kyroha@sims1.snfc21.pbi.net; Fri, 14 Jan 2000 21:49:43 -0800 (PST)
Received: from oops.CS.ORST.EDU (oops.CS.ORST.EDU [128.193.38.26])
 by ghost.CS.ORST.EDU (8.9.3/8.9.3) with ESMTP id VAA15600 for
 ; Fri, 14 Jan 2000 21:49:43 -0800 (PST)
Received: by oops.CS.ORST.EDU (8.8.5/CS-Client) id FAA16044; Sat,
 15 Jan 2000 05:49:42 +0000 (GMT)
Date: Sat, 15 Jan 2000 05:49:42 +0000 (GMT)
From: Tim Budd 
Subject: Re: Little smalltalk
To: kyroha@pacbell.net
Message-id: <200001150549.FAA16044@oops.CS.ORST.EDU>
Status: RO
X-Status: A



well, I haven't touched LST since 94, you are welcome to any sources to
do whatever you wish with it.

I have put my changes under the GNU General Public License or GPL. See the included file COPYING for details. I felt that this was the closest license to the spirit of Dr. Budd's original license.

I have attempted to preserve the original goal of Little Smalltalk as a very simple system that provides a significant part of the functionality of a Smalltalk-80 compliant system without the overhead and complexity. My original goal in using LST was to add a specific X Windows widget set to it to allow GUI programming. Instead, I conceived the idea of using a web browser as the front-end and making LST into a tiny web server that would serve pages that implemented a simple code browser.

I modified the LST VM to support rudimentary sockets and added a very basic class browser (but not editor). That was in early 2001. Then LST languished again for over a year. In mid 2002, I found references to a Tiny Smalltalk by Andy Valencia (of VSTa fame).

I found Tiny Smalltalk and discovered that it was actually a modified version of Tim Budd's original LST 4.0. I do not know who did the modifications for certain, but I think it was mostly Andy Valencia.

Andy's version (or those he borrowed from) had a several nice features that I had seriously thought about, but had not persued. Andy had converted LST to work under VSTa (or so it seemed from the code). I removed most of the OS-specific changes in order to make it work under Linux.

In addition, Andy was working on both a disassembler for bytecode and a command line debugger. I have not used either and do not know if they work.

Some very ridimentary benchmarks showed that Andy's version was nearly an order of magnitude faster than the one I'd been hacking on (I did not do a comparison against the original LST 4.0). I suspect that I slowed my version down somewhat compared to the original, but Andy's non-boxed integers certainly helped things. I'm not sure about the change in Dictionary implementation. The method cache seems to work fairly well with a high hit rate (I don't remember the exact figure, but better than 95% I think...). So, method lookup is generally not that much of the overhead.

I took my changes to the original LST and merged them with those that Andy's version had. The result I called LST 4.5. It isn't done or even half-baked, but it is an amusing little toy now.

Dr. Budd's original system came in with an image of just under 4000 objects. I have not been able to keep under that limit, but the current image is still less than 4100 objects!

1.2 New Features

1.2.1 Increase Range for SmallInts

The range of SmallInts from 0-1000 to 0 to 2^31-1.

1.2.2 New Image Format

The image format has been changed to support larger SmallInts and to attempt to be platform independent. See below for more information.

1.2.3 Class Browser

LST now supports both TCP sockets and simple class/method browser using a web browser. You can look at class methods and edit them (not well tested).

2. Code Changes

This section describes bug fixes and changes that have been made to the original source and image source.

2.1 Code Reorganization

I reorganized the code so that main.c was much smaller, added several other files etc. Most of this was to split the functionality of the system into smaller units so that the image builder code would compile without being linked to the whole thing. I had originally changed some internal structure names and other things to get the code to compile with a C++ compiler (G++), but Andy's source did not have that and it was easier to leave that alone and merge the rest.

Due to the reorganization, I also changed the makefiles for the vm (the "st" program) and the image builder.

2.2 Primitives added

I added a primitive to implement the new #position: method for String.

I added several primitives for the socket operations. These are only sketched in at this point. For instance, I still do not have the setsockopt() call correctly setting SO_REUSEADDR on the socket.

2.4 Bug Fixes

Most of these came from Andy's code.

3. Major changes and additions

This section describes the major changes and additions done so far.

3.1 Andy's changes

Andy Valencia did several changes that I found (and perhaps more that I missed). Again, I am assuming that Andy did these changes as I did not find any evidence to the contrary.

3.2 Internet TCP socket support

3.2.1 Primitives

There are several new primitives that implement various operations on a BSD-style TCP socket.

3.2.2 Classes

The TCPSocket class has been added. It doesn't do much more than wrap the primitives. It needs some clean up, but seems to work.

3.3 New General Classes

3.3.1 StringBuffer

This class provides a buffer in which to build strings. When I was experimenting with the HTTPBrowserWindow code (see below), it became clear that constructing HTTP responses by concatenating strings was far too slow to be usable. So, I created this class as a subclass of List.

MethodFunctionality
add:Forces the passed object into a string via printString.
addLast:Forces the passed object into a string via printString.
printStringThis constructs and returns a single string representing all the strings in the buffer.
sizeThis returns the combined size of all the strings in the buffer.

This class is used heavily in the HTTP class browser.

3.4 Class browser GUI

The following is from the previous implementation of the class browser and should only used as an idea of where I was going. The actual code is in classbrowser.st. Look there before assuming anything! You can do some editing of methods with the current system. The information below is incorrect.

I added a new way to view classes. This is via a web browser. I did not want to add all the GUI code to LST (yet) via some widget set, so I added a set of classes to handle HTTP requests, dispatching and displaying lists and code to the browser.

3.5 New Classes

I added the following classes:
ClassFunctionality
HTTPRequestThis class provides access to a standard HTTP request somewhat like that provided by the mod_perl Apache request object, only much more primitive. You can get the path, action (GET or POST), or URL arguments from a request. You return your response to the request object.
HTTPDispatcherThis class provides a mechanism to associate URL paths with specific blocks of code. When a request comes in, a dispatcher will look up the path of the URL request (via HTTPRequest) and dispatch it to a block. Blocks can be registered by outside entities on any URL path.
HTTPBrowserWindowThis class implements a very simple class browser. You can only look at the methods of classes and at the method text. Currently there is no provision to allow you to add methods or classe, or to modify methods. Given what is there now, this should not be a hard thing to add.

3.6 Image format changes

See the document imageformat.txt for an explanation of the new image format. This format is slightly more concise and allows for SmallInts that are much, much larger than before. It is designed to work across big-endian and little-endian platforms as well as 32 or 64-bit word sizes. Since I only have Intel-based machines, I cannot test this yet.

4. Running LST 4.5

To run the LST command line, do the following steps: To run the class browser, a few more steps are needed. I'll assume that you are at the LST prompt.

5. Known Bugs

None! Well, given the minimal amount of use of LST 4.5, I believe that there are many bugs. They just have not been found yet.

Actually, the largest two bugs are that I haven't written any C socket code for about a decade and what I have written is fairly Linux specific. I do not have access to any other OSes to test. It would be wonderful if someone could make this code POSIX compliant and also add in #define's and the rest to make it compile under that OS from Redmond.