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.

CakeML – A Verified Implementation of ML

163 pointsby setori88over 8 years ago

6 comments

vogover 8 years ago
I find it interesting that CakeML, like many other developments in this area, is based on SML (Standard ML) and not OCaml (Objective Caml). Moreover, whenever I read something about ML languages, it seems most people in the academic field talk about SML.<p>Yet, it seems that OCaml is more popular among programmers and real-world projects. Even though these programmers come from the academic field, given the niche existence that OCaml still is. For example, the astonishing MigrageOS project chose OCaml instead of SML.<p>So my question is:<p>How is that? Why is OCaml so much popular, despite having just one implementation and no real spec? Why is SML with its real spec and multiple implementations not as least equally popular?<p>EDIT: Here are two possible answers that I don&#x27;t think apply:<p>1. OCaml may be &quot;good enough&quot;, which, combined with network effects, make choosing OCaml over SML a self-fulfilling prophecy. I don&#x27;t think it is that simple, because OCaml users and projects come mostly from the academic field. They are deeply concerned with correctness of code. Which would mean they should all have favored SML over OCaml. In fact, sometimes correctness seems to be the sole motivation. For example, the author(s) of OCaml-TLS didn&#x27;t just want to create yet another TLS library in a hip language. They are concerned with the state of the OpenSSL and similar libraries, and wanted to create a 100% correct, bullet-proof, alternative.<p>2. Although one could attribute this to the &quot;O&quot; in Objective Caml, I don&#x27;t think it is that simple, because it seems the object-oriented extensions are almost unused, and wherever I saw them being used (e.g. LablGTK, an OCaml wrapper for the GTK UI library) I don&#x27;t see that much value, and that sticking to plain OCaml Modules and Functors would have led to a better interface.)
评论 #13295572 未加载
评论 #13295552 未加载
评论 #13295664 未加载
评论 #13296140 未加载
评论 #13295519 未加载
评论 #13295668 未加载
评论 #13297593 未加载
mafribeover 8 years ago
Summary: CakeML is the first verified optimising compiler that bootstraps.<p>Side note: Cake stands for CAmbridge KEnt, which is where (most of) CakeML&#x27;s verification was carried out.<p>The pioneering project in this space was X. Leroy&#x27;s CompCert. This was the first verified optimising compiler. More precisely, a realistic, moderatly-optimising compiler for a large subset of the C language down to PowerPC and ARM assembly code.
评论 #13295674 未加载
nickpsecurityover 8 years ago
Everyone with formal method background interested in this work should consider taking on one of their posted projects that would improve it. Especially Ocaml to CakeML translator.<p><a href="https:&#x2F;&#x2F;cakeml.org&#x2F;projects" rel="nofollow">https:&#x2F;&#x2F;cakeml.org&#x2F;projects</a><p>Just email them first in case someone has done the work already. Academics sometimes are slow to update web sites due to digging deep into their research. ;) The best uses I can think of for CakeML are:<p>A reference implementation to do equivalence checks against with main language, a ML or not, being something optimized.<p>Someone to build other tools in that need high assurance of correctness. Prototype it to get the algorithm right using any amount of brains and tooling that already exist with an equivalent CakeML program coming out. Then, that turns into vetted object code.<p>A nice language for writing low-level interpreters, assemblers, or compilers that bootstrap others in a high-confidence way. Idea being in verifiable or reproducible builds where you want a starting point that can be verified by eye. They can look at the CakeML &amp; assembly output with some extra assurance on top of hand-doing it. One might even use the incremental compilation paper on building up a Scheme to end up with a powerful, starting language plus assurance binary matches code.
gravypodover 8 years ago
Go into the compiler explorer [0] and type the following<p><pre><code> val num = 10 </code></pre> Then take a look at the x86 generation.<p>What is all of that. It doesn&#x27;t look like executable data needed. Is that just implicit functions or something baked into the language? If it is, why isn&#x27;t it being tree-shook?
评论 #13295721 未加载
评论 #13295845 未加载
Twirrimover 8 years ago
What is ML in this context? Neither CakeML nor Standard ML site appear to actually define it, and it&#x27;s an acronym with a few definitions in tech (e.g. Machine Learning)
评论 #13296250 未加载
评论 #13296239 未加载
fithisuxover 8 years ago
What is the difference between CakeML and StandardML in terms of Syntax and Semantics?