BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News SABLE, a Smalltalk-Inspired Language for .NET

SABLE, a Smalltalk-Inspired Language for .NET

Bookmarks

Keith Robertson, the founder of Kuler Software Tools, has written a Smalltalk-inspired language for the .NET platform called SABLE, a language meant to draw upon the qualities of Smalltalk’s syntax and the benefits of running on CLR.

SABLE is a general purpose, imperative, OOP language with a syntax similar to Smalltalk’s, but the object and deployment model show its affiliation to the .NET family. SABLE programs run on ECMA CLR. SABLE wants to be Smalltalk for the web, a language that preserves the high readability and type safety of the Smalltalk language but with type information included in assemblies and a smaller binary output to make it usable for web deployment.

Robertson declares that his ultimate purpose with SABLE is:

To create a fluid, flexible, Smalltalk-style environment for development, but when you are ready, the application compiles down to an ordinary assembly. … This will give you a highly dynamic development experience without requiring a dynamic runtime.

One of the key benefits of SABLE would be Smalltalk’s messaging syntax allowing for messages to be chained or cascaded. The language is supposed to do type checking at compile time and to support type casting even through message chains, but not only:

|typeDecl| := nodeStack pop.

nodeStack peek ~ {BLOCK_NODE} argumentNodes last~ {ARGUMENT_NODE} typeDeclNode: typeDecl.

The language can do bi-directional type inference, deducting the type of a variable or a method from the expression’s type (outward inference), or deducting the expression’s type from the expected type (inward inference).

SABLE uses method, class and assembly structure definitions for documentation purposes but, unlike Smalltalk, the metadata stays with the assemblies. Macros are always inline methods. An interesting use of macros is to augment existing closed libraries.

SABLE does not have reserved words, but it has a number of predefined identifiers. Other important features are: class extensions, contracts, full access to CLR features like generics, nested types, metadata attributes, etc.

A more than basic “Hello World” example looks like this:

sable

Useful links: The SABLE Compiler (ZIP), the SABLE language web site

Rate this Article

Adoption
Style

BT