User Tools

Site Tools


LARA: a framework for source-to-source compilation

The development of applications for high-performance embedded systems is typically a long and error-prone process. In addition to the required functions, developers must consider various and often conflicting non-functional application requirements such as performance and energy efficiency. The complexity of this process is exacerbated by the multitude of target architectures and the associated retargetable mapping tools. This novel framework introduces an approach that conveys domain knowledge and non-functional requirements to optimizers and mapping tools. LARA allows the specification of compilation strategies to enable efficient generation of software code and hardware cores for alternative target architectures. LARA provides strategies for code instrumentation and analysis, and for guiding the application of compiler and hardware synthesis optimizations. An important LARA feature is its capability to deal with different join points, action models, and attributes, and to generate an aspect intermediate representation.

LARA Framework

Aspect-Oriented Programming paradigm (AOP) tries to solve the programming languages decomposition by separating the secondary concerns with the program’s main logic. There are several AOP languages, such as AspectJ, an aspect-oriented extension for Java, and AspectC++, for C++. Although these languages are pretty useful for their associated programming languages, the aspects cannot be reused between aspect languages. Thus, an aspect created for a certain target language would have to be recoded to be applied to a different target language. Other disadvantages of these languages are the points of interest (join points), that, e.g., do not consider loops and local variables.

LARA is a novel aspect-oriented language, developed in Faculdade de Engenharia da Universidade do Porto (FEUP), which allows the development of aspects that can be applied to different programming languages. The MATLAB and C programming languages are two examples of case studies used to which where developed weaving envirnoments using the LARA approach. Another objective of this language is to aid AOP with the possibility to define different types of actions, such as variables type definition and compile optimizations.

The language is more detailed here.

Available Tools

The SPeCS group have been developing tools around the LARA language, providing compiling and interpreting tools, complete frameworks using the LARA approach, etc. Currently, the following tools available are:

  • LaraC - The LARA compiler which translates the LARA aspects, together with a target language specification, into an Aspect-Intermediate Representation (Aspect-IR). The generated Aspect-IR can be used by an interpreter to analyse the aspects and apply the defined strategies;
  • LaraI - A LARA interpreter for the Aspect-IR. The default LaraI implementation can execute all the functionalities available in LARA language, with a limited language representation. This interpreter can be expanded in many ways, such as: the addition of new Java and JavaScript features; addition of LARA API strategies; use of a different weaving mechanism instead of the default one. This tool can be used to create new weaving environments with ease.
  • WeaverGenerator - The LARA weaver engine generator. According to a given input language specification, this tool generates a weaving environment that easily interfaces with LaraI, providing the application of LARA in different environments and the easy update of new feature to the implemented weavers.

There are already several weavers that support the LARA language:

start.txt · Last modified: 2019/12/24 17:38 by joaobispo