logoalt Hacker News

An O(x)Caml book that runs

30 pointsby anirudh24sevenlast Saturday at 1:11 PM10 commentsview on HN

Comments

UncleOxidanttoday at 2:23 AM

> So the later modules embed a full 32-bit Alpine Linux machine that boots inside the browser tab, using the v86 x86-to-wasm emulator... You are running OCaml bytecode inside a Linux guest inside an x86 machine emulated in WebAssembly, several layers of emulation deep

Wow, this is wild!

> The thing I would love to reach is booting a compiled unikernel directly in wasm via WASI, with no Linux host underneath at all. That would make the last module as live as the rest.

Couldn't the Mirage unikernel thingy be used to compile a unikernel with all of the needed OCaml libs + i/o support? Thus negating the need for having to boot Linux inside of a browser tab? Couldn't that be done in all of the places they're booting Linux in a tab?

belmarcatoday at 12:42 AM

Hey, this is super interesting! We have been working on a quite similar system over the past few years at Université de Montréal. We develop and use codeBoot (https://codeboot.org) to teach introductory programming courses there. We also wrote an executable book for teaching a Cegep course (think last year of high school in the US). You can find it here (https://420-sn1.codeboot.org/) but mind you, the English version is not completed past chapter 1. The book was written in French.

Our tech stack is different but the choices we made are quite similar. Multi-tiered platform, markdown for authoring, executable exercises, teacher platform to produce, give, receive and grade homework/exams, etc. A distinguishing characteristic is that codeBoot's Python interpreter (pyinterp) allows single-stepping through the code. That's quite useful for teaching and studying.

We have a few exciting features coming up and we're working on a proper landing page and clean English translation for the book. If anybody is interested to learn more, reply here or contact me (email in my profile). I'd love to connect with educators, students or hackers alike!

quibonoyesterday at 11:24 PM

> The single biggest obstacle a beginner hits with any language is not the conceptual understanding. It is the install.

Is that _really_ the case? I find it very unlikely (not just in an OCaml context).

show 5 replies
WillAdamstoday at 1:17 AM

Interesting next step for Literate Programming.