<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/default.xsl"?>
<fr:tree xmlns:fr="http://www.forester-notes.org" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" root="false" base-url="/">
  <fr:frontmatter>
    <fr:authors>
      <fr:author>
        <fr:link href="https://patrick.sirref.org/Patrick Ferris/" type="external">Patrick Ferris</fr:link>
      </fr:author>
    </fr:authors>
    <fr:date>
      <fr:year>2025</fr:year>
      <fr:month>11</fr:month>
      <fr:day>10</fr:day>
    </fr:date>
    <fr:uri>https://patrick.sirref.org/thoughts-on-foundations-for-hacking-on-ocaml/</fr:uri>
    <fr:display-uri>thoughts-on-foundations-for-hacking-on-ocaml</fr:display-uri>
    <fr:route>/thoughts-on-foundations-for-hacking-on-ocaml/</fr:route>
    <fr:title text="Thoughts on KC's &quot;Foundations for Hacking on OCaml&quot;">Thoughts on KC's "Foundations for Hacking on OCaml"</fr:title>
    <fr:meta name="external">https://kcsrk.info/ocaml/2025/11/10/hacking/</fr:meta>
  </fr:frontmatter>
  <fr:mainmatter>
    <html:p><fr:link href="/kc/" title="KC Sivaramakrishnan" uri="https://patrick.sirref.org/kc/" display-uri="kc" type="local">KC</fr:link> recently wrote a thought-provoking piece entitled <fr:link href="https://kcsrk.info/ocaml/2025/11/10/hacking/" type="external">"Foundations for Hacking on OCaml"</fr:link>. In it, <fr:link href="/kc/" title="KC Sivaramakrishnan" uri="https://patrick.sirref.org/kc/" display-uri="kc" type="local">KC</fr:link> recounts the all to familiar experience of new CS students arriving at complex projects (like the <fr:link href="https://github.com/ocaml/ocaml" type="external">OCaml compiler</fr:link>) and not knowing where to begin.</html:p>
    <html:p>Speaking from experience, the undergraduate CS course at <fr:link href="/ucam/" title="University of Cambridge" uri="https://patrick.sirref.org/ucam/" display-uri="ucam" type="local">Cambridge</fr:link> (when I did it between 2017 and 2020) was still very much theory-first. This was true even in courses such as Operating Systems and Optimising Compilers. That's not to say there weren't hands-on aspects (building circuits, programming FPGAs, a group project with an external "client" etc.). But none of this did the "hacking skills" justice. <fr:link href="/ryangibb/" title="Ryan Gibb" uri="https://patrick.sirref.org/ryangibb/" display-uri="ryangibb" type="local">Ryan</fr:link> and I have discussed this at length, in particular how we both seem to have come out the other side of our undergraduate degrees with a healthy amount of "hacking skills". How, in many ways, that has become an integral part of the way we <html:em>do</html:em> research. Why is this the case? What could we be doing more of to help students bridge the gap from theory to real-world, complex projects?</html:p>
    <fr:tree show-metadata="false" numbered="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="https://patrick.sirref.org/Patrick Ferris/" type="external">Patrick Ferris</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>11</fr:month>
          <fr:day>10</fr:day>
        </fr:date>
        <fr:title text="Hacking Skills">Hacking Skills</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>What do I mean when I say hacking skills? I'm referring to what <fr:link href="/kc/" title="KC Sivaramakrishnan" uri="https://patrick.sirref.org/kc/" display-uri="kc" type="local">KC</fr:link> has called "systems programming".</html:p>
        <html:blockquote>
          <html:p>There are many fundamental systems skills that go into working on a language like OCaml that only come with soaking in systems programming. By systems programming, I mean the ability to use tools like the command-line, editors, version control, build systems, compilers, debuggers, bash scripting, and so on.</html:p>
        </html:blockquote>
        <html:p><fr:link href="/kc/" title="KC Sivaramakrishnan" uri="https://patrick.sirref.org/kc/" display-uri="kc" type="local">KC</fr:link>'s choice of words are spot on, you need to <html:em>soak</html:em> in the systems programming. I believe, for a lot of CS students, the only way to get comfortable with these kinds of skills is in using them. It is similar to having <html:em>work experience</html:em> to complement your theoretical knowledge. As with all work experience, you run into the chicken-and-egg problem of having just enough experience to be considered for a role (be it a job, a PhD, an internship etc.) even though that experience is often gained via the role you're trying to do!</html:p>
        <html:p>Luckily, I think open-source can play a terrific role in helping bridge that gap. There are countless projects (on Github, Sourcehut, <fr:link href="https://tangled.org/" type="external">tangled</fr:link> etc.) that need help. With the right amount of documentation, issue triaging and mentoring, open-source projects can often be a great way for students to gain the required hacking skills they need.</html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" numbered="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="https://patrick.sirref.org/Patrick Ferris/" type="external">Patrick Ferris</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>11</fr:month>
          <fr:day>10</fr:day>
        </fr:date>
        <fr:title text="Outreachy">Outreachy</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>I am one of the OCaml community's coordinators for <fr:link href="/outreachy/" title="Outreachy" uri="https://patrick.sirref.org/outreachy/" display-uri="outreachy" type="local">Outreachy</fr:link>. <fr:link href="/outreachy/" title="Outreachy" uri="https://patrick.sirref.org/outreachy/" display-uri="outreachy" type="local">Outreachy</fr:link> puts all of this into practice whilst recognising that the playing-field is not fair.</html:p>
        <html:blockquote>
          <html:p>Outreachy provides internships to anyone from any background who faces underrepresentation, systemic bias, or discrimination in the technical industry where they are living.</html:p>
        </html:blockquote>
        <html:p>Concretely, there are a few key aspects that make this possible:</html:p>
        <html:ol>
          <html:li>
            <html:p>The internships are <html:em>paid</html:em>. Everyone doesn't have the same affordances to take time out of their schedule to learn "hacking skills" and contribute to an open-source project.</html:p>
          </html:li>
          <html:li>
            <html:p>Structured for success. The mentoring provided by open-source maintainers is targeted towards people who likely need some help learning the "hacking skills" needed to succeed. The project is also tailored to the intern.</html:p>
          </html:li>
        </html:ol>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" numbered="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="https://patrick.sirref.org/Patrick Ferris/" type="external">Patrick Ferris</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>11</fr:month>
          <fr:day>10</fr:day>
        </fr:date>
        <fr:title text="Encouraging &quot;Hacker&quot; Societies">Encouraging "Hacker" Societies</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>A large part of why I feel I developed the systems programming skills I needed was through my involvement with Cambridge's "hackers" society: <fr:link href="https://github.com/hackersatcambridge" type="external">Hackers at Cambridge</fr:link> (yes, that's a completely custom website built using Swift, h/t to <fr:link href="https://jaredkhan.com/" type="external">Jared</fr:link>!). The essence of that society was to provide hands-on, practical experience writing real-world software for anybody. This included:</html:p>
        <html:ul>
          <html:li>
            <html:p>An <fr:link href="https://github.com/hackersatcambridge/workshop-intro-to-git" type="external">introductory workshop on how to use Git</fr:link>.</html:p>
          </html:li>
          <html:li>
            <html:p>A <fr:link href="https://github.com/hackersatcambridge/workshop-creative-coding" type="external">creative coding</fr:link> workshop I ran using <fr:link href="https://p5js.org/" type="external">p5.js</fr:link>.</html:p>
          </html:li>
          <html:li>
            <html:p>How to <fr:link href="https://github.com/hackersatcambridge/workshop-make" type="external">use Make</fr:link>.</html:p>
          </html:li>
          <html:li>
            <html:p>How to use <fr:link href="https://github.com/hackersatcambridge/workshop-docker" type="external">Docker</fr:link>.</html:p>
          </html:li>
        </html:ul>
        <html:p>Hackers at Cambridge offered exactly what I needed to be a better programmer. More experienced friends who were willing to sit with you and explain git branches, and a place to channel your own explorations into programming and building systems. Speaking of places to channel your developing skills...</html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" numbered="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="https://patrick.sirref.org/Patrick Ferris/" type="external">Patrick Ferris</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>11</fr:month>
          <fr:day>10</fr:day>
        </fr:date>
        <fr:uri>https://patrick.sirref.org/self-host-love/</fr:uri>
        <fr:display-uri>self-host-love</fr:display-uri>
        <fr:route>/self-host-love/</fr:route>
        <fr:title text="Self-host, self-host, self-host ">Self-host, self-host, self-host </fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>Self-hosting is another great way to build those skills. My website has had at least five different incarnations at this point. Some highlights include <fr:link href="https://www.gatsbyjs.com/" type="external">when it was completely made with GatsbyJS</fr:link> (when that was the new hottness), <fr:link href="https://github.com/patricoferris/sesame" type="external">when it was a mishmash of OCurrent and Omd</fr:link>, to now, when it is one part <fr:link href="/graft/" title="Graft" uri="https://patrick.sirref.org/graft/" display-uri="graft" type="local">Graft</fr:link> and one part <fr:link href="/forester/" title="Forester" uri="https://patrick.sirref.org/forester/" display-uri="forester" type="local">Forester</fr:link>.</html:p>
        <html:p>Before I had a website, I was also <fr:link href="https://medium.com/@patrickferris17" type="external">blogging on Medium</fr:link> (I won't pretend they were the best blogs ever, but I learnt a lot by writing them). I have since moved past Medium as their values do not align with my own, but it was an important stepping stone.</html:p>
        <html:p>Thanks to <fr:link href="/ryangibb/" title="Ryan Gibb" uri="https://patrick.sirref.org/ryangibb/" display-uri="ryangibb" type="local">Ryan</fr:link>, who is very generous with his time, I now <fr:link href="https://github.com/patricoferris/nixos" type="external">self-host</fr:link> a variety of services using NixOS.</html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" numbered="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="https://patrick.sirref.org/Patrick Ferris/" type="external">Patrick Ferris</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>11</fr:month>
          <fr:day>10</fr:day>
        </fr:date>
        <fr:title text="The OCaml Compiler">The OCaml Compiler</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p><fr:link href="/kc/" title="KC Sivaramakrishnan" uri="https://patrick.sirref.org/kc/" display-uri="kc" type="local">KC</fr:link>'s post specifically asked about the OCaml compiler. My <fr:link href="/pf341-diss/" title="Optimisations Across Hardware and Software using RISC-V" uri="https://patrick.sirref.org/pf341-diss/" display-uri="pf341-diss" type="local">third year dissertation</fr:link>, supervised by <fr:link href="/dra27/" title="David Allsopp" uri="https://patrick.sirref.org/dra27/" display-uri="dra27" type="local">David Allsopp</fr:link>, asked "what if assembly languages had instructions for functional programming languages" and in particular, OCaml! Hacking on the OCaml compiler is a course in software archaeology for many a younger CS student. Make, sed, awk, autoconf, bootstrapping, the runtime, frontend, git, lexing, parsing etc. Even if you are focusing on a particular aspect of the compiler (for me, it was the assembly generation in the backend) you still bump into a good 80 percent of the machinery that makes the compiler tick.</html:p>
        <html:p>This is where having a <fr:link href="/dra27/" title="David Allsopp" uri="https://patrick.sirref.org/dra27/" display-uri="dra27" type="local">good mentor</fr:link> is invaluable. David took the time to explain the parts of the compiler to me, and suggested some good starter exercises to get me going. Not only that, but David could help with all manners of questions that were vaguely related to the project at hand. From our conversations in early 2020 we have:</html:p>
        <html:blockquote>
          <html:p>Another question I had (whilst trying to install the RISC-V cross-compiler in an Opam switch) is the difference/meaning of:</html:p>
          <html:ul>
            <html:li>
              <html:p>ocaml-base-compiler &lt;= a compiler?</html:p>
            </html:li>
            <html:li>
              <html:p>ocaml-variants &lt;= a compiler?</html:p>
            </html:li>
            <html:li>
              <html:p>ocaml &lt;= this is a REPL?</html:p>
            </html:li>
          </html:ul>
        </html:blockquote>
        <html:p>Followed by David helpfully adding 20GB to the root device on the shared server we were using, so I could run some Docker containers! Without an experienced, patient supervisor, this would have been death by a thousand cuts at the time.</html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" numbered="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="https://patrick.sirref.org/Patrick Ferris/" type="external">Patrick Ferris</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>11</fr:month>
          <fr:day>10</fr:day>
        </fr:date>
        <fr:title text="Work Experience">Work Experience</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>After my undergraduate degree, I worked full-time at <fr:link href="https://tarides.com/" type="external">Tarides</fr:link> for two years on a range of projects, including <fr:link href="https://ocaml.org/" type="external">ocaml.org</fr:link>, <fr:link href="https://github.com/ocurrent" type="external">obuilder and ocurrent</fr:link> and <fr:link href="https://github.com/ocaml-multicore/eio" type="external">Eio</fr:link>. Undoubtedly, this is where I learned the most systems programming, and I am very grateful to have been able to work there. The time taken to learn those skills have paid themselves off now in my own research and day-to-day work. Not everyone will have the same opportunities and affordances (and job market...) to be able to go off and learn about real-world software engineering and systems programming, but if you can, I highly recommend it before jumping back into something like a PhD or research. Working alongside <fr:link href="/anilmadhavapeddy/" title="Anil Madhavapeddy" uri="https://patrick.sirref.org/anilmadhavapeddy/" display-uri="anilmadhavapeddy" type="local">Anil</fr:link>, <fr:link href="https://github.com/kit-ty-kate/" type="external">Kate</fr:link>, <fr:link href="https://roscidus.com/blog/" type="external">Thomas</fr:link>, to name but a few, taught me a lot.</html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" numbered="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="https://patrick.sirref.org/Patrick Ferris/" type="external">Patrick Ferris</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>11</fr:month>
          <fr:day>10</fr:day>
        </fr:date>
        <fr:title text="In summary">In summary</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>Having written all this, I think the upshot is that institutions should be:</html:p>
        <html:ul>
          <html:li>
            <html:p>Encouraging CS students to be involved in open-source from the jump.</html:p>
            <html:ul>
              <html:li>
                <html:p>One neat way to do this is to host course material online for students to contribute to (or at the very least look at locally). Poking around <fr:link href="https://www.cl.cam.ac.uk/~tgg22/" type="external">Timothy Griffin</fr:link>'s <fr:link href="https://github.com/Timothy-G-Griffin/cc_cl_cam_ac_uk/" type="external">compiler construction repo</fr:link> was how I got into OCaml in the first place!</html:p>
              </html:li>
            </html:ul>
          </html:li>
          <html:li>
            <html:p>Ensure mentors (be it supervisors, teachers etc.) are adequately supported and compotent for the roles they help with.</html:p>
          </html:li>
          <html:li>
            <html:p>Provide opportunities to put some of the theory into practice.</html:p>
            <html:ul>
              <html:li>
                <html:p>It is great to provide resources (as <fr:link href="/kc/" title="KC Sivaramakrishnan" uri="https://patrick.sirref.org/kc/" display-uri="kc" type="local">KC</fr:link> has) but without an avenue for putting that into practice, it is hard to really learn what any of these system programming tools are doing for you.</html:p>
              </html:li>
              <html:li>
                <html:p><fr:link href="/ucam/" title="University of Cambridge" uri="https://patrick.sirref.org/ucam/" display-uri="ucam" type="local">Cambridge</fr:link> is quite well-suited for this with their supervision teaching structure, I recall having to build a hashmap implementation in C for one of my supervisions only to watch it be kindly torn apart by my supervisor using <html:code>valgrind</html:code> and friends. I think we all learned a lot!</html:p>
              </html:li>
            </html:ul>
          </html:li>
        </html:ul>
      </fr:mainmatter>
    </fr:tree>
  </fr:mainmatter>
  <fr:backmatter>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="References">References</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Context">Context</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Backlinks">Backlinks</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Related">Related</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://patrick.sirref.org/anilmadhavapeddy/</fr:uri>
            <fr:display-uri>anilmadhavapeddy</fr:display-uri>
            <fr:route>/anilmadhavapeddy/</fr:route>
            <fr:title text="Anil Madhavapeddy">Anil Madhavapeddy</fr:title>
            <fr:taxon>person</fr:taxon>
            <fr:meta name="external">https://anil.recoil.org</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Professor of Planetary Computing at <fr:link href="/ucam/" title="University of Cambridge" uri="https://patrick.sirref.org/ucam/" display-uri="ucam" type="local">University of Cambridge</fr:link>.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://patrick.sirref.org/dra27/</fr:uri>
            <fr:display-uri>dra27</fr:display-uri>
            <fr:route>/dra27/</fr:route>
            <fr:title text="David Allsopp">David Allsopp</fr:title>
            <fr:taxon>person</fr:taxon>
            <fr:meta name="external">https://www.dra27.uk/blog/</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://patrick.sirref.org/kc/</fr:uri>
            <fr:display-uri>kc</fr:display-uri>
            <fr:route>/kc/</fr:route>
            <fr:title text="KC Sivaramakrishnan">KC Sivaramakrishnan</fr:title>
            <fr:taxon>person</fr:taxon>
            <fr:meta name="position">Assistant Prof. IIT Madras</fr:meta>
            <fr:meta name="external">https://kcsrk.info</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://patrick.sirref.org/pf341-diss/</fr:uri>
            <fr:display-uri>pf341-diss</fr:display-uri>
            <fr:route>/pf341-diss/</fr:route>
            <fr:title text="Optimisations Across Hardware and Software using RISC-V">Optimisations Across Hardware and Software using RISC-V</fr:title>
            <fr:meta name="pdf">/pf341-diss.pdf</fr:meta>
            <fr:meta name="external">https://github.com/patricoferris/riscv-o-spec</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:blockquote>
              <html:p>How can an open-source specification for a modular, flexible, reduced instruction set architecture (RISC-V) allow for greater control and manipulation over the hardware-software interface.</html:p>
            </html:blockquote>
            <html:p>OCaml uses a tagged-bit runtime representation to distinguish between pointers and immediate values (like an integer or constant constructors for variants). The least significant bit (LSB) is a <html:code>1</html:code> for immediate values and <html:code>0</html:code> for pointers. This means <html:code>1 + 2</html:code> is really <html:code>3 + 5</html:code> but instead of getting <html:code>7</html:code> (<html:code>2 * 3 + 1</html:code>) you get <html:code>8</html:code>! You have to perform an additional subtraction to get the correct value. Two instructions for a single addition (or subtraction). So I proposed <html:code>ocadd</html:code> to do it all in one.</html:p>
            <html:p>Another feature of OCaml is its support for pattern-matching:</html:p>
            <html:pre class="hilite">
              <html:code>
                <html:span class="ocaml-keyword-other">type</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-source">animal</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-keyword-operator">=</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-constant-language-capital-identifier">Dog</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-keyword-other">|</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-constant-language-capital-identifier">Cat</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-keyword-other">|</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-constant-language-capital-identifier">Camel</html:span>
                <html:span class="ocaml-source">
</html:span>
                <html:span class="ocaml-keyword">let</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-entity-name-function-binding">print_animal</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-keyword-operator">=</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-keyword-other">function</html:span>
                <html:span class="ocaml-source"> 
</html:span>
                <html:span class="ocaml-source">  </html:span>
                <html:span class="ocaml-keyword-other">|</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-constant-language-capital-identifier">Dog</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-keyword-operator">-&gt;</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-source">print_endline</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-string-quoted-double">"</html:span>
                <html:span class="ocaml-string-quoted-double">dog</html:span>
                <html:span class="ocaml-string-quoted-double">"</html:span>
                <html:span class="ocaml-source">
</html:span>
                <html:span class="ocaml-source">  </html:span>
                <html:span class="ocaml-keyword-other">|</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-constant-language-capital-identifier">Cat</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-keyword-operator">-&gt;</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-source">print_endline</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-string-quoted-double">"</html:span>
                <html:span class="ocaml-string-quoted-double">cat</html:span>
                <html:span class="ocaml-string-quoted-double">"</html:span>
                <html:span class="ocaml-source">
</html:span>
                <html:span class="ocaml-source">  </html:span>
                <html:span class="ocaml-keyword-other">|</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-constant-language-capital-identifier">Camel</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-keyword-operator">-&gt;</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-source">print_endline</html:span>
                <html:span class="ocaml-source"> </html:span>
                <html:span class="ocaml-string-quoted-double">"</html:span>
                <html:span class="ocaml-string-quoted-double">camel</html:span>
                <html:span class="ocaml-string-quoted-double">"</html:span>
                <html:span class="ocaml-source">
</html:span>
              </html:code>
            </html:pre>
            <html:p>These constructors are represented at runtime as immediate values (an enumeration using odd numbers <html:code>1, 3, 5...</html:code>). Long enough pattern-matches are converted into jump tables using this enumeration to index the correct address (see p.24). These addresses (of the jumps) are separated by four bytes, we use the enumeration to do the jump by first converting to <html:code>0, 1, 2...</html:code> and then shifting left twice (multipying by 4) and finally adding it to a base address. This is quite common. A new instruction, <html:code>oclea</html:code> fuses these into one shift-and-add instruction (named after <html:em>load-effective address</html:em>).</html:p>
            <html:p>Another common task is applying functions. This can require saving or loading the return address and moving the stack pointer. This collection of assembly instructions are often called function prologues and epilogues. These were combined into one instruction.</html:p>
            <html:p>As mentioned, OCaml has a tagged-bit representation. It is quite common to turn a number into an OCaml value by shifting left and adding one - <html:code>ocvali</html:code> does this in one go. <html:code>oceqi r1 r2 imm</html:code> checks if <html:code>r2</html:code> is equal to <html:code>imm</html:code> and assigns <html:code>1</html:code> to <html:code>r1</html:code> if it is, otherwise <html:code>0</html:code>. This is useful in OCaml because the <html:code>true</html:code> value is a <html:code>1</html:code> which is really a <html:code>3</html:code>! So simple truth checking looks like:</html:p>
            <html:pre><![CDATA[L101:
  li a1, 1
  beq a0, a1, L100  
  li a0, 1          
  ret
L100:
  li a0, 3 
  ret]]></html:pre>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://patrick.sirref.org/outreachy/</fr:uri>
            <fr:display-uri>outreachy</fr:display-uri>
            <fr:route>/outreachy/</fr:route>
            <fr:title text="Outreachy">Outreachy</fr:title>
            <fr:taxon>Project</fr:taxon>
            <fr:meta name="external">https://www.outreachy.org/</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:blockquote>
              <html:p>Outreachy provides internships in open source and open science. Outreachy provides internships to people subject to systemic bias and impacted by underrepresentation in the technical industry where they are living.</html:p>
            </html:blockquote>
            <html:p>I am one of the coordinators for the <html:em>OCaml community</html:em> for Outreachy. I have also mentored multiple three-month internships for the community.</html:p>
            <html:hr />
            <fr:tree show-metadata="true" expanded="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="https://patrick.sirref.org/Patrick Ferris/" type="external">Patrick Ferris</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2026</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>9</fr:day>
                </fr:date>
                <fr:uri>https://patrick.sirref.org/outreachy-ocaml-tiff/</fr:uri>
                <fr:display-uri>outreachy-ocaml-tiff</fr:display-uri>
                <fr:route>/outreachy-ocaml-tiff/</fr:route>
                <fr:title text="Write support in OCaml TIFF library">Write support in OCaml TIFF library</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>I am mentoring <fr:link href="/tambe-salome/" title="Tambe Salome" uri="https://patrick.sirref.org/tambe-salome/" display-uri="tambe-salome" type="local">Tambe Salome</fr:link> during the December 2025 Outreachy round to add support for writing TIFF files in the <fr:link href="/ocaml-tiff/" title="ocaml-tiff" uri="https://patrick.sirref.org/ocaml-tiff/" display-uri="ocaml-tiff" type="local">ocaml-tiff</fr:link> library.</html:p>
                <html:p>You can now see the video of the demonstration day presentation:</html:p>
                <html:div style="text-align: center">
<html:iframe title="Outreachy Demo Day December 2025 Round" width="560" height="315" src="https://watch.ocaml.org/videos/embed/8aUqMhFvhQGq4WJLH3ukjA?start=1h18m33s" frameborder="0" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" />
</html:div>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="true" expanded="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2022</fr:year>
                  <fr:month>12</fr:month>
                  <fr:day>1</fr:day>
                </fr:date>
                <fr:uri>https://patrick.sirref.org/topojson-0001/</fr:uri>
                <fr:display-uri>topojson-0001</fr:display-uri>
                <fr:route>/topojson-0001/</fr:route>
                <fr:title text="Implement a non-blocking, streaming codec for TopoJSON">Implement a non-blocking, streaming codec for TopoJSON</fr:title>
                <fr:meta name="external">https://github.com/geocaml/ocaml-geojson</fr:meta>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>GeoJSON is a JSON standardised format for handling simple geographical data. One common use of GeoJSON is to add map overlays such as with the popular JavaScript library leaflet. One issue with GeoJSON is redundant data, for example when two polygons share boundaries ideally only one would contain the full data about the boundary, however, with GeoJSON the data is duplicated.</html:p>
                <html:p>TopoJSON is an extension to GeoJSON to encode topology. This allows for redundant data to be removed and file sizes to be greatly reduced. This is often very desirable especially when working with data in the browser. In a previous Outreachy internship a new OCaml library was implemented to provide an OCaml library for TopoJSON, this project will build on this adding more functionality to the library and providing a non-blocking, streaming codec version similar to the geojsone library.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="true" expanded="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2022</fr:year>
                  <fr:month>6</fr:month>
                  <fr:day>1</fr:day>
                </fr:date>
                <fr:uri>https://patrick.sirref.org/topojson-0002/</fr:uri>
                <fr:display-uri>topojson-0002</fr:display-uri>
                <fr:route>/topojson-0002/</fr:route>
                <fr:title text="Extend OCaml's GeoJSON library to support TopoJSON">Extend OCaml's GeoJSON library to support TopoJSON</fr:title>
                <fr:meta name="external">https://github.com/geocaml/ocaml-geojson</fr:meta>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>GeoJSON is a JSON standardised format for handling simple geographical data. One common use of GeoJSON is to add map overlays such as with the popular JavaScript library leaflet. One issue with GeoJSON is redundant data, for example when two polygons share boundaries ideally only one would contain the full data about the boundary, however, with GeoJSON the data is duplicated.</html:p>
                <html:p>TopoJSON is an extension to GeoJSON to encode topology. This allows for redundant data to be removed and file sizes to be greatly reduced. This is often very desirable especially when working with data in the browser. In a previous Outreachy internship a new OCaml library was implemented to provide an OCaml library for TopoJSON, this project will build on this adding more functionality to the library and providing a non-blocking, streaming codec version similar to the geojsone library.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="true" expanded="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2021</fr:year>
                  <fr:month>6</fr:month>
                  <fr:day>1</fr:day>
                </fr:date>
                <fr:uri>https://patrick.sirref.org/ocamlorg-0001/</fr:uri>
                <fr:display-uri>ocamlorg-0001</fr:display-uri>
                <fr:route>/ocamlorg-0001/</fr:route>
                <fr:title text="Improve the ocaml.org Website">Improve the ocaml.org Website</fr:title>
                <fr:meta name="external">https://ocaml.org</fr:meta>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>OCaml.org is the main website for OCaml, a functional, typed, high-level programming language. This project revolves around improving the website on multiple different fronts including: layout, accessibility and content.</html:p>
                <html:p>Because a lot of the content of the website is about OCaml and the website itself is written in OCaml, this would be a great opportunity for interns to learn the language and functional programming concepts.</html:p>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://patrick.sirref.org/ryangibb/</fr:uri>
            <fr:display-uri>ryangibb</fr:display-uri>
            <fr:route>/ryangibb/</fr:route>
            <fr:title text="Ryan Gibb">Ryan Gibb</fr:title>
            <fr:meta name="postion">PhD Student and Nix Guru</fr:meta>
            <fr:meta name="external">https://ryan.freumh.org</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Fellow <fr:link href="https://github.com/fn06" type="external">FN06</fr:link> hacker.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://patrick.sirref.org/ucam/</fr:uri>
            <fr:display-uri>ucam</fr:display-uri>
            <fr:route>/ucam/</fr:route>
            <fr:title text="University of Cambridge">University of Cambridge</fr:title>
            <fr:taxon>institution</fr:taxon>
            <fr:meta name="external">https://www.cam.ac.uk/</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Contributions">Contributions</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
  </fr:backmatter>
</fr:tree>
