Thicket data repository for the EEG
at main 3.5 kB view raw
1{ 2 "id": "https://lucasma8795.github.io/blog/2025/07/18/effects-scheduling-w03", 3 "title": "Effects-based scheduling for the OCaml compiler - w03", 4 "link": "https://lucasma8795.github.io/blog/2025/07/18/effects-scheduling-w03.html", 5 "updated": "2025-07-18T08:00:00", 6 "published": "2025-07-18T08:00:00", 7 "summary": "This week was an extension of last week\u2019s work, where I took my success of building ocamlc with the modified compiler and started to build the rest of the executables that made up the OCaml installation. Ideally, I want to replicate the behaviour of make world &amp;&amp; make install, which builds everything necessary for a complete OCaml installation, including the compiler, the standard library, and the tools that come with it (e.g.: ocamlc, ocamlopt, ocamldep, etc.), and installs it in some directory. To make the entire build process reproducible, I made a shell script that does all the above. Since I have the compiler find all the dependencies of the .ml files, I can drop all the .mli files in the recipe and have it find them on-the-fly. Having to pull out all the relevant parts from the Makefile was quite the tedious process, but the end of the week I had it all up and working, and a quick diff between a clean OCaml installation and an installation from my script verifies this:", 8 "content": "<p>This week was an extension of last week\u2019s work, where I took my success of building <code>ocamlc</code> with the modified compiler and started to build the rest of the executables that made up the OCaml installation. Ideally, I want to replicate the behaviour of <code>make world &amp;&amp; make install</code>, which builds everything necessary for a complete OCaml installation, including the compiler, the standard library, and the tools that come with it (e.g.: <code>ocamlc</code>, <code>ocamlopt</code>, <code>ocamldep</code>, etc.), and installs it in some directory. To make the entire build process reproducible, I made a shell script that does all the above. Since I have the compiler find all the dependencies of the <code>.ml</code> files, I can drop all the <code>.mli</code> files in the recipe and have it find them on-the-fly. Having to pull out all the relevant parts from the <code>Makefile</code> was quite the tedious process, but the end of the week I had it all up and working, and a quick <code>diff</code> between a clean OCaml installation and an installation from my script verifies this:</p>\n\n<div><div><pre><code>\u279c diff ./Documents/cambridge/urop/ocaml/install ./Github/ocaml/install <span>-qr</span> | <span>grep</span> <span>\"Only in\"</span>\nOnly <span>in</span> ./Documents/cambridge/urop/ocaml/install/lib/ocaml/compiler-libs: handler_common.cmi\nOnly <span>in</span> ./Documents/cambridge/urop/ocaml/install/lib/ocaml/compiler-libs: handler_common.cmt\nOnly <span>in</span> ./Documents/cambridge/urop/ocaml/install/lib/ocaml/compiler-libs: handler_common.cmti\nOnly <span>in</span> ./Documents/cambridge/urop/ocaml/install/lib/ocaml/compiler-libs: handler_common.mli\n</code></pre></div></div>\n\n<p><code>handler_common.ml</code> is the only new file that I have added to the compiler so far, which installs the effect handler to the entry point of the compiler, so it makes sense that it appears in the diff.</p>", 9 "content_type": "html", 10 "author": { 11 "name": "", 12 "email": null, 13 "uri": null 14 }, 15 "categories": [ 16 "ocaml-effects-scheduling" 17 ], 18 "source": "https://lucasma8795.github.io/blog/feed/ocaml-effects-scheduling.xml" 19}