OT: 'best' dynamic language

Igor Sysoev is at rambler-co.ru
Sat Apr 26 10:53:29 MSD 2008


On Sat, Apr 26, 2008 at 07:56:45AM +0200, Aleksandar Lazic wrote:

> Hi Igor,
> 
> On Die 22.04.2008 10:14, Igor Sysoev wrote:
> >On Mon, Apr 21, 2008 at 09:50:58AM +0200, Aleksandar Lazic wrote:
> >
> >>I prefer nekovm (http://www.nekovm.org/) for this ;-)
> >>
> >>Look:
> >>
> >>http://lists.motion-twin.com/pipermail/neko/2008-April/thread.html
> >>
> >>=> NGinx and NekoVM
> >
> >It seems that Neko as well as Lua, perl, etc do the same in memory
> >allocation failure case: exit() or nothing, i.e., segfault.
> 
> The developer of neko (Nicolas Cannasse) have agreed that he can add a
> memory management hook at init state so that it is possible to use the
> mm of nginx.
> 
> Request:
> http://lists.motion-twin.com/pipermail/neko/2008-April/002194.htm
> 
> Response:
> http://lists.motion-twin.com/pipermail/neko/2008-April/002194.html
> 
> what do you think is this enough for the integration or do you need
> something more from neko?!

The problem is not in hooks/etc.
The problem is that interpreter MUST TEST EVERY operation result that
may fail on memory allocation. And it MUST return an error to all higher
levels, closing and freeing all allocated resources on the back way.

The existent interpreters either do not test result in most cases (perl),
or simply exit(), or in best case they throw exception. Exceptions are easy
way to program (you not need to test most operations) and cheap way to test
results (for the same reason), but they may lead to socket/file descriptor/etc
leak.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list