rest of Allan's portfolio
CrossWise Source
This is CrossWise, a programming language comparison system. It's not a religion-based my-language-is-beter-than-yours kind of thing, it's more of a practical documentation source for programmers familiar with one language and trying to get used to another. In addition, it's a Wiki so users can edit and expand it.
This project is fairly involved. You should probably start out reading the front page It actually works, and you can start from that page if you want. Or, to dive right in, you can look at the Arrays page.
The system is built upon MediaWiki, the wiki engine behind Wikipedia. The MediaWiki FAQ. MediaWiki handles all user authorization, page management, etc.
Info in a wiki is organized into pages. Info in CrossWise is organized into a matrix of pages. The columns are different languages; currently CW supports PHP, Ruby and JavaScript. The rows are 'chapters'; general areas of functionality for the language. The reader doesn't read these pages directly; instead, code in cwView.php combines text from different pages on the fly to make the blow-by-blow chart that you see.
The content pages must be organized specifically to mesh with analogous text from other languages. Most concepts are illustrated with examples. In addition, there's a system being built to test all examples with the chosen language, see cwAudit.php . Authors write the content using markup syntax that is an extension of MediaWiki syntax, so that the examples can both be viewed and tested.
As of this writing, CrossWise uses 14 tag extensions and six hook extensions. You can see them set up at the top of cwMain.cpp . Each language has its own specific PHP source also; see cwPHP.php, cwRuby.php and cwJavaScript.php .
Fancy URL-fu supplied by Apache rewrite rules.
Trace and debugging code is typically not indented to make it stick out. As you can see, there's plenty of it; not done yet.