News for hackers. Stuff that matters.
Re:Bone Lisp – Lisp Without Garbage Collection by kazinator on Tuesday June 07, 2016 @12:02PM (#11855378)
Just because memory can be freed doesn't mean it has to; the programmers can choose not to.

The mode of not freeing has been explored in programs that are short-lived and run on top of an OS that reliably cleans up memory. For instance, system utilities and compilers and such.

Got a C program that crashes due to premature allocation, according to Valgrind, and it is hard to figure out why? It it just a short-lived utility that does some job and exits? Then just #define free(p) ((void) 0) and rebuild.

Re:Bone Lisp – Lisp Without Garbage Collection by PeCaN on Tuesday June 07, 2016 @12:29PM (#11855567)
Or because it's considerably faster—if you don't have to deallocate, you can just reserve a bunch of pages on startup and use a stupid simple bump allocator.

Actually, D's compiler more or less works this way: http://www.drdobbs.com/cpp/increasing-compiler-speed-by-over...

Re:Bone Lisp – Lisp Without Garbage Collection by kazinator on Tuesday June 07, 2016 @12:33PM (#11855596)
I have seen a program, which meticulously freed everything on shutdown, take over a minute to actually do so under a large and complex test case involving lots of data. In production use, this would be a complete waste of CPU cycles.
Re:Bone Lisp – Lisp Without Garbage Collection by ksherlock on Tuesday June 07, 2016 @03:10PM (#11856937)
Re:Bone Lisp – Lisp Without Garbage Collection by lloeki on Tuesday June 07, 2016 @12:31PM (#11855576)
> The mode of not freeing has been explored in programs that are short-lived

[fork, allocate, exit] is a very valid and robust pattern leveraging the OS as a garbage collector.

This kind of pattern reminds me of crash-as-an-operation-mode software.

Re:Bone Lisp – Lisp Without Garbage Collection by jandrese on Tuesday June 07, 2016 @01:30PM (#11856035)
That's a fine solution, but you're going to cause some weenie manager's head to explode.

Also, some hapless intern is going to copy a chunk of code out of your project in their new project and then give you hell because their program leaks memory like crazy.

Also, some mid level manager is going to decide that all code must be run through static analysis and come out cleanly and you're going to have a bad day.

Re:Bone Lisp – Lisp Without Garbage Collection by foota on Tuesday June 07, 2016 @12:19PM (#11855496)
Good luck explaining that one in the code review :p