Steve Kemp's Blog Writings relating to Debian & Free Software

Minimalism still works out

Tue, 4 Jun 2013 12:32:38 GMT

When people ask me why I chose to embed Lua in my mail-client I'll point to my on_idle() documentation.

Moving from a callback which runs once every second, or so, to allowing the user to schedule tasks on arbitrary boundaries is pretty cool - and obviously requires no explicit support from myself.

Now I've fixed a couple of bugs which went unspotted/unreported in the first release I'm ready for a new one "soon".

In the meantime I'm running the client exclusively, and loving the ability to view all unread mail, only, regardless of the parent folder.



Comments On This Entry

[gravitar] Charles Darke

Submitted at 17:15:53 on 31 May 2013

Does lumail take care of possible race conditions? e.g. new mail arriving after count_messages() function which could mess up the message index?

-- Mark all messages in the currently selected folder(s) as read.
function mark_all_read()
count = count_messages()
i = 0

while( i < count ) do
jump_index_to( i )
i = i + 1

[gravitar] Steve Kemp

Submitted at 17:22:05 on 31 May 2013

This is a single threaded application so the code is either displaying messages, etc, or running the lua-code.

On that basis I'm pretty confident there are no obvious races in this kind of code.

[gravitar] Andreas Reuleaux

Submitted at 13:30:11 on 1 June 2013

While you seem to be happy with your choice of lua, and I certainly don't want
to disturb your comfort, and moreover I only have some experience using lua as
a config language for the awesome window manager (rather than programming in lua
in one of my own projects), I found it interesting, that awhile ago, Julien Danjou,
the creator of awesome, has blogged about the shortcomings of lua, and that
he would not use lua again, but rather some lisp:

I have no idea, if his critisism would still hold today, or if lua has meanwhile
improved, but following Julien's blogs, he seems to be learning/using

Well, he contributes to emacs as well, maybe that can explain his prefs.

Just my two cents, haven't had a chance yet to try lumail, which sounds like
a great idea to me however, but certainly will.

[gravitar] Steve Kemp

Submitted at 11:27:01 on 3 June 2013

Thus far I've been completely happy with Lua, but I can certainly appreciate the drawbacks - things like the #length primitive, etc, are real problems that I can see would cause pain.

But for the use I'm putting the language to so far I've not found any problems:

  • Defining configuration settings.
  • Defining functions that are called on events.

I could have gotten by with a simple home-grown language, but I think that I've made the right call in choosing something that has been debugged and tested by others.

I'm already being surprised by the interesting things I can do, and I don't expect that to go away.


Comments are closed on posts which are more than ten days old.

Spiral Logo

Recent Posts

Recent Tags



Search prior entries:

RSS Feed

  • Subscribe to feed