Posts tagged as:

Seaside

This semester I’m going to have my Ruby and PHP classes build a form driven, AJAX-y web application as the final project. This is a bread-and-butter assignment that performs the basic task of storing form data in a database then displaying it. We’ll deal with the ever present Persistence Problem by using a SQLite3 database to store user input, and the AJAX/Javascript layer will be all JQuery.

I’ve created the PHP proof of concept site at http://www.istoasisto.com, and it looks like this:

A classroom project of this size can be completed in four to six weeks, depending on the programming and web skills a student brings to the class. More is always better.

The PHP course will be starting from scratch (no cakePHP, no Drupal, no Joomla), while my Ruby course will be using Rails. I’ll be doing the project in Seaside. When all is said and done, we will count the lines of PHP, Ruby, and Smalltalk to see who get bragging rights for writing the fewest lines of code.

If you want to work along wtih us, your project should have these features:

  • An HTML form.
  • JQuery form manipulation.
  • AJAX via JQuery.
  • Validated form input.
  • Form data stored in a SQLite database.
  • A Recaptcha form.
  • User data safely displayed (potentially harmful characters sanitized).

There are dozens of features we could hang on this skeleton: pagination, search, social features (Twitter, Facebook, Buzz, etc), as well as polls, voting, thumbs-up/down, email, XML export, RSS feeds, Section 508 compliance, and more. I’ll be satisfied if most of my students can achieve basic functionality before semester burnout sets in.

And about that Seaside course—there isn’t one yet. But it is on my TODO list for future courses at CCSF. For the time being, as part of my own Smalltalk education, I’ll take this opportunity to complete the class project using Seaside. Since Smalltalk and Seaside are new to me, I’ll be starting on the same page as my PHP and Ruby students. This will be fun. I’ll be doing this project with Cincom Visualworks Non-Commercial which is free for non-commercial use on Windows, Linux, and Mac OS X.

OK. I’d better get to work on the Ruby part of this project before the Rails team unleashes another new product release just to confuse me.

Happy hacking…

6 comments

Today I felt a compulsion to install Smalltalk on my little 256MB Slicehost slice. It was an itch I just had to scratch.

My first step was to admit (to myself) that I don’t know the first thing about deploying any kind Smalltalk anywhere. I can deploy PHP and Rails in my sleep, but I’m clueless about Smalltalk. I would have to do some research.

My first resource was James Robertson’s blog. He’s the Smalltalk evangelist for Cincom Smalltalk and has created countless Smalltalk tutorials and screencasts over the years. I’ve been following his experiences installing VisualWorks Smalltalk on his Slicehost server and noted that he mentioned having a problem running his 32-bit VM on a 64-bit server. He solved that problem by installing the ia32-libs. I anticipated that I would run into the same problem since I am running a 64-bit version of Ubuntu.

My second resource was the Linode.com support library. My original plan was to install both VisualWorks and Squeak, but as time slipped away, I realized that I had dreamed too grandly. I don’t know much about Squeak, but I know nothing about VisualWorks. I realized it would be less painful to go with Squeak. I googled “deploy pharo” and found a nice Seaside deployment guide on the Linode site. I took that path of least resistance and decided to install Pharo and Pier (a CMS written in Smalltalk).

I cut and pasted the Linode commands into the terminal and in 5 minutes I was ready to go. But, when I issued the command to start Seaside, I got the message: “Could not find squeak”. I recalled James Robertson’s gotcha and installed the 32-bit Intel libraries. I’m running Ubuntu, so I used this command:

sudo aptitude install ia32-libs

I won’t post the Linode article here; you can check it out for yourself if you’re interested. I just cut and pasted away as directed. Seaside started up on port 8080 perfectly. I poked around a little, took a few screenshots, then shut it down. It’s completely unsecured, and since I don’t know how to make it safe yet, I don’t want to leave it running unprotected. Right now I’m happy with taking baby steps.

By the way, here’s the command I used to run a squeak without a gui (headless). I’m saving it here for future reference; I had to do considerable digging to find it.

/opt/pharo-vm-15-2/squeak -vm-display-null /srv/www/pier-app-1.2/Contents/Resources/pier.image

My next step is to configure Apache to proxy Seaside. Once I get the proxy working, and learn more about securing the site, I’ll leave Seaside running. By the way, I have proof of life. Cool.

When I saw this page I rewarded myself with a cup of hot chocolate.

Keep hacking…

3 comments

Today I put up a proof of concept Seaside Smalltalk site…for a few minutes. You can read about it on my Smalltalk blog if you are interested in this nerdy stuff: SmalltalkTheGoodParts.com

Keep hacking…

0 comments

Hello world!

January 14, 2010

in Editorial

Welcome, intrepid voyager. You have somehow landed in my Smalltalk learning blog. As I work through the process of learning to program in Smalltalk I will be writing about my experiences here.

I am a teacher at the City College of San Francisco, where I’ve been teaching Perl, Ruby and PHP since 2000. As an inquisitive person, I’m always interested in new ideas. In this case, an old idea and a new idea — Smalltalk and Seaside— have caught my eye. In this blog I will document my trials and tribulations as I learn Smalltalk.

By the way, I don’t pretend to know, at the beginning, which parts of Smalltalk are the good parts. I realize that the most languages have good parts. And every language has its own set of gotchas. It will be fun learning just how good Smalltalk is.

My plan is to learn enough Smalltalk to teach a course at CCSF. Of course, that idea presupposes that there will be enough students to support a class. One of the obstacles any language, new or old, must face is the tendency of people to run with the herd (Java, PHP, Python, etc) and to shun languages that don’t have name recognition: Smalltalk and Lisp, for example. I believe that Seaside is a killer app for Smalltalk, and I will be focusing my efforts on building an application as part of my learning regimen.

Happy hacking…

3 comments

DHH has brilliantly coalesced the last 15 years of MVC web practices into a Perfect Storm (Rails). He dotted all the i’s and crossed all the t’s, mercifully allowing us to embalm the template-based MVC web design-strategy, put it into a glass coffin, and ship it off to the Smithsonian.

Here’s my Rails eulogy.

The first time I saw Rails—after doing Perl and PHP web development for a few years—my mind was blown: what would take me a week in Perl, or a day in PHP, could be done in 5 minutes with Rails. At the time I jokingly described Rails as crack for web developers. It’s so good, don’t even try it once!

Rails changed the way I do web development, and whenever I drop back down the evolutionary ladder to PHP, it’s like having dental surgery without anesthetics. Painful! All the repetitious tedium—building infrastructure, writing SQL, connecting to the database, the embedded language—was taken care by a the shiny Ruby black box. Rails is a web programmer’s deus ex machina.

“Don’t Repeat Yourself,” said DHH, and he lived up to his word. Rails nailed the door shut on Web 2.0.

Now that Rails has brought Web 2.0 to its end, can it do the same for Web 3.0? The answer is that Rails is no longer on the leading edge. Rails’ replacement has already dropped while you were trying to get a handle on Rails and Ruby. The new guy in town is Seaside.

Seaside arrived several years ago with little fanfare because it runs on Squeak, a relatively new version of Smalltalk. As you may know, Smalltalk is an “old” language that most of us have only heard the old-timers get sentimental about when they talk about the Good Old Days of the Computer Science Frontier.

It turns out that the Old is New again. It’s time to break camp and move on to the NeXT Level. You can get a head start on your friends (and foes) by checking out this ear-opening Floss interview with Seaside’s creator, Avi Bryant.

Hey, you don’t want to miss the Ground Floor again, do you? Give Seaside look.

2 comments