3 ms·
Consider that classic programming language of old - LOGO. It's a really neat LISP. Yes, a LISP. to factorial :number if :number = 1 [output 1] ou
by shagie 4y ago
Consider that classic programming language of old - LOGO.
It's a really neat LISP. Yes, a LISP.
to factorial :number
if :number = 1 [output 1]
output :number * factorial :number - 1
end
or...
to reverse :stuff
ifelse equal? count :stuff 1
[output first :stuff]
[output sentence reverse butfirst :stuff first :stuff]
end
From https://el.media.mit.edu/logo-foundation/what_is_logo/logo_programming.html https://el.media.mit.edu/logo-foundation/what_is_logo/logo_p...
And from https://dl.acm.org/doi/pdf/10.1145/3386329 https://dl.acm.org/doi/pdf/10.1145/3386329
Logo’s design drew upon two theoretical frameworks: Jean Piaget’s constructivism and Marvin Minsky’s artificial intelligence research at MIT. One of Logo’s foundational ideas was that children should have a powerful programming environment. Early Lisp served as a model with its symbolic computation, recursive functions, operations on linked lists, and dynamic scoping of variables.
....
In LCSI Logo, the if instruction above becomes a call to the if procedure, which takes three inputs:
if :x<0 [right 90] [left 90]
The first input is a Boolean value, reported by the < procedure. The second and third inputs are instruction lists, only one of which will be evaluated by if depending on the value of the first input. Square brackets both delimit and quote a list, so [right 90] is equivalent to ’(right 90) in Lisp. The entire expression is therefore equivalent to
(if (< x 0) ’(right 90) ’(left 90))
in Lisp notation. How can Logo represent a thunk as merely the text of its body, without wrapping it in a lambda expression to capture its closure? See Dynamic Scope below (Section 3.7).
The use of quoted instruction lists didn’t start with LCSI. From the beginning, the main looping facility has been
repeat 4 [forward 100 right 90]
with the instructions to be repeated inside square brackets.
----
LOGO was secretly introducing us to lambdas and thunks and closures... back in 3rd grade on the Apple][+.
One of my laments is "I wish that we had computer scientists teaching us LOGO back then rather than the librarian who just wanted some quiet while we played Oregon Trail."
So... the weird characters? We dealt with them as kids, that's no weirder than LOGO.
- lmm 4y agoSounds more like TCL than LISP. (Of course there are those who consider TCL part of the LISP family). > So... the weird characters? We dealt with them as kids, that's no weirder than LOGO. Most kids didn't learn much from LOGO. AIUI the best available research on learning programming (which is very limited) says that weird characters are a barrier to understanding, and so is case sensitivity.
- shagie 4y agoLOGO was written decades before TCL and even half a decade before Smalltalk (which Wikipedia lists as one of the languages that LOGO influenced). > The first four years of Logo research, development and teaching work was done at BBN. The first implementation of Logo, called Ghost, was written in LISP on a PDP-1. The goal was to create a mathematical land where children could play with words and sentences. Modeled on LISP, the design goals of Logo included accessible power and informative error messages. > Logo was a primary influence on the Smalltalk programming language. It is also the main influence on the Etoys educational programming environment and language, which is essentially a Logo variant written in Squeak (itself a variant of Smalltalk) http://worrydream.com/EarlyHistoryOfSmalltalk/ http://worrydream.com/EarlyHistoryOfSmalltalk/ for more on how LOGO influenced Smalltalk design.
- lmm 4y agoFew would consider Smalltalk to be a LISP.
- shagie 4y agoI'm not claiming that Smalltalk is a LISP. I am saying that LOGO is old. It was written the same year that BCPL (the predecessor for C) was written. To say that LOGO is a member of {language family}, it should be restricted to languages that were in use at that time. LOGO is a member of the LISP language family. From there, it also went on to influence many other influential languages.
- lmm 4y ago"Family" perhaps, but calling it a LISP is going too far when it doesn't have true macros (indeed most implementations have no macros at all). And to my mind the close similarity with TCL as a language is a lot more interesting than the details history, even- especially - if it's a point in the design space which both languages discovered independently rather than a case of one influencing the other.