Small status update on my Smalltalk & Newspeak projects
I don’t have time right now to keep working on my Smalltalk & Newspeak projects because one of my commercial software projects has reached beta status and I’m trying to get it ready for release in January (bills sadly don’t pay themselves).
I will however work full time on my Newspeak and Smalltalk projects over the holidays, between Christmas and New Year’s which should allow me to get a lot done.
Smalltalk Labs Browser for blogs released!
Smalltalk Labs Browser for blogs is available…. NOW!
http://slbrowserfb.appspot.com interactive installation instructions are at the very bottom (click on “configuration”).
It’s free and open source, licensed under the Apache License Version 2.0 (both the client and the server). I had originally planned to release this under the MIT license but the Apache License was a better fit for reasons too numerous to name here.
You can try it out right here, just click on one of these classes (if you use a WebKit or Mozilla web browser that is): ByteString, SmallInteger, OrderedCollection. You can move the window around by dragging the title bar, or just let the auto positioning do it’s job which always tries to center the window over the clicked class name while not going over the window/document edges.
If you click on a class name with a web browser not supported by Smalltalk Labs Browser for blogs (let’s just call it slbrowserfb or SLBfb), or if you’re viewing the blog post in an RSS reader or on Planet Smalltalk, you are directed to the SLBfb website which then displays the class instead. You can try this by right clicking and choosing “open in new tab” on one of the class names, when doing that the code browser doesn’t open up. This was just a quick hack, there can be done a lot more with the layout by adding a few more interactive/dynamic elements here and there, but I think it’s pretty neat already.
This is only the beginning, at the moment there’s a lot left to be desired although initial reactions were quite positive. Next up is making the window resizable and providing a public API so that you can better integrate it with your blog’s / website’s design and hook into all the events to modify the functionality. I hope that as soon as the design can be easily changed, people will contribute some better looking default designs to the project as I’m not a designer and can only do so much (although IMHO it looks quite good like it is, but taste differs). The design is completely done in CSS 3, no images, so it’s modifiable completely without having to use an image editor.
SLBfb in action at Pharocasts
I’ve worked over the weekend to get a pre-release version of Smalltalk Labs Browser for blogs (I should really have chosen a shorter name for this one although really long product names are kind of funny) ready, exclusively for the newest episode of Pharocasts.
Head on over there now with a WebKit or Mozilla powered browser if you’d like to play around with it: http://www.pharocasts.com/2010/11/lightsout-game.html
If you use an unsupported browser, you won’t even notice that SLBfb is there, because then the class names that would usually be clickable to open the browser are replaced with pure text. This means if you put this on your website or blog you don’t have to tell your readers that it only works in WebKit and Mozilla browsers, they won’t even notice it’s there if their browser isn’t supported. I think that’s a rather nice solution. I might add support for Opera later on.
The design changed a bit since the last video I posted. I removed the area at the top that displayed the class comment so that there is more space for the list, which now holds the class comment, class definition, instance and class methods.
You can click on “hide list” and the list slides out of the way so that the full view space can be used to browse code. The public release version will probably allow you to move around in the list by using your keyboard in this view and additionally I might display small clickable controls to do that without the keyboard, so that even in full code view you can switch to the next or previous method.
This Pharocasts exclusive pre-release version doesn’t yet communicate with a backend server which holds all the source code for Pharo and other Smalltalks, that part I got only finished today. Thanks to the awesomeness that is Google App Engine, I barely had to do write any code which is nice ^^
If you have any issues with the pre-release version on Pharocasts or have suggestions for improvement or additional features, feel free to comment here or send me a Tweet @HaiColon or an email, HaiColon at gmail dot com.
Smalltalk Labs Browser for blogs preview video
This video shows how Smalltalk Labs Browser for blogs opens up when you click on a Smalltalk class in a blog post.
The animations use jQuery so you won’t see them if you don’t add jQuery to your blog, everything will be displayed instantly then.
Smalltalk Labs Browser for blogs
I thought it would be cool if a reader could click on any Smalltalk class I mention in a blog post and then a mini version of my Smalltalk Labs browser would pop up as a floating div and display this class for him so that he can browse the docs or the methods and hopefully understand my blog post better, without the need to have a Smalltalk image at hand. Could be pretty handy for tutorials too. Well, I started working on it right away, which means today :)
Here’s a first screenshot:
(The design and layout is subject to change, the class/instance method selector is missing and I’ll have to put the displayed code’s copyright and License info somewhere, probably as a hyperlink to the license)
It will probably take about a week (or longer if something else comes in between) before this is ready for use. I already got pretty far today though.
How it’s done
(Unless I change my mind about an implementation detail of course ^^)
I will have a webservice running on Google App Engine (yay free hosting!) which has all the standard Smalltalk classes and some popular libraries in a database, which are created beforehand by a Smalltalk script.
The browser widget connects to this service and then fetches all the information about a class it needs (method names, method code, class doc) as JSON and then displays it.
If you want to use the browser for a class that is not in the database, when you write a blog about your own projects for example, you can add this class easily to the browser as JSON, only for your blog. You don’t have to write this JSON code yourself, I’ll provide a Smalltalk class that outputs the necessary code that you then only need to copy and paste into your blog. You’ll probably just do something like this in a Workspace:
SLBrowserForBlogs convertClasses: #('MyOwnClass' 'MyOtherClass')
At first the database will have only Pharo classes, then I’ll add Squeak and other Smalltalks where the license permits code redistribution (meaning no commercial smalltalks). Newspeak should work too.
I’m not yet sure how you will use the browser in a blog post. You’ll probably use an html tag like
<span class="slbrowser squeak">ByteString</span>
which then gets automatically turned into a clickable link that opens the browser on the ByteString class of Squeak Smalltalk, positioned just above the link.