Bespin 0.9a1 released: multiple Bespins, code completion

Havi Hoffman

Bespin 0.9a1 features multiple Bespin instances, the start of code completion, simpler packaging and a curious new version number.

Multiple Bespins

Ever since we released the first Bespin Embedded, we’ve had requests on and off for the ability to have multiple Bespin editors on the page. When you factor in complexities around the plugin system, allowing multiple Bespins on a page is non-trivial. But, now multiple editors on the page works fine:

Multiple Bespins with command lines in white

The screenshot above shows off multiple Bespins with two of the new features from Bespin 0.8 (the white theme and the ability to include the command line). A couple of interesting implementation notes: Bespin uses Charles Jolley’s Tiki CommonJS module loader, which supports separate “sandboxes” of modules. The modules are downloaded from the server once, but each Bespin instance gets its own sandbox. That way, modules that store data in module-global variables will not get confused about which Bespin they’re working with. Settings and themes are shared between Bespin instances.

Code Completion

The other big new feature is one that is available today, but will become easier and smoother to use over time. Bespin can now do code completion, take a look at this screenshot for an example:

Code Completion Example

As soon as you hit “.”, Bespin will try to figure out what is available on the object you’re accessing. That information is gathered up beforehand in the well-known ctags format. We’re using the jsctags project (from Bespin team member Patrick Walton) to generate the tags. Using jsctags, we’ll eventually be generating the tags right in your browser (that’s the “easier and smoother” part that’s coming in the future).

Simplification

Bespin 0.9a1 simplifies two things over 0.8. First, there is now just one downloadable “Bespin Embedded” package that combines the features of both the “Drop In” and “Customizable” packages that we offered in previous releases. You can download this one package and deploy the contents of the “prebuilt” directory to your server, and you’re all ready to go! If you need to go beyond that, you can make sure you have Python installed and customize away.

The second thing we’ve simplified was the signature of “command” functions. A “command” in Bespin is basically any action you take in the editor or the command line. In versions prior to 0.9, commands took an “env” argument as the first parameter. With 0.9 onward, you should no longer include that parameter and instead just grab the “env” variable from the “environment” module.  There are more details of this change in the Bespin 0.9 Release Notes. A new tutorial on making commands is coming today or tomorrow.

Version Numbering

To date, every release of Bespin has been an alpha release. With 0.9 (codenamed “Edison”), we’re switching to the kind of release cycles used by stable and mature projects. We’ll start with a series of alpha releases that are not yet feature complete. Then we’ll move to beta test releases to work out any kinks before having a final release. 0.9a1 is no more or less “alpha” than 0.8 was, but the version number reflects that we’re heading toward a stable state.

Download Bespin Now

Download Bespin Embedded 0.9a1. Take a look at the full 0.9 Release Notes for more information about what’s new.

Stay tuned for more interesting developments in Bespin this week.

Kevin Dangoor, on behalf of the Bespin team