I like Lua as a programming language for its beauty and simplicity, but sometimes you have to defile a language with horribly obfuscated code:
L= {} for k,v
in next ,_G ._G
do L[#k ]=v end
L[10 ](([[p =prin t;for
'q=99, 1,-1'do' gg'q>1' th{n'p(
q.."'Bs' {f'!:::'{n 'th{'<114 ,'"..q.."
'Bs'of'!:: [.")gg'q>2't h{n's=(q-1) .."'Bs'{f'[
!::'{n'th{ '<!+$."{lse' s="1'B'{f'$ !::'{n'th{'
<onx."{nd; elsegg'q==1' then'p"1'B' {f'x!::'{n'
th{'wall,' 1'B'of'[!::. "s="no'mor{ '!::''{n'th
e'<'!4!"en d;p("Take'{n {'down,'pas s'it'around
,'"..s)p"- "{nd]]):gsub ("["..[==[$ 4[]==]..[[x
]].."]","" ):gsub([[B]] ,"bottle"): gsub("''?",
" "):gsub( "!:+","beer" ):gsub("gg" ,"if"):rep(
3-2):gsub( "<..","wall" ):gsub("{", function(_)
B=((B)or(3 ))+1;return( "eooe"):sub (B%4+1,(B+1
+2+9)%4+(# L[1]-13),(B* 2)%7)end))( L[#L]or...)Despite what it looks like, it is valid Lua 5.1 code. If it isn't immediately obvious what it does, then you can see the output.
The end product of a few days of hacking together code: an interactive Lua terminal, in the browser, via AJAX magic.

The javascript side was lovingly ripped from the TryRuby site (as it is conveniently BSD licensed). The server side is implemented using Apache, mod_lua, a custom "persistent Lua" C module and some Lua scripts.
Feel free to try it out, but remember that it is currently very crude and at the technical proof of concept stage, rather than nice user friendly stage.
mod_lua (what was mod_wombat, and is part of Apache core since version 2.3) is something which I'd quite like to work with for Google Summer of Code 2009. In order to work on it, you first need to be able to compile and run it. Doing this on linux is trivial - checkout the svn head of httpd, ./configure (with appropriate command line arguments), make and then sudo make install. Doing so on Windows is less trivial, but it can be done.
For my Windows setup, I've got a standard binary distribution of win32 Apache 2.2.9 (complete with development include and library files) running on Vista. This makes things slightly more interesting, as mod_lua targets Apache 2.3 and above, but I can't find win32 binary distributions of 2.3, nor do I feel confident in compiling it under windows. From this baseline, I did the following:
"E:\CPP\lua-5.1.4\src";"C:\Program Files\Apache Software Foundation\Apache2.2\include")LUA_DECLARE_EXPORT to the preprocessor definitions"C:\Program Files\Apache Software Foundation\Apache2.2\lib";"E:\CPP\lua-5.1.4\Debug")lua5.1.lib, libapr-1.lib, libaprutil-1.lib and libhttpd.lib to the library listcp "$(OutDir)\$(ProjectName).dll" "C:\Program Files\Apache Software Foundation\Apache2.2\modules\mod_lua.so")AP_DECLARE and AP_DECLARE_LUA throughout the codebase (patch available on the httpd-dev mailing list)ap_args_to_table and ap_body_to_table functions over from Apache 2.3's util_script.c into a new file, util_script_ap23.c. This is compilcated due to ap_body_to_table's usage of the request_req::body_table field, which is not present in the 2.2 version - but can be worked around via usage of apr_pool_userdata_[sg]et with the request's pool.httpd.conf as required to load and configure the module
(for comparison, similar info screenshot on the linux build)
So, time for the daily development screenshot:

Recent comments
13 weeks 6 days ago
31 weeks 1 day ago
1 year 5 weeks ago
1 year 13 weeks ago
1 year 13 weeks ago
1 year 15 weeks ago
1 year 21 weeks ago
1 year 21 weeks ago
1 year 21 weeks ago
1 year 26 weeks ago