Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
Programming Software Wikipedia

Wikipedia Chooses Lua As Its New Template Language 145

bonch writes "In an attempt to tackle the inefficient complexity of its current template system, Wikipedia will be adopting the Lua scripting language. Known most for its use in videogame scripting, particularly World of Warcraft, Lua is lightweight and designed for easy integration into existing applications. The transition is expected to begin after the release of MediaWiki 1.19, possibly in May." Basically, the template system started turning into an ugly programming language. There was debate over using Javascript or Lua; Lua ultimately won due to implementation concerns. The mailing list threads announcing the decision and discussing the change have further details.
This discussion has been archived. No new comments can be posted.

Wikipedia Chooses Lua As Its New Template Language

Comments Filter:
  • Sounds exciting (Score:5, Interesting)

    by YutakaFrog ( 1074731 ) on Wednesday February 01, 2012 @11:41AM (#38891703)
    Lua has some notable differences from more prominent languages like Java, but as a World of Warcraft addon developer, I find it a surprisingly robust and fun language to program in. I look forward to this change to Wikipedia and hope it works well for all of their contributors.
  • This seems to be at least partial evidence that that's not really the case: it was discussed for a while, a decision was made, and implementation rather than further discussion is now happening.

  • by Phrogz ( 43803 ) <!> on Wednesday February 01, 2012 @11:55AM (#38891829) Homepage

    I'll be interested to see if they go for WoW-style "raw", imperative Lua (gobs of functions) or a more OOP-style Lua [] (NB: my site).

    In designing the Lua interface for an old Game UI authoring product [] I originally went with OOP-style Lua. It was (IMHO) a rather elegant wrapper on our DOM. However, we soon found that the memory thrash of using Lua's lightweight userdata to go back and forth between C++ and Lua resulted in poor performance on consoles, and I ultimately had to redesign the interface to be more WoW-like for our next release.

    It was a shame, putting more onus on the scripter to manage objects (tables of properties in Lua) based on a 'pointer' passed around to uniquely identify each element in the DOM, and passing that pointer to all relevant functions. But the performance increase was dramatic.

  • by Phrogz ( 43803 ) <!> on Wednesday February 01, 2012 @12:03PM (#38891911) Homepage

    BTW, my personal opinion on Lua:

    It's a fun language to learn, because at the core it is *so* simple. In less than a week a good scripter can fully wrap their head around everything that Lua has to offer from the scripting side (not the C++ side; that might be another week). It's rather elegant, really, with convenient syntax for integer-based for-loops that automatically create a new copy of the loop variable on each pass for simple closure creation.

    However, when you get down to actually typing in itwell, it's not as verbose as Java, but there's some real RSI danger there. With it's simple core come decisions like "not only will we not give you foo++, we won't even give you foo+=1". Try typing things like "frameCounter = frameCounter + 1" many times and you'll start to scream. Every day I scripted in Lua at work I would long for the times when I could use Ruby to actually get something done.

    For those who know JavaScript and want to get a glimpse of what Lua is like, I have a page on my site: Learning Lua from JavaScript [].

  • by alexbirk ( 2565251 ) < minus language> on Wednesday February 01, 2012 @12:43PM (#38892385)
    Embedding Lua for configuration or building templates is it's real strength. I've used it many times in programs that require pretty extensive configuration and it's a joy in that environment. I think it's a great choice for this.
  • by Anonymous Coward on Wednesday February 01, 2012 @01:01PM (#38892643)

    And the previous two posts, just for starters, is exactly why Python continues to be so populuar. Well that and the fact that Ruby works hard to be the anti-culture programmer's language. Which means its unlikely to ever be more than an obscure language.

  • Re:Lua (Score:2, Interesting)

    by Anonymous Coward on Wednesday February 01, 2012 @01:59PM (#38893549)

    1) In standard logic, ~ means NOT. Since LUA uses functions for it's bit-wise operations, I see no issue with using this.
    2) Why? People don't consider C to be BASIC and it allows pre and post-test WHILE loops.
    3,4) I got nothing
    5) You should really make up your mind here. They use the normal % for modulo and you complain? Come on now.
    6) PHP uses . to concatenate strings, seems like you're splitting hairs here for no particular reason other than to complain.
    7) Wow, you found something good?
    8) LUA is dynamically typed, why would they have an int()?
    9,10) You really shouldn't be using LUA... go with a language that you like. It sounds like you prefer Python anyways.

    Just as a note, I haven't programmed anything in LUA before but I've looked at the code and looked over the reference manual. Looks like a fine language; I just have no use for it as of yet.

  • by svick ( 1158077 ) on Wednesday February 01, 2012 @03:34PM (#38894757)

    Using Lua instead of the current template syntax will not mean much for editors of articles and nobody claimed it would. It will only make (huge) difference for those who currently write templates.

    On the other hand, there is also some work going on to make editing of articles easier using a WYSIWYG editor [].

"I don't believe in sweeping social change being manifested by one person, unless he has an atomic weapon." -- Howard Chaykin