Grace at ECOOP

July 27th, 2014

The European Conference on Object-Oriented Programming starts tomorrow, and Grace people will be there.

On Wednesday, the first day of the full conference, we’ll present the technical paper Graceful Dialects by Michael Homer et al describes how Grace supports dialects using lexical scope, pluggable checkers, and Grace’s flexible syntax, but without requiring macros or depending on types.

At workshops held earlier in the week, Tim Jones will talk about TinygraceA Rational Reconstruction of the Escrow Example — rewriting everything in Grace always being perfectly rational — both at the Formal Techniques for Java-like Languages workshop on Monday,

And at IWACO on Tuesday, James will present On Owners as Accessors with some examples, at least, tending towards Grace.

Programming with Grace

June 20th, 2014

We are now working on a textbook for Grace, tentatively titled “Programming with Grace”. A draft of the book as well as information about both built-in libraries and graphics and animation libraries are also available on the site. We expect to put more information to help people learn how to program in Grace.

http://www.cs.pomona.edu/~kim/ProgrammingWithGrace/

The Ackerman Function

June 5th, 2014

Apropos of nothing, here’s a Grace version of Ackermann’s Function inspired by Sam Tobin-Hochstadt’s Racket example:

method ack (m : Number, n : Number) -> Number {
  print "ack {m} {n}"
  if (m <= 0) then {n + 1}
   elseif {n <= 0} then {ack((m -1), 1)}
   else {ack(m -1, ack(m, n-1))}
}

One interesting thing to note is that the condition after the “elseif” is in {brackets}, while the conditions after if is in (parens). This makes logical sense – because the first condition is always evaluated, but is of course inconsistent with every other condition (and sorry for the fixed-with font).

Code as Literature?

January 30th, 2014

Peter Seibel’s blog post Code is not Literature has generated some discussion in our department. I certainly agree with a lot of what Peter writes — when I used to coordinate our final year design patterns course, students would present examples of patterns culled from the Interweb. (Google code search was great until it was switched off). Let’s just say even finding patterns clearly expressed in code was often a bit of a struggle. So I’m quite sympathetic to Peter’s point that “most real code” isn’t really worth reading.

On the other hand, I still like Richard Gabriel’s idea of the “Poetry of Programming”. Donald Knuth’s Tex and Metafont have been published as hardbacks; Kernighan & Plauger’s Software Tools & the John Lions’ Unix book as paperbacks. One of the things I like about Smalltalk and Self was the way the IDE made code easy to read, and that much of the system code had obviously been written to be read. Now Github & SourceForge mean there are millions of lines of code around that can be read anytime: but that still doesn’t make it literature.

I guess this is because literature doesn’t happen by accident. Most writing isn’t literature — this blog post, my university’s assessment handbook, company procedure handbooks or advertising brochures may be grammatically correct and be worth reading for the content they contain: but they aren’t worth reading just for the sake of it. So we shouldn’t be surprised that most of the code isn’t literature: it doesn’t need to be.

What’s this to do with Grace? Two things, I think. First, we hope that Grace is a good language not just for writing code day-to-day, but also for code that aspires to be literature. And second, we hope that at least some of the code we write in Grace, while it may not rise to literature’s exhaled state, will at least be worth reading.

Splash 2013 Grace Tutorial

October 31st, 2013

The link to the tutorial materials is here: http://www.cs.pomona.edu/~kim/GraceStuff/

Grace in one page:

http://gracelang.org/applications/grace-in-one-page/

You should run Grace from here:
http://web.cecs.pdx.edu/~grace/minigrace/js/index.html