8 ms·
Carp 0.3
- tosh 7y agoA talk about Carp from ClojuTRE 2018 https://www.youtube.com/watch?v=BQeG6fXMk28 https://www.youtube.com/watch?v=BQeG6fXMk28
- DrBazza 7y agotl;dr Carp is a small programming language designed to work well for interactive and performance sensitive use cases like games, sound synthesis and visualizations.
- anthony_doan 7y agoThank you, I thought it was OpenBSD's CARP port to Linux until I read your comment.
- karmakaze 7y agoThanks for clarifying. The repo subject line "A statically typed lisp, without a GC, for real-time applications" had me thinking it was for hard real-time systems and not really being able to come up with areas where it would be needed. These days with fast cores and pauseless gc the same areas of the tl;dr can be done in a variety of languages now including lisp.
- chc4 7y agoHas anyone used Carp? What is your experience with it? I looked at it a few times over the years and the domain (statically typed language with Rust-esque lifetimes for no GC) is exactly what I've wanted a few times, but there isn't any mention of embeding Carp in a program, only using it standalone. Targetting e.g. video games with low latency is fine, but I'd rather write an engine (or use an existing one!) and use Carp for scripting than be locked into solely Carp.
- OliverM 7y agoI've not used it, but https://github.com/carp-lang/Carp/blob/master/docs/Manual.md https://github.com/carp-lang/Carp/blob/master/docs/Manual.md seems to have details on integrating with C codebases, including exporting your code as a dylib.
- voidhorse 7y agoI’ve played with Carp a bit and have made minor contributions to the language. I’m not sure if there’s been any investigation into using it as an embedded scripting language yet, but there are definitely folks using it for embedded programming based on the community chats. I think someone has used it for programming modular synthesizers (or something like that)? At any rate, Carp definitely supports interfacing with C libs and you can choose to disinclude the standard library which is useful when you have limited space. More generally, the language is a blast to use! IMO it grants one the fluidity and expression of lisp with the confidence one gets from a Haskellesque type system. If you have any questions, the community on Gitter is very helpful.
- dmix 7y agoIt's always interesting to see who adopts the languages first and what they build with it. A non-GC statically typed language seems to be the future a lot of people are looking for.
- NikkiA 7y agoIt's a lot like programming haskell (which is not surprising given that carp is written in haskell, and utilises haskell's type system to achieve some things), in that you'll find something is going fine for a while, then suddenly you hit a wall where you're not sure why the type system is rejecting what you want to do and suddenly you feel out of your depth. For example, trying to parse command line arguments ends up a bit weird because there's no 'return the command line arguments as a list/array' function, but you have to use Array.copy-map to run System.get-arg on each element of an array created by `(Array.range 0 (- @(System.get-args-len) 1))` and inferring the @s in there (a syntactic sugar for `(copy ...)` is a little confusing.
- wwwhizz 7y agoThe amount of parentheses is dizzying.
- StreamBright 7y agoOnce you are counting the amount of parentheses in a Python vs in a LISP program doing the same and realise the the Python version has more you give up on your parentheses phobia pretty quickly.
- sk0g 7y agoI'd like to see a proper example demonstrating this, because from what I saw on the linked project's README, the Python version would have about a third of the parentheses.
- StreamBright 7y agoWow, this is exactly what I was looking for. Christmas came early. We were debating if there is a way to create a lisp with no-GC using a borrow checker and also have ML style type system. The answer is, yes!
- blondin 7y agoi mean, is code written in lisp-like functional style maintainable? it always takes a few seconds more per line of code for it to register if it does at all... versus code written in say imperative or declarative style. i mean what could this possibly mean? "(bg rend &(rgb (/ @state 2) (/ @state 3) (/ @state 4))))"
- detaro 7y agoDo you really think people do not get used to brackets being in slightly different places and things being ordered slightly differently? (The ones starting with functional languages certainly do when they start using other languages later :D)
- yogthos 7y agoIt seems like you're getting hung up on s-expression syntax being different than what you're familiar with. This would be akin to a native English speaker saying that Korean is completely incomprehensible. Meanwhile, a native Korean speaker would have quite a different perspective. My team used to be a Java shop, and we switched to Clojure about a decade ago. Looking back and comparing similar types of projects that we've developed in both languages there's no contest. Clojure is much faster to develop, and far easier to maintain long term. There are two fundamental problems with OOP. The first problem is that classes encourage creating ad hoc APIs. Every time you create a class with some methods, that's a unique API. Knowing how one class behaves tells you nothing about the next. As the number of classes grows, it becomes more difficult to understand what the system is doing because you have to keep all the unique behaviors in your head to reason about it. The second problem is that objects are state machines. Each object has its own internal state that gets manipulated via its methods. The states of the objects are also interdependent in most cases. So, the more objects you have at runtime, the more states you have to keep in your head to know what any one piece of code is doing at any given time. In practice, this makes it impossible to reason about code with any degree of confidence in large systems. Only thing you can do is fire up the debugger, put your application in the desired state, and then inspect it. Reasoning about code becomes a heuristic at that point. You can test it for some specific cases, and hope that it will work for all cases, but you can never really know that it will. FP and immutability tackle both of these problems head on. Immutable data directly leads to the ability to do local reasoning about your code, and allows you to write pure functions that can be reasoned about independently. Meanwhile, data is not being abstracted inside opaque state machines that provide ad hoc DSLs as their API. Instead, it's explicitly passed through function pipelines to transform it. These aspects make the code much easier to understand and maintain because you can look at a specific part of the application and reason about its behavior in isolation.
- ghosthamlet 7y agoAnother Statically Typed toy Lisp: https://gist.github.com/chrisdone/516489f4f27846712225 https://gist.github.com/chrisdone/516489f4f27846712225
- mncharity 7y agoToday there's also discussion of the 1992 "Lively Linear Lisp" paper as https://news.ycombinator.com/item?id=20369522 https://news.ycombinator.com/item?id=20369522 .
- ghosthamlet 7y agoOther GC-free Lisps: Pre-Scheme(https://en.wikipedia.org/wiki/PreScheme) is a GC-free (LIFO) subset of Scheme newLISP(http://www.newlisp.org/) uses "One Reference Only" memory management Linear Lisp(http://home.pipeline.com/%7Ehbaker1/LinearLisp.html) produces no garbage (and seems to have no implementation) Dale(https://github.com/tomhrr/dale) is basically C in S-Exprs (but with macros) ThinLisp(https://web.archive.org/web/20160324213055/http://www.thinlisp.org/, https://github.com/ska80/thinlisp) is a subset of Common Lisp that can be used without GC Bone Lisp(https://github.com/wolfgangj/bone-lisp) semi-automatic memory management list is copyed from: https://www.reddit.com/r/lisp/comments/4mtktn/bone_01_lisp_without_garbage_collection/ https://www.reddit.com/r/lisp/comments/4mtktn/bone_01_lisp_w...