Friday, February 27, 2009

Coding in the cloud: Mozilla Labs Bespin

Bespin is one of the most interesting newborn project at Mozilla Labs:
Bespin is a Mozilla Labs experiment that proposes an open, extensible web-based framework for code editing that aims to increase developer productivity, enable compelling user experiences, and promote the use of open standards.
The idea is simple making coding more natural by separating this action from the heavy and often unnatural environment of the offline IDE.
I mostly code in python and I'm always quite interesting in new IDE projects and willing to try them. As far as I'm concerned I'm not truly satisfied with any of the python IDE available and so get stick with the one coming with the package itself.
To give Bespin a try just go to the project's home page and sign in to have access to the dashboard.
Note that Bespin only works with browsers that support HTML 5 property "Canvas" (this excludes Internet Explorer), have a text rendering API, and support JavaScript.
Browsers that support Bespin:
* Firefox 3.x
* Webkit Nightly Builds (development version of Safari)
* Google Chromium (development version of Chrome)
Right now to start a new project can be a little tricky so just follow the tips here below to get started.
The canonical way to start a new project would be to import your project (or a blank archive) from the dashboard in the following way:

Projects must be hosted on-line and compressed in ZIP or TAR.GZ formats.
What if you haven't any stored project and wanna begin one from scratch? Then follow the next tip:
1. From the Dashboard click on 'SampleProjects'
2. Double click the readme.txt file to enter the Editor.
3. From the command line at the bottom of the Editor run



4. Run "newfile index.html"
5. Run "save index.html"
6. At the top of the screen, next to the logo, click the "Up" icon.
7. You should now see your project, containing the inex.html, in the browser
Bespin is especially focused on online coding and is designed to implement online collaboration on the projects, something maybe like Google Documents. However if you are suspicious about cloud computing in general, or do not feel comfortable to upload your code to the cloud, you can easily install your local server.
Here's how I did this on my laptop running Kubuntu 8.10, KDE 4.2. There are currently only two supported servers: a python server and a java server. I will discuss it setting up the python server because this is the language I use and I want to support.
1. Dowload Bespin source from http://hg.mozilla.org/labs/bespin/summary(check files and then choose the archive you prefer).
2. Extract the folder in your desired location under /home
3. from the top level folder install the required packages for the environment with:


4. After the installation is finished we can configure and start the local server with the following two commands:

If all goes well you should now see something like this on your terminal:


(python)gsr@gsr-laptop:~/Bespin_NimbleNimbus/backend/python$ paver start
—> start
Server starting on localhost:8080


However it's quite probable that you will face some kind of error -at least I did-. Hopefully these should concern silly-and-easy-fixable module not installed. If when you run 'paver start' the terminal shows a long flow of errors, just go to the end of the traceback list and identify the name of the module not installed, then type:



then try again 'paver start' and if there still is a not installed module, just install it by repeating the above mentioned command. I had to do this three times because I missed sqlalchemy-migrate, httplib2 and another one.
Once your server is properly set up just warp to http://localhost:8080 and the Bespin welcome page will show up. You must sign your user in (you have to do it again if you signed in online because now you're on your own server) and then you're ready to go.
To view the list of the available commands just type 'help' in the command line. Please note that the commands vary from those related to the Dashboard and those for the Editor.
Although this project is still on its initial state it's also already usable and if you want try it and give your feedback to the development group you can do it accessing the Google Group here. You should keep in mind that Bespin is under heavy development so new features are continuously added and also the feel and the proceedings can vary quite much in the near future.
If you are thinking about what does Bespin mean, you should try to remember Star Wars The Empire Strikes Back and the gaseous planet of Bespin where the Cloud City were. Here below you can see the mockup of a Bespin logo found in the /mocks directory of the source. I know you'll remember.
Bespin is released under the MPL (Mozilla Public License)

No comments:

Post a Comment