# MeLa: A Programming Language for a New Multidisciplinary Oceanographic Float
## 2 A Programming Language Based on Models  
### Models for Programming  
Scientists use models to understand the world, for example, with climate models. Engineers use models to develop new systems (i.e., a bridge, a computer program). These models are specific to a domain of expertise, for example, electronic engineers use models of resistances or transistors. The models are assembled together to develop a system, for example, an electronic circuit. A language, graphical or textual, which allows for editing the models, is usually called a Domain Specific Language (DSL) [15]. The HeLa language is a DSL dedicated to the development of signal processing algorithms for the Mermaid floats. Models can be used in several ways in order to respond to the challenges that are introduced in the first section. First, models allow for us to represent systems at several levels of abstraction. In software engineering assembly instructions are low-level models, whereas functions or tasks of an operating system are models with a high-level of abstraction. The HeLa language gains in abstraction with models that are dedicated to the development of applications for the instrument. Instead of programming applications with tasks, which need an expert in embedded software, the HeLa language offers models called acquisition modes. Using these models, the developer does not have to manage the execution priority of tasks, or the synchronization of execution with other tasks. Instead, developing an application with an acquisition mode only requires that the user defines the input sensor and the sampling frequency. This high level of abstraction allows for developers that are not embedded software experts to write applications for the instrument (challenge 1). Second, models can be used to compute properties of the developed system before building it. The models of the HeLa language allow estimating properties of the developed applications, such as the lifetime of batteries, the cost of satellite transmission, and the processor usage, but other properties can also be incorporated in the models. Because the models are associated with the programming language, the estimations can be linked to the content of the applications. For example, the estimations can indicate which function uses most of the processor time. Thus, using models allows verifying that the instrument limits are not exceeded (challenge 2). Moreover, these estimations are computed during the writing of the applications, improving productivity. This would not be the case if measurements were done on a real instrument with specialized equipment; it would require expertise and time to realize the measures and interpret them. Third, models are used to generate the specific embedded software specific code to program the instrument. The code generation process is managed by a tool that is integrated in the language, such as a compiler. The transformation rules to generate the code are defined by embedded software experts; this ensures having a reliable and efficient code (challenge 3). For example, the acquisition modes generate several tasks, with their synchronization mechanism and execution priority. The embedded software code would not be reliable and efficient if directly written by a non-expert. It is also possible to generate several specific codes to program different platforms. In our case, we also generate code to execute the applications on a personal computer, it allows for scientists to settle the applications and verify that they behave as expected. Finally, models allow for composing (i.e., combine) applications that have been developed independently (challenge 4). The composition of applications consists mostly of verifying that applications are compatible in terms of both used computational resources (e.g., they cannot use more resources than what is available) and sensors (e.g., they cannot share a sensor if their configurations on this sensor differ). The concurrent execution of applications is also managed by the operating system at the time of execution time.