21st Century Smalltalk

February 10, 2007

Virtual Desktop in Firefox

Filed under: Adobe, Browsers, Vista Smalltalk — pfisk @ 9:12 pm

lisptest5
Vista Smalltalk Site

This is an early version of the Vista Smalltalk “virtual desktop” running in Firefox using Adobe’s Flash 9.0 runtime.

Windows can’t be resized, maximized or minimized and neither the Transcript or the ClassBrowser are functional, but it is still a major step towards having equivalent functionality across both the .Net and Flash environments.

The application is about 262kb in size and should run in most browsers on Windows, Macintosh and Linux.

Lisp Syntax for Smalltalk Semantics

Filed under: Adobe, Lisp, Smalltalk Language — pfisk @ 3:35 pm

I have added some new Lisp builtin functions to enable Smalltalk classes and messaging:

  • class-of  shows the class of an object
  • new  makes a new instance of a class
  • add-method  adds a method (lambda closure) to a class
  • send  sends a message to a class

These are some tests:

(class-of "hello world")
String

(class-of 123)
Number

(class-of Object)
Object class

(class-of (new Object))
Object

(add-method (class-of Object) 'test1 (lambda() "this is a class method")))
#<function :lambda () ("this is a class method")>

(add-method Object 'test1 (lambda() "this is an instance method")))
#<function :lambda () ("this is an instance method")>

(send Object 'test1)
"this is a class method"

(send (new Object) 'test1)
"this is an instance method"

(add-method Object 'times2 (lambda(x) (* x 2))))
#<function :lambda (x) ((* x 2))>

(setq abc (new Object))
a Object

(send abc 'times2 12345)
24690

The coming steps in implementing Smalltalk for Flash are:

  • add Transcript panel to IDE
  • add ClassBrowser to IDE
  • build classes from startup file
  • build Smalltalk reader (specialized Lisp reader)
  • create Lisp macros to translate Smalltalk syntax
  • change IDE to “virtual desktop” model

Once Smalltalk is running in Flash, I will begin the process of synchronizing classes between the .Net and Flash implementations. When that is done, you should be able to write Smalltalk applications that can run unchanged in almost any client environment: WPF (Vista, IE7), WPF/e (IE7, IE6, Firefox, Macintosh), Flash9 (IE7, IE6, Firefox, Opera, Safari, on Vista, XP, Win2003, Macintosh, Linux) or Adobe Apollo (desktop for Windows, Macintosh, Linux). And, they may even run in Samsung’s new iPhone competitor which apparently will use Flash.

Blog at WordPress.com.