Haggis is a joint venture by Greg Michaelson and Quintin Cutts to produce a notation suitable for posing programming assessments for all levels of the Scottish Qualifications Agency, Curriculum for Excellence, Computing Science curricula, as well as courses elsewhere.
The design philosophy is that Haggis should:
not be based on any one extant programming language;
be easily translatable into and out of most programming languages used in Scottish schools;
be suitable for qualifications up to Advanced Higher/University first year, while also being amenable to sub-setting as appropriate for earlier year qualifications;
be intuitive (whatever that means...);
be succinct but relaxed about there being different ways of expressing the same thing;
be orthogonal, that is unitary constructs should have meanings in different contexts;
not expose conceptual details if they are not germane.
We would like to thank David Bethune (SQA), Paul Cockshott (Glasgow) and Richard Connor (Strathclyde) for ongoing discussion about the Haggis specification and evolution.
Haggis is typed but types are not exposed if obvious from context. Haggis is mostly monomorphic and mostly indifferent to issues of implicit/explicit, weak/strong and static/dynamic typing.
The base types and their values are:
INTEGER: -big ... + big – where big is arbitrary
REAL: -big.small ... + big.small – where big and small are arbitrary
floating point notation is also fine: +/- big1.smallEbig2 == big1.small times 10 to the power big2
BOOLEAN: true & false
The structured type is:
SEQUENCE: arbitrary length sequence of values of arbitrary type
SEQUENCEs are addressed from index 0.
ARRAY: finite length sequence of same type
STRING: ARRAY of CHARACTER
TUPLE : finite length sequence of different type
RECORD: finite length sequence of different type with named fiields
STREAM: SEQUENCE of CHARACTER
this encompasses FILE & URL
Finite length structured type values may be denoted explicitly as: