Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wikipedia faces unique challenges, however, that many web applications do not face. Almost the entirety of the page rendered is user-generated content produced from hand-written wiki markup that must be parsed and rendered, and that uses complex nested templates. MediaWiki is basically a turing-complete applications platform. The wikipedia page for Barack Obama transcludes 199[0] unique templates, with 585 total non-unique invocations, and that's not counting the templates transcluded by those templates. Some of Wikipedia's templates are so complex that they had to be rewritten in Lua.

I don't think Wikipedia is really a typical case. Most websites probably don't have the CPU burden Wikipedia faces.

[0]https://en.wikipedia.org/w/index.php?title=Barack_Obama&acti...



> MediaWiki is basically a turing-complete applications platform.

Perhaps MediaWiki should figure out how to use a weaker form of computation?


Oh, the turing-completeness is new, it wasn't in the past. Using Lua was to improve template performance.


Actually, it's been around for years - it was accidental. ParserFunctions is a good example of a DSL accidentally achieving Turing-completeness, at which point people start doing awful, awful things in it because they can. So they went to Lua because a proper programming language is superior in every way to an accidental one.


You actually have to be really careful to design a language that's both useful and not Turing-complete. Regular expressions are one example of such a language, but they are not strong enough for templating.


Yeah. It wasn't actually intended to be Turing-complete, but then some excessively creative goddamn lunatic came up with a way to beat MediaWiki syntax with ParserFunctions into yielding a truly hideously inefficient "if" statement. Soooo they gave up and codified that so the CPUs wouldn't melt.


I am afraid that the way those mark-ups have been used is the way they have encouraged.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: