Is Lua Really Wonderful?

February 27th, 2008 by Phil Hughes

The Scripting Language article appeared right after a friend sent me an email about Lua. About a year ago I had some script I was playing with that was in Lua and I thought it looked like a pretty interesting language. But, the thought quickly passed as I have, well, enough other things to do.

We'll, my friend had the following points:

  1. What a piece of crap JavaScript is
  2. How big Python is
  3. How cool it would be if browsers had Lua, not JavaScript in them

On the first point, let's just say that JavaScript and design fit together about as well as Perl and design. (Ok, that should have made me enough enemies.)

While Python is my first choice for a "big" language (awk is my first choice if the task makes sense within the confines of awk), it is a big language. Execution size is one issue but, for someone new to programming, there is a lot to learn to write good Python.

Now, my friend suggested that if Lua was in a browser then you could implement most anything (including JavaScript) in Lua. Ok, I haven't given this a lot of thought and I am far from an expert on Lua (or JavaScript—it's right up there with Perl on my "languages to avoid" list) but maybe he is right. Maybe we just need to embed Lua is some browser, write a JavaScript interpreter in it for the hard-core, a Lua tutorial and then just wait for Lua to take over the world.
__________________________
Phil Hughes


Special Magazine Offer -- 2 Free Trial Issues!
Receive 2 free trial issues of Linux Journal as well as instant online access to current and past issues. There's NO RISK and NO OBLIGATION to buy. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Sorry, offer available in the US only. International orders, click here.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Scripting in the browsers should allow multiple languages !

On March 5th, 2008 Anonymous (not verified) says:

I still don't understand why there is only one language in browsers. As long as the language have a way to access the DOM, and some kind of access to browser functions, couldn't be the language engine a plugin for the browser !? . So, the browser have an API, and some scripting engines that can access that api. It would only be necessary a or , etc ..

! agreed !

On March 5th, 2008 arthur (not verified) says:

it would be _great_ if we had more choices
even stripped down plugins would be better
than having to learn yet-another-language.

i chose php for the web site i work on,
and it would be nice if some of that framework
could be off-loaded to the client side.

There's something similar available currently...

On February 28th, 2008 bch (not verified) says:

This lua article was linked to from this poll... which at this point has shown a lot of support for Tcl -- so I thought I'd point out this Tcl browser plugin project.

-bch

Featured Videos

Non-linear video editing tools are great, but they're not always the best tool for the job. This is where a powerful tool like ffmpeg becomes useful. This tutorial by Elliot Isaacson covers the basics of transcoding video, as well as more advanced tricks like creating animations, screen captures, and slow motion effects.

Shawn Powers reviews the HP Mini-Note portable computer.

Thanks to our sponsor: Silicon Mechanics

Silicon Mechanics is a leading manufacturer of rackmount servers, storage, and high performance computing hardware. The best warranty offerings available are backed by experts dedicated to customer satisfaction.

From the Magazine

August 2008, #172

There's nuttin like a Cool Project to give you some relief from the summer heat, so get out your parka cuz we got a bunch of em. First up is the BUG, not a bug, The BUG. It's got a GPS, camera and more, in a hand-sized package that's user programmable. The BUG does everything. It's both a floor wax and a dessert topping. Get one now. Need a software version of a Swiss Army knife? Take a look at Billix, and don't leave home without it. Then, chew on this one, an X server on a Gumstix device driving an E-Ink display. Need more storage? How about 16 Terabytes? Can do.

And, of course, we have the usual cast of characters: Marcel, Reuven, Dave, Kyle, Doc, plus the new kid on the block Shawn Powers. But it doesn't stop there: build a MythTV box on a budget, build your own GIS system, set up the tools to monitor your enterprise and more. Finally, remember The War of the Worlds? Now you can play too.

Read this issue