Live data from Hacker News

Carp – A statically typed Lisp, without a GC, for real-time applications

github.com

91–100 of 139 posts

Re: Carp – A statically typed Lisp, without a GC, for real-time applications

#91
post #87
post #83

Earlier quoted context omitted.

Correction, one of Hotspot's GC implementations, there are plenty of Java implementations to chose from. Including ones with soft real time GC for performance critical deployments like PTC and Aicas. https://www.ptc.com/en/products/developer-tools/perc https://www.aicas.com/wp/products-services/jamaicavm Anyone picking a traditional JVM for such workloads is doing it wrong.

What I meant is that low latency GC is sort of a commodity/mainstream now. Not advising to use java or a specific JIT+Collector.

Ah, fair enough, got it wrong.

Re: Carp – A statically typed Lisp, without a GC, for real-time applications

#93

Earlier quoted context omitted.

S-expressions also enable proper macros, as long as it has them, it's already ahead of .

I guess so, I think my point is: are s-expression enough to qualify as a LISP?

Depends who you ask, really. For me, s-expressions and macros are enough, though it would feel very weird without a REPL and image-based development.

Re: Carp – A statically typed Lisp, without a GC, for real-time applications

#94
post #90
post #61

Earlier quoted context omitted.

It's really surprising that it's rare in functional languages. Immutability seems like it should guarantee no cycles (?), so reference counting could be used.

Reference counting is usually very expensive, because even reading a variable updates the reference count, and ending a scope involves testing the reference count of every variable defined inside the scope and conditionally deallocating the referent. Without reference counting, here's the end of a hairy function scope that deallocates 15 local variables and restores two callee-saved registers: 11a6: 48 83 c4 78 add $…

> Reference counting is usually very expensive, because even reading a variable updates the reference count

There are many papers out there on how to elide most ref count operations on locals, and runtimes that use ref counting for automatic memory management typically defer ref count updates in various clever ways (like Nim IIRC). You give up some latency for significant throughput gains.

Re: Carp – A statically typed Lisp, without a GC, for real-time applications

#95
post #90

Earlier quoted context omitted.

Reference counting is usually very expensive, because even reading a variable updates the reference count, and ending a scope involves testing the reference count of every variable defined inside the scope and conditionally deallocating the referent. Without reference counting, here's the end of a hairy function scope that deallocates 15 local variables and restores two callee-saved registers: 11a6: 48 83 c4 78 add $…

> Reference counting is usually very expensive, because even reading a variable updates the reference count There are many papers out there on how to elide most ref count operations on locals, and runtimes that use ref counting for automatic memory management typically defer ref count updates in various clever ways (like Nim IIRC). You give up some latency for significant throughput gains.

Aye.

Re: Carp – A statically typed Lisp, without a GC, for real-time applications

#97
post #82
post #39

Earlier quoted context omitted.

Last I checked SBCL and CCL (both open source native compiled CL implementations) are quite a bit faster than Clasp. However, if you are primarily e.g. calling computational chemistry libraries written in C++, Clasp is the way to go. It's the only non-C++ language implementation I know of with actually usable C++ support.

C++/CLI comes to mind, as means to merge .NET and C++ worlds together.

Oh gosh, I forgot about that. Is that Windows only though? I remember MSVC had managed/unmanaged C++ and allowed calling between the two.

Re: Carp – A statically typed Lisp, without a GC, for real-time applications

#98
post #77

Earlier quoted context omitted.

> A non-blocking write should just copy the data to the socket buffer, definitely not taking milliseconds. That's the theory, right? It could be I measured something wrong, but sometimes dozens of ms is what I got, and I concluded that non-blocking I/O avoids indeterminate blocking (such as reading from a TCP socket until the sender sent N bytes) but does it completely avoid taking in-kernel locks etc? Probably not.…

> It could be I measured something wrong, but sometimes dozens of ms is what I got, and I concluded that non-blocking I/O avoids indeterminate blocking (such as reading from a TCP socket until the sender sent N bytes) but does it completely avoid taking in-kernel locks etc? Perhaps what you were seeing were occasions where the system decided during your system call that your processes' time slice had expired or some…

Preemption can happen even outside of system calls of course, but I guess my takeaway has been to just avoid calling into the system where a lot of things can happen that I don't really understand or control. That, plus setting my threads to high-priority and possibly pinning them to the right cores.

Re: Carp – A statically typed Lisp, without a GC, for real-time applications

#99
post #77

Earlier quoted context omitted.

> It could be I measured something wrong, but sometimes dozens of ms is what I got, and I concluded that non-blocking I/O avoids indeterminate blocking (such as reading from a TCP socket until the sender sent N bytes) but does it completely avoid taking in-kernel locks etc? Perhaps what you were seeing were occasions where the system decided during your system call that your processes' time slice had expired or some…

Preemption can happen even outside of system calls of course, but I guess my takeaway has been to just avoid calling into the system where a lot of things can happen that I don't really understand or control. That, plus setting my threads to high-priority and possibly pinning them to the right cores.

>That, plus setting my threads to high-priority and possibly pinning them to the right cores.

What language was that - [normally] Java does not respect priorities at all for instance. Running with higher priority may require root as well.

Re: Carp – A statically typed Lisp, without a GC, for real-time applications

#100

For the history buffs: Pre-Scheme: A Scheme Dialect for Systems Programming Richard A. Kelsey, 1997 Abstract Pre-Scheme is a statically typed dialect of Scheme that gives the programmer the eciency and low-level machine access of C while retaining many of the desirable features of Scheme. The PreScheme compiler makes use of type inference, partial evaluation and Scheme and Lisp compiler technology to compile the pro…

The letter combination "fi" seems to have been deleted throughout your quote, there. Perhaps it was a ligature in the original.

Sorry about that!

I copied the Abstract from the pdf. I believe everything looked correct in the input form where I submitted the text.

Post reply on HN