8 ms·
On any Mac from the last 15 years: $ python >>> from turtle import * You now have logo! You can do 'fd(100)' for example and it will pop up a window
by jedberg 5y ago
On any Mac from the last 15 years:
$ python
>>> from turtle import *
You now have logo! You can do 'fd(100)' for example and it will pop up a window with the turtle.
I plan to have my kids do this when they get a little older.
- somethoughts 5y agoSomewhat similar but in the browser - which is useful if you are trying to teach a bunch of kids on a smorgasbord of Macs, Chromebooks, Windows machines. https://hourofpython.trinket.io/a-visual-introduction-to-python#/welcome/an-hour-of-code https://hourofpython.trinket.io/a-visual-introduction-to-pyt...
- RodgerTheGreat 5y agoHaving access to a language with a turtle is nice, but Python really is not the same thing as Logo. Logo is a small, simple, and powerful language. It has simple syntax and a small number of concepts, making it easy to learn. Python is a large, hairy scripting language that is currently an in-vogue way to glue together performant C libraries and get work done. Python can be useful, but I do not think it is nearly as well suited to education as Logo is.
- xapata 5y agoYou misunderstood. You can provide the Logo experience with Python.
- RodgerTheGreat 5y agoI understood. My point is that python does not provide the logo experience, just one small but particularly iconic portion thereof.
- xapata 5y agoThe syntax is slightly different, but it's similar enough, I think.
- HerrMonnezza 5y agoThe point is: Logo >> turtle graphics.
- akho 5y agoNot really, no. You might not be able or willing (pedagogically) to get kids to the interesting bits, but traditional LOGOs (being ~ pre-Scheme LISPs) are dynamically scoped and have tail call optimization, neither of which would work in Python. The implications are that control structures are defined as simple procedures, there aren’t really closures, … You can probably reimplement much in Python, but at some point you will have to admit you’ve written a LOGO interpreter.
- xapata 5y agoI'm not saying Python is a LISP, but it does have closures. I'm not sure why tail call optimization matters for teaching. This is beginning to sound like a Python bashing instead of a Logo praising. Anyway, I've taught with Python a fair amount and have been pleased with the results, especially when using the `turtle` module.
- RodgerTheGreat 5y agoOne of the advantages of TCE in Logo (in combination with turtle graphics) is that you can teach the concept of recursion in a gradual and intuitive manner. You can start with drawing a circle, using recursion to make an infinite loop, stopping it manually after a while: to circle fd 3 rt 7 circle end Add a parameter, and get a spiral. The turtle winds its way off the screen, and again the student can stop the program manually: to spiral :x fd :x rt 30 spiral (:x + 1) end Introduce a base-case, and now the program stops itself at a desired size: to spiral :x if (:x = 30) [ stop ] fd :x rt 30 spiral (:x + 1) end Small, unsurprising steps building up an intuitive grasp of a useful concept. TCE can also improve the economy of the language, reducing the number of "primitive" control flow concepts that need to be provided out of the box. Since Logo has no "special forms" and is not eagerly evaluated like a Lisp, it's easy to make new control constructs without needing to teach any magic: to while :cond :proc unless run :cond [ stop ] run :proc while :cond :proc end Little things matter.
- cies 5y agoIndeed. Logo offers a great "my first programming steps" experience. Often translating the programming language (and syntax errors, etc) to the native language of the programmer. This is unmatched, and can never be matched, by Python.
- jedberg 5y agoYou don't need to know Python to use the turtle. Once you import the logo commands into the global namespace, you can just use the logo commands. You can certainly mix in Python if you want, but you don't have to.
- tannhaeuser 5y agoAgree, but just wanted to point out that Python started life as ABC, a language that, like Logo (and BASIC), was designed for teaching and prototyping. [1]: https://en.wikipedia.org/wiki/ABC_(programming_language) https://en.wikipedia.org/wiki/ABC_(programming_language)
- RodgerTheGreat 5y agoFor some time I have found it amusing that ABC's pilot studies were largely used as a justification for Python's significant whitespace, despite the fact that the ABC editor provided syntax-aware editing whereas Python was always composed with an ordinary text editor.
- deleted 5y ago[deleted]
- timbit42 5y agoThat's not Logo. That's only the turtle graphics from Logo. Logo is a complete functional language like Lisp but without parentheses, although parentheses can also be used.