Smalltalk and JavaScript on the Server

February 14, 2011

The site http://www.silversmalltalk.com is hosted on Google’s Application Engine and runs in a Java environment.

Besides Java, there are several other languages available which run on the JVM:

  • BeanShell
  • Clojure
  • Groovy
  • JavaScript (Rhino)
  • Python (JPython)
  • Ruby (JRuby)
  • Scala
  • Scheme

http://lotrepls.appspot.com/
http://code.google.com/p/lotrepls/

I have added support in the QuickSilver server code for server-side JavaScript scripting.

This opens a number of interesting possibilities:

1) QuickSilver can run on the Google servers

QuickSilver compiles Smalltalk to JavaScript source which can be compiled or interpreted by Rhino.

2) QuickSilver can support serialization on the server

Having an interactive session with a server scripting language requires that the language be able to save its state (serialized to the Memcache) between requests. Some languages can do this (C-Python, Clojure, Scheme) and others cannot. Unfortunately, JavaScript (Rhino) cannot serialize its state. However, QuickSilver should be able to maintain serialized state on the server because already stores JavaScript function source in its “CompiledMethod” objects – JavaScript functions can be instantiated only when a method is called (lazy evaluation).

3) Data and Functions can be exchanged between client and server with minimal encoding

JavaScript on both the client and server will greatly simplify client-server programming.

4) JavaScript on the server will facilitate dynamic data declarations for the database

Google’s “Big Table” database is a distributed key-value datastore (IIRC, so is Amazon’s S3 database) that does not use schemas.

What I have in mind here is using Smalltalk to directly define and manage data records.

Here is an blog post about a group doing something very similar with Clojure.

Google’s App Engine is massively scalable, very cheap to run (free for small projects), and supports instant messaging using sockets.

If we can build a comprehensive set of tools – including GUI designers and database browsers – in QuickSilver, it will open the door to building whole new classes of applications.

Advertisements

One Response to “Smalltalk and JavaScript on the Server”

  1. Jose Says:

    Do you know Redline Smalltalk? (Smalltalk on JVM)

    http://blog.redline.st/

    This can be (when finished) an alternative to Rhino


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: