Hacker News new | ask | show | jobs
by reikonomusha 1826 days ago
You can write Lisp in a way that you manage your own allocations, including avoiding the heap. It defeats part of the point of Lisp, but sometimes you can use that coding style for a subset of your program that shouldn’t be leaning on the GC too much.

I don’t do game development, but in scientific computing, I rely on the GC a lot for workload preparation and other administrivia, then adopt a GC-famished Lisp style for the hardcore numerical computing part.

To be sure though, GC-less Lisp programming takes a great deal of effort and knowledge. It’s not exactly an a la carte option. But the fact it’s possible means latency-sensitive applications are possible. Fortunately, Lisp’s primary benefit isn’t the GC.

2 comments

And with DISASSEMBLE[1] you can easily check to be 100% sure.

[1] http://clhs.lisp.se/Body/f_disass.htm

Anyone know if there have been attempts at concurrent garbage collection in any of the major lisp implementations (whether CL or Scheme). Maybe Clojure?
Clojure uses the underlying host's GC (e.g., JVM, CLR or JS engine). It also typically generates rather more garbage than other languages may due to immutability by default. As with all things, you can avoid the garbage if you are willing to abandon the usual idioms.
I heard Allegro's GC is concurrent and that "a new GC seems to be brewing in SBCL".

Also Clasp's GC (via Boehm GC and MPS).

Last but not least, quoting: "when one runs ABCL on a suitable JVM with ZGC or Shenandoah, then it has parallel GC".

https://twitter.com/stylewarning/status/1387809546287022082?...

https://lisp-journey.gitlab.io/blog/pro-mailing-list-on-comm...