Bistro Overview


Bistro is a new programming language that integrates the best features of Smalltalk and Java™. Bistro is a variation of Smalltalk that runs on top of any Java™ virtual machine (VM) that conforms to Sun's Java™ specifications. Bistro represents a further evolution of Smalltalk. Overall, Bistro resembles Smalltalk more than Java™. However, Bistro incorporates several language features from Java™ in order to better support the integration of the two languages.

Bistro preserves much of the simplicity, expressiveness and readability of Smalltalk. Apart from a few minor differences in punctuation, the method syntax of Bistro is almost identical to that of Smalltalk. So, Smalltalk software developers will find much of Bistro very familiar. Like Smalltalk, Bistro offers software developers the ability to build software models with a syntax that approaches the expressiveness and readability of natural language.

Traditionally, Smalltalk systems are built in the context of an object memory image. While an image based development environment contributes significantly to the agility of Smalltalk's integrated suite of tools, it introduces some difficulties for code, component and system configuration management in large development projects. A declarative, file based programming model makes it much easier to use existing version control and configuration management tools.

The design of Bistro is founded on previous research regarding Smalltalk and Java™ integration. Initially, the basic feasibility of integrating the two languages was explored. Having established the feasibility of integrating the two languages, the possibility of adding type information to Smalltalk to achieve full integration with Java™ was explored. This resulted in the design of the Jist programming language. However, requiring pervasive type information significantly complicated the resulting language. Further experimentation with the grammar found a means for making the type information optional. The result is Bistro, a declarative variation of Smalltalk with optional typing whose class files run on the Java™ VM.

The absence of explicit type information in Smalltalk contributes to its simplicity and its agility during software development. Software prototyping is much easier without type information. Specifying type information pervasively throughout a software system during initial development requires much more time. Also, the type information simply makes the resolution of method implementations safer and more efficient.

For these reasons, Bistro provides a spectrum of optimization options. Smalltalk developers will feel at home with the ability to write code with familiar idioms and classes. Then, as application interfaces harden and classes mature, type annotations may be added to classes in order to improve the performance of method resolution when and where needed. Performance critical methods may even be recoded directly in primitive Java™ methods. Finally, if 100% purity of the Java™ code is not an issue, a Java™ native interface (JNI) can be used to create platform specific optimizations written in C or C++.

Bistro also provides a path for migrating from Smalltalk to Java™. In its fullest realization, Bistro will provide tools for translating Smalltalk models into Java™. These tools will allow software models built with Smalltalk to be translated into Bistro, compiled into Java™ code, and then deployed on and executed in a Java™ environment.

Bistro Features

The following table summarizes the important features of Bistro. For more details, see my latest paper regarding Bistro.

Table 1. Language Features
Language Model Bistro has a declarative language model.
Name Spaces Bistro classes can include a package and imports like those found in Java™.
Classes Bistro classes have a hybrid structure based on both Smalltalk and Java™.
Metaclasses Bistro supports the definition of metaclasses like those found in Smalltalk.
Types Bistro supports the definition and use of first-class interfaces (as types).
Metatypes Just as each Bistro class has a corresponding metaclass, each type has a metatype.
Access Controls Bistro supports Java™ access controls, including public, protected, private.
Decorations Bistro also supports: abstract, final, synchronized, native, static.
In-line Variables Bistro supports in-line variable declaration and initialization.
Type Specifications Bistro variable and argument type specifications are optional.
Natural Methods Bistro natural methods closely resemble those of Smalltalk.
Primitive Methods Bistro supports the implementation of primitive methods in Java™.
Interoperability Bistro method names are translated into compatible Java™ method names.
Comments Bistro quoted comments are translated into Java™ comment blocks.
Blocks Bistro blocks are implemented using Java™ inner classes.
Adapters Bistro uses a special message idiom for defining anonymous inner classes.
Threads Bistro blocks support the fork protocol for spawning Java™ threads.
Exceptions Bistro supports both standard Smalltalk exception handling and Java™ exception handling.
Migration Bistro includes a utility for converting Smalltalk class sources to Bistro.

Oracle and Java™ are registered trademarks of Oracle and/or its affiliates.
SourceForge™ is a trademark of Geeknet, Inc.

Permission is granted to copy this document provided this copyright statement is retained in all copies.
Copyright 1999-2010 Nikolas S. Boyd.