| CARVIEW |
Motivation
The motivation for this language came while I was trying to write games. Game creation inevitably requires a lot of tweaking. As you are playing the game, you might decide that you want a certain thing to be bigger/smaller/faster/greener/whatever. It would be great if you could always make changes like that instantly, but unfortunately this isn't always easy.The naive workflow for creating code looks like this:
This process isn't very interactive or fun. And as the app gets bigger, the compile step will take more time, and this process becomes very inefficient.
Existing solutions
This is not an unsolved problem. Many apps written in an interpreted language can support live-reloading of code. Even apps in a non-interpreted language (like C++) will often go to the trouble of integrating support for an interpreted language (like Lua), so that they get the benefit of live-reloading.However, these solutions aren't terrific. First, you are usually limited to how much stuff you can change without needing to recompile. Second, these solutions usually take a lot of programmer effort to set up and maintain.
(And then there is Smalltalk, which solves these problems. However, this language didn't fit my needs, for reasons which are outside the scope of this 5-minute essay.)
So, I wanted to see if I could solve this problem in a better way. I came up with a list of requirements for this dream language.
Requirements
Requirement #1: While running an app, I should be able to modify a source file, reload it, and have the program's state be preserved across the reload (as much as possible).
But then, I also want to change stuff *inside* the program. I want to be able to just click something to change its color, or reposition it, or something else. I also want to have a variety of interfaces for viewing and changing code.
Requirement #2: It should be easy, from an API perspective, to inspect and modify code.
Then came the question, if I modify code at runtime, how do I save those changes? I didn't like the Smalltalk way of saving to an image. I like just using text source code. The world already has a great selection of text editors, source control systems, syntax highlighters, IDEs, and other tools which operate on text files. I don't want to rewrite those.
Requirement #3: We should be able to save modified code back to text, with whitespace and comments all preserved.
The Circa workflow
With all these pieces in place, our game-creation workflow looks more like this:
Which I think works pretty well.
Conclusions
So that's the core of what Circa does. There are some other neat features that I didn't mention (including, all of the neat stuff that happens inside the "Make Changes" step above). But this is only a 5-minute tour.To find out more, click here.
Circa is still a work-in-progress. To see the current status of its implementation, click here.
Thanks for reading!
- Andy
For the source of this site, click here