Hacker Timesnew | past | comments | ask | show | jobs | submitlogin
A Clojure library that implements the Logo programming language (github.com/google)
50 points by aps-sids on June 13, 2015 | hide | past | favorite | 12 comments


Hi everyone, author here! I'm really excited about the possibilities that this library opens up! I intend to write a blog post soon to explain in detail the ideas I have and to put them in context. Until then, here's the high-level:

1. Yoko's talk at the recent Clojure/West about ClojureBridge curriculum (https://www.youtube.com/watch?v=fiIJuthOhnk) shows that the inflection point for difficulty for students happens around functions, especially higher-order-functions. That's exactly what REPEAT is in Logo, and kids handle that just fine. So maybe clojure-turtle can be used to smooth out the learning curve in Clojure curricula?

2. My talk at Clojure/West was about programming in Clojure in other languages, which could open up accessibility to programming to non-English speakers (https://www.youtube.com/watch?v=MqjMZNwnYCY). I think translating clojure-turtle shortens the first step to reaching a new human language -- the set of constructs you need to translate is much smaller and more tangible. If Logo works for kids, it should work for anyone. For those who have seen my talk, clojure-turtle is sort of my successor to clj-thamil (programming in other languages) in the sense that they can make programming and/or Clojure more accessible to much wider audiences.

3. Logo is used to teach kids programming, and it's fun! MIT's Scratch is based on Logo -- it's a visual version of it. UC-Berkeley uses a modified version of it for its intro CS 10 class, and code.org uses a version of it in its projects to teach kids programming. So we're teaching Lisp (Logo) to beginners because it's simple (and easy), but why is it that when they get older, Lisp/Clojure is all of a sudden hard and "weird"-looking? That ought to be a short gap to bridge, right?

4. clojure-turtle uses Quil because the ClojureBridge curriculum uses it for capstone / advanced concept material. But Quil is a great choice on its own merit. Since Quil shares a codebase between Clojure & ClojureScript code, it easily compiles to Java and JS, meaning we ought to be able to make a try-X.com website out of this, too.

Let me know if you have any other feedback, thoughts, etc. about the code or anything else.


I have a real soft spot for LOGO, so I'm always enchanted by projects like this. I do find that turtle 🐢 graphics can be a distraction from some of logo's less appreciated features, for example, the REPL doesn't just provide an interactive environment, it's also an effective editor for procedures, typing TO BOX should bring up an edit in which you define what it means to box


This is great. Now how can we put this in a kid friendly IDE so I can teach my daughter Lisp/Logo/Turtle Geometry? I am thinking of something like an IPython Notebook. I know there are lots of resources to teach kids to code, but many of them leave me feeling cold.


DrRacket ships with turtle graphics: http://docs.racket-lang.org/turtles/Traditional_Turtles.html

I've had a good experience introducing DrRacket to early-elementary-aged kids; it's much more approachable than anything in Clojure-land.

Of course, for pre-typists you can't beat Scratch: http://scratch.mit.edu


Thanks, Phil! Your post about Logo (http://technomancy.us/167) was definitely an inspiration for this project.

I hope that something in Clojure can be made to be as effective as DrRacket has been for you.


Maybe you can look at https://turtle.sugarlabs.org/ (and some background on it http://wiki.sugarlabs.org/go/Activities/Turtle_Art ). It exports to Logo.

If you really want just typing, there are a few LOGO implementation in browser, see http://logo.twentygototen.org/ http://www.calormen.com/jslogo/

if you want to use iPython, have you looked at http://mail.scipy.org/pipermail/ipython-dev/2014-April/01372... ?


I love the jslogo site!


Maybe try to use it with Gorilla REPL http://gorilla-repl.org/ , it's like IPython Notebook.


Have you tried

ucbLogo https://www.cs.berkeley.edu/~bh/logo.html

or FMS Logo http://fmslogo.sourceforge.net/

...no IDE, but there is a REPL. As for resources you might like to investigate:

http://fmslogo.sourceforge.net/workshop/


This is truly great. I was looking for some introduction to programming for my little kid, and I wanted it to be very flexible but also visual, and I think this just the right tool.

I ran into a problem though. I can run the commands in the REPL and I can see the new turtle position in the terminal, but there is no quil window with graphics. I can also run the example function, but I get "quil.Applet cannot be cast to clojure.lang.IFn".


As far as the Quil window with graphics, I'm not sure if it's because an Applet is being used, but on Mac OS X, the window pops up for me behind my other windows and without focus. I have to hide all of the other windows on top of it to find it. It's weird, I know.

What is the command you're running that gives you the error "quil.Applet cannot be cast to clojure.lang.IFn" ?


You are correct, it works! I am on a Mac and I needed to press F3 (show all windows) to see the graphics window. It does not show up if you just do cmd-Tab.

As for the second error - I was incorrectly trying to run the core.clj, so no problem there.

Thanks for the help! I had fun drawing circles :))




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: