Processing and Racket

racket logoLately, I’ve been teaching myself the Racket programming language. It has a very interesting combination of tools, training-wheels-mode, and rocket-ship-mode. Originally built as a teaching programming language, it has significantly outgrown its pedagogical roots and is now a very robust applications language. I’m even developing a business project in it as we speak!

But it is a little rough around the edges. While it has a lot to make it a very easy language to learn, it is ultimately meant for computer scientists, those in training and those in working. There is an underlying feeling to everything that “this easy thing will eventually get harder.” As I see more and more inside the Racket community itself, I know that that is not their intention, and that they hope to be able to bring the joy of programming to everyone, regardless of their background.

 

A tool that has brought the joy of programming to everyone has been Processing. Processing, in a round-about way, brought a lot of features of the Racket[1] environment to Java. There are some very, very clear parallels between the DrRacket programming environment and the Processing editor. If this was unintentional, then it at least clearly indicates the superiority of the form as a pedagogical tool, as two independent environments have both evolved the same feature. If it was intentional, then there are ways in presentation in which Processing has grown past Racket that I think could be brought back to Racket-land.

Racket and Processing

At a very high level, you can see the similarities between the DrRacket editor and the Processing editor. I have intentionally made the code samples different for each, as they represent more of the canonical methodology for each language[2].

A checkboard. Left: DrRacket. Right: Processing

As an artist with a very strong background in computer science, there are things about Racket that appeal to me that Processing will never be able to do[3]. There are things about Processing that are very awesome and very nice that Racket could do, if someone with a very strong background in computer science took the time to make it so.

Where Racket succeeds over Lisp and Scheme, and where Processing–and thus Java–succeeds over all, is that enough is provided for you to not require you to learn the more advanced language features to get good results. Racket calls it “batteries included”, and it is, I believe, the most important concept that Processing borrows from Racket. Beginners don’t want to learn about “public static void mains”; to this day I still don’t know why that garbage is so necessary.

My hope is to try to bring some of the batteries of Processing back to Racket. The potential is there for Racket to be every bit as popular with artists as Processing is, today. The things that it lacks in comparison to Processing are relatively trivial to develop, in relation to the things that Processing lacks in comparison to Racket. By bringing artists into the much more powerful environment of the Racket programming language, once they have mastered the fundamentals of programming with the training-wheels mode, Racket can be molded by artists, for artists, to let people think and program in ways that the programmer-artist chooses, not in ways that the original language designer chose for them. If there are two groups of people that I know hate being told how to think more than anyone, it’s artists and programmers.

I’d like to hear from the Hive76 readership, especially those who have experience with Processing (though all are welcome to comment), about what you like and don’t like about Processing, about programming, about art, about putting code down in text files, etc. This certainly applies to the Arduino crowd, as well, as Arduino is based on Processing. In the meantime, I have a few thoughts on where the work could begin.

Make the website prettier

First impressions are important, and most programming language websites are prettier than Racket’s. I would more readily crib from Ruby than from Processing here. Ruby’s website is very clean and concise, very inviting and pleasing. Everyone cares about taste, especially artists.

Racket’s website is built in Racket, with a sub-language called Scribble, specifically designed for building documents and documentation. It’s an excellent language, but its default styling is kind of ugly. Restyling the site is a low-hanging fruit that could bring in more people, if only because they don’t jump ship prematurely.

Make more dynamic examples for beginners

The Racket documentation has its heart in the right place, but ultimately feels like its drawing examples are just pat examples. The drawings aren’t very interesting and its not immediately obvious how one gets to more interesting things. See this page for an example. It’s easy to draw a smiley face in Racket, it’s much harder to draw a good looking smiley face. And before it becomes apparent, the documentation dives too quickly into the computer science topics thereafter. In contrast, Processing starts off with examples that are extremely visually compelling. As people are visual creatures by nature, this seems the superior methodology. Note that the Processing example is the introductory page to the documentation–one click off of the front page–whereas the Racket example is several pages into the documentation–two clicks and several screenfuls of scrolling off of the front page. Much more compelling examples in Racket are much more deeply hidden.

 

Finally, make more artistic things with Racket

The Processing website is built around showcasing what people have done with Processing. While Racket’s package system can be considered the same thing, to a degree (and it is already in the process of getting better), it is again not as visually compelling. Racket needs an elevator pitch, a high level view that shows the answer to “what will you do with Racket?”.

 

Footnotes:

[1] Historical Note: Racket has been around since 1994, when it was originally called PLT Scheme. They figured they lost more people being immediately associated with Scheme and Lisp than they gained, so in 2010 they changed the name to underscore the fact that there is so much more to Racket than the name “Scheme” implies. Suffice to say, for beginners it doesn’t matter, other than knowing that their is history to the project and it isn’t going away anytime soon.

[2] There are problems in both examples; both are overly simplistic and both would not scale well for large applications. But the gist of the difference is there, Racket is about functions that define what we want to happen, Processing (because it is based on Java) is about instructions. The differences to the non computer scientist are difficult to explain, so for now you will just have to take my word for it that the former is a generalization of the latter and is therefore more robust and open for greater expressiveness.

[3] For the computer scientists reading, succinctly: macros. You either know what I mean or you don’t, this is not the place to get into a technical description of macros. For the non-computer scientists, the best analogy I can make is magic. Magic isn’t real in our world, but I can think of nothing that comes closer to resembling it than the massive productivity gains that macros can afford, once mastered. But neither is mastery of macros in Racket required to do great work. Processing is what happens to languages like Java that do not have macros. In Racket, something like Processing would stay a part of Racket and not be a separate project.

The No-Video Game!

It’s a vidya game but not! A completely audio-based game, the objective is to use sonar to find the hidden submarine and destroy it with depth charges. But be careful! If you are not close enough to hit the submarine, it will get away and you must hunt it down again.

Got an Arduino Mega2560 on the innards side. Got the joystick and arcade buttons from Ada Fruit! Very nice quality, shipped very quickly, and not too expensive to boot. Box was just a little, prefab wooden deal from a craft store somewhere in the middle of nowhere. And the speakers, I think I pried them out of a few alarm clocks.

3 Hour Game Jam with GameDev.net

Next Saturday at Hive76 we will be hosting an international 3 hour game jam with gamedev.net. Contestants have 3 hours to complete a small game based on a secret theme, to be revealed at the beginning of the contest. This contest has a secondary requirement that all of the games have to be puzzle games.

Any programming language and API is acceptable, as long as it will run in some way (app or web app) on the judges 64-bit Windows Vista machine or their Mac Mini.

Third and second places are premium memberships (3 months and one year, respectively) to gamedev.net First prize is a $75 gift card for Amazon.com!

Organizer: Sean McBeth (Philip Fominykh at the assist)
More Information at : http://www.gamedev.net/community/forums/topic.asp?topic_id=566163
Saturday, April 10th, contest starts at 5:00PM

Grace Hopper

A day late for Womans History day, here is a post about another great female geek, Grace Hopper. With a PhD in mathematics from Yale, she became a Naval officer, pushed for Machine Independent programming languages, and became a Rear Admiral in the US Navy.

Wikipedia has a better entry on her than I could ever write, so I’d suggest reading that for a full Bio. Or better, watch her take on The Late Night Show and ham it up. I especially love the “I didn’t know [about computers] Since it was the first one.’ There is also a biography about her out on the shelves.

I first heard about her from her ‘nanosecond’ wire gifts she would give out. After she retired Rear Admiral Hopper became a speaker for DEC, and traveled around and spoke about the history of computers. She was known to give out 11.8 inch long sections of telephone cable, to give people a hands on fee for how far electricity traveled in a nanosecond.

Python Programming on Feb 22nd

We are running a workshop on Feb. 22nd about getting started with Python. We will help you get Python installed and setup, and get you working on some great initial projects to get your feet wet. This class is best for people with some programming experience in *any* language, but can be taken by someone without any experience at all. The workshop is a measly $5 suggested donation to cover snacks,etc. If you really can’t afford that, we have $0 tickets available too.

You will need to bring your own computer (Mac/Linux/Windows) and your curiosity. Bonus points if you bring a snack for the people running the workshop! It’s be quick, it’ll be fun, and you will walk away knowing how to build some cool stuff using your new tools. This class is brought to you by Hive76, specifically by Phillip and Far.

Dive into programming Python:
Mon, February 22, 6:30pm – 8:00pm
915 Spring Garden St (Suite #519) – Hive76 Headquarters

Register Now

 
Get Academic tickets