<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: ocaml</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/ocaml.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2025-12-17T23:23:35+00:00</updated><author><name>Simon Willison</name></author><entry><title>AoAH Day 15: Porting a complete HTML5 parser and browser test suite</title><link href="https://simonwillison.net/2025/Dec/17/vibespiling/#atom-tag" rel="alternate"/><published>2025-12-17T23:23:35+00:00</published><updated>2025-12-17T23:23:35+00:00</updated><id>https://simonwillison.net/2025/Dec/17/vibespiling/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://anil.recoil.org/notes/aoah-2025-15"&gt;AoAH Day 15: Porting a complete HTML5 parser and browser test suite&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Anil Madhavapeddy is running an &lt;a href="https://anil.recoil.org/notes/aoah-2025"&gt;Advent of Agentic Humps&lt;/a&gt; this year, building a new useful OCaml library every day for most of December.&lt;/p&gt;
&lt;p&gt;Inspired by Emil Stenström's &lt;a href="https://simonwillison.net/2025/Dec/14/justhtml/"&gt;JustHTML&lt;/a&gt; and my own coding agent &lt;a href="https://simonwillison.net/2025/Dec/15/porting-justhtml/"&gt;port of that to JavaScript&lt;/a&gt; he coined the term &lt;strong&gt;vibespiling&lt;/strong&gt; for AI-powered porting and transpiling of code from one language to another and had a go at building an HTML5 parser in OCaml, resulting in &lt;a href="https://tangled.org/anil.recoil.org/ocaml-html5rw"&gt;html5rw&lt;/a&gt; which passes the same &lt;a href="https://github.com/html5lib/html5lib-tests"&gt;html5lib-tests&lt;/a&gt; suite that Emil and myself used for our projects.&lt;/p&gt;
&lt;p&gt;Anil's thoughts on the copyright and ethical aspects of this are worth quoting in full:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The question of copyright and licensing is difficult. I definitely did &lt;em&gt;some&lt;/em&gt; editing by hand, and a fair bit of prompting that resulted in targeted code edits, but the vast amount of architectural logic came from JustHTML. So I opted to make the &lt;a href="https://tangled.org/anil.recoil.org/ocaml-html5rw/blob/main/LICENSE.md"&gt;LICENSE a joint one&lt;/a&gt; with &lt;a href="https://friendlybit.com"&gt;Emil Stenström&lt;/a&gt;. I did not follow the transitive dependency through to the Rust one, which I probably should.&lt;/p&gt;
&lt;p&gt;I'm also extremely uncertain about every releasing this library to the central opam repository, especially as there are &lt;a href="https://github.com/aantron/lambdasoup"&gt;excellent HTML5 parsers&lt;/a&gt; already available. I haven't checked if those pass the HTML5 test suite, because this is wandering into the agents &lt;em&gt;vs&lt;/em&gt; humans territory that I ruled out in my &lt;a href="https://anil.recoil.org/notes/aoah-2025#groundrules-for-the-advent-of-agentic-humps"&gt;groundrules&lt;/a&gt;. Whether or not this agentic code is better or not is a moot point if releasing it drives away the human maintainers who are the source of creativity in the code!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I decided to &lt;a href="https://github.com/simonw/justjshtml/commit/106289acee29045cc5afe9732915357063dfc37a"&gt;credit Emil in the same way&lt;/a&gt; for my own vibespiled project.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/avsm/status/2000979482744607216"&gt;@avsm&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/definitions"&gt;definitions&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/functional-programming"&gt;functional-programming&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai"&gt;ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generative-ai"&gt;generative-ai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/llms"&gt;llms&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai-assisted-programming"&gt;ai-assisted-programming&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ai-ethics"&gt;ai-ethics&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/vibe-coding"&gt;vibe-coding&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ocaml"&gt;ocaml&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/vibe-porting"&gt;vibe-porting&lt;/a&gt;&lt;/p&gt;



</summary><category term="definitions"/><category term="functional-programming"/><category term="ai"/><category term="generative-ai"/><category term="llms"/><category term="ai-assisted-programming"/><category term="ai-ethics"/><category term="vibe-coding"/><category term="ocaml"/><category term="vibe-porting"/></entry><entry><title>Comby</title><link href="https://simonwillison.net/2022/May/18/comby/#atom-tag" rel="alternate"/><published>2022-05-18T05:47:24+00:00</published><updated>2022-05-18T05:47:24+00:00</updated><id>https://simonwillison.net/2022/May/18/comby/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://comby.dev/"&gt;Comby&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Describes itself as “Structural search and replace for any language”. Lets you execute search and replace patterns that look a little bit like simplified regular expressions, but with some deep OCaml-powered magic that makes them aware of comment, string and nested parenthesis rules for different languages. This means you can use it to construct scripts that automate common refactoring or code upgrade tasks.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=31413533"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/parsing"&gt;parsing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/refactoring"&gt;refactoring&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ocaml"&gt;ocaml&lt;/a&gt;&lt;/p&gt;



</summary><category term="parsing"/><category term="refactoring"/><category term="ocaml"/></entry><entry><title>Pyre: Fast Type Checking for Python</title><link href="https://simonwillison.net/2018/May/11/pyre/#atom-tag" rel="alternate"/><published>2018-05-11T17:47:26+00:00</published><updated>2018-05-11T17:47:26+00:00</updated><id>https://simonwillison.net/2018/May/11/pyre/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.facebook.com/notes/protect-the-graph/pyre-fast-type-checking-for-python/2048520695388071/"&gt;Pyre: Fast Type Checking for Python&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Facebook’s alternative to mypy. “Pyre is designed to be highly parallel, optimizing for near-instant responses so that you get immediate feedback, even in a large codebase”. Like their Hack type checker for PHP, Pyre is implemented in OCaml.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=17048446"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/facebook"&gt;facebook&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/static-typing"&gt;static-typing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mypy"&gt;mypy&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ocaml"&gt;ocaml&lt;/a&gt;&lt;/p&gt;



</summary><category term="facebook"/><category term="python"/><category term="static-typing"/><category term="mypy"/><category term="ocaml"/></entry><entry><title>Module Pycaml</title><link href="https://simonwillison.net/2006/Aug/3/module/#atom-tag" rel="alternate"/><published>2006-08-03T19:46:18+00:00</published><updated>2006-08-03T19:46:18+00:00</updated><id>https://simonwillison.net/2006/Aug/3/module/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://pycaml.sourceforge.net/"&gt;Module Pycaml&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Integration between Python native libraries and OCaml.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_29.shtml"&gt;The Voidspace Techie Blog&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ocaml"&gt;ocaml&lt;/a&gt;&lt;/p&gt;



</summary><category term="ocaml"/></entry></feed>