For the benefit of anyone who hasn’t been following the development of Sapphire, let me summarise this quickly. Sapphire is the name of a new programming language being developed by SapphireSteel Software to be implemented on Microsoft’s DLR (Dynamic Language Runtime) for .NET. It will be a highly encapsulated OOP language with an accessible syntax similar - though not identical - to that of Ruby. Its principal design goals are: simplicity, efficiency and reliability. It is not a version or a ‘fork’ of Ruby. It is a totally new language designed from the ground up. SapphireSteel Software shall, of course, continue to support Ruby as well as Sapphire.
Anyway, now that we have the grammar, let me explain what the testing and documenting phase involves. What we plan to do is to go through every tiny bit of the language defined by our grammar (for example, variable declarations, lambda functions, accessor methods and so on) and write small sample programs illustrating that specific language element. In other words, we’ll turn the formal language definition into real bits of Sapphire code. We then have to check that these bits of code are, in fact, allowed by our grammar. In order to do that we will feed them into the ANTLR grammar parser and, all being well, this will generate a structure in which each token - all the identifiers and punctuation - is shown on its own branch of a grammar tree. If ANTLR fails to parse the example code, this either means that the code is wrong or that our grammar is wrong.
This long, nit-picking testing phase serves three purposes:
- It checks that our grammar is correct.
- It lets us verify that the syntax of Sapphire is ‘nice’: clear, succinct, unambiguous and elegant.
- It ensures that we end up with a definitive language specification and a user guide.
At each step of the testing, I will be adding to and revising the ‘human readable’ language definition document and also writing chapters in a step-by-step ‘manual’ to ensure that people will be able to learn to use Sapphire easily. As readers of this blog will know, we place a great deal of importance on good documentation and it is our intention to release the Sapphire specification and user guide at the same time as the release of our implementation of the Sapphire language itself.
As always, we’ll keep you informed of the ongoing development of Sapphire here on the blog.