What is Sapphire?
Sapphire is a dynamic, object oriented programming language being developed by SapphireSteel Software.
Is Sapphire a fork of Ruby?
No. Sapphire is a new programming language. It will use a Ruby-like syntax but it is not a ‘type’ of Ruby or a ‘fork’ of Ruby.
What are the main characteristics of Sapphire?
Clarity and lack of ambiguity
Deep object orientation
‘Black box’ encapsulation: data inside objects is always private
Dynamic programming with a class’s explicit ‘consent’
Incremental testing via type assertions
Is Sapphire a strongly typed language?
No. Sapphire variables may take on any type and a single variable may be assigned different object types (no coercion required!) - just as in Ruby. Type declarations are neither necessary nor are they enforced. Type assertions are optional. They give the programmer the ability to assert that, at critical points in a program, a certain variable is expected to have a specific type or fall within a specific range of values. Method return values may be asserted in a similar way. Type assertions facilitate incremental testing to verify the correctness of a Sapphire program. They do not cause a variable to be instantiated to the asserted type.
What platform, will Sapphire run on?
The Sapphire language is not platform-specific. SapphireSteel Software’s implementation of the Sapphire language will target the Dynamic Language Runtime on .NET. We will be happy to assist other developers who wish to implement Sapphire for other platforms.
Is Sapphire a proprietary language?
The Sapphire language will be defined by SapphireSteel Software. We shall publish a full Sapphire language specification describing both its grammar and semantics. This specification will be made public and other developers will be able to use it to implement the Sapphire language.
Is Sapphire ‘like Python’?
Not particularly. Sapphire is an orthogonal language characterised by a small, unambiguous syntax. Some people have suggested that this makes it similar to Python. In fact, Sapphire is not greatly influenced by Python and the two languages have few points of similarity. For example, unlike Python, Sapphire implements ‘black box encapsulation’, single inheritance, it has no procedural programming capabilities (it is 100% OOP) and indentation is not significant. In short, Python and Sapphire are not close relatives.
Is Sapphire like Smalltalk?
There are many points of similarity between Sapphire and Smalltalk. Both languages are deeply and consistently object orientated and implement thorough encapsulation with data-hiding. However, there are also many differences. Sapphire’s syntax will be much more familiar to most programmers. It has familiar constructs such as for loops and if tests. For example whereas Smalltalk’s message passing mechanism requires multi-part messages to be sent to an object like this:
(a = b) ifTrue: [^'ok'] ifFalse: [^'error'].
Sapphire uses the Ruby-like syntax:
if ( a == b )
'ok'
else
'error'
end
Is Sapphire a competitor to Ruby?
No. The two languages are very different and are best suited to different type of application. Ruby’s rich and varied syntax and the fluidity of its dynamic capabilities make it a very adaptable language for scripting, prototyping, research, AI and metaprogramming. Moreover Ruby is a wonderful language for implementing dynamic frameworks such as Rails. By contrast, Sapphire’s principal goal is to implement an unambiguous, highly modular programming language in which the security and reliability of a program’s runtime state can be tested and predicted in the process of incremental development.
When will Sapphire be available?
Sapphire is currently in the early stages of development. We have not announced a final ‘release date’. We propose to make a preliminary release of an experimental Sapphire grammar in the near future and we will publish revisions of the Sapphire specification as it continues to be developed.