2004-10-10 · in Ideas · 151 words

The existing indentation-based syntax used for occam dates from the early 80s; newer indentation-based languages such as Python and Haskell are somewhat more pleasant to use (for instance, Python's if ... elif syntax is much more compact than occam's "IF"). It shouldn't be too hard to mechanically translate a Python-style syntax either to traditional occam code or to a structured format that KRoC could read in the way it currently handles the standard and C-style syntaxes; if a structured format were used, then the existing syntax parsers could be separated from the compiler.

One possible structured format would simply be XML; there might be advantages to having an XML representation of occam for automated tools such as GAToR to use.

While chatting to Matt Jadud about my occam Python-style syntax plan, he suggested S-expressions instead; they're very simple to manipulate in Lisp-family languages, and they're much easier for humans to deal with.