Blog_COLT_FeatureImage

Recently, a new tool stirred the Flash Community, and if you’re a fan of Bret Victor’s speeches regarding live coding / drawing / building game mechanics from geometric shapes, this will also interest you!

COLT (short for Code Orchestra Livecoding Tool) is a live compiler for speeding up the flow of development for ActionScript developers.

In the best scenarios, a developer only has to wait a few seconds for an entire small project to compile. But trust me, there’s some larger projects that can literally take minutes (I’ve worked on some that took 10-20 minutes, or sometimes it would even fail completely due to weird circumstances, such as other active programs / time of day / position of the moon / weather conditions ).

Such situations ultimately turns developers sour, hating their lives, raising their fist to the ceiling – and finding ways to kill time instead of staring lifelessly at their screens.

What does it do?

The idea is basically to minimize the time you’re fiddling-around with a particular method in your code, so that COLT can compile it immediately each time you save the “Live” class file, and observe the changes from where you left-off in the last compilation (only… it never really closes the application! it continues to run!)

Preview Demo (SWF)

This area requires
Adobe FlashPlayer version 9.0.0 or above.
iOS Devices are not currently supported.


This area requires
Adobe FlashPlayer version 9.0.0 or above.
iOS Devices are not currently supported.

Try clicking and holding the mouse to “attract” nearby balls on the demo above.

Preview Image

First_COLT_Experiment

The Goods

What I’m really liking so far is, well the fact it re-compiles the project as soon as I save the file I’m currently focusing on!

I didn’t think it would work at first, but I was surprised that modifying referenced-methods called within the [LiveCodeUpdateListener] method ALSO gets refreshed in the live SWF.

Compilation times seems very fast too. I’m not sure if it updates just a portion or the file, but regardless of how it’s doing it… NICELY DONE!

The FlashDevelop plugin seems to work really well to transfer most  of the project details to the COLT project file.

COLT_Plugin_Shot_02

I haven’t tried these features yet, but for larger development-teams, these are jaw-drop  worthy:
- Updates to multiple devices;
- Multiple Developers / Designers can collaborate on the same live project.

The Bads

It was difficult to get it working at first. I probably spent a good hour trying to solve some runtime errors with the COLT application itself and the FlashDevelop plugin. Two of the issues I had to reach out to the devs are:

lcmxmlc Error: unable to open ./themes/Spark/spark.css;
Error when trying to run on a project in FlashDevelop

One issue that remains is trying to use COLT with bigger projects. I haven’t had any success the first time around. I’ve only got it working by starting a new AS3 project strictly for experimenting with it. COLT is still very young after all! The LiveCode compiler may not be based on the latest available compiler (aka: ASC2.0), then again I have no idea what they use under-the-hood.

Another thing that was a bit of a “bummer” for me was having to include some housekeeping code to clear / clean the Flash stage. Each time the recompilation occurs, basically it leaves everything from the last session on the Stage. This isn’t so much of a problem if I was rebuilding an entire level for a game since a cleanup method should be expected. But for simple experiments or even behavior-design coding, this feels like putting a stick in your wheels (only a small one though, a toothpick even!).

Oh! and Internal classes (such as helper classes appended at the end of an ActionScript class file) doesn’t seem to support the [Live] and [LiveCodeUpdateListener] metadata tags. Maybe I didn’t use it right, but it wasn’t a huge deal to make the helper class it’s own file anyways.

It is already known that constructors would typically be the first place people would try to use the COLT on. But given the way it’s treated differently at runtime than regular methods, you will have to toss your initialization code in a separate method and call it from your Class constructor.

Conclusion

This is an amazing giant step in the right direction for trimming down compilation time. COLT is the worldwide cure for Flash developers losing their minds from wasting hours of painful compilation-time just to test a few modified lines of code.

It no longer has to feel like a tough decision before compiling. You just save your file and PRESTO! Changes are up!

Plus, Project Managers will probably love COLT since developers will do more coding than trips to Starbucks / Tim Hortons every 10-20 minutes!

Try the Code Orchestra Livecoding Tool yourself, then convince others to try it too ;)

Stay up-to-date on the development of COLT by following:
Code Orchestra (@code_orchestra) and Makc (@makc3d / makc3d.wordpress.com)