{"id":50,"date":"2007-11-27T22:41:00","date_gmt":"2007-11-28T06:41:00","guid":{"rendered":"http:\/\/eschatologist.net\/blog\/?p=50"},"modified":"2009-01-25T20:57:55","modified_gmt":"2009-01-26T04:57:55","slug":"jon-harrop-dives-into-ocaml-on-llvm","status":"publish","type":"post","link":"https:\/\/eschatologist.net\/blog\/?p=50","title":{"rendered":"Jon Harrop dives into OCaml on LLVM"},"content":{"rendered":"<p>As seen on the <a href=\"http:\/\/lists.cs.uiuc.edu\/pipermail\/llvmdev\/\">LLVMdev<\/a> mailing list: <a href=\"http:\/\/www.ffconsultancy.com\/\">Jon Harrop<\/a>, <a href=\"http:\/\/lists.cs.uiuc.edu\/pipermail\/llvmdev\/2007-November\/011523.html\"><cite>Fibonacci example in OCaml<\/cite><\/a>: <\/p>\n<blockquote><p> Here is a complete 104-line native code compiler for a tiny subset of OCaml that is expressive enough to compile an external Fibonacci program: <code>[...]<\/code> <\/p><\/blockquote>\n<p>  The compiler is itself written in OCaml, of course; for those who don&#8217;t know, <a href=\"http:\/\/caml.inria.fr\/ocaml\/index.en.html\">OCaml<\/a> or <em>Objective Caml<\/em> is an object-oriented dialect of Standard ML, a <strike>purely<\/strike> functional language.<\/p>\n<p>Jon&#8217;s name rang a bell because I just listened to the second of two podcasts from <a href=\"http:\/\/www.dotnetrocks.com\/\">.NET Rocks<\/a> on the <a href=\"http:\/\/research.microsoft.com\/fsharp\/fsharp.aspx\">F#<\/a> functional programming language \u00e2\u20ac\u201d <a href=\"http:\/\/www.dotnetrocks.com\/default.aspx?showNum=266\"><cite>Jon Harrop Makes Us F#<\/cite><\/a> and <a href=\"http:\/\/www.dotnetrocks.com\/default.aspx?showNum=293\"><cite>F# Moves Forward<\/cite><\/a> \u00e2\u20ac\u201d that <a href=\"http:\/\/blogs.msdn.com\/somasegar\/archive\/2007\/10\/17\/f-a-functional-programming-language.aspx\">Microsoft will be including with future versions of VIsual Studio<\/a>.  F# is itself a derivative of OCaml, runs atop the .NET Common Language Runtime, and can interoperate with other code <\/p>\n<p>F# is interesting because, due to its functional and side-effect-free nature, one can get a <strong>huge<\/strong> amount of parallelism out of straightforward code.  (It&#8217;s the lack of side effects that allow such analysis to be performed.)  The <a href=\"http:\/\/www.xbox.com\/\">Xbox Live<\/a> matching service, for example, is using a <a href=\"http:\/\/research.microsoft.com\/mlp\/apg\/trueskill.aspx\">TrueSkill<\/a> engine developed in F# by <a href=\"http:\/\/research.microsoft.com\/\">Microsoft Research<\/a>.<\/p>\n<p>OCaml on <a href=\"http:\/\/llvm.org\/\">LLVM<\/a> is interesting in a lot of the same ways:  You have a functional language that&#8217;s very amenable to all sorts of analysis and optimization, and an abstract platform that can run on an extremely wide variety of systems very efficiently.  It&#8217;s really the best of both worlds, where you will be able to write the parts of your software that need to be highly parallel and mathematically rigorous in a language amenable to it, and interface that to the rest of your application in a very natural fashion.<\/p>\n<p>It&#8217;s great to see that Jon is enjoying exploring OCaml atop LLVM and I can&#8217;t wait to see what kind of fun results!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As seen on the LLVMdev mailing list: Jon Harrop, Fibonacci example in OCaml: Here is a complete 104-line native code compiler for a tiny subset of OCaml that is expressive enough to compile an external Fibonacci program: [&#8230;] The compiler is itself written in OCaml, of course; for those who don&#8217;t know, OCaml or Objective&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[45,53,54,34,4,52,51,22,55,56,57],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-technology","tag-net","tag-f","tag-functional-programming","tag-llvm","tag-mac","tag-microsoft","tag-ocaml","tag-programming","tag-standard-ml","tag-xbox","tag-xbox-live"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p74loH-O","_links":{"self":[{"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=50"}],"version-history":[{"count":1,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/50\/revisions"}],"predecessor-version":[{"id":51,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/50\/revisions\/51"}],"wp:attachment":[{"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}