Experimenting with OCaml and eBPF February 15, 2025Building on top of the excellent book BPF Performance Tools by Brendan Gregg. How can we apply the techniques from Chapter 12 Languages to OCaml? First OCaml is roughly equivalent to C, it’s a compiled language with a runtime written in C. It supports frame pointers using the --enable-frame-pointers configuration option on x86_64, with ARM64 support in OCaml 5.4. Eventually the code we’re interested in is C or looks roughly like C but wit...| Perpetually Curious Blog
Building OCaml from assembly August 30, 2024At work I’ve been focusing on improving the debugging experience with OCaml. As part of that I’ve discovered how some of the pieces fit together, that might be obvious in retrospect, but are interesting to at least me so I’m going to post details about them here. The first nugget is you can hand compile an OCaml program into a final executable. What do I mean? You can ask the OCaml compiler to output all the assembly generated that goes into a...| Perpetually Curious Blog
Getting Started with LLDB on OCaml August 3, 2024This post is a companion to KC’s excellent Getting Started with GDB on OCaml that shows how to debug OCaml programs with GDB. I wanted to demonstrate the same functionality using LLDB on Linux ARM64. The aim is to show the beginnings of debugging OCaml programs with LLDB and highlight a few LLDB tricks I’ve found. We will start with the same program: (* fib.ml *)letrec fib n =if n = 0then0elseif n = 1then1else fib (n-1) + fib (n-2)let main ...| Perpetually Curious Blog
Debugging OCaml with Emacs March 25, 2024This post started as a summary of my March Hacking Days effort at Tarides. I have been working on improving the debugging situation for OCaml and wanted to see how easily I could setup debug support in Emacs using DAP. Debug Adapter Protocol (DAP) is a wire protocol for communicating between an editor or IDE and a debug server like LLDB or GDB, providing an abstraction over debugging, similar to how Language Server Protocol (LSP) provides language supp...| Perpetually Curious Blog
ICFP 2022 Review October 11, 2022I wrote up a highlights of ICFP 2022 for the Tarides blog. It was great to get back to in-person conferences again and getting the chance to meet people. Thanks to my employer Tarides for covering the cost. For me personally the OCaml Workshop was fantastic beginning to end, read the blog post for the full details. Outside of OCaml I spent time in the Haskell Implementors Workshop, hearing about the new features for GHC and excited by the progress that Cabal i...| Perpetually Curious Blog
OCaml with Emacs in 2022 September 7, 2022I am revisiting my OCaml setup post from 2021 because I needed to setup a new macOS machine. The official OCaml site points newcomers to Visual Studio Code which is a fine choice to get started. However I am using Emacs and have done so for over 20 years, and did not find a good description of how to set things up with Emacs. Here I could digress into why Emacs but I will just strongly encourage any developers to invest heavily in learning their edito...| Perpetually Curious Blog
Getting Started with OCaml in 2021 October 29, 2021OCaml is an awesome language with many fine features. I enjoy using it immensely! Unfortunately, it suffers from a perceived weakness in how to get started. Like any new skill, there can be a learning curve. The tools are all there, but combining them for a good developer experience might seem difficult at first. Often I’ve found that the barrier for getting into a new langauge is less about the new features of that language and more about ...| Perpetually Curious Blog
Hakyll Blog setup August 27, 2021I wanted to port my blog across from an old Jeykll setup to Haykll. The Jekyll was out of date and keeping the required ruby tools installed when I swapped machines was a huge pain. I don’t write ruby much anymore. Considering my options, I looked at Hugo and Hakyll, discarding Hugo because I don’t want to keep up with the JS churn, even though they have lots of great resources and themes available. So Hakyll seems like the best option. I already regularil...| Perpetually Curious Blog
OCaml CI with CircleCI| lambdafoo.com
Why do frame pointers matter for OCaml?| lambdafoo.com