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!
Due to the reorganization, I also changed the makefiles for the vm (the "st" program) and the image builder.
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.
Method | Functionality |
add: | Forces the passed object into a string via printString. |
addLast: | Forces the passed object into a string via printString. |
printString | This constructs and returns a single string representing all the strings in the buffer. |
size | This returns the combined size of all the strings in the buffer. |
This class is used heavily in the HTTP class browser.
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.
Class | Functionality |
HTTPRequest | This 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. |
HTTPDispatcher | This 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. |
HTTPBrowserWindow | This 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. |
kyle@nahuatl:~/lang/lst/lst4.5> ./st 3227 objects in image ->
kyle@nahuatl:~/lang/lst/lst4.5> ./st 3227 objects in image -> File fileIn: 'classbrowser.st'.This will spew a lot of stuff to the screen as it reads in the source in classbrowser.st.
-> HTTPClassBrowser new start. Socket: 3 IP: 127.0.0.1 Port: 6789LST will print out the socket file descriptor number, the IP it bound to and the port it is using.
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.