Skip to content

Cull keyword explosion

jckarter edited this page Nov 17, 2010 · 3 revisions

Motivation

Clay's syntax currently has 41 keywords! We should explore ways of simplifying the grammar without sacrificing readability or power of the language.

Proposed implementation

Discussion

Some keyword groups have similar semantics and could be foldable into a single keyword that reads well in the same contexts:

  • "alias" and "callbyname" both have call-by-name semantics
  • "ref" and "lvalue" respectively create and consume lvalues
  • "record", "variant", "enum", and "instance" all deal with types, and could be folded into a single "type" facility with more flexibility than the current computed records

Clone this wiki locally