lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Apr 21, 2017 at 2:04 AM, Eike Decker <zet23t@googlemail.com> wrote:
> Hello Lua Users,
>
> I'm preparing for a talk at my company in which I want to focus on things
> that are exclusive about Lua (and which I keep missing in other programming
> languages).
>
> While metatables are are neat, the concept isn't foreign in other languages
> (albeit it's often not as complete nor as concise).
>
> Things that come to my mind which I have never/rarely/barely encountered in
> other languages is:
>
> 1) The debug API which enables me to inspect the stack variables and
> defining hook functions within my program. While this can somehow be done in
> other languages, I am not aware of any language where this is an intrinsic
> part of the language API itself; It's always a mere VM functionality that is
> "chiseled in stone".
> Also cool is the ability to set a hook function that gets executed only
> after a certain amount of instructions, which is great for programming
> contests where the most efficient solution is searched - at least this makes
> the comparison very fair.
>
> 2) Environment tables which allows faking/sandboxing the global registry for
> functions: This is not impossible to do in other languages, but it's usually
> not as simple and often not even possible at all within the language itself.
>
> 3) Coroutines: True coroutines are available in some other languages and
> some languages offer extensions for this, but again, this isn't easy nor
> cheap to do - and often not possible as well.
>
> This is the list I would go through and showing examples for each point and
> what it can be used for.
>
> Do you have anything else that comes to your mind?
>

One that I had not seen mentioned is a controllable and replaceable
garbage collector. This allows you to control latency over all and in
critical spots within your code.

-- 
Andrew Starks