Hi,
I made a little progress at the Self/Linux port. :-) I was just able to evaluate the first Self expression on Linux with NIC generating i386 code:
gordon@salt:~/self/vm/linux/debug > Self -F -l hello.txt -t -p Self Virtual Machine Version 4.0.5, Wed 20 Jan 99 20:42:59 Linux 2.0.33 (linux) Copyright 1989-95: The Self Group (type _Credits for credits)
VM# 1 1: ( | parent* = <0>. | ) VM#
OK. It is not really spectacular, I have to admit...
Well, I am going to try now all language features systematically.
Gordon.
------------------------------------------------------------------------ eGroup home: http://www.eGroups.com/list/self-interest Free Web-based e-mail groups by eGroups.com
This looks good. Here is a file that might help you:
http://www.lsi.usp.br/~jecel/release/fac.self
This was created by Ole Agesen using his amazing type analysis and program extraction system. This file, when read into the initial Self system (empty world) creates just the objects needed to run a simple program that prints a table of factorials up to 49! and then stops.
Note that as is, the file creates a snapshot (about 300KB) that when "executed" will do the job. For testing a port it would probably be a good idea to change the last few lines to run the program directly instead. That is, replace everything from the "snapshotAction _AddSlots:" on with just "world obj7 main".
Speaking of snapshots and things, did you worry about the infamous Endian issue? Self ran originally on 680X0 machines, then the Sparc. Both of these are "big endian" processors, while the X86 is a "little endian" one. This will cause problems when reading integers/pointers from a file, talking with the network and so on. In Squeak, they were able to restrict their problems to the image (snapshot) code and the graphics primitives.
After you get things running well enough, you might want to take a look at the optional files in the download area and get the stuff in the "tests" subdirectory. Besides some benchmarks, there are a lot of "regression tests" that will allow you to test all aspects of your VM port.
-- Jecel
------------------------------------------------------------------------ eGroup home: http://www.eGroups.com/list/self-interest Free Web-based e-mail groups by eGroups.com
Jecel Assumpcao Jr wrote:
This looks good. Here is a file that might help you:
Thank you for your suggestion. I am going to try it out when time comes. Currently, I have to stick to very small examples until I get the code generation under control.
There are still unresolved questions about how the GC, recompiler, debugger traverses the stack. The stack frame is quite different on i386: creating a new stack frame is not an atomic action on i386. I am not able to predict what happens, if somebody tries to traverse a stack frame while it is in creation. Additionally, the code on i386 is not 32 bit aligned. There is no delay slot.
Well, I am still working in single step mode.
Speaking of snapshots and things, did you worry about the infamous Endian issue? Self ran originally on 680X0 machines, then the Sparc. Both of these are "big endian" processors, while the X86 is a "little endian" one. This will cause problems when reading integers/pointers from a file, talking with the network and so on. In Squeak, they were able to restrict their problems to the image (snapshot) code and the graphics primitives.
As soon as NIC runs, I am going to look if it is possible to read a snapshot. The big/little-endian issues have to be addressed, of course. I hope, the Self snapshot does not contain foreign data.
-Gordon
------------------------------------------------------------------------ eGroup home: http://www.eGroups.com/list/self-interest Free Web-based e-mail groups by eGroups.com
self-interest@lists.selflanguage.org