Is there an explanation of the memory allocation used? There seem to be a GC ( https://github.com/eriksvedang/Carp/blob/master/src/gc.c ), maybe used in the compiler only, coupled with lifetime analysis ( https://github.com/eriksvedang/Carp/blob/8665a7f9a19d9347cc0... ), which as far as I know is used once ( https://github.com/eriksvedang/Carp/blob/6107e619d4f632acace... ) in the compiler. This analysis seems tied to…
As far as I understand from listening to Erik talk about Carp, there is an interactive interpreter which does use GC. In contrast, the compiler generates GC-free code.
Carp: a statically typed lisp, without a GC, for high performance applications
31–40 of 71 posts
Re: Carp: a statically typed lisp, without a GC, for high performance applications
#32Is there an explanation of the memory allocation used? There seem to be a GC ( https://github.com/eriksvedang/Carp/blob/master/src/gc.c ), maybe used in the compiler only, coupled with lifetime analysis ( https://github.com/eriksvedang/Carp/blob/8665a7f9a19d9347cc0... ), which as far as I know is used once ( https://github.com/eriksvedang/Carp/blob/6107e619d4f632acace... ) in the compiler. This analysis seems tied to…
As far as I understand from listening to Erik talk about Carp, there is an interactive interpreter which does use GC. In contrast, the compiler generates GC-free code.
Yes, but the question was how it does that. Does it reject code where it cannot reliably detect lifetimes? Or does it generate code that just does not deallocate (i.e., that leaks) objects whose lifetime the compiler can't determine? Both of these are "GC-free"...
Re: Carp: a statically typed lisp, without a GC, for high performance applications
#33Earlier quoted context omitted.
As far as I understand from listening to Erik talk about Carp, there is an interactive interpreter which does use GC. In contrast, the compiler generates GC-free code.
> In contrast, the compiler generates GC-free code. Yes, but the question was how it does that. Does it reject code where it cannot reliably detect lifetimes? Or does it generate code that just does not deallocate (i.e., that leaks) objects whose lifetime the compiler can't determine? Both of these are "GC-free"...
Re: Carp: a statically typed lisp, without a GC, for high performance applications
#34Re: Carp: a statically typed lisp, without a GC, for high performance applications
#35Earlier quoted context omitted.
As far as I understand from listening to Erik talk about Carp, there is an interactive interpreter which does use GC. In contrast, the compiler generates GC-free code.
> In contrast, the compiler generates GC-free code. Yes, but the question was how it does that. Does it reject code where it cannot reliably detect lifetimes? Or does it generate code that just does not deallocate (i.e., that leaks) objects whose lifetime the compiler can't determine? Both of these are "GC-free"...
Re: Carp: a statically typed lisp, without a GC, for high performance applications
#36That's brilliant... I'd always assumed lisps were so tightly bound to the GC that any other memory model was infeasible.
Re: Carp: a statically typed lisp, without a GC, for high performance applications
#37I understand this is marked as "a research project", so any answer here is possible and must be accepted; that said I'd really love to learn at least about plans with respect to the following questions: • Regarding FFI, is it possible to pass pointers to carp functions/closures as arguments to external dynamically loaded functions? are those features available in REPL? • What's the story/approach regarding structs in…
1. Yes, and yes! 2. No plans for inheritance at the moment, probably some kind of interfaces but that's not a top priority right now. Custom types are limited to structs, I will add union types soon 3. This has not been decided yet, I want to do more research before settling on any particular solution. It will be a high priority though, since I want to use it for the games I write Thanks, Erik
Re: Carp: a statically typed lisp, without a GC, for high performance applications
#38That's brilliant... I'd always assumed lisps were so tightly bound to the GC that any other memory model was infeasible.
ThinLisp is not a typical Lisp implementation in that it does not implement a
garbage collector or many of the other run-time development features of other
Lisps. ThinLisp is designed for producing high quality deliverable C libraries
and executables from Lisp sources. Originally designed for real-time control
applications, ThinLisp stresses run-time performance at the expense of some
development time conveniences.
Prescheme http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.4031
Schlep http://people.csail.mit.edu/jaffer/Schlep/scm2c.html
BitC http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.570.5677&rep=rep1&type=pdf
and various others...Re: Carp: a statically typed lisp, without a GC, for high performance applications
#39Anyway, it sounds neat, but even after playing with it a bit, I'm not sure how necessary it is.
SBCL (and supposedly the commercial Common Lisps) are pretty fast nowadays. Not C fast, but I can usually get about 1/2 - 1/3 C speed and 4-8x faster than Python without doing anything special.
For example, I made an animation app (https://github.com/jl2/qt-fft-viz) that reads an MP3 and generates an animation while it plays back, and I get 90+ fps. It's not a big graphics/CPU intense video game, but it's doing a lot of FFT calculations and some basic graphics.
So, not to diminish the Carp project, but I think regular old Common Lisp is faster than most people think, is better supported, has more libraries, and works on more platforms and operating systems.
Re: Carp: a statically typed lisp, without a GC, for high performance applications
#40Earlier quoted context omitted.
> In contrast, the compiler generates GC-free code. Yes, but the question was how it does that. Does it reject code where it cannot reliably detect lifetimes? Or does it generate code that just does not deallocate (i.e., that leaks) objects whose lifetime the compiler can't determine? Both of these are "GC-free"...
Very simple. The compiler, written in lisp (with a GC) just generates C code, which is compiled and executed. Without any GC, it tracks the vars.