The reason for praxis

When I saw what was possible with Lisp Machines, Smalltalk environments (Squeak, Croquet) and Emacs, I realized that what I loved most about those systems I could create for myself very easily just with an embeddable language and a render loop. The most valuable ingredient that makes this work really are the embeddable languages, so thank you so much to the makers of Lua, FICL Forth and s7 scheme for making these beautiful languages accessible through a C API.

I’m surprised that systems like praxis aren’t more common considering how fun it is and how easy it is to set up, or maybe its just that while this style is perfectly suited to my taste, its not necessarily what other people prefer.

One way of looking at praxis is as a repl augmented with a graphical and audio engine to use as you see fit. The socratic dialogue you have with your world as you define it and build it is enhanced by visualizations you are free to add in any form and at any stage. For instance, say you are making a simulation, and part of it calls for an implementation of AI strategy which involves exploring a complex algorithm. You can change the render function to not run the usual simulation, and instead temporarily focus on the behaviour of the AI algorithm. When you are satisfied, you can swap your old simulation render and state back in and pick up where you left off.

Although the primary intended way of interacting with your world with praxis is through the programs you write in the editor, there are many Lua calls that are generated from input events that you can redefine. In addition, the graphical engine has features such as a pick cursor and a non-banking mouse camera movement model with the ability to change the ground plane (orbiting, panning, moving in and out) which when combined with the introspection facilities of Lua and commands that allow you to modify the text edit buffer, allow you to add powerful customized editing features to your environment. For example, at the press of a button you can have praxis perform a simple behaviour such as inserting the pick position into the program, or something more complex such as inserting the definition of the update function for the object the mouse is currently hovering over so it can be edited. This was inspired by the “code gun” idea in the “Code Hero” project, where a piece of code can be “fired” at an object in the world and it would be applied to the object that was hit. The same thing can be achieved in praxis for example by setting the definition of LMBDown to be: find the object the pick position is nearest to, then run the code in the “code gun” with this object as a parameter.

So praxis is the result of me implementing all the various things I’ve seen in other live coding environments that I thought was cool. The Lua files that come with praxis are a little messy, because I make something and then get distracted by the next shiny trinket I want to make. I’ve added things like portals you can peer through (the sort you see in the Croquet Smalltalk project) which I’ve implemented with stencils, midi recording, a modifiable camera ground plane, being able to draw to textures and use them and other assorted bits and pieces. When I added s7 scheme, I got some SICP code that I liked working with it (I like all of it naturally, but specifically, the symbolic algebra stuff). I added Forth just because I like it. In praxis, another key idea is that you can recover from any fault, including an infinite loop, or even a fault deep inside the call to render. The editor and a basic ground grid is always available so you can see where the problem occurred, fix it, and continue the render/update loop with minimal disruption to the state of the system you are making.

Please enjoy praxis, and I hope you create many wonderful universes with it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s