the blog
Back to -Blog

The Sapphire Language

First details...
by Huw Collingbourne
Tuesday 18 March 2008.

Regular readers of this blog may have noticed a few cryptic references to two projects we have underway - one is called Amethyst, the other is called Sapphire. Up to now we’ve been silent on the details of these two projects. The time has come to spill a few beans about Sapphire...

Sapphire is the name of a new programming language. It has a Ruby-like syntax - but much simplified. The overriding design principle of Sapphire is that the language should be consistent, unambiguous and deeply object oriented. In order to achieve this we have removed many constructs from Ruby: whereas Ruby often has many alternative ways of accomplishing the same effect, Sapphire aims to have one way of doing one thing.

See also: Ruby, Sapphire and Amethyst (27th July, 2007)

The syntax of Sapphire is much stricter than that of Ruby. For example, commands (method calls without parenthesis) are not available. A method name without parentheses is not a method-call but a method-reference. Methods can be assigned to variables and passed as arguments. Lambda methods (nameless methods implemented as blocks) are assigned in a similar manner and these are first class objects. A lambda method is always an instance of the Block class and it has the same independent existence as any other type of object.

Our implementation of object orientation is more rigorous than that of Ruby. We have gone back to the fundamental principles of object orientation epitomised by Smalltalk. This means, for example, that encapsulation and data-hiding is enforced. There are a number of ways of breaking encapsulation as a ’side effect’ in Ruby; this is not allowed in Sapphire.

Another important feature is the ability to assert expected types and ranges. If a method can only operate successfully on string arguments, say, and should always return an array, you may specifically assert that the ingoing arguments are strings and the returned value is an array. You may also assert that values fall within specific ranges (for example that an integer must be between 1 and 100). These assertions are not required and type violations may be optionally treated as errors, warnings or may be ignored. So Sapphire does not ‘remove’ duck-typing and it does not demand type declarations. Its type assertions are there as development and debugging tools - aimed at finding and trapping potential bugs as an integral part of program development rather than having to rely solely on testing.

So, in brief, these are the design principles of Sapphire:

- A simple, consistent, unambiguous syntax
- Rigorous object orientation
- Everything (even blocks and methods) are objects
- A high degree of modularity/encapsulation
- Optional object type checking via assertions

We plan to define a clear specification of the Sapphire language and to make this publically available at an early stage. This will begin when we release the ANTLR grammar of the first draft of the Sapphire syntax later this month. Our own implementation of Sapphire will be developed for .NET (running on the Dynamic Language Runtime) and will be supported by a programming environment code-named Amethyst. If other developers are interested in implementing Sapphire for other platforms, we would be very pleased to work with you, so please get in touch!

For a background to the Smalltalk version of Object Orientation, see: Ruby The Smalltalk Way

Note: Sapphire is not intended to complete with Ruby but to complement it. SapphireSteel Software remains completely committed to supporting Ruby and Microsoft’s IronRuby as a primary goal. Moreover, it is our aim to ensure that our implementation of Sapphire is able to cooperate closely with other .NET languages including IronRuby.

Bookmark and Share   Keywords:  DLR  Sapphire
  • The Sapphire Language
    21 March 2008, by Josh Charles

    Is Sapphire going to be a .NET language? Please say yes!

    • The Sapphire Language
      21 March 2008, by Huw Collingbourne


      Well, that is to say, that our implementation of Sapphire will run on the DLR (the Dynamic Language Runtime) for .NET. The language definition, however, does not specify a platform so, in principle, Sapphire could be implemented on other platforms. But we only have plans to implement Sapphire on .NET.

  • Sapphire is already on the way
    18 March 2008
    • Sapphire is already on the way
      18 March 2008, by Huw Collingbourne

      A previous comment brought that to my attention. It’s unfortunate that the same name has been chosen for an unrelated project. We have been talking about our preparations for Sapphire for some time now and for a product to be called ’Sapphire In Steel’ - the first mentuion was, indeed, in the ’About’ section of our original Project Blog in early 2006:

      Sapphire is the name of a programming project currently in development. We shall, at a later date, provide more information on Sapphire In Steel on this site.

  • The Sapphire Language aka Python
    18 March 2008

    “whereas Ruby often has many alternative ways of accomplishing the same effect, Sapphire aims to have one way of doing one thing.”

    Welcome to Python minus tabs =P

    • The Sapphire Language aka Python
      18 March 2008, by Huw Collingbourne

      Don’t think Python. think Smalltalk! :-)

  • Coincidences are fun: The OTHER Sapphire Language
    18 March 2008, by Jörg W Mittag

    Coincidences are fun!

    Three weeks ago, Daniel J Berg also announced a new programming language, also based on Ruby, also named Sapphire.


    • Coincidences are fun: The OTHER Sapphire Language
      18 March 2008, by Huw Collingbourne

      An unfortunate coincidence of names. We have been mentioning the Sapphire project since 2006, however ;-)

      best wishes


      • Coincidences are fun: The OTHER Sapphire Language
        2 September 2009, by Neil Murphy

        I guess the other guy could call it Emerald, or Cubic-Zirconium or something.

© SapphireSteel Software 2014
aldactone for sale cernos depot for sale aurogra for sale buy bortenat order esomeprazole finpecia for sale buy amitryn online buy suhagra order bactrim d.s buy bimatoprost 3ml tadalafil generic femara letrozole buy orlistat online poxet 60mg order ciplactin buy rapamune 1mg buy viagra buy lovegra 100mg vidalista 20mg oleanz for sale caberlin cabergoline buy generic ciprofloxacin buy generic kamagra oral jelly tadalafil super active cialis super active sulpitac buy generic diclofenac omnacortil 40mg irovel for sale arcalion sulbutiamine malegra professional for sale fertyl super for sale buy generic lasix buy nitazoxanide atorvastatin baclof baclofen buy zantac order veenat dilantin buy vardenafil online buy sildigra xl plus rasalect rasagiline mesylate floricot buy memantine online zenegra careprost for sale buy tadora online buy quinine sulphate 300mg lithosun sr buy bupron sr 150mg buy penegra online buy revlimid online piracetam premarin conjugated estrogens order garlic himalaya tadaga super kamagra for sale cutivate cream for sale vega 100mg calutide duprost 0.5mg buy generic ampicillin online buy kamagra flonida fluorouracil urimax 0.4mg rizact 10mg avanafil buy exemestane online buy sildenafil citrate jelly 100mg buy flucanazole order filagra super active isotretinion for sale rifaximin buy cenforce online buy baclofen order qutipin sr soranib for sale armodafinil buy vilitra 20mg buy verdenafil buy acamprol buy mirtaz qutipin tadarise for sale buy naltroxene online andriol for sale modafresh 200mg order caverta buy cialis 20mg flutivate cream 0.05% cilostazol 100mg buy ketasma 1mg buy viagra buy levipil online prosteride buy sildenafil citrate buy arpizol online cernos gel testosterone gel buy generic zhewitra order doxicip hostacycline order buspin tizan terbicip fincar finasteride order natamet sildigra for sale buy viread buy bupropion 150mg buy sildisoft viraday for sale avanafil diflucan 200mg buy apcalis jelly attentrol 10mg buy tadalafil professional online buy auvitra online buy rapacan 1mg erlonat erlotinib rogaine shampoo alodox armodafinil 150mg buy generic biduret buy generic normabrain memantine 10mg buy calaptin 120mg order super p force simvastatin 20mg buy tadalafil 20mg order fertyl imatib for sale buy malegra dxt buy nodict 50mg vardenafil 20mg buy prilosec 20mg buy topirol online mesterolone 25mg buy geftinat malegra armod armodafinil buy cernos capsules generic nuvigil buy anastrazole online order generic imatinib sustanon 250mg avana 100mg modalert for sale buy x-vir online metronidazole flagyl buy vasotec online tadalafil 20mg buy malegra fxt 100/40mg buy flagyl online buy generic tenofovir + emtricitabine order a-ret gel amlodac amlodipine buy melanocyl buy tadalafil 20mg buy zithromax 250mg amlodipine besylate 10mg order pelosta modvigil 200mg buy tadalafil