The Grace Programming Language

What is Grace ?

At ECOOP (European Conference on Object-Oriented Programming) in Maribor in 2010, a need for a new language appeared. About twenty people, mainly teachers and researchers from Universities around the world, gathered and agreed on design principles for a new programming language, Grace. The Grace Programming Language, designed and implemented by Andrew Black, with Kim Bruce, Michael Homer, Tim Jones, and James Noble, is the result of that design process.

The purpose of Grace is to allow novices to discover programming in the simplest possible way. Other famous languages such as Java or Python are widely used by professionals, but may be hard to assimilate for a beginner in programming. That is what the object-oriented Grace language is made for.

Starting with Grace

Where do I run Grace ?

Minigrace is the implementation of Grace and its library being used in teaching. It does not yet implement everything the current draft specification. You can try minigrace online in your web browser (works best in Chrome or Firefox).

A tutorial with examples is available; you can also read the language specification and the standard library documentation there. The examples in the tutorial are “live”; you can edit and run them to see what happens.

A few things to know about Grace

Grace is an object-oriented language, you can define classes and objects as we will see later.

Our goal is to help novices at programming to learn how to write correct and clean code; this is why indentation does matter in Grace.  Each new block (delimited by braces { and }) must be indented at one level further than the previous line. Otherwise, all lines must be indented at the same level. Line breaks end statements, so semicolons are unnecessary. The exception is that if you need to continue on the next line, you can do so by indenting the second and subsequent lines of a long statement.

Accepted Not Accepted

You can check and test all the specificities on Grace in one page

4 thoughts on “The Grace Programming Language

  1. Hi, a little correction above … you say “delimited by semicolons {}” but actually those are not semicolons. Usually they are called curly braces {}.

  2. I realise that the overall language design is probably finalised, but if indentation does matter, would there be any ambiguity in removing the need for { and }? I’ve only just started looking at Grace so the answer may become obvious, but as my father always used to say ‘If in doubt, cut it out’.

    My worry about { and } is that they are so ‘thin’, and easily (for a beginner) confused with ( and ) or [ and ]. This is why I prefer the Visual Basic End … keywords, e.g.,

    class cat
    def name = “Felix”
    method getName
    return name
    end method
    end class

  3. Hi John that’s a good question – the language design is mostly finalised but we still think about options.

    I actually tried out a design based on indentation, and it worked surprisingly well. Where the curly brackets are significant is for blocks, which in Grace are lambda expressions. So ‘(print “x”)’ prints immediately, but ‘{print “X”}’ is delayed until evaluated. That’s how any control structures work in Grace, from “if” on up — Grace is like Smalltalk or Ruby in this.

    As to why we went with curly brackets for other structures too — so that Grace would (at first glance) look like other curly bracket languages: Java, JS, C#, C…

Leave a Reply

Your email address will not be published. Required fields are marked *