Accessibilité Contact Aller au menu Aller au texte

How I learned to Stop Worrying and Love Static Typing

Intervenant(s) : Alexander Heußner
Date : Jeudi 8 juillet 2010 Horaire : 11h00 Durée : 20 minutes
Lieu : ENSEIRB - Amphi C
Thèmes transversaux : En anglais

The conference

Slides : PDF file (only static excerpt - attention : >21MB), or see complete, low-res, dynamic version here.

Each internet discussion war tends to partially order programming languages whereas "mine" is always better than "yours". I propose to take a pragmatical approach to the underlying question : « Why would I personally choose this language and not the other for a certain kind of programming problem in a given context ? ». This presentation will trace one possible practical answer.

Programming a simple parser for the modeling language PROMELA forced me to leave my native riverside of Python’s duck typing in order to climb the mountain of OCaml’s strong static typing. I prejudged it a "mountain" as writing down exactly each type information seems superfluous with respect to the pythonic way in which types are also inevitable but stay in the programmer’s head. However, I was amazed about the supplementary foresight that was achievable for debugging due to the compiler’s type inference. This was especially valuable for a parser that per se demands to juggle with types (of the parsed language). Nevertheless, static typing is no vademecum for code correctness : it needs at least the company of unit testing as well as a carefully prepared mental model.

In the end, I personally gained a lot from this experience for both the straightforward pythonic way of attacking problems, where now types are more prominent in my mental model, as well as my next hike in the OCaml functional mountains in which I still miss sometimes the beautiful simplicity of pythonic solutions ("write down the mental model and it « works » out of the box").

The speaker

Alexander Heußner is currently working on formal methods for the verification of distributed asynchronous applications. Although python aficionado from the bottom of his heart, he was forced to get deeper into OCaml which now became his second favorite "pragmatic problem solution language".