Sign in

Jan Midtgaard

@janmidtgaard.bsky.social
69 followers 77 following 37 posts

Recovering academic. Occasionally hacks OCaml and property-based testing, manufacturing bad luck on an industrial scale. Mastodon account: types.pl/@jmid

PostsRepliesMedia
Jan Midtgaard @janmidtgaard.bsky.social · 23/09/2025
types.pl/@jmid/115253...
types.pl
Jan Midtgaard (@jmid@types.pl)
Here's a preprint of the paper I wrote up for Olivier's festscrift 🎉 🍾 Property-Based Testing of OCaml 5's Runtime System: Fun and Segfaults with Interpreters and State Transition Functions We desc...
010
Reposted by Jan Midtgaard
David Ho @davidho.bsky.social · 04/05/2025
I think a lot about what Carl Sagan said in one of his final interviews.
"WE'VE ARRANGED A society based on science and technology, in which nobody understands anything about science technology. And this combustible mixture of ignorance and power, sooner or later, is going to blow up in our faces. Who is running the science and technology in a democracy if the people don't know anything about it?"
"Science is more than a body of knowledge, it's a way of thinking. A way of skeptically interrogating the universe with a fine understanding of human fallibility. If we are not able to ask skeptical questions, to interrogate those who tell us that something is true, to be skeptical of those in authority, then we're up for grabs for the next charlatan, political or religious, who comes ambling along."
246188206426
Jan Midtgaard @janmidtgaard.bsky.social · 02/07/2025
Congratulations Prof. Ron! 😃👏
110
Reposted by Jan Midtgaard
Yaron Minsky @yminsky.bsky.social · 24/06/2025
A gem from Stephen Dolan, which proposes replacing the "generational hypothesis" that drives the design of generational GCs with a notion of lifetime dispersion as measured by the gini coefficient. Nice to see economics playing a role here! dl.acm.org/doi/pdf/10.1...
1347
Jan Midtgaard @janmidtgaard.bsky.social · 08/05/2025
Good stuff (of course there's property-based testing involved! 🤓) and a very nice collaboration with past @tarides.com summer interns and colleagues. The paper is even open access for your reading pleasure: link.springer.com/chapter/10.1...
link.springer.com
Dynamic Verification of OCaml Software with Gospel and Ortac/QCheck-STM
This paper introduces the QCheck-STM plugin for Ortac, a framework for dynamic verification of OCaml code. Ortac/QCheck-STM consumes OCaml module signatures annotated with behavioural specification co...
121
Jan Midtgaard @janmidtgaard.bsky.social · 08/05/2025
Last night it was announced that our TACAS-paper 'Dynamic Verification of OCaml Software with Gospel and Ortac/QCheck-STM' co-authored with Nikolaus Huber, Naomi Spargo, Nicolas Osborne, and Samuel Hym won the 2025 @etapsconf.bsky.social's Best Tool Paper Award 🎉 #testing #pbt #award
220
Reposted by Jan Midtgaard
Noah Shachtman @noahshachtman.bsky.social · 07/05/2025
There are people I know in the national security community who are terrified that the US government is sleepwalking into a 9/11-level catastrophe. Focusing finite resources on nonsense like this instead of credible threats -- that is the reason they're so worried. www.wsj.com/world/greenl...
wsj.com
Exclusive | U.S. Orders Intelligence Agencies to Step Up Spying on Greenland
The push underscores the seriousness of President Trump’s intent to acquire the island from Denmark.
1111922706
Reposted by Jan Midtgaard
Anil Madhavapeddy @anil.recoil.org · 06/05/2025
Oooh, MirageOS+unikraft PR has appeared from @tarides.com, which should allow much easier deployment of OCaml code to the @unikraft.cloud ! github.com/ocaml/opam-r...
github.com
Publish OCaml/Unikraft packages v1.0.0 by shym · Pull Request #27856 · ocaml/opam-repository
OCaml/Unikraft: an OCaml cross compiler to Unikraft backends OCaml/Unikraft is structured into many packages to allow users to build only what they need. Packages use one of two version numbers: 0...
0124
Reposted by Jan Midtgaard
Martin Janiczek @janiczek.cz · 01/05/2025
A blogpost I wrote on elm-test's Test.Distribution - testing whether your fuzzers generate interesting cases often enough! martin.janiczek.cz/2025/05/01/e...
martin.janiczek.cz
Elm test distributions
…in which I’ll tell you how you can make sure your property based tests are testing the interesting cases.
095
Reposted by Jan Midtgaard
Gro-Tsen @gro-tsen.bsky.social · 07/04/2025
This video was posted on Twitter by the official account of the People's Republic of China's embassy in the United States. The Chinese Communist Party is lecturing the US Republican President by using a Reagan speech on the importance of free trade. We are really living in the Weird timeline.
0266
Reposted by Jan Midtgaard
KC Sivaramakrishnan @kcsrk.info · 05/04/2025
👀 Oleg Kiselyov's compilers course in OCaml 👀 okmij.org/ftp/tagless-...
okmij.org
Compiler
The materials for the course on compilers: built incrementally and fully in tagless-final style
03916
Jan Midtgaard @janmidtgaard.bsky.social · 04/04/2025
...and the award for best exception name showing up in an opam-repo CI run goes to... 🏆😄
CI log error message that has a red cross and the text "pyml.20210924 (failed: Great)"
020
Reposted by Jan Midtgaard
Marcello Seri @mseri.me · 26/03/2025
≪We estimate the supply-side value of widely-used OSS is $4.15 billion, but that the demand-side value is much larger at $8.8 trillion. We find that firms would need to spend 3.5 times more on software than they currently do if OSS did not exist.≫ From www.hbs.edu/faculty/Page... #opensource
hbs.edu
The Value of Open Source Software - Working Paper - Faculty & Research - Harvard Business School
011
Reposted by Jan Midtgaard
New Nomads @new-nomads.com · 24/03/2025
Just... have... to drop this... here.
062
Jan Midtgaard @janmidtgaard.bsky.social · 23/03/2025
Scratching another old itch, I've utilized a wonderful hack by @edwintorok.bsky.social to get the Thread-modes of Lin and STM working much better 🤓 github.com/ocaml-multic... (as in: from defunct to decent) It even works on OCaml 4 too! 😄
github.com
Improve context switching chance in `Lin_thread` and `STM_thread` modes by jmid · Pull Request #540 · ocaml-multicore/multicoretests
This fixes #338 - or at least gives it a good kick in the right direction. Both Lin_thread and STM_thread are currently marked as experimental - and for good reason: The chance of them triggering u...
042
Reposted by Jan Midtgaard
KC Sivaramakrishnan @kcsrk.info · 14/03/2025
If all goes well, OCaml 5 code will ride into space in < 24 hrs. www.dphispace.com/post/parsimo...
55612
Jan Midtgaard @janmidtgaard.bsky.social · 12/03/2025
> We have been using OCaml 5 in production since the middle of February 2025, and the rollout has been entirely uneventful. This was a highlight for me, after having worked to stress test it over the past ~3 years. There are other nuggets in @semgrep.bsky.social's latest blog post though... 🤓
semgrep.dev
Semgrep | Upgrading Semgrep from OCaml 4 to OCaml 5
0104
Reposted by Jan Midtgaard
KC Sivaramakrishnan @kcsrk.info · 10/03/2025
Great work from @tarides.com folks on pragmatic verification of OCaml software. Chosen as one of the distinguished papers at TACAS 2025. Paper: janmidtgaard.dk/papers/Huber... Code: discuss.ocaml.org/t/ann-ortac-...
1259
Jan Midtgaard @janmidtgaard.bsky.social · 05/03/2025
github.com/ocaml/opam-r... uses github.com/ocaml/opam-r... which uses github.com/ocaml/opam-r... which seem to be supported on Windows. The status page is green for one of 4.14 or 5.3 on each. Which OCaml version are you using - you didn't say?
github.com
opam-repository/packages/caqti-driver-postgresql/caqti-driver-postgresql.2.1.2/opam at master · ocaml/opam-repository
Main public package repository for opam, the source package manager of OCaml. - ocaml/opam-repository
300
Jan Midtgaard @janmidtgaard.bsky.social · 05/03/2025
Which libraries is your (minimal) example using? Are you perhaps using caqti-driver-postgresql? Also, which versions of the libraries are you using?
github.com
ocaml-caqti/caqti-driver-postgresql.opam at master · paurkedal/ocaml-caqti
Cooperative-threaded access to relational data. Contribute to paurkedal/ocaml-caqti development by creating an account on GitHub.
100
Jan Midtgaard @janmidtgaard.bsky.social · 05/03/2025
Also: Beware that not all packages may work out of the box on Windows, as they tends to require C code and libraries at some point, and setting that up may require fiddling with conf-* files on the opam repository. Caqti should however run on Windows, it seems from windows.check.ci.dev
windows.check.ci.dev
opam-health-check
100
Jan Midtgaard @janmidtgaard.bsky.social · 05/03/2025
From the error message, it sounds like an error while trying to use postgresql with Caqti. If that's the case, I would try to cut out 'dream' and see if a simple 5-10-line OCaml program can connect with such a database through Caqti.
100
Jan Midtgaard @janmidtgaard.bsky.social · 05/03/2025
OK. If I'm understanding the above page correctly, this means you got a MinGW installation of the compiler (it's the default). It is handy to know, to understand the problem and when searching, e.g., Google or Discuss for someone else with a similar problem.
110
Jan Midtgaard @janmidtgaard.bsky.social · 04/03/2025
Yep 👍 How did you install OCaml under Windows? ocaml.org/docs/ocaml-o... lists some of the variants I mentioned above.
ocaml.org
OCaml on Windows · OCaml Documentation
Read about the state of OCaml on Windows and our roadmap to improve Windows support.
110
Jan Midtgaard @janmidtgaard.bsky.social · 04/03/2025
For the latter I would probably use the `nm` tool on Linux.
000
Jan Midtgaard @janmidtgaard.bsky.social · 04/03/2025
3. You are getting a linking error. This means the compiler(s) translated each file, but failed in the last part stitching them together based on names. Here it fails to resolve a bunch of names listed in the error. Have you checked that the mentioned file(s) exist - and that they contain the names?
110
Jan Midtgaard @janmidtgaard.bsky.social · 04/03/2025
2. You are sharing an error message - but not much about the code that trigger it. Generally it helps to create and share a small reproducer. From such a thing, I sometimes end up figuring out the problem myself...
110
Jan Midtgaard @janmidtgaard.bsky.social · 04/03/2025
I don't have the answer for you, so here's some general advice: 1. Your post is too short on detail. For one, OCaml can run in at last 4 ways on Windows (MinGW, Cygwin, MSVC, WSL, ...). Which one are you using?
310
Reposted by Jan Midtgaard
David Allsopp @dra27.uk · 01/03/2025
Finally - Relocatable OCaml in “fully relocatable” mode is also reproducible (as long as the C compiler is reproducible) and passes its testsuite 😮‍💨🥳🎉🍾🎊
3489
Jan Midtgaard @janmidtgaard.bsky.social · 24/02/2025
Using a tuple-comma with right-to-left evaluation seems a distraction. Is that intentionally or did it get mixed up with the single ; sequence operator? ocaml.org/docs/mutabil...
ocaml.org
Mutability and Imperative Control Flow · OCaml Documentation
Write stateful programs in OCaml. Use for and while loops, if-then-else, mutable record fields, and references.
110
Jan Midtgaard @janmidtgaard.bsky.social · 19/02/2025
OK, but that does something with a worse complexity. In your gist, List.mem is going to take O(n) time, and you are calling it for each row * col. I'm suggesting something like dropping `|> PosSet.of_list` and replacing `PosSet.iter` with `List.iter`, thus taking only 1 pass over the list 🙂
200
Jan Midtgaard @janmidtgaard.bsky.social · 19/02/2025
After a quick look at that code, you seem to only use PosSet in part2, where the set is represented as a list, then transformed into a set only to iterate over it. Unless this is a bottleneck, I would probably just keep the list as is and iterate over that directly... 🤔🤷
200
Jan Midtgaard @janmidtgaard.bsky.social · 19/02/2025
If your use case is something involving integers, you might consider Patricia trees, a functional and fast bit-walking trie-like data structure: github.com/backtracking... codex.top/api/patricia...
github.com
GitHub - backtracking/ptset: Integer set implementation using Patricia trees
Integer set implementation using Patricia trees. Contribute to backtracking/ptset development by creating an account on GitHub.
200
Jan Midtgaard @janmidtgaard.bsky.social · 19/02/2025
In OCaml's Stdlib sets are represented as balanced search trees: github.com/ocaml/ocaml/... The answer is therefore "it depends". For many uses assuming no/few collisions hashtables are going to be fast. Worst case, however probing may end up spending O(n) time. Sets offer a worst case of O(log n).
github.com
ocaml/stdlib/set.ml at trunk · ocaml/ocaml
The core OCaml system: compilers, runtime system, base libraries - ocaml/ocaml
110
Jan Midtgaard @janmidtgaard.bsky.social · 18/02/2025
Thanks for the kind words Sabine 🙏☺️
020
Jan Midtgaard @janmidtgaard.bsky.social · 18/02/2025
The future is still up in the air. I've been taking a break to hack on a couple of open source things and to go skiing with the family over the winter holidays. ⛷️ Feel free to shoot me a PM if you want to meet, catch up, and chat over a coffee ☕ 🙂
140
Jan Midtgaard @janmidtgaard.bsky.social · 18/02/2025
Dear all After a bit over 3 years my contract with Tarides has come to an end. It has been great - working with and being team lead for an exceptional group of software engineers and - applying my property-based testing skills to stress test and help get the multicore OCaml5 runtime+stdlib in shape.
2142
Jan Midtgaard @janmidtgaard.bsky.social · 14/02/2025
Raphaël Monat has a PhD position open to work on static analysis with him at Inria in Lille 🙂 recrutement.inria.fr/public/class... #phd-position #abstract-interpretation #static-analysis #ocaml
recrutement.inria.fr
PhD Position F/M Resource-Aware Conservative Static Analysis
Offre d'emploi Inria
040
Jan Midtgaard @janmidtgaard.bsky.social · 06/02/2025
Beautiful morning in Aarhus for a morning dip with 4C water and 3C air ☀️🌊🤓
A bright February sunrise over a point where the sea meets a slim sand beach with a forest of naked trees close by.
030
Jan Midtgaard @janmidtgaard.bsky.social · 05/02/2025
QCheck(2) hacking continues: 💻 github.com/c-cube/qchec... Replacing an RNG split hack with faster, gastly Obj.magic one, QCheck2 on OCaml 4 starts to work reasonably 🤓 #ocaml #quickcheck #pbt
030
Reposted by Jan Midtgaard
ading.dev @ading.dev · 31/01/2025
I got Linux running in a PDF file using a RISC-V emulator. PDFs support Javascript, so Emscripten is used to compile the TinyEMU emulator to asm.js, which runs in the PDF. It boots in about 30 seconds and emulates a riscv32 buildroot system. linux.doompdf.dev/linux.pdf github.com/ading2210/li...
12311129
Jan Midtgaard @janmidtgaard.bsky.social · 31/01/2025
Over the past couple of days, I've been scratching a 3-year old QCheck(2) itch github.com/c-cube/qchec... It's nice to finally make progress on it! 😃 #ocaml #quickcheck #pbt #fp
github.com
QCheck2 shrinker improvements to list, array, bytes, strings, and functions by jmid · Pull Request #319 · c-cube/qcheck
This PR takes a first step towards improving the QCheck2 list shrinker. The current one uses the input size tree and offers only prefixes, e.g., shrinking [1;2;3;4;5;6;7;8] to [], [1;2;3;4], [1;2;3...
010
Reposted by Jan Midtgaard
Brian Phillips @brianphillips.lol · 30/01/2025
If you wanted no leaks you should have gone into Settings -> Security -> Configure privacy & security -> Privacy options -> Other -> Configure -> Media interface and clicked “Disallow.” The Leak setting is on by default but we understand your privacy is important so we’ve made it easy to opt out
824315335438
Reposted by Jan Midtgaard
Yaron Minsky @yminsky.bsky.social · 30/01/2025
A post about the long and winding road that lead to the Dune build system for OCaml, and, eventually, to Dune replacing our old internal build system, Jenga. blog.janestreet.com/how-we-accid...
blog.janestreet.com
How we accidentally built a better build system for OCaml
A “build system” is one of the most important tools in a developer’stoolbox. Roughly, it figures out how to create runnable programs froma bunch of different...
1438
Jan Midtgaard @janmidtgaard.bsky.social · 23/01/2025
Yep 👍 It reminds me (again) of steps 1 and 2 of this nice, pedagogical paper that I was academically raised with: citeseerx.ist.psu.edu/document?rep... As a result, I tend to just read these as "named in either prefix or postfix notation"... 🤓
citeseerx.ist.psu.edu
010
Jan Midtgaard @janmidtgaard.bsky.social · 23/01/2025
You are however introducing a data dependency, which I believe corresponds to an eta-expansion in a desugared version. These should align: ``` (* Prints hello after world *) let _ = f "hello" () >>= fun u -> f "world" u (* Prints world after hello *) let _ = let* u = f "hello" () in f "world" u ```
100
Jan Midtgaard @janmidtgaard.bsky.social · 23/01/2025
This is just the good old right-to-left evaluation issue surprising for the N+1'th time, isn't it? 🤔 Recall that despite its syntax, >>= is just a 2-argument function call to bind underneath the hood, which are most likely evaluated right-to-left, but with evaluation order technically undefined.
110
Jan Midtgaard @janmidtgaard.bsky.social · 18/01/2025
I don't think so. My friend is more into 3d-printing that FP... He happened to have a fair amount of excess orange ligaments after printing pumpkins for Halloween, and then thought of me 😄
110
Jan Midtgaard @janmidtgaard.bsky.social · 18/01/2025
Yesterday a very good friend gave me this nice box of homemade OCaml coasters, all 3d-printed. Naturally, they were immediately put to good use... 😄🍻 #ocaml #fp
A box with coasters, each with an OCaml-logo camel on them and lying on a white table
381
Reposted by Jan Midtgaard
xvw @xvw.lol · 17/01/2025
I'm really happy to present, with @tarides.com , #OCaml Eglot, an #Emacs (minor) mode for editing OCaml code, using LSP through Eglot, the built-in #LSP client of Emacs: github.com/tarides/ocam... Feedback, contribution and RT much appreciated
github.com
GitHub - tarides/ocaml-eglot: An overlay on Eglot for editing OCaml code using LSP
An overlay on Eglot for editing OCaml code using LSP - tarides/ocaml-eglot
2167