Progress on Darwin/Linux port?

61 views
Skip to first unread message

Dave Mason

unread,
Jun 10, 2009, 10:19:43 AM6/10/09
to Strongtalk-general
I'm very interested in Strongtalk, but I don't do windows... never
have.

I have Linux servers I could run on, and my desk/lap-tops are all
MacOSX, so I won't be able to contribute anything until it runs on one
or both of the platforms.

../Dave

talksmall

unread,
Jun 10, 2009, 11:40:10 AM6/10/09
to Strongtalk-general
Hi Dave,
A number of people are in your position (I was one when I first got
involved with Strongtalk), and I've done some porting work to
facilitate getting the VM running in both OSX and Linux, however, the
biggest problem in both environments is getting enough of a UI running
to allow people to develop in Strongtalk.

I started out with a linux port and the core VM does run under linux
(or at least it did, see below), but only in headless mode. I also did
some preliminary enabling for an OSX port (the principal piece being
to ensure 16 byte alignment of DLL calls - to keep things simple this
is now the case under all OSes). I even implemented ANSI exceptions
under Linux in file out format using a text editor - just because I'm
a masochist. It's not a route I'd recommend ;) The fact that the linux
VM is headless does not make it completely useless though, because you
can pass a script of Smalltalk code to it using the -script command
line argument.

If you take a look at the Wiki tab on the project site you will find a
section on building the VM - http://code.google.com/p/strongtalk/wiki/Building
- which also includes instructions for building under Linux.

Although we have not got that far yet, it probably wouldn't be too
hard to extrapolate this for OSX, though maybe an Xcode-based build
might be more appropriate. I have only just acquired an iMac, so
trying this out is definitely on my todo list, though how soon I will
get there I don't know, as I don't have that much time to devote to
the Strongtalk project as a whole (<10 hours per week) and there are
other bits that need attention. If you fancy tackling this, I'd really
like to encourage you to get involved. I'll do my best to support you
in any way I can.

If you are interested in this, you should checkout the gcc-linux
branch from SVN, rather than the trunk. This has been the mainline for
all of my contributions to the project. At some stage this needs to be
merged back into the trunk, but before I do that, I want to revalidate
the linux build. I took a quick look at it a couple of weeks ago and
it wasn't working. I haven't had the time to spend on sorting this out
yet. I may try and do that over the next couple of days. If so I'll
post again when I check in, and, if necessary, update the build
instructions on the Wiki.

Just for reference, what are your skills in C++ and assembler like? Or
do you only envisage contributing to the Smalltalk side of things?
(That's not inherently a problem, but it will make it more difficult
for you to contribute until we have a UI in either Linux or OSX -
though you could always try the masochistic route ;))

Another thing to bear in mind is that this is still pre-alpha code.
Crashes are to be expected. I almost always run the VM as a debug
session under an IDE (VisualStudio Express on Windows and Eclipse CDT
under Linux), with the sole exception of a small script I wrote that
launches the VM when doing primitive generation.

If none of this has frightened you off yet (and appearances to the
contrary, I sincerely hope it hasn't), then welcome. Please jump in,
ask questions and basically get involved.

Regards, Steve

talksmall

unread,
Jun 23, 2009, 5:34:45 PM6/23/09
to Strongtalk-general
Just a quick heads up. I've just managed to run a "Hello, world"
script in the burgeoning OSX port of the Strongtalk VM. Not quite
ready to check in yet, but I should have a version ready to go in
about a week or so. As with the Linux port this will be a script-only
version until someone (possibly me) ports UI support for OSX and
Linux.

Regards, Steve

David Griswold

unread,
Jun 23, 2009, 6:20:17 PM6/23/09
to strongtal...@googlegroups.com
That's great!
-Dave

Dave Mason

unread,
Jun 24, 2009, 1:35:52 PM6/24/09
to Strongtalk-general
On Jun 23, 6:34 pm, talksmall <StephenLR...@googlemail.com> wrote:
> Just a quick heads up. I've just managed to run a "Hello, world"
> script in the burgeoning OSX port of the Strongtalk VM. Not quite
> ready to check in yet, but I should have a version ready to go in
> about a week or so.

That's great! The reason I haven't responded in the past couple weeks
is that I've been cleaning stuff up before "vacation". Which will end
with ESUG in France in September, maybe see some of you there.

> As with the Linux port this will be a script-only
> version until someone (possibly me) ports UI support for OSX and
> Linux.

One of my projects over the summer is to make a minimal GUI that runs
through Firefox, i.e. that uses only the network interface, and none
of the OS-specific screen handling. I'm working to get this working
first on Pharo/Squeak, and then will move it to Strongtalk. If that
is running on OSX by then, so much the better. To the extent
possible, moving the primitives interface of Strongtalk to mirror that
of Squeak would make some porting much easier.

As for my expertise, I have taught C++ in an OO course, but have
little experience actually building programs.

../Dave

talksmall

unread,
Jun 24, 2009, 5:12:11 PM6/24/09
to Strongtalk-general
Hi Dave,
A pre-req for this is some kind of socket support which Strongtalk
doesn't have at the moment.

It shouldn't really be necessary to rewrite the Strongtalk primitive
interface in order to port over Squeak code, provided that the code
you are porting is not tightly coupled to the low-level details of the
Squeak implementation (and that would be a bad idea ... right?).

Appropriately layered code is much easier to port than poorly designed
code. That is one of the reasons that porting Strongtalk to other x86
platforms has been reasonably easy - few parts of the VM directly
depend on the OS, they are well-encapsulated and the rest of the VM
depends, in the main, on an abstraction to the OS-layer.

The same cannot be said of the dependency on the instruction set
architecture. Porting Strongtalk over to another ISA - say ARM, or
PowerPC - would be much harder. Similarly, porting to 64-bit will
involve a fair amount of work. There are lots of places with implicit
assumptions about the size of a pointer and its equivalence to the
size of an integer, and the built-in macro assembler is not 64-bit
aware.

Once the core porting work is out of the way, I have a few competing
projects to pick between - a UI port for OSX and Linux (probably GTK+
based), porting Eliot Miranda's Aliens FFI interface from Squeak,
porting some NewSpeak stuff, enhancing the still very basic UI-level
debugger, investigating the "new backend" - a more sophisticated code
generator for the recompiler that generates code that is about twice
as fast as the current "old" code generator, GC finalization
support, ... &c. So much to do, so little time, oh, and a day job too
- they tend not to want to pay me if I don't do anything for them!

> As for my expertise, I have taught C++ in an OO course, but have
> little experience actually building programs.

C++ knowledge is only really required if you want to poke around in
the VM, in particular the recompiler from which Strongtalk gains its
performance. Now that the bulk of the VM side of the OSX porting work
is done, there should be little need to use C++ unless you need to
debug, or you just want to see what makes the VM tick. Even then, the
VM spends more time in assembly code than in C++ - either in the
interpreter or in compiled nmethod versions of Smalltalk methods. The
most important remaining pieces of the OSX port are Smalltalk coding
to fix up the DLL calls for OSX so that they conform with the
libraries under OSX.

Once I have tidied up the port so that all of the tests past (both ST
and VM-level tests) then I will upload binary versions of the VM,
image and sources for each of the platforms. Hopefully that will
enable people to get involved without having to build the VM first.
For the time being that will mean command line scripting for those on
OSX and Linux, but you can do quite a lot that way. Ruby, Perl and
Python hackers got along without IDE support for years. A nice project
for someone might be to build an OSProcess class in Smalltalk to allow
execution of external commands. The Squeak version would be a good
place to start.

Regards, Steve

Gilad Bracha

unread,
Jun 25, 2009, 11:43:47 AM6/25/09
to strongtal...@googlegroups.com, Strongtalk-general
A couple of comments:
A. Squeak's FFI is a liability and no one should seek to emulate in
Strongtalk or anywhere else.
B. Instead, I recommend porting the Alien API from Newspeak to
Strongtalk. It has already been ported to Squeak. The underlying
Newspeak primitives are very close to the Strongtalk FFI so it should
much easier.
C. At that point, one should be able to start hooking up the Newspeak
GUI, which can be bound to the web or to native GUI.

Cheers, Gilad

On Jun 24, 2009, at 11:12 PM, talksmall <Stephe...@googlemail.com>
wrote:

talksmall

unread,
Jun 25, 2009, 1:10:35 PM6/25/09
to Strongtalk-general
Hi Gilad,

On Jun 25, 4:43 pm, Gilad Bracha <gbra...@gmail.com> wrote:
> A couple of comments:
> A. Squeak's FFI is a liability and no one should seek to emulate in  
> Strongtalk or anywhere else.

Wasn't seriously considering it.

> B. Instead, I recommend porting the Alien API  from Newspeak to  
> Strongtalk. It has already been ported to Squeak. The underlying  
> Newspeak primitives are very close to the Strongtalk FFI so it should  
> much easier.

OK. Sold. Once I get the basic OSX port done I'll look to port the
Alien API.

> C. At that point, one should be able to start hooking up the Newspeak  
> GUI, which can be bound to the web or to native GUI.

How easy is it to take the NewSpeak native UI without the rest of
NewSpeak? Not that I'm not interested in a full NewSpeak port; I am.
However I'd like to have a solution that works for pure Smalltalk
programmers as well as for NewSpeak and, potentially, for other
languages as well.

Does the native UI have support for Linux or OSX yet? I was under the
impression that that was on the backlog from what I had seen on the
NewSpeak forums.

Regards, Steve

Craig Latta

unread,
Jun 25, 2009, 2:07:55 PM6/25/09
to strongtal...@googlegroups.com

Hi Gilad--

> Squeak's FFI is a liability and no one should seek to emulate in
> Strongtalk or anywhere else.

Also, Eliot's recent FFI work is slated to take its place anyway.


-C

--
Craig Latta
www.netjam.org


Colin Putney

unread,
Jun 25, 2009, 5:27:48 PM6/25/09
to strongtal...@googlegroups.com

On 25-Jun-09, at 10:10 AM, talksmall wrote:

> How easy is it to take the NewSpeak native UI without the rest of
> NewSpeak? Not that I'm not interested in a full NewSpeak port; I am.
> However I'd like to have a solution that works for pure Smalltalk
> programmers as well as for NewSpeak and, potentially, for other
> languages as well.

Another option here is OmniBrowser. It's not as sexy as the the
Newspeak UI, but it's pure Smalltalk, and has a web interface to all
the usual browsers, inspectors, debuggers etc.

Colin

Gilad Bracha

unread,
Jun 26, 2009, 5:34:34 AM6/26/09
to strongtal...@googlegroups.com, Strongtalk-general
Wrt porting the Newspeak GUI to Smalltalk: most of it exists in an
earlier dialect we call NS1. We are moving it to full Newspeak but it
is easier to start from the older NS1 version because NS1 lacks the
nested classes.

Hence one simply decompiles NS1 into Smalltalk. You can file that out
to Strongtalk. Not that I recommend staying in that mode.

Regarding the native bindings: you are correct - only windows exists.
A Linux port would likely involve GTK as you suggest - so rather than
do a specialized GTK based API I advocate doing it right once and for
all. I'd make a similar argument for any web GUI - the binding is not
really much harder than a special purpose hack. Do the right thing.

Cheers, Gilad

On Jun 25, 2009, at 7:10 PM, talksmall <Stephe...@googlemail.com>
wrote:

talksmall

unread,
Jul 14, 2009, 8:37:55 PM7/14/09
to Strongtalk-general
OK. So a week is a long time in politics, and sometimes even longer in
development.

Still not quite ready with the OSX port, but very close. All the ST-
level tests now pass, but there is an access error during the
recompile world step that follows the tests. Once I have tracked that
down I will check in and upload the binaries as promised. I hope to do
this by the end of the week.

Regards, Steve
Reply all
Reply to author
Forward
0 new messages