The OpenModelica framework is an Open Source effort for building a complete compiler for Modelica started at the programming environments laboratory at Link¨ oping university. It is written in a language called RML [10], Relational Meta Language, based on natural semantics. Natural semantics is a popular formalism for describing the semantics (i.e. the meaning of language constructs) for compilers. By using the RML language this formalism is combined with efficient compilation into optimized C code. The OpenModelica framework is used to experiment with new language features and language design for the ongoing development of the Modelica language. The design of the Modelica language is performed in the Modelica Design Group (by the Modelica Association) - an open group of Modelica users, resarchers, vendors, etc., where the the Modelica language is evolved through intensive discussions in threedays workshops, three or four times a year. Recently, support for Meta-programming and function overloading (including an external interface to LAPACK) have been implemented in the OpenModelica compiler. This paper present the design and implementation of these language constructs in the OpenModelica framework and illustrates how to utilize this framework for research in e.g. language design, metaprogramming and modeling and simulation methodology.
[1]
Walid Taha,et al.
Multi-stage programming with explicit annotations
,
1997
.
[2]
Peter Fritzson,et al.
Modelica - A Unified Object-Oriented Language for System Modelling and Simulation
,
1998,
ECOOP.
[3]
Peter Fritzson,et al.
The Open Source Modelica Project
,
2002
.
[4]
Peter A. Fritzson,et al.
Principles of object-oriented modeling and simulation with Modelica 2.1
,
2004
.
[5]
Mikael Pettersson,et al.
Compiling Natural Semantics
,
1999,
Lecture Notes in Computer Science.
[6]
Peter Bunus,et al.
Debugging and Structural Analysis of Declarative Equation-Based Languages
,
2002
.
[7]
Peter Fritzson,et al.
Incremental declaration handling in Open Source Modelica
,
2002
.
[8]
Tim Sheard,et al.
Accomplishments and Research Challenges in Meta-programming
,
2001,
SAIG.
[9]
Bjarne Stroustrup.
A C++ tutorial
,
1985,
ACM '85.
[10]
Peter Aronsson.
Automatic Parallelization of Simulation Code from Equation Based Simulation Languages
,
2002
.
[11]
Stephen Wolfram,et al.
The Mathematica Book
,
1996
.