[ANN] Squeak/.NET bridge

Benjamin Schroeder benschroeder at acm.org
Sat Sep 13 17:39:51 UTC 2003


Hi everyone,

I'd like to announce a project that a colleague and I have been working 
on: a bridge from Squeak to .NET.

First, I should introduce myself.

My name is Ben Schroeder.  I have been interested in Squeak for quite a 
while now, but have only recently started doing much programming with 
it.  I think it's a great environment - I like both the language and 
the tools and have been impressed with what I've seen of the community 
and philosophy.

We do a lot of work with .NET where I work, and a couple of us were 
interested in trying out some more dynamic languages with some of the 
APIs that it had - for example, for databases and for native Windows 
windowing.  We wrote a bridge from the Ruby language to .NET, and had 
good success writing some utilities and scripts with it.

We recently ported that bridge to Squeak, and have posted a first 
release on SqueakMap.  The bridge uses TCP sockets to talk to a 
separate .NET VM.  (It shares a backend with the Ruby bridge.)

Although the bridge works fairly well already, and passes a large 
number of tests, I should mention that is certainly alpha code.  I'll 
mention a particularly important issue in a moment.

Here is an example of the kind of code you can write with the bridge.

	| dotNet list reversed |
	dotNet := DotNet startNew.
	
	list := dotNet ArrayList new.
	list add: 'Hello'.
	list add: 'World'.

	Transcript show: list count. "Prints <<2>>"
	
	reversed := list collect: [:each | each reversed].
	
	Transcript show: reversed asArray. "Prints #('elloH' 'dlroW')"
	dotNet exitDotNet.

There are more examples and more information at our swiki:

	www.saltypickle.com/SqueakDotNet

The program itself is available both there and on SqueakMap.

It is licensed under the GPL, but we plan to release under a more 
liberal license (something like LGPL, MIT, or SqueakL) soon.  If the 
licensing is an issue for anybody who'd like to use the bridge, please 
let me know and I'll be happy to relicense it for you.

The issue that I mentioned above is that the bridge sometimes leaves 
its separate .NET processes running - in particular, if you do not send 
#exitDotNet to a DotNet instance.  You can leave one instance running 
as long as you'd like, at least if you do not shut your image down, but 
if you let it go, it will leave its partner process running.

Of course, it is harmless to simply kill the other processes after 
exiting Squeak.  They will be "DotNetBridge.Server.exe" processes.

  You can also send #exitDotNet to any DotNet instances from the same 
session.  We plan to fix the problem in the next release (sometime 
within the week) by adding finalization and image shutdown code that 
sends #exitDotNet to live .NET instances.  I apologize for the 
inconvenience.

I hope you enjoy our bridge!  I'd love to hear any questions or 
feedback - either on this list or via private mail.

Regards,
Ben Schroeder



More information about the Squeak-dev mailing list