12 ms·
The Apple II Source Code for the LOGO Language Found
- sarahdavid130 8y agoLove this post
- jeremiemv 8y agoThat Turtle!
- larsbrinkhoff 8y agoGeneral Turtle, anyone?
- thought_alarm 8y agoThe source code is 213 KB of ASCII, assembled on 1980-8-6. A souped-up Apple II at that time would have had 64 KB of RAM, and 140 KB of storage per floppy disk. I guess you needed a PDP-11 to do any real work in those days.
- eesmith 8y agoFWIW, VisiCalc - first spreadsheet computer program for personal computers - was developed in 1979 on the MIT Multics system, which was a Honeywell machine, and Electric Pencil - first word processor for personal computers - was (as far as I can tell) developed in 1976 on the Altair.
- orphean 8y agoLater on assemblers like Merlin and ORCA/M added the ability to assemble source files as separate objects which were then linked. Earlier assemblers (and the later ones!) also typically supported a capability to reference another source file from another which lets a large assembly chain itself without needing to have the whole thing in memory at once. At runtime, you could use overlays to essentially load in program modules in and out of RAM dynamically so you'd be surprised at the (relative) sophistication of some software packages back then!
- macjohnmcc 8y agoI watched an interview with a Sinclair Spectrum programmer who used a TRS-80 computer and a custom hardware interface to send code assembled in the TRS-80 directly into the Spectrum's memory to allow for quicker development and use of floppy and hard disks on the TRS-80.
- Angostura 8y agoI bought a fantastic Logo implementation for the ZX-Spectrum. That must have fitted into well under 16K. I wish I could remember who produced it.
- WorldMaker 8y agoUsing a serial bus to remote build/debug an application device is a venerable tradition. I know I still do that with USB and Android/iOS devices connected to a PC.
- ajross 8y agoA PDP-11/45 or 11/70 would have much more memory, but being a 16 bit machine would still have been unable to handle this file in a conventional editor. Honestly I don't know if there were paging editors available for common environments. Certainly nothing on Unix would have worked. Per the link, the file was editted and built on a PDP-10 running ITS, which was a 36 bit machine with an 18 bit address space. Interestingly, almost everything else I've seen from ITS uses the 6 bit upper-case-only encoding. This is pretty clearly ASCII.
- larsbrinkhoff 8y agoITS text files use 7-bit ASCII. Five characters packed per word. Some things like file names use a 6-bit ASCII subset (the range 32-95). What have you seen from ITS?
- larsbrinkhoff 8y agoNot PDP-11. This was cross assembled from a PDP-10 running MIT's Incompatible Timesharing System.
- DonHopkins 8y agoThis is wonderful! My first paid programming job was writing a Logo Adventure program for C64 Terrapin Logo. They wanted a simple non-graphical game that showed off Logo's list processing capabilities, and I just used Logo's top level interpreter as the parser! That saved a lot of coding, but it did let you cheat (aka "learn to understand and program and debug Logo"). https://medium.com/@donhopkins/logo-adventure-for-c64-terrapin-logo-4c684a240b53 https://medium.com/@donhopkins/logo-adventure-for-c64-terrap... Here is the source code to LLogo in MACLISP, which I stashed from the MIT-AI ITS system. It's a fascinating historical document, 12,480 lines of beautiful practical lisp code, defining where the rubber meets the road, with drivers for hardware like pots, plotters, robotic turtles, TV turtles, graphical displays, XGP laser printers, music devices, and lots of other interesting code and comments. http://donhopkins.com/home/archive/lisp/llogo.lisp http://donhopkins.com/home/archive/lisp/llogo.lisp
- derefr 8y agoDiving into that MACLISP file, I found this variable and explanatory comment: > SYNSTAX ... A STACK OF SYNTAX PROPERTIES If there were a "stupid-clever variable names" hall of fame, that one would certainly make the cut.
- DonHopkins 8y agoIt also mentions BIBOP LISP: BIg Bag Of Pages (OR (BOUNDP 'BIBOP) (SETQ BIBOP ITS)) ;;THE TURTLE PACKAGE IS GOING TO EAT LOTS OF FLONUM SPACE, SO IN BIBOP LISP, ASSURE ;;THAT ENOUGH WILL BE AVAILABLE. (AND (MEMQ 'BIBOP (STATUS FEATURES)) (ALLOC '(FLONUM (2000. 4000. NIL) FLPDL 2000.))) https://www.saildart.org/BIBOP.RPG[UP,DOC]4 https://www.saildart.org/BIBOP.RPG[UP,DOC]4 BIBOP is the dynamically expandable version of MACLISP, the SAIL standard MACLISP. Essentially, the main advantage of BIBOP is that whenever one of the expandable spaces runs out of space, BIBOP requests a larger core allocation from the monitor and the delinquent space grows in the allocated memory. December 1973; updated March 1974 The (in)famous "Bibop" (pronounced "bee-bop") LISP scheme has been available for some time now and seems to be more or less reliable. Bibop means "BIg Bag Of Pages", a reference to the method of memory management used to take advantage of the memory paging features of ITS. The average LISP user should not be greatly affected in converting to this new LISP (which very eventually will become the standard LISP, say in a few months). https://ml.cddddr.org/lispnews/lispnews-19740213.html https://ml.cddddr.org/lispnews/lispnews-19740213.html WEDNESDAY FEB 13,1974 FM+7D.3H.28M.38S. LISP 746 - GLS - AS OF VERSION 746, LISP SYSTEMS OF THE SAME VERSION WILL SHARE PAGES AMONG THEMSELVES; I.E. A LISP, MACSYMA, AND CONNIVER CAN ALL SHARE PAGES COMMON TO THE LISP SYSTEM. BIBOP LISP HAS BEEN GREATLY RESTRUCTURED; I WILL RE-EDIT THE BIBOP DOCUMENT AS SOON AS I CAN (SAY WITHIN THE NEXT WEEK). -- GLS https://github.com/PDP-10/its/search?q=BIBOP&unscoped_q=BIBOP https://github.com/PDP-10/its/search?q=BIBOP&unscoped_q=BIBO... There's nothing easier on the eyes than some good old fashioned PDP-10 Midas assembler MacLisp source code!
- coldcode 8y ago6502 assembly is so nice, I wrote some apps in the early 80's. You can learn the language in a few minutes. But all sorts of interesting clever things were possible.
- sumoboy 8y agoI don't recall learning it in a "few minutes" say compared to Apple Basic, but it was definitely a great learning experience.
- mmusson 8y ago6502 assembler on C64 is basically what taught me how to program. It was just as important to learn the memory map so that you could access low-level features by reading and writing at special memory addresses. The Compute! books were especially useful.
- jacquesm 8y agoGood old 6 character identifier names. That really required some creativity, both to keep some descriptive value as well as to not generate identical identifiers by accident.
- deleted 8y ago[deleted]
- MicahKV 8y agoWow, what a blast from the past. My introduction to programming was on an old Apple II with BASIC and LOGO. I was in the 6th grade at the time, and never did anything as complex as looping to draw spirals - I basically used LOGO like an etch-a-sketch.
- acomjean 8y agoMe too. I really liked Logo. I worked as "child volunteer" at and art museums "festival of the future" making logo spirographs for interested visitors. It was the early 80s and the apple ][+ 's 7 colors (2 white and 2 black..) was pretty bad compared till today, but we didn't care because not much was better. Basic was built in so I ended up going back to that. I learned logo, pascal and basic, but being built in and not having access to pascal at home made my choice. I did return to logo in high school on macs for some neat fractal and equation graphing programs.
- apricot 8y agoHey! Hey! Stop bad-mouthing the Apple II's graphics capabilities. I'll have you know the computer has not 7 but 8 high-resolution colors (of which two are white and two are black, but who cares about being a little wasteful when you have so many colors to choose from?).
- octorian 8y agoI started on the Apple II with BASIC. Then, some computer teacher convinced my parents that I should be learning LOGO instead and gave me lessons. After spending some time on it, I found it sufficiently frustrating that I actually gave up and went back to BASIC. I don't recall exactly that it was that I didn't like about LOGO back then. One thing probably was that I needed to first boot up into a "special environment" to run my code, and thus it didn't feel like I was writing a real program for the machine. Another might have been the emphasis on moving a turtle around, versus actually doing anything with text.
- DonHopkins 8y agoAlan Kay was quite inspired by a groundbreaking game series called "Thinkin' Things," which had a visual blocks programming language for controlling and drawing colorful patterns with marching bands, football players, and cheerleaders: "Let's build a halftime show"! https://www.youtube.com/watch?v=gCFNUc10Vu8&feature=youtu.be&t=24m58s https://www.youtube.com/watch?v=gCFNUc10Vu8&feature=youtu.be... https://news.ycombinator.com/item?id=17423719 https://news.ycombinator.com/item?id=17423719 http://squeak-dev.squeakfoundation.narkive.com/7ZN0H3vt/etoys-alice-and-tile-programming http://squeak-dev.squeakfoundation.narkive.com/7ZN0H3vt/etoy... >Alan Kay on "Etoys, Alice and tile programming": "This particular strand starting with one of the projects I saw in the CDROM "Thinking Things" (I think it was the 3rd in the set). This project was basically about being able to march around a football field and the multiple marchers were controlled by a very simple tile based programming system. Also, a grad student from a number of years ago, Mike Travers, did a really excellent thesis at MIT about enduser programming of autonomous agents -- the system was called AGAR -- and many of these ideas were used in the Vivarium project at Apple 15 years ago. The thesis version of AGAR used DnD tiles to make programs in Mike's very powerful system."
- pq0ak2nnd 8y agoSummer 1981, 11 years old, learning logo on a ][. It sure beat the hell out of trying to draw a straight line in HIRES mode in assembly: goddamn skipping every six horizontal lines made no sense to my pre-teen brain that couldn't grok modulus.
- dekhn 8y agoTBH that HIRES mode still bothers me.
- WJW 8y agoI remember my very first program, from the book "Programmeren voor kinderen" ("Programming for kids" in Dutch) repeat 4 forward 100 right 90 It drew a square on the screen and my mind was blown. I haven't recovered yet :)
- jake-low 8y agoIf you don't mind me asking, did the book do any explaining of why the magic computer words were in a foreign language (English)? Had you been exposed to much English already when you picked up the book? As a native English speaker I feel fairly ignorant of how programming is taught in other (human) languages. I recall a quote [1] by Eric S. Raymond commenting (or perhaps speculating?) that Linus commented his kernel code in English because it never occurred to him to do otherwise. But I'm curious for your perspective as I imagine the experience of a child learning from a book is quite different from that of an adult who is immersed in the English-dominated "hacker culture" on the internet. [1]: http://www.catb.org/~esr/faqs/hacker-howto.html#skills4 http://www.catb.org/~esr/faqs/hacker-howto.html#skills4
- crescentfresh 8y agoI always wondered how non-english speaking developers from other countries who were first adopters of HTTP (or any new tech) reacted to words like "GET" and "Content-Type" and other things that were clearly invented by westerners. What would we think if we had to implement something new and use words we didn't understand?
- mirkules 8y agoI can tell you a similar anectode. My family used to live in a eastern Europe communist-at-the-time country. Computers were hard to come by and the only place you could get good hardware was in Germany. My dad went to Germany and bought an Atari (I forget which one exactly), and realized it was all in German. Seeing that he didn't know any German, he learned it enough to navigate the UI. In other words, the time cost of learning German was less than the cost of the computer + the trip to Germany. Basically necessity.
- ur-whale 8y agoOh, it is so nice to see this again. This is the tool that introduced me to the notions of recursion and fractals when I was 11. I remember spending two weeks cobbling up a Logo program to draw the dragon curve on my Apple IIe https://en.wikipedia.org/wiki/Dragon_curve https://en.wikipedia.org/wiki/Dragon_curve
- dekhn 8y agoI remember (quite clearly) the day I was introduced to the Apple II+ and shown Logo. It was way over my (middle school) head- functions? recursion? so I went with BASIC and later Machine Language, but the ideas stuck and percolated and later helped me understand Emacs LISP and functional programming. I thought the integration with the turtle so that you could make graphics really was slick (compared to direct explicit mode in BASIC). I'd love to get my hands on an actual physical Logo turtle.
- DonHopkins 8y agoTerrapin Logo for the Apple ][ and C64 came with a 6502 assembler written in Logo by Leigh Klotz, that they used to write Logo primitives (for controlling the turtle, etc). It would be ambitious to make a self hosting 6502 Logo meta assembler, by porting the entire 6502 assembly language Logo source code to the 6502 Logo Assembler!
- jrd259 8y agoNote there were two versions of Logo for the Apple II. The other was developed by Logo Computer Systems Inc. (I was one of the staff). Our version was written first in Lisp (on Lisp Machines) then manually compiled to assembler. The Lisp development environment included a full 6502 emulator, allowing the developers to execute Logo either at the Lisp level (fast) or to drop down into the instruction level (slow). The emulator also emulated the Apple II's graphics.
- effish 8y agoSerious overkill huh? I do have the sources for both those, but only printed not electronic media.
- larsbrinkhoff 8y agoWould it be possible to scan those in?
- jackpirate 8y agoWhat does "manually compiled to assembler" even mean? How is that different from "rewriting it in assembler"?
- effish 8y agoThere is a gray area there. But we are talking about translating an existing model program and algorithms, not looking at the program as a black box and recreating its behavior. As the person who translated the Pascal Logo model to TI9900 assembler it was definitely the case that at the beginning of the project I translated every line of Pascal to a few instructions of assembler. By the end I was just looking at the gist of what a routine would do (its “contract” as they say) and writing it in assembler as you would new code. It’s much like translating a literary work. There’s a famous quotation (which I’m not comfortable relating in full) about translations being either faithful or beautiful but not both. Essentially maybe I became a fluent native speaker of 9900 assembler.
- spsrich 8y agoI love 6502 - so clean and simple. Even after 35 years I still remember the opcodes in hex.
- Graham24 8y agoA9418D0004
- killa_kyle 8y agoI was in a "Computer Magnet" grade school and LOGO was my first exposure to programming in our APPLE IIe computer lab :)
- Lord_Nightmare 8y agoBefore today, was this version of MIT Logo for the Apple II EVER released? I'm asking because of reaperducer's comment from just a week ago: https://news.ycombinator.com/item?id=18086566 https://news.ycombinator.com/item?id=18086566
- larsbrinkhoff 8y agoNo, this version was never released. People with fond memories of Logo on an Apple II would probably have used a later version licensed to Terrapin. Or the Krell version. Or the completely separately implemented LCSI Logo mentioned elsewhere in this thread.
- sigmaprimus 8y agoLogo was critical in my understanding of sub routines and got me away from the dreaded GOTO command in BASIC, can't say I did much more than use it as an expensive Spirograph but it is certainly responsible for my ability to understand function calls and libraries and how use them in modern object orientated laguages. Just instinct for new programmers now a days, but in the 80s and early 90s it was a difficult concept for many to grasp.
- brynet 8y agoI remember "programming" (copying from graph paper) in LOGO on Unisys/Burroughs ICON computers back in school in Ontario, Canada.
- bradfitz 8y agoTo save others time who want to actually use this, Here's the disk image: https://github.com/pneubauer/ptp2bin/raw/master/LOGO.dsk https://github.com/pneubauer/ptp2bin/raw/master/LOGO.dsk Here's a web-based emulator to run said disk image: https://www.scullinsteel.com/apple2/ https://www.scullinsteel.com/apple2/ Here's the manual: https://archive.org/details/Apple_Logo_II_Reference_Manual/page/n0 https://archive.org/details/Apple_Logo_II_Reference_Manual/p...
- larsbrinkhoff 8y agoThat's the manual for LCSI Logo.
- tom_ 8y agoNever seen anybody initialize the stack pointer to $00 before. The 6502's stack pointer is postdecrement, so an initial value of $ff is more usual.
- rpiguy 8y agoCould this be a trick to use the top of stack like another register and use all of the one byte stack instructions on it? If it is using the top of stack as a register, where then would be the real stack?
- MisterOctober 8y agoHot diggity dog! Like lots of folks, LOGO on the Apple II was my first exposure to computer -- thanks to one Mr. Milligan in Westbrook, ME -- some of the other kids in my class did some pretty amazing graphics with it -- the one that is particularly clear in my mind was a well-proportioned and '3D-type' rendering of the brandmark of the band 'Foreigner' -- I had no idea at the time how to even pronounce that word, but the fact he'd done it with the turtle sure made an impression on me
- jepler 8y agoI looked into this a bit and zeroed in on the implementation of sine/cosine computation, which is pretty critical for turtle graphics. I didn't follow every last instruction, but it looks like it used a 91 (or maybe 92)-element LUT of 4-byte floats, split into 2 halves. This allows direct look-up of the SIN of every angle in the first quadrant, that is 0 to 90 degrees, plus the value for the next 1-degree angle. It looks like after looking up the two precalculated values, linear interpolation is then performed between them. (Also, the FP numbers are in a format that must have been easy to do software arithmetic on. Leading byte is exponent, with bias of 126; next 3 bytes are sign and mantissa, with no implied 1-bit. This has just a hair less precision than a modern 32-bit 'float'. 7A 47 7C 2D is the entry for SIN(1), and is equal to 0.017452407... while double precision SIN(1) is 0.0174524064372835...) Next, I bodged together a version of what I assume the linear interpolation step does. In both double precision and simulated LOGO precision, the maximum relative error is about .00005 and the maximum absolute error is about .000045, which would be awful hard to detect when plotting to an entire display with about as many pixels as an application icon on your modern high-dpi telephone. On the other hand, that's only 4 correct digits. This is an interesting contrast to the Commodore BASIC implementation of sin/cos that I'm familiar with. It used a fairly high degree polynomial, which might have gotten a few more accurate digits (5 digits for sin(1.5 degrees)!) but is sure to be quite a bit slower than 2 table lookups, a multiply, and a few add/subtracts. (plus range reduction) 0.0261759515 Estimated Apple LOGO SIN(1.5 degrees) ^ 0.026176948307873153 Modern Double Precision SIN(1.5 degrees) 0.0261769483 Commodore 64 BASIC SIN(1.5 degrees) ^
- effish 8y agoThe only time anyone would notice slight errors in turtle position was trying to do animation by drawing over a previous drawing with an XOR or ERASE or background color pen. It might be necessary to explicitly reset the turtle position to the original start. I do remember having to be careful with the anti-aliasing so that when pointing in any random direction FD 100 RT 180 FD 100 would draw the same pixels in either direction.
- Latteland 8y agoIt's so cool to look at that 6502 assembly. I had an atari 400 computer, and I had this cool book that taught assembler for 6502 and I hand compiled my programs into bytes and put them in a data program and I could call them from basic. I had this great book called "De Re Atari". Those were fun times. I was in high school and the future was unlimited!
- Vogtinator 8y agoI wonder what they mean by this: APOUT: AND #$7F ;eat Apple idiot char codes, type Ascii JMP COUT did the Apple II not use ASCII?
- tomtomtom777 8y agoApple II did use ASCII. But ASCII defines 128 code-points. The other 128 code-points are specific to the character encoding or "codepage". They don't like Apple's "idiot" character encoding (which is custom, Apple II specific), so they throw away the top bit with the AND leaving only ASCII characters.
- dragonwriter 8y ago> But ASCII defines 128 code-points. The other 128 code-points are specific to the character encoding or "codepage". ASCII is a character encoding, and it's a 7-bit encoding. It has no code pages. There are many 8-bit encodings / code pages that are ASCII supersets (including the Apple II one), however.
- tomtomtom777 8y agoYes. I meant to the "8-bit character encoding" but I think it's clear from the context.
- executesorder66 8y agoDoes anyone know where/how the guy found it?
- larsbrinkhoff 8y agoI found it in backups from ITS. ITS is the MIT operating system for the PDP-10, which was the workhorse around the AI Lab, Logo Lab, Lab for Computer Science, Mathlab, Dynamic Modeling group, etc.
- effish 8y agoHmmm, I’m vaguely remembering uploading the TI-Logo source to the MIT ITS PDP-10 for backup purposes too. If so it might be there also. You’d want to be careful about the copyright on that. Though I’d love to see it again
- larsbrinkhoff 8y agoThat's why I try to run most of the finds by the original authors. I sent you an email with some more details; or at least I tried and it didn't bounce.
- peterburkimsher 8y agoLogo was my first programming language! I recently rewrote my own version of it so that I could draw a time-proportional train map. I wrote "fd 5" for 5 minutes, for example. http://peterburk.github.io/tra/ http://peterburk.github.io/tra/ The version I wrote can read values from a spreadsheet, so could be used in other applications too. I think this kind of thing could be a great way for a young person to go from a homework project to the front of Hacker News. If any of you have kids, I'd be happy to help gather the data for some other subway networks! Also, where should I contribute old Apple II software? I recently used ADTPro to copy a lot of old programs onto my MacBook Pro as DSK images. 5.25 floppies: https://mega.nz/#!yDITXIZC!8fREZdAruk2yYLv859jKABGSWeG4UkRoCN4_feKnmIM https://mega.nz/#!yDITXIZC!8fREZdAruk2yYLv859jKABGSWeG4UkRoC... https://www.flickr.com/photos/150180606@N08/sets/72157672562505858 https://www.flickr.com/photos/150180606@N08/sets/72157672562... https://www.flickr.com/photos/150180606@N08/sets/72157672589613188 https://www.flickr.com/photos/150180606@N08/sets/72157672589... I've also got a larger selection of DD floppies, HD floppies, JAZ disks, SCSI disks, IDE disks, MacFormat and other CDs. Please tell me if you want the links!