The Second Coming of JavaScript

Context Free, Programming Comments Off

Some months ago, John Resig created processing.js - an impressive JavaScript port of processing, which draws its output on a ‘canvas’ element entirely client-side inside your browser (at least if your web-browser is Firefox 3 or a recent nightly build of WebKit, that is).

Now Context Free (the original inspiration for Structure Synth) has been ported to JavaScript too: Aza Raskin has created ContextFree.js (Source here).

JavaScript has undergone a tremendous evolution. From creating cheesy ‘onMouseOver’ effects for buttons on web pages to being the ‘glue’ binding together complex applications like Firefox or Songbird (the Mozilla application frameworks works by stringing together C++ components with JavaScript). Likewise Microsoft chose to build their Silverlight technology on .NET components which can be controlled by JavaScript in the browser.

And of course the ActionScript in Adobe Flash is also JavaScript. Adobe (and/or Macromedia) has put a lot of effort into creating fast JavaScript implementations - most notably their Tamarin virtual machine and Just-In-Time compiler, which in theory should make JavaScript almost as fast as native code - or at least comparable to other JIT compiled languages such as Java and the .NET languages. Tamarin is open-sourced, and will eventually make it into Firefox 4.

Finally, while the Tamarin virtual machine was built to execute (and JIT) bytecode originating from JavaScript, other languages may target Tamarin as well. Adobe has demonstrated the possibility of compiling standard C programs into Tamarin parseable byte-code (their demo included Quake, a Nintendo emulator, and several languages like Python and Ruby).

So perhaps a future version of Structure Synth could be running as C++ compiled into Tamarin bytecode in a Flash application…

(Structuring) Structure Synthesis

Context Free, Structure Synth, Digital Art Comments Off

Well, I started worked on a spare time project, called Structure Synth: a small application for generative structure synthesis (in 3D). The app itself will be built around an embedded editor with a OpenGL visualization window next to it. Here is a mock-up shot:

Structure Synth GUI

Structure Synth GUI

The structures are designed in a simple language, EisenScript (named after the Great Russian director, Sergei Eistenstein, of course). It will be similar, but not identical, to the Context Free Design Grammer that Context Free uses.

An EisenScript defines a Rule Set, where each rule is defined as a number of Actions.

An Action would typically be to perform a Transformation and either call another rule, or one of the built-in drawing primitives. As in Context Free rules can be defined recursively in terms of themselves.

Rules are allowed to be ambiguous: more than one definition for a rule can exist, and when ambiguous rules are encountered the Builder will choose one at random. Again, as in Context Free, it will also be possible to specify a weighting for each of the rule definitions.

Here is an example of how an EisenScript rule set might look:

EisenScript example

Structure Synth will be built in C++/Qt4.3/OpenGL and will be Open Source (GPL). It should be cross-platform (Windows, Linux, and Mac).

I’ve started a subversion repository here (Google Code Hosting), but will probably move to SourceForge.

Generative Art

Context Free, Structure Synth, Digital Art Comments Off

The Syntopia logo above was created by my first script in Context Free, a program I can highly recommend. It is a bit like Logo (does anyone remember this?) on steroids.

However, I’ve been thinking of ways of extending Context Free into 3D, and will start posting some of my design sketches for Structure Synth - an IDE/Language for creating generative art (like Context Free).

I plan to write it in C++/Qt4.3/OpenGL and it should be runnable on Windows/Mac/Linux.

Variation on the Syntopia Logo

Variation on the Syntopia Logo

For an example of a Context Free script, the syntax for the above picture can be downloaded here: circles.cfdg.

The syntax for Structure Synth will be quite similar to CFDG-script but with a few twists: like the ability to ‘retire’ rules after a certain number of either recursions or iterations, and the option to change (rendering) settings when a rule is executed. Naturally the ’state’ operators (like rotations and deformations) also need to be adapted to a 3D world.

There will be an integrated OpenGL viewer, and I plan to add PovRay support for creating high-quality views of the 3D-models.

More details will follow in the next weeks.

Context Free Art

Context Free, Art Comments Off

Context Free is a programming language and IDE for creating highly complex and stunning images (think Iterated Function Systems gone wild). Their gallery showcases the potential diversity of this unique application.

Context Free (Graphite)

Context Free (Graphite)

Based on a design by N.Design Studio. Modified by hvidtfeldts.net (more...)
Entries RSS Comments RSS Login