• Linked Applications

Matt Roberts


Matt Roberts is a Lecturer in the Department of Computing in the Faculty of Science and Engineering at Macquarie University.


My interests are in functional language implementation, pattern matching, term-rewriting, higher-order type systems and data-type generics.

Peer Reviewed

 2016 - Specifying CSS layout with reference attribute grammars

Layout for web documents is a complex process described by the lengthy prose Cascading Style Sheets (CSS) specification. It is difficult to ensure that implementations match this specification. We show how an implementation can more closely match the specification by using attribute grammars to define layout computations. Particularly, we show how high-level patterns encode the terminology of the specification, discriminating between elements using the same language as in the specification. We also present a new method of injecting artificial structure into an existing tree using reference attribute grammars. The result is a high-level executable specification for CSS layout that can form the basis for a full declarative implementation.


Scott Buckley, Anthony Sloane, and Matthew Roberts. 2016. Specifying CSS layout with reference attribute grammars. In Companion Proceedings of the 2016 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity (SPLASH Companion 2016). ACM, New York, NY, USA, 29-30. DOI: http://dx.doi.org/10.1145/2984043.2989216

 2015 - Oberon-0 in Kiama

The Kiama language processing library is a collection of domain-specific languages for software language processing embedded in the Scala programming language. The standard Scala parsing library is augmented by Kiama's facilities for defining attribute grammars, strategy-based rewriting rules and combinator-based pretty-printing. We describe how we used Kiama to implement an Oberon-0 compiler as part of the 2011 LDTA Tool Challenge. In addition, we explain how Scala enabled a modular approach to the challenge. Traits were used to define components that addressed the processing tasks for each Oberon-0 sub-language. Combining the traits as mixins yielded the challenge artefacts. We conclude by reflecting on the strengths and weaknesses of Kiama that were revealed by the challenge and point to some future directions. The Kiama library implements language processing in Scala.Attribute grammars, strategy-based rewriting and pretty-printing are supported.We describe building an Oberon-0 compiler using Kiama.Trait-based mixins in Scala proved useful to modularise the compiler.Overall, our participation in the 2011 LDTA Tool Challenge was worthwhile.


AM Sloane, M Roberts . Oberon-0 in Kiama. Science of Computer Programming, 2015

 2014 - Monto: A Disintegrated Development Environment

Integrated development environments play a central role in the life of many software developers. Integrating new functionality into these environments is non-trivial and forms a significant barrier to entry. We describe our Monto architecture which aims to address this problem. Monto components communicate via text messages across an off-the-shelf messaging layer. The architecture imposes limited constraints which enables easy combination of components to form an environment. A prototype implementation shows that this approach is practical and shows promise for full-featured development environments.


 Anthony M. Sloane, Matthew Roberts, Scott Buckley and Shaun Muscat. Monto: A Disintegrated Development Environment. Proceedings of the International Conference on Software Language Engineering, 2014. 

 2014 - Respect your Parents: How Attribution and Rewriting can get along

Attribute grammars describe how to decorate static trees. Rewriting systems describe how to transform trees into new trees. Attribution is undermined by rewriting because a node may appear in both the source and product of a transformation. If an attribute of that node depends on the node’s context, then a previously computed value may not be valid. We explore this problem and formalise it as a question of ancestry: the context of a node is given by the tree’s parent relationships and we must use the appropriate parents to calculate attributes that depend on the context. We show how respecting parents naturally leads to a view of context-dependent attributes as tree-indexed attribute families. Viewed in this way, attribution co-exists easily with rewriting transformations. We demonstrate the practicality of our approach by describing our implementation in the Kiama language processing library.


Anthony M. Sloane, Matthew Roberts and Leonard G. C. Hamey. Respect your Parents: How Attribution and Rewriting can get along. Proceedings of the International Conference on Software Language Engineering, 2014 

 2014 - Type Inference for the Spine View of Data

In this work we describe both a type checking and a type inference algorithm for generic programming using the spine view of data. The spine view of data is an approach to decomposing data in functional programming languages that supports generic programming in the style of Scrap Your Boilerplate and Stratego. The spine view of data has previously been described as a library in a statically typed language (as in Haskell), as a language feature in a dynamically typed language (as in Stratego), and as a calculus of patterns (as in the Pattern Calculus). The contribution of this paper is a type inference algorithm for the spine view and a type relation that underlies this inference algorithm. In contrast to all other typed implementations of the spine view, the type inference algorithm does not require any type annotations to be added in support of the spine view. This type inference algorithm is an extension of Hindley-Milner type inference, thus showing how to introduce the spine view of data as a language feature in any functional programming language based on Hindley-Milner.


Anthony M. Sloane and Mathew Roberts. Type Inference for the Spine View of Data. In Proceedings of the Workshop on Generic Programming.

 2014 - Domain-Specific Program Profiling and its Application to Attribute Grammars and Term Rewriting

We present a method for profiling programs that are written using domain-specific languages. Instead of reporting execution in terms of implementation details as in most existing profilers, our method operates at the level of the problem domain. Program execution generates a stream of events that summarises the execution in terms of domain concepts and operations. The events enable us to construct a hierarchical model of the execution. A flexible reporting system summarises the execution along developer-chosen model dimensions. The result is a flexible way for a developer to explore the execution of their program without requiring any knowledge of the domain-specific language implementation.

These ideas are embodied in a new profiling library called dsprofile that is independent of the problem domain so it has no specific knowledge of the data and operations that are being profiled. We illustrate the utility of dsprofile by using it to profile programs that are written using our Kiama language processing library. Specifically, we instrument Kiama's attribute grammar and term rewriting domain-specific languages to use dsprofile to generate events that report on attribute evaluation and rewrite rule application. Examples of typical language processing tasks show how domain-specific profiling can help to diagnose problems in Kiama-based programs without the developer needing to know anything about how Kiama is implemented.


Anthony M. Sloane, and Matthew Roberts. Domain-Specific Program Profiling and its Application to Attribute Grammars and Term Rewriting. Science of Computer Programming (in press). 



 Earlier Publications
 2011 - Compiled Generics for Functional Programming Languages

We address the problem of extending existing functional language compilers to support generic programming constructs, such as those that arise in term rewriting and datatype generic programs.

In particular, we present a compiler capable of compiling a wide range of generic programs in a way which substantially reduces the execution overhead traditionally associated with such programs, without requiring type classes. We explicitly build upon a baseline functional compiler by extending it to support a universal spine view of data and by adding a mechanism for building polymorphic functions from monomorphic ones.

This work employs variants of standard pattern compilation and lambda lifting translations that render these generic extensions into efficient code while making only modest modifications to our baseline compiler and its run-time. We show that type inference (with annotations for higher-ranked types and polymorphic recursion) can be maintained, by building all the mechanisms needed for type inference of generic programs on top of an existing variant of Damas and Milner’s algorithm W.

We demonstrate that this compiler achieves type safe and efficient compiled generic programs by showing the breadth of generic programs that we can encode with it and by benchmarking the execution speed and memory use of the programs output by the compiler. The generic programs we demonstrate are generic transformations, generic queries, generic traversals, generic equality, generic show plus a large number of variants of these. We also provide a proof of the soundness of the type system which underpins the compiler.

In summary, the primary outcome of this research is a new compiler for generic programs which uses a unique combination of encoding techniques and which generates efficient generic code. For each of our extensions (polymorphic functions with specific behaviour and the explicit spine view) we provide new algorithms for pattern compilation, type inference and conversion to primitive operations. These can be easily incorporated into existing functional language compilers.

Source Code


Matthew Roberts. Compiled Generics for Functional Programming Languages. PhD thesis, Department of Computing, Macquarie University, 2011. 

 2006 - Wiki Pedagogy - A Tale of Two Wikis

This paper reports on a research project investigating the deployment of two different wikis in two Masters of IT subjects. As well, two different learning task designs were used (weekly whole class extension question tasks versus semester long group projects) providing further basis for comparison and contrast within the project. Data collection mechanisms included a 22 item student survey, interviews with academics and observations on student contributions to the wikis. Key results regarding students’ patterns of behaviour, the impact of learning task design upon contributions, the effect of training, and the quality of the wiki applications themselves are discussed. Based on these results, a set of 12 principles for implementing wiki based learning tasks are recommended.


Matt Bower, Karen Woo, Matt Roberts, and Paul Watters. Wiki pedagogy - a tale of two wikis. In Information Technology Based Higher Education and Training, 2006. ITHET ’06. 7th International Conference on, pages 191–202, 2006. 

 2001 - Artificial Actors for Real World Environments

We have developed a simulation environment called CreatureSpace that allows testing our agent theories on intelligent agents in a complex realistic environment. We present the CreatureSpace architecture and our experiences in combining multiple artificial intelligence techniques in a uniform environment. We use Half-Life as the rendering engine for CreatureSpace. We focus on how agents can manage large amounts of information and describe our embedded knowledge solution.


 Matthew Roberts. Artificial actors for real world environments. In AAAI Spring Symposium on Artificial Intelligence and Interactive Entertainment, pages 87–94, 2002. 



Research Articles

Program Committees


My teaching philosophy is to empower students to learn by giving them the guidance and opportunity they need to construct their own understanding of the course material and to navigate the sea of information which lies before them. Read More...

CS Conversations

Public Lectures

Teaching Articles



Current Projects

  • Kiama: language processing via embedded domain-specific languages
  • dgen: A "decidedly generic" language for data-type generics, term-rewriting and function language implementation experimentation.
  • Monto: A disintegrated development environment





Contact Information

Department of Computing
Macquarie University
Sydney, NSW 2109

Phone: +61 2 9850 9564
Fax: +61 2 9850 9551

Email: matthew.roberts AT mq.edu.au
Twitter: @altmattr

Detailed CV

Office: E6A374 (Campus Maps, Google Map)

  • No labels