BECS 2022 – 2nd International Workshop on Big data driven Edge Cloud Services

]

About Lightweight Code Generation

Andreas Schmidt

OVERVIEW

There is often something mystical about code generation. This is partly due to tools, that are able to achieve a high degree of generation thanks to their flexibility and universality, but this also makes the tools extremely complex and restricts their use to suitably trained persons. A “code generation light” ap-proach, which would often be sufficient in many cases, is difficult to implementwith these tools.In principle, however, getting started with code generation is actually quite simple. Only two things are needed: (1) a model that describes the application to berealized, and (2) a template, which transforms the model into code.In the simplest case, the model can consist of a series of statements in an ASCIIfile, or of an object graph over which the template iterates. This provides a clearseparation between the semantic aspects (model) and the technical aspects (template).This tutorial will introduce lightweight generator technologies that can easily integrated into your own software development process and delegate tedious, mo-notonous programming tasks to the code-generator, so that you can concentrateon the more demanding and interesting programming tasks. For this reason, anumber of different software generator technologies and their functional rinciples will be presented and how they can be realized with minimal effort. The tutorial also includes practical parts in which the participants perform a series of concrete tasks in the sphere of software code-generation. For this part the participants need a laptop. Additionally, a PHP interpreter, a MySQL database and a web server are required. An installation guide for the software for the different platforms can be found here.