<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:iweb="http://www.apple.com/iweb" version="2.0">
  <channel>
    <title>programming</title>
    <link>http://philippewang.info/web/contents/prog/prog.html</link>
    <description> </description>
    <generator>iWeb 3.0.2</generator>
    <item>
      <title>From learning to teaching OCaml</title>
      <link>http://philippewang.info/web/contents/prog/Entries/2010/2/10_From_learning_to_teaching_OCaml.html</link>
      <guid isPermaLink="false">127e1a93-eac3-417d-9726-d1eb4593f792</guid>
      <pubDate>Wed, 10 Feb 2010 02:35:32 +0100</pubDate>
      <description>(written in Feb 2009, updated in Feb 2010)&lt;br/&gt;&lt;br/&gt;I learnt (functional and imperative) OCaml in 2004 with Mathieu Jaume and Valérie Ménissier-Morain. The homework consisted in writing a Tetris-like game using the Graphics module. Well, apart from the fact that it prevented me from sleeping enough at that time, it was quite interesting.&lt;br/&gt;&lt;br/&gt;The following semester, I learnt with Renaud Rioboo how types were inferred (with those type inference rules that seemed so useless and so weird, but then seen as hardly replaceable) and I programmed a type checker for a tiny ML (a sort of typed λ-calculus with imperative references and loops). Yeah, that was fun. Then, in 2005, I used my knowledge in OCaml to program arithmetic computation on big integers and matrixes, taught by Philippe Aubry and Valérie Ménissier-Morain.&lt;br/&gt;&lt;br/&gt;To potentially do something useful during the summer of 2005, I contacted Mohab Safey and Emmanuel Chailloux to work on MLGmp, an interface between OCaml and the GMP library: the garbage collector didn’t seem to behave as expected, there were some kind of memory leaks. We have worked for quite a long time on that problem, without having ever found an acceptable solution because those cases were not happening so often and casual programs would probably not encounter those leaks.&lt;br/&gt;&lt;br/&gt;In 2005, I also learnt (preemptive thread-based and cooperative thread-based) concurrent programming in OCaml.&lt;br/&gt;&lt;br/&gt;In early 2006, I wrote a type checker for a Caml compiler (including OCaml’s algebraic data types, records, abbreviations, pattern matching and unparametered file-based modules). That was really painful though very interesting. For instance, I couldn’t find any comprehensive (and understandable) documentation on how to do it, especially to answer the questions as “Why is this cyclic type accepted while that other one is rejected? They are nearly the same!”. The only “comprehensive” documentation being OCaml’s (hardly understandable for beginners) source code.&lt;br/&gt;&lt;br/&gt;In summer 2006, Benjamin Canou and I replaced OCaml’s two-generation garbage collector by a simple stop and copy (one-generation) garbage collector. This was our first step in bringing OCaml to being qualifiable for civil avionic software (DO-178B). Then we wrote an MC/DC compliant code coverage tool for a subset of OCaml. Esterel Technologies used our summer work to make their production MLcov tool and succeeded in using OCaml for qualifiable civic avionic software: the code generator of the latest version of SCADE Suite is written in OCaml. A free software version of &lt;a href=&quot;http://mlcov.ortsa.com/&quot;&gt;MLcov is available&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Later in 2006 and in 2007, I learnt the foundations of OCaml’s type inference (typed λ-calculus, &lt;a href=&quot;http://en.wikipedia.org/wiki/System_F&quot;&gt;System F&lt;/a&gt;, &lt;a href=&quot;http://www.cs.chalmers.se/Cs/Research/Logic/book/&quot;&gt;Martin-Löf’s type theory&lt;/a&gt;, ...).&lt;br/&gt;&lt;br/&gt;I don’t remember when I learnt object-oriented programming in OCaml, probably in 2006 or 2007. Same for polymorphic variants. When did I learn phantom types? Probably in 2007 or 2008. Do I like them? Not really, they quickly become painful to handle, though it’s (kind of) good they exist.&lt;br/&gt;&lt;br/&gt;I gave my first lesson in OCaml in 2006. I think I’ve already spent more than a hundred hours of my life teaching OCaml, most as a teaching assistant, the rest as a “nice guy who is okay to teach OCaml for free”...</description>
    </item>
  </channel>
</rss>
