TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Unix system programming in OCaml (2014)

269 pointsby jxubalmost 7 years ago

9 comments

themckmanalmost 7 years ago
For those interested, some of the underlying libraries that make up Docker for Mac (and, I think, Windows) are written in OCaml (or have components written in OCaml): VPNKit[0], DataKit[1] and HyperKit[2] (qcow2 support is implemented in OCaml).<p>0: <a href="https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;vpnkit" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;vpnkit</a><p>1: <a href="https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;datakit" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;datakit</a><p>2: <a href="https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;hyperkit" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;hyperkit</a>
评论 #17512602 未加载
评论 #17512467 未加载
emmelaichalmost 7 years ago
Ocaml, in comparison to other functional statically typed languages has had many successful Unix applications.<p>For a great tour of going to Ocaml (from Python), see Thomas Leonard&#x27;s blog.<p>A retrospective is here but read the whole lot.<p><a href="http:&#x2F;&#x2F;roscidus.com&#x2F;blog&#x2F;blog&#x2F;2014&#x2F;06&#x2F;06&#x2F;python-to-ocaml-retrospective&#x2F;" rel="nofollow">http:&#x2F;&#x2F;roscidus.com&#x2F;blog&#x2F;blog&#x2F;2014&#x2F;06&#x2F;06&#x2F;python-to-ocaml-ret...</a>
评论 #17513002 未加载
a0almost 7 years ago
This is such a great book. OCaml’s type system feels like a superpower specially in the context of Unix development which is traditionally done in C.
emersionalmost 7 years ago
I&#x27;m contributing to a linker written in ~OCaml [1], and now I understand writing systems code in OCaml is really a bad idea. It makes things more complicated when you really don&#x27;t want them to be. As James Mickens says [2]:<p>&gt;You can’t just place a LISP book on top of an x86 chip and hope that the hardware learns about lambda calculus by osmosis.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;rems-project&#x2F;linksem" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rems-project&#x2F;linksem</a> [2]: <a href="http:&#x2F;&#x2F;scholar.harvard.edu&#x2F;files&#x2F;mickens&#x2F;files&#x2F;thenightwatch.pdf" rel="nofollow">http:&#x2F;&#x2F;scholar.harvard.edu&#x2F;files&#x2F;mickens&#x2F;files&#x2F;thenightwatch...</a>
评论 #17513320 未加载
评论 #17513338 未加载
tntnalmost 7 years ago
Only somewhat related,but I&#x27;ve tried to learn ocaml before but have never been able to figure out when to put what kind of delimiters where. Can anyone recommend a resource that explains the usage of the double comma and the like?
评论 #17511736 未加载
评论 #17511750 未加载
评论 #17514818 未加载
ofrzetaalmost 7 years ago
For some real world applications take a look at libguestfs <a href="http:&#x2F;&#x2F;libguestfs.org" rel="nofollow">http:&#x2F;&#x2F;libguestfs.org</a>, a library that can inspect, mount, edit VM filesystem images. Also includes tools for p2v and v2v migration.
rpcope1almost 7 years ago
I think one major turn off, especially for systems programming, was the lack of multicore threading support (i.e. it had no way to get parallelism using threads). Does anyone know if this has changed?
评论 #17513077 未加载
评论 #17512126 未加载
评论 #17512766 未加载
评论 #17512795 未加载
toolslivealmost 7 years ago
You really don&#x27;t want to use the Unix module directly. If you&#x27;re serious about system programming in OCaml, use Lwt or Async to allow for concurrency.
testaccount7almost 7 years ago
IIRC in Coders at Work, Brendan Eich talks about hiring a programmer who wrote an OS in OCaml.