Re: Squeak FFI for .Net

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: Squeak FFI for .Net

Benjamin Schroeder-2

On Jan 30, 2007, at 6:16 AM, kiran wrote:

> Can we use Squeak FFI to write adapters for accessing Windows .Net  
> components?

Hi Kiran,

You can use Squeak FFI to call functions from C DLLs, so I think if  
you had a Managed C++ DLL that called your .NET code, this would  
work. However, it might be difficult to retain references to  
individual .NET objects.

There is a bridge between .NET and Squeak that lets you use most .NET  
objects directly from Squeak. I haven't tried it with Croquet, but I  
think it should work. The code style looks like

        list := DotNet ArrayList new.
        list count. "Answers 0"

        list add: 'Hello'.
        list add: 'World'.

        list do: [:each | Transcript show: each; cr]. "Prints Hello(cr)World

John Pierce and I wrote this bridge as a way of being able to  
explore .NET in an interactive fashion, and also so we could explore  
using more dynamic languages in our .NET shop.

There are a few rough edges - such as garbage collection - but maybe  
this will be useful to you.

The Squeak/.NET Bridge is usually available via SqueakMap, but right  
now the hosting server is down. If you're interested, please send me  
mail directly and I will send you a copy. (Replies on the list are OK  
too, but private mail might be more polite to the list! :)

Benjamin Schroeder