Wikipedia Chooses Lua As Its New Template Language
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.
Lua is a terrible language. What is wrong with you people?
"the template system started turning into an ugly programming language" - ah, any sufficiently complex system eventually evolves to contain a limited, broken version of Common Lisp.
Stop delaying the inevitable!
The funny thing about Wikipedia is that there's so many "Bicycle Sheds"(http://en.wikipedia.org/wiki/Bicycle_shed) that we can be ensured that no action ever takes place and there's plenty of people to opine on a point that the implementation of a decision never happens.
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.
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
Maybe they should take a step back and wonder why templates became so popular in the first place? Now every page looks the same, and sports fifty irrelevant warning messages that "this page is part of blah blah blah" and god help you if you decide not to use the template, or change something you don't like about it, because you will bring down the wrath of the anal-retentive neckbeards that run the place harder than the fist of an angry god.
do, And with any
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.
as possible? How Is th'e worst oof in jocks or chaps our cause. Gay
I can't wait to make edits using this new language, only to have them reverted minutes later.
Seriously though, I'm sure it'll make it a lot easier for an admin to sculpt the page in their own vision without interference from others.
The author specifically modeled it on MVP to maintaining a strict separation of concerns. Presentation and model don't co-mingle. Might seem a bit unusual at first since the language will seem limited at first. But, it'll keep you from running into the "bloating script" problem.
I swear to God...I swear to God! That is NOT how you treat your human!
Wikipedia could stick to PHP or switch to any other language. But that's not their problem. Their problem is the messy markup language they slowly created. I know cause once I tried to render their markup inside another app. Basically, they have all sorts of tags that reference obscure server-side behaviour and everything is so entangled that creating a new renderer is basically impossible. This is sad because they are wasting the work of volunteers.
Check out my cross-platform apps
...do BRASIIIIIIIIIIIL ~ Galvão Bueno
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.
Exactly what I was thinking. We have a problem: not enough people understand how to edit Wikipedia because of it's complexity. Rather than analyze what makes it complex and how it could be simplified (which is boring), we'll focus on implementing something technically whizzy in some language that's cool, and that will solve the problem.
Wiki syntax did always strike me as stunningly stupid. It has essentially become just another markup language. Except that it's much more unclear, shitty and limited than original XML. Which is a textbook example of the inner-platform anti-pattern.
Another horrible example is TypoScript. Which is a template language, written in another template language (PHP)!! Again becoming a shitty clone of PHP. Which itself already is a shitty clone of a proper scripting language. (I've had to use it in my day job, every day, for five years. I know. [And yes, I still keep up-to-date. And if anything, with the new tacked-on over-blown object system it has only gotten worse.])
XHTML already IS a n00b markup language that your grandma can use.
PHP already IS a n00b template language that every "web designer" (read: wannabe amateur) can use.
And for that purpose, they are perfectly fine!
I stopped editing Wikipedia many years ago and I have no intention to ever have anything to do with them again.
Seriously, Wikipedia's #1 fault and the reason I ceased actively contributing is that it requires humans to use a mark-up language for what is essentially a simple text based document.
And all such edits would be handled much easier via a WYSWIG editor. Yes, elitist monkeys with far too much time on their hands love that feel of doing something complicated for the sake of it.
Those more intelligent and or beings who have furthered the race through reproduction tend not to want to waste time.
Implement a simple editor that facilitates editing. And let computers do what they do best, process. And humans do what they do best collate ideas and knowledge.
First rule of computers. Don't waste time doing what a computer can do better than you.
the only language that would use more words to describe the article than what's in the article
Just because the decision has been officially put to rest does not mean that it won't be unofficially/covertly trifled to death. The original posts subject "Let's discuss having a discussion about a decision" may very well still apply.
The nmap guys seem to have considered a few scripting languages too for a while, and stuck to Lua because of a couple of reasons addressed in this conference (and probably in some other place in the NSE docs). While I know nothing of the people behind the scenes of Wikipedia, I do kind of trust the decisions made by the nmap team, so my guess is it's not a clueless decision.
That's because it's the devs. They tend to solve stuff in relatively short order.
(The reason a visual editor has taken so long is that it involved not merely an impossibly difficult problem - analysing wikitext - but politics as well - ten years' existing data and a requirement to keep the shitty, shitty format. Wikimedia has lots of sheer brilliance on tap, but this problem also required money and politics.)
http://rocknerd.co.uk
Knowing nothing about Lua(La)TeX, I wonder if this could be helpful in any way. Perhaps, at least in *TeX -> HTML conversion?
I don't have the bookmark here, but I followed the discussion ( I am on that mail list, and I am a huge fan of javascript ) is that with Lua, is possible to have "quotas". You can limit what LUA do in cpu and ram useage, while a javascript vm maybe will end stressing the server. This was the ultimate motive. This and that some features we easy to implement (where already implemented in the discussion). I think this mean that Javascript must add these things, and make easy for "language embeders" to control how much memory javascript take. I don't know how feasible is that.
-Woof woof woof!
Is there any reason why a templating language shouldn't be declarative? I can think of one reason: they were looking for something to translate their old spaghetti code into. If that's it, they're doing it wrong.
For example, the lua table object is used by the standard library (table functions) to represent C arrays with integer indexes or more accurately C++ vectors. However, in general you should not attempt to use the resulting table object in any other way than provided for by the table functions. It would have been more user-friendly to have an own vector type for this.
Although it isn't a problem most of the time, sometimes you want to preserve the order in an associative array with non-numerical indexes like you are used to for example in PHP. As far as I know this can only be achieved by having a second table defining the order.
I really like using "or" to express default initialization anywhere though, this will assign "die" if funny is null (or false): ..
function be(funny)
funny = funny or "die"
end
Hey don't blame me, IANAB
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.
User-generated anything (code, data, content, etc) is best supported when you allow many modes of expression, and freedom to change without a standards committee getting in the way.
On the other hand, machines require a fixed standard, or something that changes relatively infrequently.
For this reason, I think the choice of any scripting language here is as ill-conceived as the web itself being standardized on HTML/JavaScript.
Great. Now if they actually handle the problem of people tapping the proverbial delete button like it dispenses morphine, then myself and a lot of editors will actually have a reason to return to that hellhole.
There is no justification (outside of highly illegal content) for articles being deleted as rapidly as they are. Not in the era of cheap bandwidth, cheap disk space, and crowdsourcing.
Random Thoughts From A Diseased Mind (Not For Dummies)
Gebus, we're spending developer cycles on THIS?
How about the ability to drag an URL into the body of an article to automatically create a reference?
Which is more important?
You can't use JavaScript/HTML to write the backend. Concurrency in Javascript sucks. Look at Node.js. By any objective measure it's extremely grotesque, not withstanding its familiarity. There are easier ways to do I/O than by creating a gazillion closures at run-time around a single event loop.
Lua has real coroutines and is extremely easy to integrate and extend without necessarily having to refactor your existing base. 'nuff said.
A way to make use of the skillz I acquired writing scripts for the PtokaX DC Hub.
Learn the difference.
(Not that the OP knows any better, but if you're going to argue you should at least have a basic knowledge of what you're talking about. I know, I know, "are you new here?", etc.)
Looking at the discussion on Lua vs JavaScript, it seems to me that Tim Starling already had made up his mind, and basically even with 3 people asking and pushing for JavaScript, and none except Tim for Lua, Tim just didn't listen to their comments.
Since when is the indexing offset important? You should be using "zip", "map" (or even "parallel-prefix") and the like.
That's the thing that irks me most about Lua. It pretends to be "high-level", but it isn't really. (Well, that and weak typing. There really is not excuse for that -- other than ignorance.)
HAND.
Stop your bitching and unjustified mongering. If your articles weren't speedily deleted, Wikipedia would be obligated to keep your content there for at least a week (if someone proposed deletion as soon as you created), or longer if you dispute the proposed deletion and someone moves to initiate a deletion debate.
On the other hand, if it *were* speedily deleted, then it's your problem and your problem alone. The criteria are designed to be as narrow as possible, and you really have to have created a really inappropriate article in order for it to be rapidly deleted, buddy.
I use it as a plugin language for a high speed C++ HTTP server. Its easy for the rest of the company to write custom handlers to fit their specific needs.
Next up, the logic used to decide which plugins to run, and in what order, is so convoluted in C++ I am embedding a Prolog engine in the system.
Stand back! I'm going to try Predicate Logic!