Hacker News new | past | comments | ask | show | jobs | submit login
Carp – a statically typed, non-GC Lisp language (github.com/carp-lang)
135 points by sph on Dec 17, 2022 | hide | past | favorite | 62 comments



Related:

Carp – A statically typed Lisp, without a GC, for real-time applications - https://news.ycombinator.com/item?id=28875051 - Oct 2021 (134 comments)

Carp 0.3 - https://news.ycombinator.com/item?id=20368969 - July 2019 (23 comments)

Carp: A statically typed Lisp, without a GC, for real-time applications - https://news.ycombinator.com/item?id=16829278 - April 2018 (39 comments)

Show HN: A simple drawing and animation framework in Carp - https://news.ycombinator.com/item?id=15995146 - Dec 2017 (1 comment)

A walkthrough of the internals of the Carp compiler - https://news.ycombinator.com/item?id=15986827 - Dec 2017 (1 comment)

Carp, a compiled Lisp with type inference and a borrow checker - https://news.ycombinator.com/item?id=15778530 - Nov 2017 (109 comments)

Carp Language - https://news.ycombinator.com/item?id=13087780 - Dec 2016 (1 comment)

Carp: a statically typed lisp, without a GC, for high performance applications - https://news.ycombinator.com/item?id=12039268 - July 2016 (67 comments)

Carp – a statically typed Lisp, without a GC, for high performance applications - https://news.ycombinator.com/item?id=12037783 - July 2016 (1 comment)


Anyone using this for a real application? How does the performance look like?

Is the tooling any good? Package manager?

The GUI example in that page looks intriguing.


> The GUI example in that page looks intriguing.

That's just SDL[0] though; they implemented basic SDL bindings.

[0] https://github.com/carp-lang/Carp/blob/master/core/SDL.carp


Somewhat related, "A Little Taste of Dependent Types," implemented in Racket:

https://youtu.be/VxINoKFm-S4


"Checking Dependent Types with Normalization by Evaluation: A Tutorial" [1]

This one is cool too, I believe from the same author. I've read it recently and it makes pretty clear the intuition behind dependent types implementation.

[1] https://davidchristiansen.dk/tutorials/nbe/


That's basically this[0] book, is it not?

Great book (the entire series) by the way.

[0] https://thelittletyper.com


A bit pricey for people not in US.


How’s the memory managed?


They have documentation about that: https://github.com/carp-lang/Carp/blob/master/docs/Memory.md

It's interesting to see it's implemented in Haskell, looks like Clojure, has certain Rust-like semantics, and compiles to C. Quite an eclectic mix of languages going on here. Quite unusual that they don't mention anything about concurrency anywhere. The docs do say that there's a fork function, but there's no real information. Maybe the expectation is for developers to use C concurrency primitives?


From that link:

    (defn say-hi [text]
      (while true
        (if (< (length &text) 10)
          (println "Too short!")
          (println &text))))
Surprisingly similar to Rust, though I wonder if borrowing-by-default wouldn't be more readable than adding & everywhere. If you really need to give something ownership, you could have a sigil that maps to (move <var>)


> Maybe the expectation is for developers to use C concurrency primitives?

My guess is that they simply haven't thought much about this yet. One step at a time.


That's correct, concurency is not supported right now. I have a POC for using pthread but essentially the borrow checker is not aware of it and so it's quite unsafe.

Note: I'm a contributor.


Borrow checker like Rust.


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

What does VM mean in this context? I assume it stands for Virtual Memory - does that mean it bypasses the MMU?


Wouldn't it mean Virtual Machine, so no BEAM, JVM, MoarVM, or whatever to handle the memory management behind the scenes?

Which is kind of funny, I wonder if that means they directly call sbrk and brk rather than using malloc and free.


I'm guessing it means virtual machine, which in this context might be better phrased as runtime. Think something like the JVM or Beam.


Somewhat related; Not statically typed nor maintained, but nice work nonetheless [0].

[0] https://github.com/barak/stalin


I saw a talk once by Siskind who was a very smart fellow. The origin of the name Stalin in this case came from "Static Language { (I)mplementatio(N) }" in deliberate contrast with "Dylan" [1] which was a more dynamic dialect of Lisp being developed at the time whose principles he disagreed with. I think he worked on Dylan originally, so one could also say he disagreed with the principals as well as the principles. ;-)

[1] https://en.wikipedia.org/wiki/Dylan_(programming_language)


FWIW, I've wondered whether your use of the past tense meant that he died (maybe it's just me thinking that way), so I've verified that this doesn't appear to be the case, his CV [1] has been updated this year.

[1] on https://engineering.purdue.edu/~qobi/


Sorry, I meant the tense simply to refer to that one talk (to not overgeneralize), but I could see how it would lead to your question.


Beautiful logo


Optional parenthesis and optional separators always force me to pause and parse the code instead of scanning it, because I need to establish the context of every single operation.

I'm sure Carp is interesting, but I would be so unproductive in it.


What do you mean by optional parentheses? Are you referring to the square brackets? Carp is inspired by Clojure, and in both [] is a reader macro that instantiates an array (a vector, as opposed to a list). I'm not a fan of using the array syntax to define function arguments.


I'm not sure what you mean by optional parenthesis. I'd say optional separators are a legacy feature, I don't think anyone writes Carp with separators.

Note: I'm a contributor.


Authors need to rethink the name if possible. I automatically read it as Crap language, maybe I have borderline dyslexia.


I was wondering what happens if you make CARP an Object Oriented Language...


And right after that, it should get an Extensible Types System


you gain in gas savings what you lose in flexibility?


[flagged]


Whoa - please don't take HN threads further into flamewar, and especially not nationalistic flamewar! This is going the wrong way down a one-way street.

I realize these things can be annoying but what commenters here (all of us, including me) need to work on is metabolizing annoyances rather than venting them. Then we can keep having a curious conversation.

https://news.ycombinator.com/newsguidelines.html


Most people on this site are American. Deal with it. Also, newsflash, you're speaking English.


Please don't respond to a bad comment by breaking the site guidelines yourself. That only makes everything worse.

https://news.ycombinator.com/newsguidelines.html


So because most people on this site are American and might misread the title, the authors have to consider changing it? Why would the authors of Carp care about the demographics of Hacker News?


Such a clever name for a language. He only killed a 10 million or so. I wonder what were the other name ideas that lost to 'Stalin'


Do you have something to comment about the language, though?


"Eschew flamebait. Avoid generic tangents."

https://news.ycombinator.com/newsguidelines.html

We detached this subthread from https://news.ycombinator.com/item?id=34027264.


4 million just in Ukraine. (All this is pre-WWII.) How many of 30M Soviets died because the whole officer corps was executed just shy of WWII? Or because all military assets were poised at the border, easily bypassed, not defending cities?

The first actual census in USSR came up 15M "short", but it is unknown how many were killed, vs. previously overcounted because of weird czarist policy inherited from Mongol rule: peasants who escaped were still counted against a town's tax obligations.

Making nukes whose spiritual descendants will be handed over to Putin's insane successors, as Russian Federation splinters, might do in the whole world.


Stalin — man of steel — was his nom de guerre, just as many people are (or at least that was long the convention) referred to by their usernames.

The term is used quasi-ironically on this very site, when people say they will “steelman” an argument. And there are many other people born with that name in various languages, such as Stahlman or, notably around here, Stallman.

I’m not to trying to defend one of the most brutal dictators in history, but since you’re the one who raised the onomastic issue…


იოსებ სტალინი seems to have had a good education, despite having had the kind of early family life which makes for either bitter revolutionaries or slow, steady, drinking. I wonder if his choice of nom de guerre had been a deliberate 20th century rejection of Plato's {gold, silver, iron, brass} men in the Republic?

https://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1...

(compare the meritocracy espoused here and in following sections with that described by Goldstein in 1984 ... and we can be certain EA Blair had read the Republic)


As an old Etonian he certainly would have read it.


a) IIRC, the slogan was "Stalin Brutally Optimises"

b) non-hackers pick names in hopes of glorification by reference; hackers pick names that are pejorative: eg git

Когда называть вещи, щепки летят.


very insensitive to all the nazis he killed



time magazine person of the year '39 '42

https://en.m.wikipedia.org/wiki/Eastern_Front_(World_War_II)


Time PotY is not an endorsement. Several times they've given it to what you would call "influential villains."



america's fascion sense has always been top knotch


Wrong


what's wrong?


I think it was closer to 10 billion actually



I knew the name sounded familiar, that was it


Very cool... and congrats. But unless I missed it ? Where are the network,db and concurrency libs or packages ?

I know its still early, but to code something practical in 2022, We need to be able to connect and talk to other programs.

Missing:

1) Network lib (http client + server)

2) Basic Db access

3) How will concurrency work ? Threads ? CSP ?

4) Cryptographic functions (hashes etc)

5) enc/dec like json, xml etc

Don't get me wrong Im very impressed with Carp, but i want to be able to actually use it :/

Please dont say 'the std lib needs to be small' and ppl can bring their own http and crypto libs. Its 2022 (at least for a little bit more) your language is up against a lot of competition that does include the basics.

Go-Lang (I know not everyones.cup of tea) what they did do right from day one is include these basics in the stdlib. They really wanted ppl to use it to build stuff!

Again congratulations on getting this far, been keeping an eye on it every now and again.


> but to code something practical in 2022, We need to be able to connect and talk to other programs…i want to be able to actually use it

Sounds like perfect things for you to work on to learn and enjoy programming with carp!


>Go-Lang (I know not everyones.cup of tea) what they did do right from day one is include these basics in the stdlib. They really wanted ppl to use it to build stuff!

This is one possible philosophy. Another is the one rust is following.


So you see someone's

- open source project on the internet

- that clearly states it's a research project

and instead of commenting on the project, you complain that it doesn't have the libraries you need for your job.

Brilliant!


>..and instead of commenting on the project, you complain that it doesn't have the libraries you need for your job. >Brilliant!

Aaai I guess the my tone got lost via the internet :/ That is why I made sure to compliment the author/project twice in the beginning and in the end.

1)>>Very cool... and congrats.... I know its still early...,

2)>> Again congratulations on getting this far, been keeping an eye on it every now and again.

I am assuming, at some point the authors would want their project to be used by some people ? If I were one of those people, the above is what I would need.

I guess the internet and my 2nd-lang-english, might have made me came out "rude" ? But I assure you it was really just "positive-feedback" and my honest opinion ! YMMY

sigh


> 1) Network lib (http client + server)

There are protocols other than HTTP, too.


You are 100% right, but I'm guessing it's a fair guess that if you ONLY can implement one (time/dev resources etc) you probably can't go too much wrong starting with HTTP.


Yes, but less people care about those.


You know, there is this flashy new language called Rust. Not that well known yet, I admit.

It doesn't have any of the above in the standard library, apart from threads, and it seems to be doing fine...

Building a language is a massive amount of work already. Building out a reasonable cross platform standard library is a huge amount of work on top.

These things can easily provided by libraries. (apart from concurrency)

Besides, if you look at the commit history, the language doesn't seem to be developed anymore anyway, just a few commits in the last year.


> It doesn't have any of the above in the standard library, apart from threads, and it seems to be doing fine...

Keep in mind that Rust has a package manager (+ registry) and build system as part of its distribution. The whole mentality of "small, reusable crates" is what makes a small standard library reasonable.


>It doesn't have any of the above in the standard library, apart from threads, and it seems to be doing fine...

Lol true, true. I showed one example (Go) where they had it in and (I liked it). You showed one example (Rust) where it was/is not in the case. My personal preference is to have them included YMMY :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: