enlivend ([info]enlivend) wrote,
@ 2007-11-22 11:36:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Curly Logo
It's been a while since I played with Logo. Back in the mid 80's a friend had it on his Amiga; years later and with mixed results I tried teaching it at my kids' school on a bunch of battered old Archimedes. But now, thanks to code monk,  it comes wrapped up in a couple of Javascript files and you can run it in your browser.

The blurb says:

In order to see it working, I recommend you use Firefox (2.0) or Safari 3. Curly Logo's turtle should be visible in the upper half the window, and a text area should be visible in the lower half. At the bottom of the text area is a space for you to type Logo commands. If you haven't tried Logo before you could try typing some of the following:

fd 100 rt 90
Moves the turtle forward and turns it.
repeat 3 [ fd 100 rt 90 ]
Completes the square started by the previous command.
cs repeat 7 [ setpw 2 * repcount setpc repcount fd 50 rt 360 / 7 ]
A septagon using the 7 colours of the rainbow and a varying pen width

In order to use Curly Logo you'll need a browser that implements XML, XHTML, SVG, CSS, and JavaScript (Totally Buzzword Compliant). In 2007 that means you need Firefox 2 or Safari 3. Internet Explorer support is not. You might be able to convince me on esoterica like Opera (it kind of half works in Opera without me having tried at all).

You do not require an internet connexion; once you have downloaded the Curly Logo page and associated JavaScript pages, Curly Logo does not use the network. That means you can save the page and reload it later from your local disk. Curly Logo is not a AJAX application (it is a JAX application), it does not evaluate anything by sending it to a server and expecting a response; all computation and display is performed locally in the web browser by executing JavaScript.

OK, it's not lisp (but it got me thinking - what's the pain in embedding a smallish lisp in Javascript?). But I have a certain fondness for it.




(Post a new comment)


[info]manjushra
2007-11-22 12:49 pm UTC (link)
I've noticed how most IT curriculae (?pl) concentrate quite a lot on this aspect of programming, getting some kind of cursor to draw geometric shapes.

I guess that incorporates some important ideas in programming but surely far more interesting simple games can be devised to include those kind of commands. Even changing a caption to text entered by the user, getting it to blink, change colour, mouserollover with some amusing effect/text.... instead we get children boredly tapping in commands into floor turtles which then trundle round on the carpet for a bit.

but it is good to get a beginner's programming environment up on some easy-to-access internet screen (even if most schools will not have firefox installed bc the LEA standard is IE).
interesting post - thx

(Reply to this)(Thread)


[info]enlivend
2007-11-22 01:17 pm UTC (link)
I think there's an immediate gain for the kids when they see that even the simplest of invocations leave a visible trail - experimentation is easy and you don't need to know how to write a computer program. For me, the plus was that I knew I was shipping a lisp of sorts, albeit heavily disguised. Oh, and credit goes to NickB for bringing this to my attention.

(Reply to this)(Parent)(Thread)


[info]nickbarnes
2007-11-22 01:39 pm UTC (link)
Among the serious deficiencies in Logo-like languages: no higher-order functions, no type system, no introspection. The first of these is hard to fix while retaining Logo syntax rules. But I think a simple Lisp-like language ought to be quite easy in a Curly Logo like form (i.e. in a Javascript page), complete with turtle functions or other ways of getting that immediate visual feedback.
Joe was initially teenager-bored when I showed him Curly Logo. Then I drew a square and he was suddenly fascinated.

(Reply to this)(Parent)(Thread)


[info]drj11.wordpress.com
2007-11-22 01:54 pm UTC (link)
As Logo is Lisp (or so they Logo crowd tell me), Curly Logo supports Lisp syntax: (fd (sum 10 20 30)) (rt (/ 360 3)) (fd 50) (http://www.amberfrog.com/logo/#(fd%20(sum%2010%2020%2030))%20(rt%20(/%20360%203))%20(fd%2050)). Just don't look behind the curtain.

Enjoy.

(Reply to this)(Parent)(Thread)


[info]nickbarnes
2007-11-22 02:02 pm UTC (link)
In what sense is Logo Lisp?

(Reply to this)(Parent)(Thread)


[info]drj11.wordpress.com
2007-11-22 02:34 pm UTC (link)
http://el.media.mit.edu/Logo-foundation/logo/programming.html : "The Logo Programming Language, a dialect of Lisp"

That's why I said "or so the Logo crowd tell me". Personally I think they're trying to make Logo cool by association with Lisp (pre AI-Winter I guess).

(Reply to this)(Parent)


(Anonymous)
2007-11-22 10:33 pm UTC (link)
Diff a Logo manual and a Lisp manual. Note that, apart from changing a funny character here and there, they're almost identical. :-)

Examples:
It uses prefix notation for almost everything.
It has built-in support for plists, and gobs of familiar Lisp functions, like map, reduce, filter, and apply.
It calls lambdas "templates". It calls defmacro ".defmacro".
It even uses Lisp naming conventions, like "listp" and "numberp" and "emptyp" and "equalp". It changes one character in a few places: &rest is ?rest, eq is .eq, and you quote symbols with a single " instead of a single '.

Logo:
apply [[x] [sum :x 3]] [5]
Lisp:
(apply #'(lambda (x) (+ x 3)) '(5))

This is, of course, not coincidental: Logo was first implemented in Lisp. Logo probably has a bad rap these days because everybody used a cheap clone on their PC in 1985 that only did turtle graphics, so they think "Logo" means "turtle graphics", much like how they think "Lisp" means "slow dead interpreted AI language that doesn't even have arrays". It's actually a neat little Lisp dialect.

(Reply to this)(Parent)


[info]drj11.wordpress.com
2007-11-22 02:41 pm UTC (link)
Logo, in its turtle form, was intended to teach mathematics. I don't believe it's a good tool for teaching programming. I don't know about IT so I have no idea about its effectiveness at delivering that.

Do LEA's really standardise on IE? How is that justified? I'm shocked. And not shocked, at the same time. Choosing to not support Curly Logo on IE was partly political, but mostly it doesn't do SVG so it's not going to hack it.

(Reply to this)(Parent)(Thread)


[info]nickbarnes
2007-11-22 04:07 pm UTC (link)
Use Curly Logo to get Real Browsers into schools....

(Reply to this)(Parent)(Thread)


[info]drj11.wordpress.com
2007-11-22 04:27 pm UTC (link)
That would be awesome!

(Reply to this)(Parent)(Thread)


[info]nickbarnes
2007-11-22 04:55 pm UTC (link)
It would certainly be quite a result.
Next to write an indispensible educational app that only works on *nix....

(Reply to this)(Parent)


[info]manjushra
2007-11-22 09:13 pm UTC (link)
sorry to shock you but most people i know don't see IE as an application. If you want to get on the internet you press the little blue "e", basta.

(Reply to this)(Parent)(Thread)


[info]nickbarnes
2007-11-22 11:20 pm UTC (link)
When I've set up machines for people, I have removed IE (as near as possible without actually breaking Windows), made Firefox the default web browser, put the Firefox icon somewhere prominent on the desktop, and changed its name to "Internet" (because, even now, the web is still called "the internet"). Nobody has ever asked me "where is IE?" or "how do I get on the Internet" or "where's the browser". Firefox is similar enough to IE that people just think it *is* IE (and even call it "Explorer"), without noticing the many ways in which it is superior :-)

(Reply to this)(Parent)(Thread)


[info]manjushra
2007-11-23 08:50 am UTC (link)
even now, the web is still called "the internet"

excuse my appalling ignorance but in what way are the terms not synonymous?

(Reply to this)(Parent)(Thread)


[info]drj11.wordpress.com
2007-11-23 09:48 am UTC (link)
You can't telnet across the web, but you can telnet across the internet.

(Reply to this)(Parent)


[info]nickbarnes
2007-11-23 10:16 am UTC (link)
The internet is a set of technologies (called things like TCP, IP, ICMP) developed in the 1970s for connecting computers together, and is also the set of computers which use those technologies to connect together. Lots of different systems, running on those computers, developed at various times in the last 30 years, use the internet for various purposes: email, usenet, IM, P2P, ecommerce, ssh, etc etc etc etc (it's a very long list).

The web is a particular one of these systems which uses the internet. It was developed in the mid-90s, when the internet was already more than 20 years old. It uses a protocol called HTTP, running over the internet. The web is implemented by software systems called web browsers and web servers, but there are millions of computers on the internet which run neither web browsers nor web servers.

The web was the first internet application which was so compelling that hundreds of millions of non-technical people started using the internet, but when you use Pidgin to do IM, or Thunderbird to do email, or LimeWire to share music, you are using the internet but you're not using the web.

The distinction is a little blurred in these days of webmail and webchat, where the actual underlying communication is non-web but the users access it via a bit of web.

(Reply to this)(Parent)


[info]manjushra
2007-11-23 11:16 am UTC (link)
the many ways in which it is superior : .... which are?

(Reply to this)(Parent)(Thread)


[info]enlivend
2007-11-23 11:52 am UTC (link)
Don't get him started :)

(Reply to this)(Parent)(Thread)


[info]manjushra
2007-11-23 12:13 pm UTC (link)
no, really, I'm interested! firefox has only annoyed me so far by needing to install java plugins so I want to know, what's the big deal? what's wrong with the little blue "e"?

(Reply to this)(Parent)


[info]manjushra
2007-11-23 07:55 pm UTC (link)
besides which, it's quite fun to get him going :)

(Reply to this)(Parent)


[info]nickbarnes
2007-11-23 04:28 pm UTC (link)
They include: smaller, faster, less buggy, fewer security holes, more conformant to various web standards (which is why Curly Logo works on it and doesn't on IE), more configurable, more portable, more readily extensible (so there are more extensions available).

And not under the control of a convicted monopolist likely to exploit dominant market share at the expense of users.

If you visit java/flash/PDF sites you will need the appropriate plugins, just as you do for IE; all the main plugin providers make plugins for both firefox and IE, but they only work if you install the plugin *after* the browser.

(Reply to this)(Parent)(Thread)

What no rhyming couplets?
[info]manjushra
2007-11-23 09:08 pm UTC (link)
Firefox is smaller and less prone to virus
It's muscly and compact and never will rile us

Firefox is fierce, independent and wild
Self-sustaining, robust, nobody's child

Firefox is so lush! it's almost a rush!
Words can't convey how it takes me today!
Configurable and portable
Eas'ly turn-on-'n'-offable
It's even - well - extensible!
With Ravenbrook's soft touch.

Not under the control
Of the modern day troll
Who monopolizes,
claims the prizes
And robs the others,
His software brothers
Of their equal share:
It's so not fair!

Firefox is better than the little blue e
More reasons available from the Master, NB.


(No offence Nick - it's Friday)

(Reply to this)(Parent)(Thread)

Re: What no rhyming couplets?
[info]nickbarnes
2007-11-23 11:42 pm UTC (link)
The plans reveal the Deathstar's flaw
The rebel fighter's agile craft
target missiles at the core
and find the ventilation shaft.

The Empire is fatally weakened.

We are many
we are expendable
we are true
we are the Borg
You will be assimilated.

(Reply to this)(Parent)(Thread)

Re: What no rhyming couplets?
(Anonymous)
2007-11-24 09:29 am UTC (link)
They're Pinky and The Brain
Yes, Pinky and The Brain
One is a genius
The other one's insane.

Before each night is done
Their [poems] will be unfurled
By the dawning of the sun
They'll take over the world.

They'll overthrow the Earth
They're dinky
They're Pinky and The Brain, Brain, Brain, Brain
Brain, Brain, Brain, Brain
Narf!

(Reply to this)(Parent)(Thread)

Re: What no rhyming couplets?
[info]nickbarnes
2007-11-24 11:13 pm UTC (link)
Bagsy insane.

(Reply to this)(Parent)


[info]drj11.wordpress.com
2007-11-22 02:03 pm UTC (link)
For Lisp in JavaScript you probably want: http://www.joeganley.com/code/jslisp.html

(Reply to this)

Javascript and Scheme
(Anonymous)
2007-11-22 02:05 pm UTC (link)
Hi Nick,

As some people have compared javascript and scheme - and as I consider javascript an important language for the future I like your idea about a smallish lisp (or scheme) in java script. Some links:
http://www.bluishcoder.co.nz/2006/05/scheme-implementation-in-javascript.html
http://javascript.crockford.com/little.html
http://hop.inria.fr/usr/local/share/hop/weblets/home/articles/scheme2js/article.html

Michael Arnoldus

(Reply to this)

Lisp in a Browser
(Anonymous)
2007-11-22 09:40 pm UTC (link)
If you are interested in Lisp in a browser, this looks interesting:

Kamen Lisp: http://www.cs.stevens.edu/~dlong/software/kamen/

It doesn't work in version of Firefox I'm running, 2.0.0.2, but I've not spent much time configuring it.

Cheers,

Tom H.

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…