Modern Logo

Leon recently posted a link to a great blog entry on rediscovering Logo. You know, Logo -- the one with the turtle.


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2007/12/modern-logo.html

I also like NodeBox for generating procedural graphics in Python (Mac only). Some of the example graphics produced are very impressive, and the generating code is surprisingly short.

Thereā€™s also a project for a cross-platform Ruby equivalent underway (Scribble?).

I donā€™t understand this fascination with Lisp. Why put all of your emphasis on ā€œeleganceā€ and lines of code. I prefer a easy to follow form that is verbose. Why be vague and cryptic?
(I know this post is about Logo, but upon reviewing the sample program, I can see the relation to Lisp; the same argument applies)

I never used logo. But I figure it was a favourite of manyā€¦ cool

ā€œthat is verbose. Why be vague and cryptic?ā€

These are not opposites. Verbose code makes the initiation easy and the work hard.

Anyway I didnā€™t know lisp when I was exposed to logo, but I remember the lists, and the fact that the file I/O and file system seemed somewhat strange and nonintuitive, at least compared to the language proper.

(Ah, and ruby may have gotten its symbol notation from there.)

Hi Jeff,

I canā€™t agree more with the last line from Processing you quote. I just wrote my thesis in Java. I didnā€™t have to hand in the program, only the results, and before starting to program, I couldnā€™t oversee which parts I would and wouldnā€™t explore.

Therefore, for every method I had to decide ā€œwill I spend a lot of time to make an elegant data structure and adapt easy later, or will I ā€˜hackā€™ this together because I will probably never adapt or use this codeā€?

In the end, I have made a mishmash program with quite a lot of really elegant methods, and some complete hackerish that was very specific to one test set. Actually, the core of my program is something ā€œi am not proud ofā€, but in the sense of code hiding it was a nice black box having a comment ā€œdo only use this on the turtle layoutā€ (where turtle is a mahjong term, not something to do with logo).

A friend of mine who did saw the code was repelled by it, however I think it has saved me a lot of time to NOT do every bit in extreme neat code style.

Noā€¦not logoā€¦iā€™m begging youā€¦ Iā€™d rather do a whole day of TURBO PASCAL 7.0 than one minute with Logoā€¦

runs away screaming

(yes. I was forced to learn Logo in school. Yes I loathe it to this day, even more than Pascal)

Processing is nice, and some 2 years ago when Actionscript 2.0 ruled the Flash landscape Iā€™d have agreed that processing would be your best bet for ā€œlearn as you goā€ visual programming.

I agree there is something uniquely rewarding to programming visual results and not just command-line apps, and I think itā€™s very compelling to a new/hobbyist programmer and as such can be a great teaching vessel.

While Actionscript itself may not be as fully matured a language as Java, I would staunchly argue the Actionscript3.0 API is a tightly integrated singular platform that offers far more potential and ease-of-use than the hodge-podge collection of importable libraries to be used with processing.

Furthermore, with MXMLC, Actionscript3.0 can be coded and compiled entirely with your own free text-editorā€¦there is no need to actually own Flash, to create a .fla file, or to pay Adobe any money.

Flash apps are also easily shareable online, and play nicely with the browser as well as desktops via A.I.R, as well as providing their own ability to open Socket connections for fun synchronous multi-user applications. (like Games! a new/hobby programmer always wants to make games. ;o))

In summary: I think Actionscript wins for its environment and interoperability, even if itā€™s ECMAScript-based language is lacking ā€œmatureā€ features (like Enums) that can be found in Java 1.5+

Lots of Irritating Silly Parenthesisā€¦

What I think is truly interesting here is the resurgence of Functional programming languages. One of the more interesting projects Iā€™ve looked at is the Microsoft Research Language F#, which is a .NET language based on OCaml.

With the craze in object oriented languages, we sometimes forget that certain types of problems are more easily solved with different paradigms.

Logo is certainly based on Lisp. Logoā€™s FIRST and BUTFIRST operators are Lispā€™s CAR and CDR. The syntax is, of course, very different, but that reflects the designerā€™s intention that the language be as easy to use as possible by the intended users, children. In discussing Logo, it is essential to not forget that the language was designed for pedagogy - to make it possible for children (not high school students) to enter a world where they could construct programs and reflect on the process of programming.

The same applies to turtle graphics. The purpose of turtle graphics was not to enable creation of photo-realistic rendering, or to do scientific visualization. The aim was pedagogy, to provide a compelling domain where one can think about programming. Turtle graphics provide some very important pedagogical features. First, because turtle motion is relative motion (forward/back, turn left/right) it allows a child to think of the drawing (or program) by using her own body, to ā€œplay turtleā€. For children, the ability to think of a program concretely is essential, and nothing is more concrete to a child than her own body. Second, turtle graphics abstracts away coordinate systems, so a child can make drawings without having to first master matrix multiplication.

As a third, but lesser point: when properly done, turtle graphics encourages modularity and re-use. Why? Because turtle graphics (sub) programs can be composed, but only if the program has no side-effects (other than the drawing itself). That is, if the program, on exit, leaves the turtleā€™s heading and pen-state unchange, you can build larger drawings by combining smaller drawings. This idea, in miniature, is one of the core ideas we need to build re-usable, composable programs.

In sum: criticize the language according to its intended purpose (and the historical state of computing at the time.) Logo remains an excellent language for teaching. Logo is very easy for beginners to start with, yet allows one to grow into (most, if not all) the subjects of academic computer science.

Disclaimer: I worked on Logo at the Logo Laboratory at MIT in the mid 1970s, and was one of the developers who built Logo for the Apple II. I knew Papert and Solomon.

I only used logo to draw circles and stuff in elementary schoolā€¦ later on we used Logo Writer (basically the same, but the turtle had a turtle shape :D:D:D ). When they started to teach us programming we used qbasicā€¦ ah, the memories

They didnā€™t teach us programming in elementary school (or high school, for that matter). However, I think itā€™s funny for people to use execution speed as an excuse for writing something in Java, since that was the primary excuse against writing anything in Java for many years (and still is in some areas). In general, I still find the execution speed of almost anything written in Java appalling on a Windows desktop, and with the bickering between Sun and Microsoft over the proper way to write a JVM, I doubt itā€™s ever going to get significantly better.

Of course, once you get the JVM and the program loaded into memory and running, the program itself is usually responsive enough for many uses, but then so are most scripting languages.

Real programmers code in Logo !!!

(no pun here)

The same comments where made about Lisp and (Object) Pascalā€¦

P.D. Karel itā€™s a good alternative, a mixture of Logo and Pascalā€¦

I always preferred the use of Lost In Stupid Parenthesis.

As for why you should use it, after spending a bunch of months the only reason I could think of it was the only language that AutoCAD supported for building additional capabilities.

People who like Logo should check out Turtle Art on the OLPC (http://wiki.laptop.org/go/Turtle_Art). Itā€™s like Logo but you build your program graphically, using pieces that fit together to show the flow of control. The thing I love about it is that the program and turtle art workspace are the same thing ā€“ itā€™s like building something on a lab bench instead of writing a computer program. Itā€™s also one of the most polished XO activities, probably because it was written for a commercial robot product and then ported to the XO.

See http://www.contextfreeart.org/ for Modern Logo graphics

LOGO is so great I learned it when I was seven years old in the public library in Mexico.

I could say that I know 5 other sw developers that participated in the same program. Coincidence? I donā€™t think so.

LOGO is a joy to program and a joy to learn. And I donā€™t what language provides the WOW factor that drawing a star with a loop had back thenā€¦

A few details for people interested in Logo:

I describe the Lispy aspect of the language a little while ago here: http://blog.ianbicking.org/2007/10/19/logo/ ā€“ someone mentioned Ruby, and it wasnā€™t directly inspired by Logo, but Smalltalk was inspired by Lisp, and also Logo very specifically, and Smalltalk was a strong influence on Ruby.

There are several more interesting implementations than UCBLogo. StarLogo (http://education.mit.edu/starlogo/) and NetLogo (http://ccl.northwestern.edu/netlogo/) explore highly concurrent systems. NetLogo seems to be more Javaish. Elica (http://www.elica.net) is a Logo for Windows that has lots of graphics capabilities (3D, etc). Alan Kayā€™s group actually wrote a Logo in Javascript, but then seemed to lose interest and itā€™s disappeared. Another (living) attempt at this is Curly Logo (http://www.amberfrog.com/logo/) which uses SVG for rendering.

Outside of Logo, for 3D worlds thereā€™s Alice (http://www.alice.org/) and VPython (http://www.vpython.org/). Iā€™ve heard good things about Panda3D (http://panda3d.etc.cmu.edu/), but itā€™s probably not as beginner-oriented as Alice and VPython. Pyglet (http://www.pyglet.org/) is shaping up to be pretty cool too. On the Ruby side thereā€™s also the clever environment of Hackety (http://hackety.org/).

Thereā€™s lots of other things out there too, of course. I wouldnā€™t start with UCBLogo (too retro), and certainly not Java (whereā€™s the interactive fun and experimentation?)