4 ms·
Having 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 simp
by RodgerTheGreat 5y ago
Having 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.
- xapata 5y agoTurtle in Python would have the same flow of ideas up to the invention of new control flow, which I agree is cool. But that's why Python isn't a LISP. Yet, the creation of a "while" here isn't so different than making a new function which performs that logic. Was your example intended to demonstrate creating new syntax?
- RodgerTheGreat 5y agoYes, it's a do-while loop. It takes two arguments ("cond" and "proc") which would both be bracketed lists. "unless" is common sugar for a negated if statement. "run" evaluates a list as an expression. You'll notice that if/unless also take their bodies as lists, rather than any sort of special-purpose block syntax. "stop" short-circuits the current procedure and immediately returns. Since Logo has dynamic scope, any variable references in "cond" and "proc" will resolve the same within "while" as they did in its caller; no nasty visibility surprises. Since Logo does not eagerly evaluate lists, there is no need to "quote" or otherwise escape the lists in the caller's context. It is precisely that one can define such a construct without defining new syntax per se that is useful.
- 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.