JSqueak – Smalltalk interpreter written in Java
21 June, 2008
JSqueak (formerly known as Potato) is less than 5000 lines of code, available under the MIT licence. It runs the Mini2.1 image, which is included for convenience. This image contains a complete Smalltalk development environment, including:
- Rich text and Text editor
- File browser (no file access in VM yet)
- Code browser
- Decompiler (plus temp-name hints)
- Source Code Debugger
Dan wrote JSqueak to teach himself NetBeans and Java in the fall of 2006. Although he developed it as a throw-away project, he notes that
it has features that recommend it for further useful service:
- It is simple
- Uses Java objects and storage management
- Uses Java Integers for SmallIntegers
- It is general
- A weak(*) object table enables enumeration and mutation
- It is efficient
- Includes a method cache and an at-cache (**)
- Also a cache of common SmallIntegers
(*) – This does not mean wimpy — it’s a good sturdy object table — it just doesn’t hold onto garbage.
(**) – This is not an automated teller machine, but a device that speeds up array and stream access.
These properties make it a reasonable base for teaching about VM design.
Dan adds that a number of things should be finished or improved if this VM is to see further use – it currently runs between 10 and 30 times slower than the C-based VM! If you wish to track or contribute to such projects, he invites you to add yourself to the (brand new!) JSqueak Interest mailing list.
You can find out more, and run the application as a WebStart Java Application at the JSqueak home page.