Lua integration suggestions

"Thomas Harning Jr." <[email protected]>
Newsgroups gmane.comp.window-managers.ion.general
Message-ID <[email protected]>
I was looking through things in Ion-3 and noticed the usage of some
structures that could be implemented using existing structures in Lua,
one of the seemingly important elements of the WM.
 1) stringstore
   This could take advantage Lua's string storage.  Perhaps using a
table in the registry w/ a known index (ex: name).  Using a the
LUA_ENVIRONINDEX would be useful, however from the look of it, this
may not work.
 2) other rv_tree usage/map/ptrlist/
  Lua's table structures could be a useful place to put the RB-trees.
In writing this email and researching more into the code, it looks
like the tree structure is used alot... so there could potentially be
vast improvement, or a vast amt of wasted code-writing.

However... if the direction of Ion is to use more Lua integration,
changing the mechanisms could be another step in immersion.

1)
Pros:
 * Any strings shared between Lua/Ion indirectly would use the same
memory space.  The current Lua implementation prevents duplicate
strings and even simple ptr comparison would prove data equality
(however the Lua developers state that this is an implementation
detail and should not be treated as 'standard' behavior).
Cons:
 * More work...
 * Potentially less performant (I have not run benchmarks on Lua's
tables vs the rb_trees... but I do know that the table implementation
has been an object of optimization due to its importance)

2)
Pros:
 * Mapping values would be simple
 * Any lists/trees/maps exported to Lua may be usable as-is (if object
setup is done at add-time, such as linking metatables to objects).
Cons:
 * Looks like plenty of work:
   * The iteration functions would need to be converted to Lua-based ones:
      * Mappings -> using 'next'
      * Arrays/Lists -> using array-like indexing (however 1-based)
 * Long lists would have array-like performance behavior if order is
important, otherwise you could do a mapping like
t[(lightweight)ptrOfValue] = value, depending on the type of object in
the list.  Strings could just use t[string] = string.

Any other ideas on this?
....  I just started using Ion-3 a few months ago due to its Lua
integration (great fan and user of) and then found the tiling
behavior, responsiveness, and lightness to top out the Lua integration
as a factor.

--
Thomas Harning Jr.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.