Saturday, August 25, 2007

Lua VS the rest: 1-0

(This will go through a story before ending up to the Lua programming language. Sorry but I felt like writing about myself a bit.)

I've started programming (if you can call DOS batch files programs) when I was 11. My first "program" was a wrapper that was supposed to make floppy disk formatting easier by calling format with some arguments and an optional volume label (I think that I had named it KAFmat). What I liked about files? Nothing. I just had no other choice at that time (I had no idea how I could use QBasic, I barely spoke English after all).

After 2 years a family friend gave me an verbatim CD of Visual Basic 6.0. At first I was only playing with putting buttons that did nothing on a form but soon I started making some programs (one year after I made Logicrypt). I continued programming with Visual Basic for about 4 to 5 years while at the same time I tried some other languages like Pascal, Basic, C++. I also tried and learned quite well Plua (=Palm Lua) which I liked a lot because of its great syntax and ease of programming and the fact that it was a complete IDE which I could use on my old Palm Zire.

But, not before a year, I completely uninstalled Windows and Ubuntu took their place. Of course Visual Basic doesn't run on Wine so I had to find an alternative. At that time I was taking Java and C lessons on my university but I never really liked any of these languages because I find them too tricky for daily use: Java is not lightweight at all while C need too much writing for simple programs. I tried Gambas which is like Visual Basic but I stopped using it because it creates executables for Linux only (but is a very good programming environment nevertheless). So I thought that it would be easy to learn Lua since I already knew Plua.

And so I did. I now program mostly in Lua. It is a very powerful language and suitable for daily use. If you have an idea then you simply open a notepad and write some Lua code which will easily run on Linux and Windows. The code is interpreted by the very lightweight and portable Lua virtual machine which fits easily even on a floppy disk. The virtual machine can either run the source code or the compiled bytecode (which you can distribute if you do not want to show the source code of your programs). The virtual machine doesn't support GUIs or sockets but this functionality can be added with the wxlua and the (great) LuaSocket libraries. You may also use LuaGL for OpenGL 3D or 2D Graphics.

I have only published one Lua program until now: FuckBrainfuck

For more info on Lua you may check its entry on wikipedia or go directly to its website by clicking here or at the title of this post.

No comments:

Post a Comment

Popular Posts