{"id":1435,"date":"2020-08-06T04:21:02","date_gmt":"2020-08-06T04:21:02","guid":{"rendered":"http:\/\/sdi.thoughtstorms.info\/?p=1435"},"modified":"2020-08-06T04:21:02","modified_gmt":"2020-08-06T04:21:02","slug":"carp-a-statically-typed-lisp-without-a-gc-for-real-time-applications","status":"publish","type":"post","link":"https:\/\/blog.thoughtstorms.info\/?p=1435","title":{"rendered":"Carp: A statically typed Lisp, without a GC, for real-time applications."},"content":{"rendered":"<p>This looks rather good.<br \/>\n<em><a href=\"https:\/\/github.com\/carp-lang\/Carp\">Carp: A statically typed lisp, without a GC, for real-time applications.<\/a><\/em><br \/>\nIt is what it says. It&#8217;s a Lisp, with some inspiration from Clojure in terms of syntax, that&#8217;s designed for writing fast native code like games and &#8230; (w00t!) audio applications. Etc.<br \/>\nIt actually compiles into C.<br \/>\nIt takes some syntactic inspiration from Clojure (so it looks like Clojure and Clojure editors should handle it fine)<br \/>\nBut it also takes inspiration from ML.<br \/>\nIt has an ML-style type-system with type-inference. And the best way of representing type information in a Lisp program that I&#8217;ve seen.<br \/>\nUsing a form called &#8220;<em>the<\/em>&#8220;.<br \/>\nSo you write something like<br \/>\n[cc lang=&#8221;clojure&#8221;]<br \/>\n(the Int sexp)<br \/>\n[\/cc]<br \/>\nThis declares that the sexp needs to evaluate to the type Int.<br \/>\nBecause it has type-inference, the type of much of the rest of the code can be deduced just from a few of these explicit specifications.<br \/>\nCarp also (allegedly) has an ML style module system. I have no idea what that means because I&#8217;ve not used ML. But it is something I hear a lot of people raving about.<br \/>\nHowever, Carp is a low-level language designed as a C-level language. It has the usual Lisp-style dynamic lists, but only for use at compile-time. It also has macros executed at compile-time.<br \/>\nAt run-time code, you only have more primitive types : Ints, Floats, etc. Plus data-structures including Arrays, some kind of map \/ dictionary, structs and Sum Types. So you get the power and type-safety of ML \/ Haskell algebraic data-types but at a C-level without depending on heap allocation.<br \/>\nIt also has some kind of Rust-like &#8220;ownership semantics&#8221; for pointers. I haven&#8217;t quite understood this yet, but again it looks sensible.<br \/>\nIn all, this looks a really tasteful and well thought out combination of good ideas from a number of places (much like Clojure itself) that will add up to a much nicer than C experience for writing the sorts of things that I usually write with C.<br \/>\nAll I&#8217;ve done so far is installed it and run a couple of examples, but I can well see myself trying to use this to do the coding for some audio \/ VCVRack stuff.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This looks rather good. Carp: A statically typed lisp, without a GC, for real-time applications. It is what it says. It&#8217;s a Lisp, with some inspiration from Clojure in terms of syntax, that&#8217;s designed for writing fast native code like games and &#8230; (w00t!) audio applications. Etc. It actually compiles into C. It takes some [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[58,67,255],"class_list":["post-1435","post","type-post","status-publish","format-standard","hentry","category-tools","tag-carp","tag-clojurescript","tag-low-level"],"_links":{"self":[{"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/posts\/1435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1435"}],"version-history":[{"count":0,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/posts\/1435\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}