Why is Lua such popular?

Sunday, September 16th, 2007

Background

A steadily increasing community exists around the programming language Lua, especially in the games related industry. In case you don’t know it: for instance, games like Far Cry or S.T.A.L.K.E.R. use Lua as an embedded scripting language.

academic thesis

And there are Unix applications like RPM 5 and Monotone which also embed Lua as their programming language for scripting extensions. In RPM 5 one can code .spec macros in Lua via %{lua:...} and in Monotone one can hook into the run-time processing of the application by declaring Lua callback functions in ~/.monotone/monotonerc. Having such an embedded scripting language in an application is great for hackers like me as it allows to adjust and extend applications easily and flexibly.

writing college essays

[more…]

10 days, 6 languages, …

Sunday, September 16th, 2007

The last two weeks I’ve first coded in my lovely C and the neat Java programming languages for developing the Java JNI-based bindings to my OSSP uuid C library. Then I worked on key management functionality for OSSP ase (a web application) in my preferred web programming languages Perl (backend) and JavaScript (frontend). Finally, the last days I was forced to switch over to programming in C++ (main application) and Lua (run-time hooks and extensions) while hacking on a NETSYNC-based access control functionality for the distributed version control system Monotone.

So, I ended up coding in 6 different programming languages in the short time range of just about 10 man-days. Such speedy switching of the software artist’s tools is not something I like very much, but it at least keeps one trained this way ;-) Now, at the weekend, I’m reflecting this programming expedition and recognize a few experiences which are IMHO worth noting in my BLOG.

thesis creator

Let me share my train of thoughts in the following three BLOG articles about 1. Java Native Interface (JNI), 2. Lua and embedding a scripting language into applications, and 3. distributed version control versus central access control.

jQuery core and its 20KB limit

Tuesday, April 3rd, 2007

Triggered by recent code size discussions in the jQuery community, I’ve thought a little bit more about the “all dancing all singing 20KB jQuery core limit” which is often stated. You have not heard about this until now? Well, for acceptable reasons jQuery core is meant to be not larger than 20KB and to still reach this goal people optimize the jQuery core code by single characters — even if it IMHO sometimes obscures the code to some extend.

First, the “packer” compressed jQuery SVN as of today is 20961 bytes which actually is 20.46KB. Well, I’m personally fine with this. But I’m personally also fine with a jQuery of 30KB or even 40KB in size — as long as great functionality and stability is provided. And I can image that most people also care more about other factors than about a few KB more or less.

[more…]

jQuery External Link Plugin

Sunday, April 1st, 2007

On the net one sometimes see web pages where hyperlinks to external URLs are visually marked with an additional icon placed at the end of the hyperlink. I found this always a neat effect and hence have created such a simple icon myself in a few colors and coded a very
small jQuery plugin jquery.extlink.js which allows me to automatically add such an icon to all web pages. Find this jQuery plugin in the File Repository area.

jQuery RegExp Selectors

Friday, March 16th, 2007

I don’t know why jQuery doesn’t already provide support in its selector syntax for the Perl-style operators “=~” and “!~“, but I really wanted this feature for regular expression based matching of DOM node attribute value matching:
[more…]

jQuery Debugging Plugin

Friday, March 16th, 2007

Recently I was forced to debug my jQuery hacks in Internet Explorer (IE). I got extremely tired of having to use the nasty JavaScript alert() function for debugging while in Firefox I can use the cool Firebug plugin and its console.log() function. I thought Firebug is a Firefox/Firebug specific solution only. [more…]

JavaScript sprintf(3)

Thursday, February 15th, 2007

Some time ago I was extremely bored by the fact that on hacking JavaScript code I had no POSIX sprintf(3) style function available. Perhaps the puristic JavaScript-only coders might see no need for this, for a Unix hacker this gap has to be filled. Hence I’ve searched for an sprintf(3) implementation and found Jan Moesen’s small sprintf(3) implementation. [more…]