ST2JS - Smalltalk to Javascript translator

Diego Gomez Deck DiegoGomezDeck at consultar.com
Thu Aug 3 09:34:57 UTC 2006


Hi Craig,

> Hi Diego--
> 
> > To use the network from JS in browsers, you have to hack over a HTTP
> > requests to a web server. Plain sockets are just not available for JS
> > code.
> 
> 	That's fine, I just want to download a VM and object memory from some
> website and start it.

What is "easy" to do is to re-write (just in case it's needed) your
objects in a way that translation to JS becomes posible.

To do that, ST2JS uses a similar approach that SLang>>C translator.  You
can insert conditionals statements in this way:

   self
      jsLiteral: '/* plain JS code */'
      inSmalltalk: [ "Smalltalk code" ].

Of course you can put this type of statements only in "base" classes.

> > Firing processes from javascript (in browsers) is, AFAIK, not posible.
> > What can be done is a type of multithreading for javascript
> > processes...
> 
> 	Oh, by "spawning host processes" I just meant starting an application
> on the host from JavaScript.

Not, it's not posible.

What is posible is to create an "ST process" inside the internet-browser
using just generated JS code.  It will be very slow, but any browser can
become a Smalltalk environment without any installation at all.

Let me stated in this way: If they like what they get with plain-JS
code, may be they'll motivated to download and install the "real" spoon.

> 	thanks,
> 
> -C

Cheers,

-- Diego





More information about the Squeak-dev mailing list