What does HackerNews think of Carp?

A statically typed lisp, without a GC, for real-time applications.

Language: Haskell

#1 in JavaScript
#1 in JavaScript
Not CL, but there is ulisp (http://www.ulisp.com/) for microcontrollers, supposed to be really tiny, and there is Carp (https://github.com/carp-lang/Carp) which is without a GC so seems suitable for real-time stuff.
Everybody is trying to make a more user-friendly Rust. The problem is that it is not clear yet whether that's possible, and if it is, how it may look. I know Vale and have tried it, though it's extremely early to judge anything so far. It does have a much stronger theoretical background than V, but even the theory is not completely clear at this point.

There is also Carp by the way: https://github.com/carp-lang/Carp

For embedded application (as in micro-controllers) there is http://www.ulisp.com/

SBCL still needs garbage collection. There are also https://github.com/carp-lang/Carp and https://github.com/bakpakin/Fennel

I haven't used these. Would be great if low-level and embedded engineers could chime in.

I've had my eye on Carp[1], if you're interested. Uses ownership like Rust instead of GC, sort of a rust-like typed lisp.

1: https://github.com/carp-lang/Carp

This looks really lovely, I look forward to following the maturation of Ante in the future. I've often thought that the niche of a general purpose low-level FP language was a promising space. The only other langs that fit in there are ATS[1], which is notoriously complex/difficult-to-learn, and Futhark[2], which is more GPGPU/scientific-computing specific.

We've got Rust, which is essentially a C-style lang that steals all kinds of goodies from the ML family; it's nice to see Ante as a kind of inverse to this: i.e. an ML style lang that borrows some of the nice bits from traditional imperative langs (and hopefully maintains their performance characteristics).

Looking through the language tour there already seem to be a plethora of very sensible/ergonomic design decisions here. The 'loop' and 'recur' keywords are a great feature, making a nice little functional nod towards while loops. As a long-time Haskell user the explicit currying initially turned me off, but after seeing a couple examples I can see how it's actually a very reasonable solution, and moreover the ability to curry out of order is really nice instead of having to use 'flip' or similar combinators (as a side note, the explicit currying reminds me a bit of APL's α and ω arguments in dfns, a feature I'd love to see pop up more). The paired tuples also seem like they'd be a pleasure to use; certainly a bit more flexible than tuples in other ML style langs. Making '.' the pipeline operator is also a smart bit of syntax, and I can see it being very accessible to OO programmers in that it looks (and acts) like the method chaining they're familiar with. Refinement Types seem like a good alternative to full on dependent typing (ATS has an analogous (and more general) proof system for ensuring things like array indices are valid (an essential feature in a low level FP lang), but it involves threading those proofs through your program which seems much more clunky than what's presented here).

Overall I'm really excited to see where Ante goes, it seems like a very pragmatic functional language, something the world definitely needs more of...

[1]: http://www.ats-lang.org/Home.html

[2]: https://futhark-lang.org/

EDIT: In regards to low level FP langs there's also Carp, Erik Svedäng's nifty little statically typed Lisp. It's like Scheme with a Rust-y memory model:

https://github.com/carp-lang/Carp

I love Clojure, but I do miss static types. I'm hoping Carp[0] (mentioned in the article) comes into its own. It seems like it could become my ideal language. The other problem I have with lisps in general is that they seem to encourage clever programming that is hard to read / debug (or maybe they just attract developers who value brevity over clarity... not sure).

[0] https://github.com/carp-lang/Carp

Check out https://github.com/carp-lang/Carp

From the readme:

> The key features of Carp are the following:

> - Automatic and deterministic memory management (no garbage collector or VM)

> - Inferred static types for great speed and reliability

> - Ownership tracking enables a functional programming style while still using mutation of cache-friendly data structures under the hood

> - No hidden performance penalties – allocation and copying are explicit

> - Straightforward integration with existing C code

> - Lisp macros, compile time scripting and a helpful REPL

We're lucky that language diffusion works both ways. I've kept my eye on Carp[1] because it takes a cue from Rust and brings deterministic memory management & ownership into a Lisp.

[1] https://github.com/carp-lang/Carp

There’s a lisp-like language without a GC called Carp [1]. I believe the goal was enabling real time applications and specifically games. I’ve only toyed with it a tiny bit, but it has an ownership memory model inspired by Rust. Pretty neat project!

[1] https://github.com/carp-lang/Carp

Another commenter already mentioned Gambit Scheme. That provides for inline C and therefore very easy interop with external libraries. It still has a runtime and GC though - those might pose a problem depending on your platform and task.

Ferret (https://github.com/nakkaya/ferret) and Carp (https://github.com/carp-lang/Carp) are both Lisp-like low level languages. Both seem to be fairly experimental in nature though.

> anything but C

Taking you literally, Rust and D can both compile for bare metal. D in particular has a "Better C" subset. (https://dlang.org/spec/betterc.html)

In the same vein, Terra is a C like language (manual memory management) that you metaprogram with Lua. (https://github.com/terralang/terra)

Taking you very literally, Forth is also an option.

For that track of thought - There are some more static nascent Clojure inspired languages around that might fit. Eg this one, doesn't have GC either: https://github.com/carp-lang/Carp
You should check out Carp[1]. The language is still young but it might scratch that itch.

[1] https://github.com/carp-lang/Carp

Having built remote monitoring and firmware updating systems for high-current LiFePO4 batteries in Rust for low-level STM32 and ESP32 integrations, Clojure for backend and ClojureScript on the frontend - I can corroborate this.

The dynamism of Clojure and the memory safety of Rust are a strong combination, especially for streaming EDN data over websockets to Clojure or ClojureScript frontend.

However, neither Rust nor Clojure is the end-game. Eventually all languages will IMO adopt memory lifecycle management (lookahead guarantees) and borrow-checking as language features to do runtime optimization.

An interesting language in this regard is Carp, a high-performance statically-typed Lisp implemented in Haskell with borrow-checking: https://github.com/carp-lang/Carp

It's a shame they did not opt to follow Clojure syntax more closely, or it would make the transition much easier for the growing Clojure community. Clojure seems to be winning the Lisp language wars.

Rust could have be so much more if it used S-expressions or M-expressions. The macro language is an abomination compared to Lisp, but I understand they had to lure the embedded C crowd.

If you are interested in game development and lisp, may I suggest having a look at https://github.com/carp-lang/Carp ? It's "A statically typed lisp, without a GC, for real-time applications.", the Gitter is quite friendly as well.
The most interesting Clojure-like language around is, IMO, Carp[^1]. Carp is a Lisp written in Haskell that compiles down to C with Rust ownership semantics and looks like Clojure. So you get a GC-less Lisp with fast startup time that is suitable for game development with the safety guarantees of Rust.

[^1]: https://github.com/carp-lang/Carp

You can build a Lisp to stay close to the metal with zero-cost abstractions. Most people drawn to Lisp are wanting productivity instead of max performance. Besides, the commercial Lisps and fastest in FOSS are really fast.

There was a systems type of Lisp called PreScheme that was closer to what you're envisioning. Carp also aims at no-GC, real-time use. Finally, ZL was C/C++ implemented in Scheme with both their advantages compiled to C. Although done for ABI research, I've always encouraged something like that to be done for production use with tools to automatically make C and C++ library bindings.

https://en.wikipedia.org/wiki/Scheme_48

https://github.com/carp-lang/Carp

http://zl-lang.org/

Not exactly lisps, but Carp (https://github.com/carp-lang/Carp) and Scopes (https://bitbucket.org/duangle/scopes/wiki/Home) might be worth a look. I haven't tried the former, and couldn't get the latter to do anything useful, though. (it looks like the author stopped responding to issues, sadly).
Very interesting, and thanks for answering.

Could I ask what kind of project it is? I wonder if I'm just lucky that Clojure fits perfectly my use case, which is mostly a set of distributed systems of all kinds. So while as a whole there's tens of thousands of LOC. The components have very strong boundaries being as it's a set of services assembled together through RPC, PubSubs and DBs. Maybe that alleviate the lack of a static type checker.

We've adopted Clojure about 3 years ago, team of 10. We've had a few people leave and join throughout. Only one person knew Clojure beforehand. Our stack is about 50% Clojure, 40% Java and 10% Scala. Of all three, Clojure has given us the least issues, has been pretty easy to maintain and generally has fewer defects. Java tend to have the most bugs, almost always related to some shared state. Scala I find the hardest to extend and maintain, but the code base we have for it I think does Scala wrong, it's like the worst mix of OOP and FP.

> I dream of a statically typed Clojure with type inference, spec-inferred types and optional dynamic typing for REPL experimentation and glue code

That's pretty much exactly core.typed: https://blog.ambrosebs.com/2018/09/20/towards-typed-clj.html

That said, the project never managed to get more contributors.

If you're looking for a typed Lisp, I've been keeping my eyes out on Carp: https://github.com/carp-lang/Carp

Well, Go seems to have enabled a new wave of software renaissance - Kubernetes, Docker, you name it - Go seems to have filled the space that Java was too fat for, JavaScript too light for, and C/C++ too difficult/fun-less to use for (which is everything).

After 20 years of coding, and having just recently discovered LISP and learned Clojure, I believe the perfect language will be a Clojure compiled to native with the ease of Go (e.g. w/ similar import system).

One such direction seems to be Carp (https://github.com/carp-lang/Carp), but I haven't tried it yet.

The borrow checker comes with different trade-offs though, which I personally find, for many applications, the immutable data-structure + atomic references with GC route (or values over time semantics) is a better fit.

The way you are forced to model things so that the borrow checker can successfully validate your code can often be frustrating, and it also comes at the cost of slow compile times and interactive programming, which Clojure is kind of a champion at, so I'm not sure it would be a good fit to add a borrow checker to it.

I love the borrow checker for manually managed memory though, and for programs that need that kind of performance and tight memory usage, it is great. I've been following along the development of Carp because of that and my preference of Lisps: https://github.com/carp-lang/Carp

Tangential question, but what Lisp is the most promising one to invest time on right now?

Common Lisp still has some activity, mainly coming from SBCL, but is a bit stagnant. It has a fantastic literature and many mature implementations.

Scheme is great, but a bit too fragmented. Racket seems to be gaining some momentum. The merge with Chez may be the tipping point to attract a critical mass of developers.

Clojure has many interesting modern ideas, but I feel being so tied to Java and the JVM has hurt a bit in the long run.

I miss a bit of innovation in the typed lisp area, like e.g. Qi or Shen which never took off. Carp [1] looks nice.

[1] https://github.com/carp-lang/Carp

Re statically typed Lisp, I’m keeping an eye on Carp [1] which seems to be a quite active project.

[1] https://github.com/carp-lang/Carp

If you like Rust and Lisp this is also a cool project: https://github.com/carp-lang/Carp.
Except for the the Clojure branch of the family tree.

Eg: there was this vaguely clojurey statically typed non-GC language, being targeted for games, presented at a recent Clojure conf: https://github.com/carp-lang/Carp

I think that part of the power of LISP is it's dynamic nature but if you want typed options they exist for Clojure and Racket. There is also development on a language called Carp that aims to be a Clojure style language for C https://github.com/carp-lang/Carp.
Something maybe of interest to HNers to keep an eye on: I noticed that the creator of the Carp language tweeted about getting Carp ready for the Lisp Game Jam.

https://twitter.com/e_svedang/statuses/977569718101069824

https://github.com/carp-lang/Carp

A couple of useful links:

https://github.com/carp-lang/Carp

> Carp is a small programming language designed to work well for interactive and performance sensitive use cases like games, sound synthesis and visualizations.

The key features of Carp are the following:

* Automatic and deterministic memory management (no garbage collector or VM)

* Inferred static types for great speed and reliability

* Ownership tracking enables a functional programming style while still using mutation of cache-friendly data structures under the hood

* No hidden performance penalties – allocation and copying are explicit

* Straightforward integration with existing C code

http://blog.veitheller.de/Carp.html, HN discussion at https://news.ycombinator.com/item?id=15778530

From their github (https://github.com/carp-lang/Carp)

The key features of Carp are the following:

- Automatic and deterministic memory management (no garbage collector or VM)

- Inferred static types for great speed and reliability

- Ownership tracking enables a functional programming style while still using mutation of cache friendly data structures under the hood

- No hidden performance penalties – allocation and copying is explicit

- Straight-forward integration with existing C code

PreScheme was a C replacement. It had manual de-allocation. Carp LISP is a new one with code being updated. MLkit supports reference-based GC, region-based management, and disabling GC for real-time use.

https://github.com/carp-lang/Carp

http://www.elsman.com/mlkit/