Blog
The OCaml Planet RSS
Articles and videos contributed by both experts, companies and passionate developers from the OCaml community. From in-depth technical articles, project highlights, community news, or insights into Open Source projects, the OCaml Planet RSS feed aggregator has something for everyone.
Want your Blog Posts or Videos to Show Here?
To contribute a blog post, or add your RSS feed, check out the Contributing Guide on GitHub.
Overall, I enjoy bug-hunting. Getting there can be really quite tortuous, via the fairly typical “oh my goodness, why do I do this?”, but there’s something inordinately satisfying about arriving at a complete and convincing explanation not only for what is going wrong but also for why it was only sometimes wrong. I find the satisfaction is in inverse proportion to the size of the fix then required: the best of these fixes have pages of explanation followed by a miniscule diff. A couple of old personal scalps of mine include the path from a random failure in a debugger test (see ocaml/ocaml#9043) only seen with specific-code-alignment-on-one-CI-worker to a missing GC root registration fixed in ocaml/ocaml#9051 (and which I’d allowed to become masked in the past by automatically allowing re-running ‘unstable’ tests in ocaml/ocaml#401; a technique I’d strongly recommend never using again!) and the relationship between Unix.fork only failing on every other invocation in the OCaml REPL on Cygwin, and an unstable topological sort (see cygwin/cygwin#226f694). My personal favourite is not mine, though, which is the wonderful alignment of compiler planets required in ocaml/ocaml#10071. Obligatory xkcd.
Over the weekend, I decided to extend my Box tool to incorporate file upload. There is a straightforward POST API for this with a curl one-liner given in the Box documentation. Easy.
OCaml is famous for allow you to do a lot of things like modules. Like really a lot! Advanced features like functors, aside, it’s really common to either alias module names to something shorter or localize open Module_name to a smaller scope:
In my previous article I mentioned that OCaml’s Stdlib leaves a lot to be desire when it comes to regular expressions. One thing I didn’t discuss back then was that the problem is somewhat mitigated by the excellent module Scanf, which makes it easy to parse structured data.
One of the things that bothered me initially in OCaml was the poor support for working in regular expressions in the standard library. Technically speaking, there’s no support for them at all!
