Lisp AND Squeak

reic0024 at d.umn.edu reic0024 at d.umn.edu
Thu Jul 18 14:09:46 UTC 2002


HNBeck at t-online.de (Hans Beck) wrote:
> Hi,

Hola!

> > I was working on Tk bindings for Squeak by using a TCP/IP connection to
> > STk (Scheme/Tk).  
> 
> Can I found this in Swiki ?

Nope, it never got terribly finished.  The only widgets that I really
had working were the TopLevel window and buttons.  But it worked, more
or less.  It would be much better to have a socket connection directly
to Tk- require STk, a very specific implemenation of Scheme is a bit
steep.  

> > Sure, especially using an RPC protocol like SOAP or XML-RPC.
> 
> Hmmm. Is that more than using Named Primitives ? Would'nt it be nice to
> write haskell (lisp) code in a method and the byte code machine switches 
> to the adequate VM automatically ?

Huh?   SOAP and XML-RPC are protocols for RPC, that is, remote procedure
calls.  They could be implemented using primitives, but those to
protocols are such that it's better to make them in straight Squeak-
which they are for the implementations we have available to us now in
Squeak.

> i.e.
> testMethod: aParameter
> 
>     result = useHaskell[
>         let f = x*x
> 		in f(aParameter)]
> 
> ^result
> 
> something like that.....ok I know, I'm a dreamer...

If you can find or write a SOAP or XML-RPC implementation for Haskell,
that could be very easily done, provided that Haskell has an 'eval'
function like Lisp.   I've only played with Haskell, but I've noticed in
the REPL (like in hugs) you cannot do certain things, like create new
types or functions, which seems odd.  Maybe you can do it with eval.  In
any case, given that haskell has an eval function and an XML-RPC or SOAP
implementation, you could easily say:

testMethod: aNumber
	"let's assume than haskellConn is an instance var"
	result := haskellConn : '
		let f = x * x
		in f($aNumber)'.
	"thanks to SOAP's neatness, it converts the XML response to a Smalltalk
object"
	^ result !

The dollar-signage probably could be avoided, but I just thought perhaps
it's better to be more explicit.

Regards,
Aaron



More information about the Squeak-dev mailing list