Tag: Smalltalk

Re-Infected by Smalltalk

I seem to be afflicted with a chronic, recurring condition, a sort of living nightmare in which I imagine myself a programmer. I’ve experienced this numerous times over the past several decades, but it appeared to be finally cured in my retirement as I focused my life more on spiritual matters.

But recently, I decided that I wanted to develop a couple of Web and mobile applications in support of my spiritual teaching as well as for the nonprofit Job One for Humanity volunteer work that I’m doing. Without much of a commitment to actually doing something, I started poking around in the world of mobile application and web development.

By a chain of circumstances I can only be described as being dragged down a dark rabbit hole, I encountered a language which I had explored previously as a possible development language and environment. I’m referring to the Smalltalk-inspired Amber language. In the three or so years I have been away from Amber, it appears to have undergone considerable growth and gained in popularity. More importantly, it appeared to have overcome most if not all of the packaging, delivery, and performance issues inherent in traditional Smalltalk.

Ever since I first discovered it something like 15 or 20 years ago, I have loved Smalltalk. It is my favorite, widely-used programming language by a lot. (If I omit the qualifier, “widely-used”, then that honor goes to LiveCode.)

So I was excited to encounter a vastly improved Amber product which is a tool that generates high-quality JavaScript code from working Amber applications. Even though I’m not a systems-level guy, I set out in an effort to install Amber on my Mac with complete confidence it would be a positive experience.

Man, was I wrong!

As it now stands, Amber does not apparently have any easy way to install on any platform. It involves so many dependencies and requires so much command console typing (which for me is far more painful than programming) that I was tempted several times to give up. But I persevered. However, I kept encountering roadblocks I could not decipher or understand, and when I sought help in the Amber community — or in one of the communities supporting one of the dependency modules — I got very little response and nothing definitive that actually worked.

As a result, after three days of mucking about with it, I gave up.

But that is not the end of the story. In the course of investigating Amber, I discovered that a newer dialect of Squeak Smalltalk — which, over recent years, has become the Gold Standard of free Smalltalk environments — was also capable of spitting out web applications using generated HTML, CSS, and JavaScript. This relative newcomer is called Pharo.

Not only does Pharo have a single-button install, its documentation is really outstanding. There are a number of free e-books available, several of them authored or co-authored by the original developers of the language, and they have a wonderful tutorial as well as an online video course spread over several weeks of in-depth training.

So now I’m off, once again infected by Smalltalk, learning this new dialect and the robust environment in which development takes place, for the moment at least happy as a clam. I truly hope the Amber team gets its act together on the installation side, because I’d love to explore it as well, but for now I’m sitting sale to master Pharo and make these new application ideas a reality.

P.S. to Laurence. You knew this would happen, didn’t you?

 

Choosing Between JavaScript and Python and Ending Up With CoffeeScript

I’ve just about completely given up my Web design & development business as a way of making a living these days. I’m focusing instead on being a content creator for clients who can benefit from my ability to research and absorb information on a broad variety of topics quickly and to equally quickly render my knowledge into cogent words. These can then become blog posts, press releases, long guest articles or for that matter eBooks.

But that doesn’t mean I’m giving up my long and deep interest in building stuff for the Web. I’ve just decided that I no longer want to do so under deadline and for clients who have to depend on me to finish work on schedule and under budget. There are many reasons for this decision and they’re beyond the scope of this post. Suffice it to say that I’m now looking at Web development more as a hobbyist.

That has been incredibly freeing.

Since what I want to build for myself — and for the occasional friend or non-profit who is willing to wait for the result — are Web applications rather than standard Web sites, I want to choose a language in which to work that I can have fun writing, that doesn’t require me to spend too many hours poring over arcane (i.e., C-like) syntax, and in which I can be reasonably productive on both the client and the server side of the Web.

I began my new study of this subject open to any language. I surveyed the field, narrowed it to a few, spent a few hours examining each and reading positive and negative reviews and reading sample code. Ultimately, I narrowed my choice of language to three: Python, Smalltalk and JavaScript.

The first big problem I ran into is that there really isn’t a very good way to handle the client side in Python. There are kludges and vague attempts at translations, but none of them is either stable, well-supported or very clean in terms of the way they handle the output to be stored in the client. In essence, I can substitute Python for PHP with ease, but I’m still stuck with a four-language solution (HTML/CSS/JS/Python).

Smalltalk suffers from nearly the opposite problem: deployment on widely available Web servers is all but impossible. There are a couple of Web servers written in and for Smalltalk but they are little-used, and require me to become the maintainer of a server. That’s not my interest.

Still, I clearly want (need?) a single-language solution for client and server-side programming. Clearly the only real widely used language that meets that requirement is JavaScript. But the syntax. Ugh.

CoffeeScript LogoBut then I remembered encountering CoffeeScript. I took a quick look, read and worked through a quick tutorial, and then spent a couple of hours investigating its use in Web development. I am impressed with the clean syntax of the “language” (it seems to me to be not quite a language but a sort of meta-language).

So my new approach is to master CoffeeScript and incorporate JQueryUI on the client side and (presumably) backbone.js on the server (though those choices are still wet paint) to support the creation of Web apps. CS compares fairly favorably to  Python from a clean-syntax perspective, uses white-space formatting as its structuring mechanism (which I really like for a number of reasons) and has a pretty extensive collection of libraries, recipes and plugin/add-on tools.

A Little Book On CoffeeScript CoverI’ll keep you posted on my CoffeeScript journey. It may turn out to be another blind alley but I’m going to give it a fair try. My first step is to pick a good second book (beyond the Little Book on CoffeeScript with which I’ve already started to learn the basics.)

 

 

Looking Back 10 Years at My Vision for Smalltalk

My old colleague Laurence Rozier forwarded me an email tonight which was sent earlier today to members of the Squeak developers list. The email contained a link to a chapter entitled "The Future of Squeak" that I wrote for a compilation of essays and discussions about the Squeak variant of Smalltalk back in 2000.

It was strange enough to see that piece being referenced after so many years. But it was stranger still to read it over and realize that it could still elicit such passion in me for this, the Best Computer Programming Language Ever, tempered by my usual chagrin that its curators and caretakers were unable (and in some ways unwilling) to do what it would take to make Smalltalk the broad language of choice for software development I always thought it deserved to become. (On some level, I still think that, though the intervening years have taught me to be less certain of my own certitude.)

With the benefit of hindsight, it seems to me that Squeak ultimately did itself in with its "cuteness". Many of its creators and defenders were focused so intently on the language's proven utility as a language with which to teach children programming that they neglected the ways in which their UI design would perpetuate the notion that Smalltalk was a "toy language".

I had recently become aware of a Squeak fork called Pharo that showed some promise. In one of my "I love this stuff, why can't I work in it?" free-form explorations one night, I downloaded it. At first blush, it appeared these guys (including one of Squeak's major developers, Stephane Ducasse) had done what I thought had needed to be done to Squeak but didn't have the expertise to do myself. Tonight as I started this note, I decided to update my Pharo image. It's in process as I write this and has already failed once due to a connection timeout problem but I'm going to stay with it and perhaps explore Pharo a bit further even though there's no way I can justify taking the time to do so.

Smalltalk does that to me. It just gets under my skin and into my blood like no other programming language I've ever learned.