[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: (not) handling new programming idioms with grace
- From: Dibyendu Majumdar <mobile@...>
- Date: Mon, 16 Jul 2018 18:38:45 +0100
On 15 July 2018 at 15:22, John Belmonte <firstname.lastname@example.org> wrote:
> It's been about 10 years since my post "state of the Lua nation on resource
> cleanup" . The only relevant thing that's happened in this area since
> then was Lua getting pcall + coroutine love in 5.2.
>  http://lua-users.org/lists/lua-l/2009-01/msg00333.html
I don't believe it is technically possible to implement deterministic
cleanup of objects in Lua. I think the main issue is Lua's approach of
throwing exceptions using longjmp. As far as I know, you need
systematic stack unwinding in order to implement something like this -
and that would be impossible to do while keeping Lua's primary design
criteria - to be small and portable.
If you have a technical solution that works - or if anyone else has -
would be happy to be corrected.