Jan Midtgaard's Avatar

Jan Midtgaard

@janmidtgaard

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

66
Followers
77
Following
37
Posts
04.12.2024
Joined
Posts Following

Latest posts by Jan Midtgaard @janmidtgaard

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...

types.pl/@jmid/115253...

23.09.2025 13:03 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
"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."

"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."

I think a lot about what Carl Sagan said in one of his final interviews.

04.05.2025 06:21 ๐Ÿ‘ 18519 ๐Ÿ” 6302 ๐Ÿ’ฌ 247 ๐Ÿ“Œ 277

Congratulations Prof. Ron! ๐Ÿ˜ƒ๐Ÿ‘

02.07.2025 08:47 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Post image

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...

24.06.2025 08:57 ๐Ÿ‘ 34 ๐Ÿ” 7 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
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...

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...

08.05.2025 08:39 ๐Ÿ‘ 2 ๐Ÿ” 1 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Post image

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

08.05.2025 08:38 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0
Preview
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.

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...

07.05.2025 00:13 ๐Ÿ‘ 1932 ๐Ÿ” 711 ๐Ÿ’ฌ 113 ๐Ÿ“Œ 66
Preview
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...

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...

06.05.2025 21:22 ๐Ÿ‘ 12 ๐Ÿ” 4 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Elm test distributions โ€ฆin which Iโ€™ll tell you how you can make sure your property based tests are testing the interesting cases.

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...

01.05.2025 13:10 ๐Ÿ‘ 9 ๐Ÿ” 5 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 1
Video thumbnail

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.

07.04.2025 20:06 ๐Ÿ‘ 26 ๐Ÿ” 6 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 3
Compiler The materials for the course on compilers: built incrementally and fully in tagless-final style

๐Ÿ‘€ Oleg Kiselyov's compilers course in OCaml ๐Ÿ‘€

okmij.org/ftp/tagless-...

05.04.2025 06:14 ๐Ÿ‘ 39 ๐Ÿ” 16 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
CI log error message that has a red cross and the text "pyml.20210924 (failed: Great)"

CI log error message that has a red cross and the text "pyml.20210924 (failed: Great)"

...and the award for best exception name showing up in an opam-repo CI run goes to... ๐Ÿ†๐Ÿ˜„

04.04.2025 08:30 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
The Value of Open Source Software - Working Paper - Faculty & Research - Harvard Business School

โ‰ช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

26.03.2025 08:16 ๐Ÿ‘ 1 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 1
Post image

Just... have... to drop this... here.

24.03.2025 01:34 ๐Ÿ‘ 6 ๐Ÿ” 2 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
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...

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! ๐Ÿ˜„

23.03.2025 16:12 ๐Ÿ‘ 4 ๐Ÿ” 2 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Post image

If all goes well, OCaml 5 code will ride into space in < 24 hrs.

www.dphispace.com/post/parsimo...

14.03.2025 08:03 ๐Ÿ‘ 56 ๐Ÿ” 12 ๐Ÿ’ฌ 5 ๐Ÿ“Œ 2
Preview
Semgrep | Upgrading Semgrep from OCaml 4 to OCaml 5

> 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... ๐Ÿค“

12.03.2025 20:25 ๐Ÿ‘ 10 ๐Ÿ” 4 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Post image

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-...

10.03.2025 04:18 ๐Ÿ‘ 25 ๐Ÿ” 9 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
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

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?

05.03.2025 21:36 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 0
Preview
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.

Which libraries is your (minimal) example using?

Are you perhaps using caqti-driver-postgresql?

Also, which versions of the libraries are you using?

05.03.2025 21:31 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
opam-health-check

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

05.03.2025 16:37 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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.

05.03.2025 16:29 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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.

05.03.2025 16:19 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
OCaml on Windows ยท OCaml Documentation Read about the state of OCaml on Windows and our roadmap to improve Windows support.

Yep ๐Ÿ‘ How did you install OCaml under Windows?

ocaml.org/docs/ocaml-o... lists some of the variants I mentioned above.

04.03.2025 20:28 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

For the latter I would probably use the `nm` tool on Linux.

04.03.2025 19:12 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

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?

04.03.2025 19:10 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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...

04.03.2025 18:59 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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?

04.03.2025 18:56 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 0

Finally - Relocatable OCaml in โ€œfully relocatableโ€ mode is also reproducible (as long as the C compiler is reproducible) and passes its testsuite ๐Ÿ˜ฎโ€๐Ÿ’จ๐Ÿฅณ๐ŸŽ‰๐Ÿพ๐ŸŽŠ

01.03.2025 17:10 ๐Ÿ‘ 48 ๐Ÿ” 9 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 0
Preview
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.

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...

24.02.2025 08:41 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0