A Web Console ( of sorts )
March 22, 2007I’ve been reading Paul Graham’s book on ANSI Common Lisp, and Gleick’s Chaos, and probably a Remo Williams adventure or two ( gotta have the mindless fiction, it’s like TV but, Remo is entertaining ). At some point, while reading either Graham’s book, or essays on his website, i realized that i could implement a “top level” ( of a sort ) in PHP. It wouldn’t be as powerful , but it would allow me to interact with my system in a way that would normally require lots of screwing around otherwise.
So I sat down and coded it up before work one morning and then a few days later I updated the console to utilize a bit of AJAX to support history browsing. It has worked terribly well, i’ve been pretty impressed with what i’ve been able to pull off with it. Building new classes has gotten easier, because i can build out a test harness quickly and just keep executing it while i’m developing, but the more impressive bit is when I have a bug in the system, i’m able to test specific pieces in the system quickly without having to open up a bunch of different files.
I realize that this is not the behaviour that a top-level provides, as a top level allows you to drop new classes/methods into the system and they stay there until the system is rebooted or you get rid of them. However, i’ve sorted through this by using a text area for the input, giving me the ability to write large bodies of script. This allows me to write classes/methods/etc and execute it all at once, so while it is not exactly the same, the spirit is there. I suppose it would be relatively straightforward to add in some stuff to actually write out these things to files and then have them hang around indefinitely, but there’s some issues with the implementation that make it a non-trivial problem, and i don’t know that there’d be much benefit.
The system is almost completely stabilized from the massive rewrite of pretty much everything. The resource management system is almost there, a few things to finish as part of the cleanup of the database during the move to Postgres.





