Unable to load image

carp-lang/Carp: A statically typed lisp, without a GC, for real-time applications. :marseycarpautism:

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

https://old.reddit.com/r/Clojure/comments/8r1535/carp_clojure_inspired_statically_typed_lisp/

https://i.rdrama.net/images/16841357006985586.webp

Carp is a 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

  • Lisp macros, compile time scripting and a helpful REPL

Learn more


42
Jump in the discussion.

No email address required.

statically typed lisp

:marseywtf:

without a garbage collector

:marseygasp:

real-time applications

:marseyohno:

Carp

:marseybsod: :marseydead:

Jump in the discussion.

No email address required.

automatic memory management with no garbage collector or VM

Part of me wants to say that should be literally impossible outside of the stack

Jump in the discussion.

No email address required.

you exit the program, the kernel takes care of everything. simple as.

:#marseybigbrain:

Jump in the discussion.

No email address required.

This is why I prevent my programs from terminating, you get squatter's rights on RAM

Jump in the discussion.

No email address required.

Probably still less memory intensive than the average electron trash

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

That's just reference counting :marseyshrug:

Jump in the discussion.

No email address required.

the link is from 2013, rust doesn't have a GC anymore

nowadays rust has a very fancy ownership model and kinda of a "compile time reference count" that allows automatic memory management without a GC or VM


poor "people" should be mass killed

Jump in the discussion.

No email address required.

Does that have nasty limitations for the coder? That sounds impossible to implement in a way that doesn't make me want to blow my brains out. I'm barely convinced it can even be done for all cases either way. Seems like the kind of thing languages like C++ would jump on instantly if it was practical

Jump in the discussion.

No email address required.

Does that have nasty limitations for the coder?

technically yes, the biggest one is only allowing a single mutable reference of a variable, although this can be avoided by using a RefCell instead of a normal reference

and there are things "normal" rust code can't do, like:

  • Dereference a raw pointer

  • Call an unsafe function or method (like when calling C functions from rust)

  • Access or modify a mutable static variable

  • Implement an unsafe trait

  • Access fields of unions

to do these unsafe things, you put them inside an unsafe block (it's complicated, read more here: https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html)

I'm barely convinced it can even be done for all cases either way

well, rust can. the checks are done by what's called the borrow checker, it analyzes lifetimes and figures out if your code is safe or not

having said all of that, rust is not perfect, can't be bothered to list every little problem with it but i'll go ahead and say compilation time sucks (probably from all the safety checks)


poor "people" should be mass killed

Jump in the discussion.

No email address required.

Ooh thanks it's time for me to dig into this a lil more

:#marseyreading:

Jump in the discussion.

No email address required.

The problem with Rust is that the community is filled with soybois who constantly get distracted by the latest social justice cause of the week instead of doing shit like putting out a proper formal spec so that all Rust behavior isn't technically undefined.

Jump in the discussion.

No email address required.

Rust does this. It's (probably) not done at runtime, it just determines when to allocate and free memory at compilation time and then inserts the allocations and frees.

Edit: someone beat me to it.

Jump in the discussion.

No email address required.

compile time scripting

I think I just nutted

Jump in the discussion.

No email address required.

dude histrionic fish lmao

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.