[SSSD] Embedding Lua into SSSD

Nikolai Kondrashov Nikolai.Kondrashov at redhat.com
Tue Aug 25 16:04:55 UTC 2015


On 08/25/2015 04:14 PM, Nikolai Kondrashov wrote:
> Hi Pavel,
>
> On 08/24/2015 11:54 AM, Pavel Březina wrote:
>> On 08/21/2015 07:01 PM, Nikolai Kondrashov wrote:
>>> I might be in a strange and careless mood today, but here is something I
>>> wanted to suggest since the time I saw the amount of logic that goes into
>>> SSSD and is implemented in C.
>>>
>>> What if we implement some of the complicated logic inside SSSD in Lua [1]?
>>
>> can you tell us what features of Lua do you like and might help simplify
>> SSSD? I don't know the language, just fast scrolled over the manual and seen
>> few examples. It seems to be similar to javascript.
>
> Most of all, I like its simplicity, then flexibility. And then how easy it is
> to embed. The latter comes from simplicity, first of all.
>
> I listed the features I think will help us in the other message in this
> thread, but here they are again and then some:
>
>      * exception handling
>        (somewhat rudimentary, but workable)
>      * automatic memory management
>        (incremental mark-and-sweep with good controls, customizable allocator)
>      * easier data massaging
>        (string operations, built-in (limited) regexes, etc.)
>      * brevity
>        (implicit dynamic typing, syntax sugar)
>      * OOP support
>        (there are several libraries to choose from)
>
> I don't know enough JavaScript to really compare, but to me knowing that it
> has two pairs of equality operators [1] is quite off-putting.
>
> There is, however, a seemingly good comparison, which should give the general
> idea:
>
>      http://stackoverflow.com/a/1022683/1161045

Some things about that comparison:

     * Lua supports bitwise operators now.
     * There are no typeof and instanceof operators, but functions doing that
       are usually implemented in OOP libraries
     * It doesn't mention that Lua uses 1-based array indices by default [1].
       It feels awkward at first, but you can get used to it.

Nick

[1] A long discussion on the official wiki :)
     http://lua-users.org/wiki/CountingFromOne



More information about the sssd-devel mailing list