As someone who hasn't done graphics programming(or anything like this), it's amazing to me how 'simple' directives can yield such things. Is this type of logic still used in games/graphic programming today?
It can, and it does, sort of! There's a bit more boilerplate in most environments designed for shipping things, but one of the more high power/terseness activities is writing a shader that can render signed distance fields.
Visual effects in games and movies is a direct usage.
If I wanted to have a brick wall I could progressively melt with a large laser, I'd render it with an SDF. SDFs are good for anything with volume, as mesh based rendering is intrinsically 'hollow'.
It's not the only solution for things like that, there's also voxel and particle based rendering, as well as reasonable hybrids. It's just another tool in the toolbox.
Sort of related to games/graphics programming - There's an open source CAD program called OpenSCAD that allows you to create 3D models with code that can be simple, but gets complex fast. I personally tried using it to create models for 3D printing, but got overwhelmed and decided to go to other tools.
Well, they say that Logo gave them a taste of functional programming, which is a broader statement than turtle drawing (which, to be fair, is the bulk of the prior discussion). Logo was strongly influenced by Lisp and, consequently, is a multi-paradigm language including functional as one of its paradigms.
You can think of it that way, but you can also think of a Logo program as a purely functional computation that follows the monad laws. Here's a Haskell package that implements it: https://github.com/aneilmac/worldturtle-haskell#readme
This was a great blast from the past. A few friends of mine and I would write down instructions to draw crude pictures in Logo; the usual sorts of things you'd expect from kids (and one step away from calculator tricks that would result in 8,008,135).
I'm sure lots of other kids did the same thing; kind of a fun way to sneak into writing programs - a low barrier to entry, and immediate results you could tinker with.
A lot of kids (middle and high schoolers) these days have pet projects like making html based website and writing a discord bot in javascript. The fact that our district hands out chromebooks probably contributes to the trend.
This takes me back to https://mitpress.mit.edu/books/turtle-geometry, a great book by Harold Abelson and Andrea DiSessa. It uses turtle geometry to explore college-level maths concepts and biological phenomena such as predator-prey relationships.
Last night I was chatting to my girlfriend (who works as a CAD designer in textile industry) about Logo! Like the author of this post, Logo was my first language, and I was really excited to draw squares and cubes and rocket ships, between the ages of 7 and 9. I had a lot of fun experimenting with the audio frequency generation as well, composing some basic songs (odetojoy, auclairdelalune, frerejaque).
Years later, when I was 26, I got to use Logo again! I wanted to draw a time-proportional train map of Taiwan. The distance between each point on the map corresponds to the time it takes a local train to travel that far. It made more sense to do that in Logo than in any other language. So I rewrote a basic Logo implementation in JavaScript and called it TurtleSheet :)
I hope that some teachers will see the potential of empowering kids, by giving them real-world data like public transport times, and getting some real designs out. If I saw something drawn by a 9 year old here on Hacker News, I'd definitely upvote it. (I don't support it as child labour, but if they like Logo and want to do something useful with it, that's one idea)
16 comments
[ 10.9 ms ] story [ 898 ms ] threadhttps://www.iquilezles.org/www/articles/distfunctions/distfu... compose a few of these together and you can manifest some pretty nuts infinity fractals.
Here's a video I made playing with the functions Inigo's provided. https://twitter.com/LeapJosh/status/1439876813258256385
If I wanted to have a brick wall I could progressively melt with a large laser, I'd render it with an SDF. SDFs are good for anything with volume, as mesh based rendering is intrinsically 'hollow'.
It's not the only solution for things like that, there's also voxel and particle based rendering, as well as reasonable hybrids. It's just another tool in the toolbox.
https://openscad.org/
Turtle drawing is arguably the most non-functional, stateful programming paradigm ever invented.
http://people.eecs.berkeley.edu/~bh/v1-toc2.html
I'm sure lots of other kids did the same thing; kind of a fun way to sneak into writing programs - a low barrier to entry, and immediate results you could tinker with.
Is there something popular like this today?
Years later, when I was 26, I got to use Logo again! I wanted to draw a time-proportional train map of Taiwan. The distance between each point on the map corresponds to the time it takes a local train to travel that far. It made more sense to do that in Logo than in any other language. So I rewrote a basic Logo implementation in JavaScript and called it TurtleSheet :)
http://peterburk.github.io/tra/
I hope that some teachers will see the potential of empowering kids, by giving them real-world data like public transport times, and getting some real designs out. If I saw something drawn by a 9 year old here on Hacker News, I'd definitely upvote it. (I don't support it as child labour, but if they like Logo and want to do something useful with it, that's one idea)