Skip to content

Commit b3b5fb0

Browse files
[scrape.yml] New OCaml Planet blog posts and videos (#3110)
Co-authored-by: cuihtlauac <[email protected]>
1 parent 35a8f9e commit b3b5fb0

File tree

179 files changed

+15163
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+15163
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: A DSL for decentralised identity in OCaml
3+
description:
4+
url: https://anil.recoil.org/ideas/dsl-for-decentralised-id
5+
date: 2022-08-01T00:00:00-00:00
6+
preview_image:
7+
authors:
8+
- Anil Madhavapeddy
9+
source:
10+
---
11+
12+
<h1>A DSL for decentralised identity in OCaml</h1>
13+
<p>This is an idea proposed in 2022 as a Cambridge Computer Science Part II project, and has been <span class="idea-completed">completed</span> by <a href="https://www.linkedin.com/in/michal-mgeladze-arciuch" class="contact">Michał Mgeładze-Arciuch</a>. It was co-supervised with <a href="https://patrick.sirref.org" class="contact">Patrick Ferris</a>.</p>
14+
<p>There are currently multiple identity providers without direct incentives to
15+
cooperate. This leads to many redundant implementations of the identity
16+
handling logic, many of which are not immediately compatible with each other,
17+
leading to additional increases in friction when eventual agreement needs to be
18+
reached to perform user actions. Furthermore, from the perspective of the user
19+
of the identity service, they need to keep track of identity documents from
20+
multiple sources, which leads to more security attack surface.</p>
21+
<p>Solving the problem of partial identity proofs allows for many possible
22+
opportunities. For example, consider a simple May Ball ticketing system in
23+
which every college member gets a discount to their College, but without
24+
revealing their exact identity. Or imagine an e-commerce system, in which every
25+
user could prove their age to be over a given threshold, without revealing any
26+
additional information to the retailer. In the example of a carbon credits
27+
project, we would be able to allow entities associated with any carbon
28+
offsetting project to prove their association, protecting the identity of
29+
whistleblowers.</p>
30+
<p>This project will build a system of Decentralised Digital Identifiers, which
31+
can be used to prove a subset of the information associated with the user’s
32+
identity using cryptographic proofs. Every participant in
33+
the system will have a public-private key pair associated with them. Then any
34+
identity provider P could provide an identity document for Alice, who has a
35+
public key A, by cryptographically signing a message containing both A, to
36+
point to the receiver of this document, and the document itself. Then, whenever
37+
Alice would want to authenticate herself to a service provider S, she could do
38+
so simply by sending the message she received from P to S. Then the service
39+
provider can verify that P, indeed supplied Alice with the given identity
40+
document.</p>
41+
<p>This Part II project was successfully completed but not available online; please
42+
contact the author for a copy of it. <a href="https://www.linkedin.com/in/michal-mgeladze-arciuch" class="contact">Michał Mgeładze-Arciuch</a> has subsequently founded <a href="https://www.czechtradeoffices.com/se/news/czech-startup-yoneda-labs-raises-over-$100-million-to-revolutionize-chemical-reactions-with-ai">Yoneda
43+
Labs to revolutionize chemical
44+
reactions</a>!</p>
45+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: A hardware description language using OCaml effects
3+
description:
4+
url: https://anil.recoil.org/ideas/tracing-hdl-with-effects
5+
date: 2025-03-01T00:00:00-00:00
6+
preview_image:
7+
authors:
8+
- Anil Madhavapeddy
9+
source:
10+
---
11+
12+
<h1>A hardware description language using OCaml effects</h1>
13+
<p>This is an idea proposed in 2025 as a Cambridge Computer Science Part III or MPhil project, and is <span class="idea-available">available</span> for being worked on. It may be co-supervised with <a href="https://kcsrk.info" class="contact">KC Sivaramakrishnan</a> and <a href="https://github.com/andrewray" class="contact">Andy Ray</a>.</p>
14+
<p>Programming FPGAs using functional programming languages is a very good fit for
15+
the problem domain. OCaml has the <a href="https://anil.recoil.org/notes/fpgas-hardcaml">HardCaml ecosystem</a> to
16+
express hardware designs in OCaml, make generic designs using the power of the
17+
language, then simulate designs and convert them to Verilog or VHDL.</p>
18+
<p>HardCaml is very successfully used in production at places like <a href="https://janestreet.com">Jane
19+
Street</a>, but needs quite a lot of prerequisite knowledge
20+
about the full OCaml language. In particular, it makes very heavy use of the <a href="https://github.com/janestreet/hardcaml/blob/master/docs/hardcaml_interfaces.md">module
21+
system</a> in
22+
order to build up the circuit description as an OCaml data structure.</p>
23+
<p>Instead of building up a circuit as the output of the OCaml program, it would
24+
be very cool if we could <em>directly</em> implement the circuit as OCaml code by
25+
evaluating it. This is an approach that works very successfully in the <a href="https://github.com/clash-lang/clash-compiler">Clash
26+
Haskell HDL</a>, as described in this
27+
<a href="https://essay.utwente.nl/59482/1/scriptie_C_Baaij.pdf">thesis</a>. Clash uses a
28+
number of advanced Haskell type-level features to encode fixed-length vectors
29+
(very convenient for hardware description) and has an interactive REPL that
30+
allows for exploration without requiring a separate test bench.</p>
31+
<p>The question for this project is whether the new <a href="https://anil.recoil.org/papers/2021-pldi-retroeff">effect handlers</a>
32+
in OCaml 5.0 might be suitable for using OCaml as a host language for a tracing-style
33+
hardware description language. We would explore several elements using OCaml 5:</p>
34+
<ul>
35+
<li>using effects for control-flow memoisation (see <a href="https://github.com/ocaml-multicore/effects-examples/blob/master/multishot/memo.ml">the example</a>)</li>
36+
<li>restricting arbitrary recursion using effect handlers</li>
37+
<li>ergonomic ways of encoding fixed-length vectors</li>
38+
</ul>
39+
<p>This project will require a deep interest in programming language design and implementation,
40+
and an enthusiasm for learning more about digital hardware. There are quite a few good
41+
<a href="https://anil.recoil.org/ideas/computational-storage-for-vector-dbs">usecases</a> for using heterogenous hardware like FPGAs these days.
42+
There's a great <a href="https://signalsandthreads.com/programmable-hardware/">Signals and Threads episode</a> on
43+
programmable hardware with <a href="https://github.com/andrewray" class="contact">Andy Ray</a> that should give you more useful background knowledge as well.</p>
44+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: An imperative, pure and effective specification language
3+
description:
4+
url: https://anil.recoil.org/ideas/effective-specification-languages
5+
date: 2024-08-01T00:00:00-00:00
6+
preview_image:
7+
authors:
8+
- Anil Madhavapeddy
9+
source:
10+
---
11+
12+
<h1>An imperative, pure and effective specification language</h1>
13+
<p>This is an idea proposed in 2024 as a Cambridge Computer Science Part II project, and is currently <span class="idea-ongoing">being worked on</span> by <a href="mailto:[email protected]" class="contact">Max Smith</a>. It is co-supervised with <a href="https://patrick.sirref.org" class="contact">Patrick Ferris</a>.</p>
14+
<p>Formal specification languages are conventionally rather functional looking,
15+
and not hugely amenable to iterative development. In contrast, real world
16+
specifications for geospatial algorithms tend to developed with "holes" in the
17+
logic which is then filled in by a domain expert as they explore the datasets
18+
through small pieces of exploratory code and visualisations.</p>
19+
<p>This project seeks to investigate the design of a specification language that
20+
<em>looks and feels</em> like Python, but that supports typed holes and the robust
21+
semantic foundations of a typed functional language behind the hood. The
22+
langage would have a Python syntax, with the familiar imperative core, but
23+
translate it into <a href="https://hazel.org">Hazel</a> code behind the scenes.</p>
24+
<p>Another direction to investigate is also translating the same code into OCaml 5,
25+
and use the new effect system to handle IO and mutability in the source language
26+
code. This would allow for multiple interpretations of the program to execute
27+
depending on the context:</p>
28+
<ul>
29+
<li>an interative JavaScript-compiled (or wasm-compiled) tracing version that records variable updates</li>
30+
<li>a high performance version that batches and checkpoints variable updates and deploys parallel execution</li>
31+
</ul>
32+
<h2>Background Reading</h2>
33+
<ul>
34+
<li><a href="https://hazel.org/papers/propl24.pdf">Toward a Live, Rich, Composable, and Collaborative Planetary Compute Engine</a>, PROPL 2024.</li>
35+
<li><a href="https://patrick.sirref.org" class="contact">Patrick Ferris</a>'s first year PhD report (available on request to students interested in this idea).</li>
36+
<li><a href="https://anil.recoil.org/papers/2021-pldi-retroeff">Retrofitting effect handlers onto OCaml</a></li>
37+
</ul>
38+
<h2>Links</h2>
39+
<ul>
40+
<li><a href="https://hazel.org">Hazel</a></li>
41+
</ul>
42+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Analysis of the Raft Consensus Protocol
3+
description:
4+
url: https://anil.recoil.org/ideas/raft-consensus
5+
date: 2012-01-01T00:00:00-00:00
6+
preview_image:
7+
authors:
8+
- Anil Madhavapeddy
9+
source:
10+
---
11+
12+
<h1>Analysis of the Raft Consensus Protocol</h1>
13+
<p>This is an idea proposed in 2012 as a Cambridge Computer Science Part II project, and has been <span class="idea-completed">completed</span> by <a href="https://anil.recoil.org/news.xml" class="contact">Heidi Howard</a>.</p>
14+
<p>The Paxos algorithm, despite being synonymous with distributed consensus for
15+
a decade, is famously difficult to reason about and implement due to its
16+
non-intuitive approach and underspecification. In response, this project
17+
aimed to implement and evaluate a framework for constructing fault-tolerant
18+
applications, utilising the recently proposed Raft algorithm for distributed
19+
consensus. Constructing a simulation framework for our implementation would
20+
enable us to evaluate the protocol on everything from understandability and
21+
efficiency to correctness and performance in diverse network environments.</p>
22+
<p>In retrospect, the complexity of the project far exceeded initial expectations:
23+
reproducing research from a paper that was still under submission and was
24+
modified regularly proved a big challenge alongside Raft's many subtleties.
25+
Nevertheless, the project achieved optoinal extensions by using our work to
26+
propose a range of optimisations to the Raft protocol. The project successfully
27+
conducted a thorough analysis of the protocol and released to the community a
28+
testbed for developing further optimisations and investigating optimal protocol
29+
parameters for real-world deployments.</p>
30+
<h2>Related Reading</h2>
31+
<ul>
32+
<li><a href="https://raft.github.io/raft.pdf">In Search of an Understandable Consensus Algorithm</a>, Diego Ongaro and John Ousterhout</li>
33+
<li><a href="https://anil.recoil.org/papers/rwo">Real World OCaml: Functional Programming for the Masses</a></li>
34+
</ul>
35+
<h2>Links</h2>
36+
<p>The dissertation is available as <a href="https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-857.html">UCAM-CL-TR-857</a> in the Cambridge Computer Laboratory technical report series. <a href="https://anil.recoil.org/news.xml" class="contact">Heidi Howard</a> continued work on Raft subsequent to submitting this project and published it later in the year as <a href="https://anil.recoil.org/papers/2014-sigops-raft">Raft Refloated: Do We Have Consensus?</a>.</p>
37+
<p>You can watch <a href="https://anil.recoil.org/news.xml" class="contact">Heidi Howard</a> talk about her work in a Computerphile video from 2016:</p>
38+
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/jn3DBzr--Ok?si=D0rbJYdhqMX37pBw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe>
39+
<p><a href="https://anil.recoil.org/news.xml" class="contact">Heidi Howard</a> also continued to work on Raft and distributed consensus later:</p>
40+
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/Pqc6X3sj6q8?si=HuYcxC1crauL422C" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe>
41+
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
title: Announcing OCaml Labs
3+
description: Introducing OCaml Labs, a new project at Cambridge Computer Lab to develop
4+
and improve the OCaml programming language.
5+
url: https://anil.recoil.org/notes/announcing-ocaml-labs
6+
date: 2012-10-19T00:00:00-00:00
7+
preview_image:
8+
authors:
9+
- Anil Madhavapeddy
10+
source:
11+
---
12+
13+
<p>I’m very excited to announce <a href="https://anil.recoil.org/projects/ocamllabs">OCaml Labs</a>, the latest project
14+
to hit the Cambridge Computer Lab. As anyone that hangs out near me
15+
probably realises, I very much enjoy functional programming. My weapon
16+
of choice tends to be <a href="http://www.ocaml-lang.org">OCaml</a>, as it
17+
condenses <a href="http://events.inf.ed.ac.uk/Milner2012/X_Leroy-html5-mp4.html">decades of
18+
research</a>
19+
into a pragmatic blend of functional, imperative and object-oriented
20+
programming styles. What’s perhaps less well known are the steady
21+
<a href="http://www.ocaml-lang.org/companies.html">inroads</a> that OCaml has been
22+
making into mission-critical areas of industry. At <a href="http://ocaml.janestreet.com">Jane
23+
Street</a>, billions of dollars of
24+
transactions are routed through a huge ML code-base that is designed to
25+
catch bugs <a href="http://vimeo.com/14313378">at compile-time</a>. At
26+
<a href="http://github.com/xen-org/xen-api">Citrix</a>, the Xen management
27+
toolstack that powers
28+
<a href="http://blogs.citrix.com/2012/10/09/one-in-a-million/">millions</a> of
29+
hosts in the cloud is <a href="https://anil.recoil.org/papers/2010-icfp-xen.pdf">largely written in
30+
OCaml</a>. Facebook does
31+
sophisticated <a href="https://github.com/facebook/pfff/wiki/Main">static
32+
analysis</a> using OCaml over
33+
their vast PHP codebase to close security holes.</p>
34+
<p>The OCaml community is small but dedicated, but there is always more to
35+
do to improve the language and ecosystem. So, thanks to a generous
36+
platform grant from <a href="http://ocaml.janestreet.com">Jane Street</a>, we are
37+
launching a program to help with the open-source development of OCaml
38+
from Cambridge.</p>
39+
<p>The <em><a href="http://www.cl.cam.ac.uk/projects/ocamllabs/">OCaml Labs</a></em> are
40+
based in the <a href="http://www.cl.cam.ac.uk">Cambridge Computer Lab</a> and led
41+
my myself, <a href="http://www.cl.cam.ac.uk/~am21/">Alan Mycroft</a> and <a href="http://www.cl.cam.ac.uk/~iml1/">Ian
42+
Leslie</a>. We’re closely affiliated with
43+
other
44+
<a href="http://www.cl.cam.ac.uk/projects/ocamllabs/collaboration.html">groups</a>,
45+
and will be:</p>
46+
<ul>
47+
<li>
48+
<p>developing the OCaml Platform, which will bundle the official OCaml
49+
compiler from INRIA with a tested set of community libraries that
50+
refreshed every six months.</p>
51+
</li>
52+
<li>
53+
<p>working with the core OCaml team at INRIA’s
54+
<a href="http://gallium.inria.fr/">Gallium</a> group on the compiler, and with
55+
commercial partners like <a href="http://ocamlpro.com">OCamlPro</a> on tool
56+
development. OCamlPro are making some very impressive progress
57+
already with the <a href="http://opam.ocamlpro.com">OPAM</a> packge manager and
58+
<a href="http://www.typerex.org">TypeRex</a> IDE helper.</p>
59+
</li>
60+
<li>
61+
<p>supporting the online presence with more teaching material and
62+
content. Yaron, Jason and I are working hard on a <a href="http://realworldocaml.org">new
63+
book</a> that will be published next year,
64+
and the OCaml Web team (led by <a href="http://ashishagarwal.org">Ashish</a>
65+
and
66+
<a href="https://plus.google.com/109604597514379193052/posts">Christophe</a>)
67+
have made great progress on a <a href="http://www.ocaml-lang.org">brand new
68+
website</a> that we will move to the
69+
<code>ocaml.org</code> domain soon.</p>
70+
</li>
71+
</ul>
72+
<h3>Research efforts</h3>
73+
<p>Of course, it is difficult to hack on a language in a void, and we also
74+
<em>use</em> OCaml heavily in our own research. The other half of OCaml Lab’s
75+
goals are more disruptive (and riskier!):</p>
76+
<ul>
77+
<li>The upcoming first beta release of <a href="http://openmirage.org">Mirage</a>,
78+
which is an operating system designed for cloud and embedded
79+
environments, and is written almost entirely from the ground up in
80+
OCaml. The outputs of Mirage include a <a href="http://www.openmirage.org/blog/breaking-up-is-easy-with-opam">large number of
81+
libraries</a>
82+
which are usable separately, such as pure implementations of TCP/IP,
83+
DNS, SSH, DHCP and HTTP. The Xen hackers, led by <a href="http://dave.recoil.org">David Scott</a>, are out in force to integrate Mirage
84+
into their <a href="http://www.xen.org/xensummit/xs12na_talks/T2.html">next-generation</a>
85+
platform. Meanwhile, Raphael Proust is busy eliminating the <a href="https://anil.recoil.org/papers/drafts/2012-places-limel-draft1.pdf">garbage
86+
collector</a>
87+
with his cut-down “LinearML” variant.</li>
88+
<li>Working with our collaborators at the <a href="http://horizon.ac.uk">Horizon
89+
Institute</a> on privacy-preserving technologies
90+
such as
91+
<a href="https://anil.recoil.org/papers/2012-sigcomm-signposts-demo.pdf">Signposts</a>
92+
which let you build and maintain your own personal clouds that
93+
operate <a href="https://anil.recoil.org/papers/2011-icdcn-droplets.pdf">autonomously</a>
94+
from the central cloud. You can read more about our <a href="http://www.cam.ac.uk/research/features/privacy-by-design/">privacy-by-design</a> philosophy too.</li>
95+
<li>Extending OCaml to run on secure hardware platforms that doesn’t
96+
compromise on performance, using the MIPS64-based <a href="http://www.cl.cam.ac.uk/research/security/ctsrd/cheri.html">capability
97+
processor</a>
98+
that is being developed at at the Lab.</li>
99+
<li>The <a href="http://www.trilogy-project.org">Trilogy</a> was a hugely
100+
successful EU-funded effort on future evolution of the Internet, and
101+
resulted in <a href="http://trilogy-project.org/publications/standards-contributions.html">numerous
102+
RFCs</a>
103+
on subjects such as multipath-TCP. We’re partipating in the
104+
follow-up (imaginatively dubbed “Trilogy2”), and look forward to
105+
working on more structured abstractions for programming large-scale
106+
networks.</li>
107+
</ul>
108+
<h3>Getting involved</h3>
109+
<p>So, how can you get involved? We are initially advertising three
110+
positions for full-time developers and researchers
111+
(<a href="http://www.jobs.cam.ac.uk/job/-21662/">junior</a> and
112+
<a href="http://www.jobs.cam.ac.uk/job/-21942/">senior</a>) to help us get started
113+
with the OCaml Platform and compiler development. These aren’t
114+
conventional pure research jobs, and a successful candidate should enjoy
115+
the open-source development cycle (you retain your own copyright for
116+
your own projects). The Computer Lab offers a pretty unique environment:
117+
a friendly, non-hierarchical group in a beautiful city, and some of the
118+
best faculty and students you could hope to hang out with.</p>
119+
<p>And finally, there is a longer lead time on <a href="http://www.cl.cam.ac.uk/admissions/phd/">applying for
120+
PhDs</a>, but this is a great time
121+
to get involved. When I started at the Lab in 2002, a little project
122+
called <a href="http://xen.org">Xen</a> was just kicking off, and many of us had a
123+
wild (and oft great) time riding that wave. Get in touch with myself,
124+
<a href="http://www.cl.cam.ac.uk/~am21/">Alan</a>,
125+
<a href="http://www.cl.cam.ac.uk/~iml1/">Ian</a> or
126+
<a href="http://www.cl.cam.ac.uk/~jac22/">Jon</a> soon if you are interested in
127+
applying! There’s some more information available on the <a href="http://www.cl.cam.ac.uk/projects/ocamllabs/collaboration.html">OCaml Labs
128+
pages</a>
129+
about options.</p>
130+

0 commit comments

Comments
 (0)