Dynamic languages are becoming increasingly popular for different software development scenarios such as Web engineering, rapid prototyping or the construction of applications that require runtime adaptiveness. These languages are built on the idea of supporting reasoning about (and customising) program structure, behaviour and environment at runtime. The dynamism offered by dynamic languages is, however, counteracted by two main limitations: no early type error detection and fewer opportunities for compiler optimisations. To obtain the benefits of both dynamically and statically typed languages, the authors have designed the StaDyn programming language that provides both approaches. StaDyn keeps gathering-type information at compile time, ...