ArticleslgStudy

science

Haggis (programming language)

Haggis (programming language) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Haggis (programming language) rather than just read about it. In short: Haggis is a high-level reference programming language used primarily to examine computing science for Scottish pupils taking SQA courses on the subject. Haggis is used as a tool to bridge the gap between pseudocode and typical computer programming.

Haggis (programming language) — main illustration
Haggis (programming language) — illustration

Key takeaways

  • Haggis (programming language) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Haggis (programming language) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Haggis (programming language) from memory before moving on to harder problems.

Reference excerpt

Haggis is a high-level reference programming language used primarily to examine computing science for Scottish pupils taking SQA courses on the subject. Haggis is used as a tool to bridge the gap between pseudocode and typical computer programming. Haggis is not based on any one language but a mixture that is intended to allow a pupil familiar with any of the many languages used in classrooms to easily understand the syntactic construct being used in an example. It has multiple programming paradigms of functional, imperative, and object oriented to suit this purpose. There are three separate language definitions, one for each level at which computing is assessed by the SQA; these are proper subsets of each other, so, for example, any program contained by the National 5 level language is also well-defined at Higher and Advanced Higher levels. Higher includes the definition of procedures and functions and the use of record types and files, while Advanced Higher includes object-orientation. Online Haggis interpreters have been developed to provide a way for examiners and teachers to check their programs are correctly defined and behave as expected.

Overview In Scotland, school-level computing qualifications are awarded by the Scottish Qualifications Authority. A decision was made for computing courses that a single choice of programming language for examination should not be mandated: this allows teachers to choose languages as appropriate to context. This, however, leaves the issue of how to examine programming, especially in the light of recent educational research that encourages the teaching of reading and understanding code as a core discipline, which should therefore be examined. Initially, a form of pseudocode language emerged among examiners, to avoid any such language dependency. However this led to the very undesirable situation that, while students are being taught about the importance of rigour of terms in a programming language, they can look back over previous years of examinations and see non-standard use of coding that varies from example to example. Haggis is the solution to this. Haggis is a formally defined reference language, but its purpose is to examine programming, not to write programs. A further requirement is that it must not be a mandatory part of the curriculum, so students who have never previously seen the language should be able to read it. These aspects, along with an attempt to conform as far as possible with the evolved pseudocode style, directed the specification of the language. So, while Haggis is in fact a programming language (even though, in general, not all Haggis programs are executable), it is not intended as a language in which to write programs. These concepts are more fully explained in an academic paper.

History Haggis was commissioned by the SQA in 2010 to provide a uniform syntax and form in which to present questions to pupils in assessments. Its present form was jointly developed by Quintin Cutts (University of Glasgow), Greg Michaelson (Heriot-Watt University), and Richard Connor (University of Strathclyde). The aim of developing Haggis was to emphasize the core idea of ensuring pupils could view code and demonstrate their understanding of its behaviour in order to develop their computational thinking and programming skills. Haggis was first introduced into the computing science examinations as part of the Scottish Government's Curriculum for Excellence development program in the 2013/2014 session in National 5, 2014/2015 for the new Higher courses and into the new Advanced Higher in the 2015/2016 session. Haggis was not introduced as a language to replace other languages already used in education, nor was it intended that the language should be taught or used in the normal curriculum. However, some teachers have adopted it as a rigorous pseudocode form to enhance teaching delivered in another language.

Features and philosophy

Core principles Haggis was designed with 8 core principles in mind

Not be based on any one extant programming language Be adaptable to programming languages already taught in the Scottish Curriculum. Provide enough complexity for Advanced Higher teaching while being appropriately useful for earlier teaching years. Provide an instinctive element, e.g., variable types are self-specified. Be concise in use but open to interpretation of multiple ways to solve a problem. Allow different constructs to have different meanings when used in certain contexts. Don't visualize the non-useful elements, such as memory being allocated.

Use within education It was designed to be both functional/sequential and object-oriented based in order to be simple and complex for National 5/Higher students and Advanced Higher students simultaneously. Haggis was designed to allow pupils across Scotland to enhance the learning and understanding of computer programming through reading examples and aid the step of converting from pseudocode to full programming. It was not created with the intention of asking pupils to write it in assessments but to provide a uniform language in which to present code examples to students, ensuring that all pupils have a fair understanding and are not hindered by learning a different programming language than the one exemplified in the assessment.

Syntax

Syntax and structure in Haggis are very similar to other programming languages and can be easily learned.

Reserved words Reserved words are capitalized; this would generally be considered ugly for a programming language but makes the program structure clearer for a first-time reader of the language. Similarly, the language deliberately contains a great deal of syntactic redundancy. DECLARE, FOR, WHILE, etc.

Data types (Types are normally determined by inference except where this is not possible.)

Character (a single character type, from which strings are composed) Integer Real (including integers) Boolean (true or false)

Structured types Array: Sequence of same data types. String: Array of Characters. Record: A labelled collection of values. Object: as defined by class descriptors. Arrays are included at National 5 level, records at Higher, and objects at Advanced Higher.

Line numbers In some examples in examination papers, line numbers are used to allow easy reference; this is not a part of the language, however.

… excerpt ends here. Continue reading the full article.

Illustrations

Haggis (programming language): A more complex example of some Haggis code
A more complex example of some Haggis code

Worked examples

Example 1 — a first encounter with Haggis (programming language)

Start with the simplest possible case. Write down what Haggis (programming language) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Haggis (programming language) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Haggis (programming language) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Haggis (programming language)

In research
Haggis (programming language) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Haggis (programming language) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Haggis (programming language) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Education in Scotland, Programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for Haggis (programming language) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Haggis (programming language)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Haggis (programming language) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Haggis (programming language) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Haggis (programming language) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Haggis (programming language) in simple terms?

Haggis is a high-level reference programming language used primarily to examine computing science for Scottish pupils taking SQA courses on the subject. Haggis is used as a tool to bridge the gap between pseudocode and typical computer programming.

Why does Haggis (programming language) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Haggis (programming language)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Haggis (programming language).

Tags

  • Education in Scotland
  • Programming languages

Keep exploring