The Power of LOGO (Part 1)   Leave a comment

THE POWER OF LOGO (Part 1)

LOGOsent4
The output of a LOGO procedure to generate random sentences using a small vacabulary

Logo or LOGO is a quite different language from BASIC, C, or Assembly Language. It’s based on the language LISP (LISt Processing language) and has a totally different attitude behind it from other programming languages, because lots of other languages are mainly descended from FORTRAN (FORmula TRANslation), while LOGO is descended from Lisp (LISt Processing language). According to LOGO supporters, ALL dialects of BASIC, even BBC BASIC, Sinclair Spectrum BASIC, AmigaBASIC, Simons’ BASIC, MSX BASIC, Sinclair QL SuperBASIC, and Laser BASIC are crap!

LOGO comes from the Greek word “logos”, meaning word, which indicates its emphasis on words instead of numbers to make programs. This means that the name of Tom Baker’s final Doctor Who adventure “Logopolis” (city of words) seems quite inappropriate, because the actual words spoken or intoned by the Logopolitans to create their program were hexadecimal numbers in their own language.

TARDISEarlsCourtLooks like the Doctor’s TARDIS has landed in Earls Court, London

Even the most fundamental things about LOGO are different from BASIC, as well as from other languages. There are no programs as such, only Procedures made up of Primitives instead of commands, as well as calls to other Procedures. Procedures can also call themselves, which is known as recursion, a concept explored in the classic Doctor Who story “Castrovalva” (following straight on from “Logopolis”), featuring Peter Davison in his first story as The Fifth Doctor. An example of recursion used is when the companion Tegan (played by Janet Fielding) says “Of course, if we had an index file we could look it up in the Index File under index file. Insane, I’m talking nonsense!”, to which the companion Nyssa (Sarah Sutton) replies “Recursion isn’t nonsense”, Tegan says “Eh?”, then Nyssa replies “That’s an example of recursion, when procedures fall back on themselves! If you had an index file, you could look it up in the Index File!”

LOGOcastroThe City of Castrovalva was a “recursive occlusion” folding in on itself to form a massive time/space trap

In LOGO You can have lots of Procedures held in RAM simultaneously, which can each call on any of the other Procedures. You can save them all together to make sure all the necessary Procedures are there. This is called saving the Workspace. To load a Procedure, or collection of Procedures, you type READ “filename (note there are no quotes at the end) instead of the familiar BASIC command LOAD “filename”, or any variations on this such as being followed by a comma and device number, such as LOAD “filename”,8 or DLOAD “filename”, etc. The key combinations you use are also different from C64 BASIC V2. Instead of RUN STOP or RUN STOP and RESTORE, it’s Ctrl + G to stop a Procedure, while Ctrl + C (Create) or RUN STOP defines a Procedure and exits from the Procedure text editor, but press Ctrl + G and your new Procedure is Gone. Of course, the dreaded PEEK and POKE commands which dominate Commodore BASIC V2 programs using graphics and sound don’t even exist in LOGO. There are two equivalent Primitives or options, which are .DEPOSIT instead of POKE, and .EXAMINE instead of PEEK, but these are used only occasionally, for example to set the size of sprites. Even these Primitives can be buried inside Procedures, such as on the Commodore LOGO sprite demo on the utilities disk with the Procedures SMALLX, SMALLY, BIGX, and BIGY to protect the user from having to remember any memory locations.

LOGO was created by Seymour Papert of MIT in about 1967-1970 according to various sources, as a protest or in a fit of rage, when his son told him his class had been studying FORTRAN programming at school that day. FORTRAN is quite similar to early dialects of BASIC. The original Colossal Cave Adventure, often called just by the filename ADVENT by Crowther & Woods was written in FORTRAN. Seymour Papert and his group of programmers were involved in promoting alternative methods of education. LOGO is one of these methods. Back in those days they required a big mainframe computer to run LOGO on, but at the time a “mainframe” may have had as little as 8K or even less. Later on, when microcomputers came out, they could run LOGO in 16K or 48K of RAM.

During 1984, I read articles about LOGO in Commodore 64 magazines, including Your 64 Issues No. 2 and No. 4, as well as Commodore Horizons Issue No. 6. These can now be downloaded from http://awesome.commodore.me/magazine-2/ and select from the pull down menu. You can even get some German and Danish magazines from there. I thought that the Danish magazine COMputer, with its review of the C128 spread over a few issues, was quite interesting but obviously TMR can’t read them! If it was written in 6502 Assembler, he’d understand it, but he can’t even read the German or Danish scrolling text in various demos.

The Commodore Horizons Issue No. 6 article (P47) exposes the very interesting and suppressed information “ Most people bought their micro eager to learn programming, but now spend their time playing computer games. What happened to that initial enthusiasm? The answer is simple. It was destroyed by Basic”. The piece goes on to say about BASIC “The complex mathematical syntaxes involved in Basic programming are damaging to mental health. It appeals only to the mathematically inclined”.

The Your 64 article in Issue No. 2, which was called “SPRITE LOGO ICON STYLE” (P52), described in a 3 page long article a language totally different from Commodore BASIC V2, as well as from BASIC in general, making it easy to control sprites in Procedures of a few lines, although the article claimed that to do the same things in BASIC or PASCAL would take hundreds of lines. The article said it was about “SPRITE LOGO”, but it was actually about the official Commodore LOGO package for the C64.

There was also the article in Your 64 Issue No. 4, called “Grammar School” (P52), which was a few pages long, all about using LOGO for constructing sentences, even some kind of poetry, with no turtle graphics in sight! Some LOGO Primitives which are capable of manipulating words instead of just doing graphics include PRINT, MEMBER?, SENTENCE, REQUEST, READCHARACTER, and RESULT. These articles included some listings. I was amazed by the power and simplicity of the language.

It seems that in 1984 there was only one version of LOGO available for the C64, programmed by Terrapin, or at least only one version which I heard of at the time. Unfortunately it was DISK ONLY, but I couldn’t afford a disk drive for at least £199 and the actual software LOGO cost at least £34.95 (from Chromasonic, Archway, London) on top of that, and was usually $50-$80 in the USA, but sometimes on sale for as little as $35, so I couldn’t possibly have had it. Of course, as you may have guessed LOGO for Atari 8 bit computers was available on cartridge, so didn’t require an expensive disk drive at all. Athlete Brian Jacks was seen using Atari LOGO on the BBC TV series Micro Live.

There were some turtle graphics packages available for the C64, but that’s the only feature of LOGO that they had. Users of computers running more up to date versions of Microsoft BASIC released in about 1982, or even earlier because the manufacturers agreed to pay Microsoft at the time (e.g. Tandy Color Computer, Dragon 32/64, then MSX in 1983) had a Graphics Macro Language built in to the DRAW command, as well as more conventional drawing with the LINE command.

People felt a sense of achievement using a few LOGO commands, sometimes in direct mode instead of in procedures, to draw graphic computer artwork. It can also be used to teach geometry far more easily than staring at a page in a text book like “Mr Wells” who nearly made me stay behind after school for 4 hours until the night classes started. This whole way of thinking is rejected by TMR, though.

The articles I read in the magazine Your 64 and Commodore Horizons told me that LOGO not only did graphics, but was a powerful language in other ways as well, including manipulating lists of words to make sentences or poetry, as well as programming in Artificial Intelligence (AI). I was absolutely amazed by what I read about LOGO!

I saw LOGO running at the 64 Software Centre in London where I bought a copy of Turbo BASIC, which was just an extended BASIC for the Commodore 64. Turbo BASIC didn’t enable me to write programs that I could distribute which would run without the Turbo BASIC package being loaded first, so it was no use to me for writing commercial software. I don’t think that LOGO would have enabled me to write commercial programs either, although I’m not 100% sure about this point, but it was amazing watching it draw a pattern of overlapping circles and arcs, especially as I couldn’t even draw a single line using the built in Commodore 64 BASIC! Of course, all these years later you’re probably safe to release programs in this LOGO interpreter and post a link to download the software, but I doubt your programs would earn you any money.

The official Commodore LOGO for the Commodore 64 was by the company Terrapin, but also Copyright MIT. Terrapin also produced LOGO for the Apple ][ and I think for Atari as well. Terrapin LOGO allows the user to control all available sprites with the turtle primitives such as FORWARD or FD, LEFT or LT, RIGHT or RT, BACK or BK, etc, so long as you first use the Primitive TELL [number] to specify a certain sprite. It comes with a very comprehensive manual, and a Utilities disk with lots of Procedures, that extend the commands or primitives built in to the language and encourage users to extend these Procedures. The Procedures include text applications, such as an adventure game, and a sentence and postcard generator, not just turtle graphics. It even includes an Assembler written in LOGO!

LOGOcity2The beginnings of a city skyline which could be saved as a screen

Using Terrapin LOGO it’s possible to draw complicated graphics screens with the turtle, then save the screens as files which you could use as backdrops for games or applications, although this facility isn’t available in various other versions of LOGO released at about the same time. It’s much easier than calculating in BASIC where you want everything to be drawn.

As for me in 1984, I ended up just going home with my copy of Turbo BASIC, but never managed to do much with it. I only remember splitting the screen into text and graphics windows, as well as drawing some filled squares. “Is that all? We thought we were gonna SEE something!”, my Dad said. I replied “Don’t you realise how difficult (more like impossible) it would be for me to do that without this software?!”

Unfortunately, although LOGO is similar in different versions, whether on the same computer, or different computers, not all the Primitives are the same. Some problems which can come up include whether or not you can or must use short forms such as FORWARD or just FD, RIGHT or just RT, READCHARACTER or just RC, as well as other Primitives checking for a condition such as “EMPTY?” or EMPTYP , “MEMBER?” or MEMBERP. AFAIK the Primitive TELL doesn’t even exist on all versions of LOGO. Digital Research LOGO has these differences from Terrapin LOGO, as well as adding the primitives NODES to check how much RAM is free and RECYCLE to free up the RAM, but unfortunately it seems that DR never took LOGO that seriously and I read that they were amazed when anyone wrote a program long enough to find a bug.

Recently, I did a search on the Internet to find out more about Terrapin LOGO. I was very surprised to find out that the company is still in business and selling versions of LOGO for modern computers, such as the PC, Mac, and “classic Mac” http://www.terrapinlogo.com/ !! I sent an email to find out the answer to the all important question is it possible to write programs in Terrapin LOGO which could be run by anyone, without the need to have a copy of Terrapin LOGO? The answer came back, that it IS possible, because Terrapin LOGO has a RUNTIME version which can be included along with any programs written under it to allow them to run without breaching Copyright! How amazing!! I think this means that people can forget about using C, BASIC, or even Assembly Language (which nowadays is totally discouraged) on PCs and Macs. LOGO is potentially capable of doing anything those languages can. If Terrapin LOGO can’t do everything for some reason, then at least it would make a good start to learn some really useful programming, before moving on to LISP or SCHEME, the latest language in that family. I read that LISP can be used to create whole operating systems!

The Commodore 64 wasn’t a ground breaking computer, because it had hardware similar to other computers on the market at the same time, but no built in programming language that could easily control them. If Commodore had had the inspiration to produce the Commodore 64 with LOGO built in on ROM instead of the crappy Commodore BASIC V2, then it could have been a ground breaking computer. Of course, no computer was ever produced with LOGO built in, although early Atari computers were more flexible, with no language built in. Users could just remove their Atari BASIC cartridge and insert an Atari LOGO cartridge instead. Unfortunately, having LOGO built in to the C64 would have required at least a 16K ROM for a core LOGO (which could easily have loaded more procedures), like other computers had for their BASIC ROM (e.g. Sinclair, Tandy, Dragon), while MSX even had a 32K ROM, instead of the Commodore 64’s crappy 8K BASIC ROM, so this meant that for Jack Tramiel it was out of the question! It would have meant less profit for him, unless he was absolutely certain that it would result in more sales. To sum up “If someone sells a product against me, I want to wipe them out!” (Jack Tramiel). I once suggested to a magazine that a theoretical new computer should have LOGO with a compiler for extra speed built in and they agreed with me that it was a good idea.

I think that’s enough for the first part of this series about LOGO. In future instalments I plan to draw some detailed backdrops, as well as tutorial programs you can use to learn French, or any other spoken language. Obviously, TMR won’t be interested in this, because he has already confessed to spectacularly and deliberating failing a French exam, but I passed mine a year early!

You can find out more about Commodore LOGO for the C64 by clicking on the links below.

http://www.nostalgia8.nl/logo/c64/c64-logofiles.htm

http://www.nostalgia8.nl/logo/c64/c64-logofiles.htm

http://www.nostalgia8.nl/logo/docs/reviews_logo_64.htm

Advertisements

Posted January 10, 2014 by C64hater in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: