If you like this project, you may be interested in a similar project that I did a while back using using the turtle interpretation of grammars to represent connections between LEGO bricks:
This reminds me of a story of how Logo was implemented on 8-bit microcomputers.
Leigh Klotz was the man who ported MIT Logo to the Apple ][ and then the Commodore 64. According to him “The Commodore 64 CPU 6510 has a bidirectional parallel port at location 0 and 1, taking up 2 of the 256 "page zero" locations, which are the only ones you can indirect through. When I ported MIT Logo from the Apple II, there were lots of places that dereferenced nil without checking, and those caused crashes. Commodore gave me a chip they fabbed in qty 12 yield that brought out the I/D decide status as a pin, and we used a Nicolet-Paratronica logic analyzer to feed the address and data bus to a Pet running a BASIC disassembler. I could then set a breakpoint in-circuit to see the 256 instructions prior to or after the errant memory access, so I could go put on guard code...”
I got it from Jamie Zawinski's weblog. Be forewarned. Following the link from Hacker News will lead to an unsavory image. Just copy & paste it, instead.
DDoS of brogrammers and financially obsessed man-children. I think he nailed it. However the content in his pages is very lightweight and hosted in AWS it looks like so maybe that referrer logic pre-dates him hosting it and the DNA Lounge website there and... also because what he has to say is certifiably true. Good laugh.
I'm seeing some really interesting JavaScript techniques in the turtlevm.js[1] source.
This line in particular stands out:
const code = String(work).trim().split("{").slice(1).join("{").slice(0, - 1).trim().replace("/0/", _turtlevmapi).replace("/1/", strCode);
It looks like the author is injecting the turtle code written by the user into a "work" function that removes dangerous objects (XMLHttpRequest, WebSocket, etc).
Can someone with experience writing a VM in JS point to a good reference on the topic?
I certainly hope that isn't the intent, because there are other ways to generate network requests (new Image() and fetch(), for example). Sandboxing JS eval is a very hard problem and even Angular 1's "bulletproof" sandboxed template engine was repeatedly owned. I'd be wary of XSS on any site like this one.
For anyone interested about this kind of things, I did something a bit similar for 3d voxel rendering:
https://voxeltoy.com/, also inspired by shadertoy.
// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(1);
// Global code will be evaluated once.
const turtle = new Turtle();
turtle.penup();
turtle.goto(0,0);
turtle.pendown();
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function pausecomp(millis)
{
var date = new Date();
var curDate = null;
do { curDate = new Date(); }
while(curDate-date < millis);
}
// The walk function will be called until it returns false.
function walk(i) {
turtle.forward(i);
turtle.right(150);
//await sleep(100); //await not valid inside the walk function
pausecomp(50)
return i < 200;
}
Not really in the true spirit of turtle (if it doesn't "go forward" I don't count it!), but I had to make this one based on the MAD computer program discussed here yesterday.
This reminded me of a physics toy I saw ~10 years ago where you would draw simple two-dimensional robots with legs and muscles, optimize their gait, and race them.
I am reminded of what i believe is the same thing constantly and can never find it. I always thought it was called something like Sodaracer but searches have been unsuccessful. I remember evolution algorithms to make the fastest amoeba wheels.
While TurtleToy is way more advanced, few years ago I built a small webapp that uses nested CSS to make recursive images: https://zetabee.com/weave/
Click [Help] button to get an idea of how it works. It was heavily inspired by Structure Synth but written from scratch to work with CSS3 in a modern browser.
This takes me back. I remember learning Logo at school when I was 10 or 11 and had a project to do using Logo. For some reason I couldn't make it into school for a few weeks, I'm not sure if I was ill or something else but was going to miss the project hand in date, so I wrote the code on paper while I was at home as I didn't have a Logo compiler or interpreter for my ZX Spectrum. My teacher put my code into the interpreter and it ended up looking exactly as I had expected. I think it was a tank and used procedures/functions which was above and beyond what we'd been taught.
Of course Logo wasn't the most complex language ever but I remember being pretty pleased with myself having written a computer program on a bit of paper and it doing exactly what I'd visualised it to do.
> Of course Logo wasn't the most complex language ever
Logo's turtle graphics aren't the most complex language ever, but underneath of it is a Lisp without the parentheses, which is quite powerful including list processing and recursion.
I am so glad this exists. Turtle Graphics remains the best way to teach so many fundamental concepts. From recursion to path finding.
One feature that I wish existed was library import. Or community accepted set of extension modules. An easy way to call polar coordinates, Spirographs, matrix transforms, etc.
If you're into this, you might also be interested in robotic pen plotters. This article from last year kicked off a serious new hobby for me which combines code/art/robotics/etc and has been a ton of fun.
[+] [-] jncraton|7 years ago|reply
https://github.com/jncraton/connectiongrammar
The "API" is admittedly quite poor currently, as I just quickly hacked this together on top of NLTK, but I was able to put together some fun results.
[+] [-] YeGoblynQueenne|7 years ago|reply
[+] [-] carapace|7 years ago|reply
[+] [-] rudolfwinestock|7 years ago|reply
Leigh Klotz was the man who ported MIT Logo to the Apple ][ and then the Commodore 64. According to him “The Commodore 64 CPU 6510 has a bidirectional parallel port at location 0 and 1, taking up 2 of the 256 "page zero" locations, which are the only ones you can indirect through. When I ported MIT Logo from the Apple II, there were lots of places that dereferenced nil without checking, and those caused crashes. Commodore gave me a chip they fabbed in qty 12 yield that brought out the I/D decide status as a pin, and we used a Nicolet-Paratronica logic analyzer to feed the address and data bus to a Pet running a BASIC disassembler. I could then set a breakpoint in-circuit to see the 256 instructions prior to or after the errant memory access, so I could go put on guard code...”
I got it from Jamie Zawinski's weblog. Be forewarned. Following the link from Hacker News will lead to an unsavory image. Just copy & paste it, instead.
https://www.jwz.org/blog/2018/11/weird-machines/#comment-192...
[+] [-] js2|7 years ago|reply
http://www.dereferer.org/?https%3A%2F%2Fwww%2Ejwz%2Eorg%2Fbl...
[+] [-] johnwyles|7 years ago|reply
[+] [-] nikofeyn|7 years ago|reply
[+] [-] msla|7 years ago|reply
[+] [-] ebcode|7 years ago|reply
This line in particular stands out: const code = String(work).trim().split("{").slice(1).join("{").slice(0, - 1).trim().replace("/0/", _turtlevmapi).replace("/1/", strCode);
It looks like the author is injecting the turtle code written by the user into a "work" function that removes dangerous objects (XMLHttpRequest, WebSocket, etc).
Can someone with experience writing a VM in JS point to a good reference on the topic?
[1]https://turtletoy.net/js/turtlevm.js?v=56
[+] [-] whyonearth|7 years ago|reply
[+] [-] aarondf|7 years ago|reply
1: https://turtletoy.net/turtle/9ddc6d4dc5
[+] [-] azeirah|7 years ago|reply
http://imgur.com/gallery/CXLtbZA
[+] [-] milancurcic|7 years ago|reply
[+] [-] azeirah|7 years ago|reply
<3
[+] [-] antoineMoPa|7 years ago|reply
(Lots of useless moves happen while the pen is up)
[+] [-] redbonsai|7 years ago|reply
[+] [-] deyan|7 years ago|reply
[+] [-] guillaumec|7 years ago|reply
[+] [-] antoineMoPa|7 years ago|reply
One feature I'd like: A way to slow down the render so we can see the whole generation in slow-motion.
[+] [-] gabriel34|7 years ago|reply
the async way doesn't seem to work inside the walk function, but the older (and uglier imo) way does
As an example here is the modified code for https://turtletoy.net/turtle/eed0f57234
edit: implemented: https://turtletoy.net/turtle/e99ca811ad[+] [-] keithxm23|7 years ago|reply
[+] [-] msurguy|7 years ago|reply
[+] [-] kayamon|7 years ago|reply
https://turtletoy.net/turtle/9ddc6d4dc5
[+] [-] mrspeaker|7 years ago|reply
https://turtletoy.net/turtle/ba15abdde7
[+] [-] drostie|7 years ago|reply
[+] [-] DBYCZ|7 years ago|reply
If only I could remember the name of it...
[+] [-] scrumbledober|7 years ago|reply
EDIT: soda constructor by sodaplay.
http://maciejmatyka.blogspot.com/2018/02/soda-constructor-re...
EDIT2: from that link, here is a playable open source recreation linked at the bottom
https://peterfidelman.github.io/constructor/
[+] [-] _xgw|7 years ago|reply
[+] [-] chime|7 years ago|reply
Click [Help] button to get an idea of how it works. It was heavily inspired by Structure Synth but written from scratch to work with CSS3 in a modern browser.
[+] [-] welly|7 years ago|reply
Of course Logo wasn't the most complex language ever but I remember being pretty pleased with myself having written a computer program on a bit of paper and it doing exactly what I'd visualised it to do.
[+] [-] timbit42|7 years ago|reply
Logo's turtle graphics aren't the most complex language ever, but underneath of it is a Lisp without the parentheses, which is quite powerful including list processing and recursion.
[+] [-] ArtWomb|7 years ago|reply
One feature that I wish existed was library import. Or community accepted set of extension modules. An easy way to call polar coordinates, Spirographs, matrix transforms, etc.
[+] [-] viach|7 years ago|reply
They developed their own declarative language for generating art.
[+] [-] agumonkey|7 years ago|reply
[+] [-] ejo4041|7 years ago|reply
Edit: I meant directly from the site. I could do it from my desktop using python.
PS, this is awesome!
[+] [-] Jack5500|7 years ago|reply
[+] [-] unknown|7 years ago|reply
[deleted]
[+] [-] nottwo|7 years ago|reply
Also reminds me of the Forth Haiku Salon: https://forthsalon.appspot.com/
[+] [-] etrautmann|7 years ago|reply
http://www.tobiastoft.com/posts/an-intro-to-pen-plotters