2021-09-12 00:30:14 The only algorithm I can think of that is simple to implement requires at the very least an accumulator (which may be on the stack or in a variable). 2021-09-12 00:39:30 yeah sorry, kinda moot now.. I implemented rot and my problem went way. 2021-09-12 00:39:32 *away. 2021-09-12 00:39:41 maw 2021-09-12 08:25:23 PICK and ROLL upon thee 2021-09-12 16:04:04 hey all, having a little conceptual problem, wondering if someone could help 2021-09-12 16:04:39 i'm implementing a LOGO (for my son) in forth, because it needs to drive a robot that already runs forth and he's learning logo 2021-09-12 16:05:28 logo has commands like "forward 10" which I'm so far implementing like : forward token evaluate xxxxxx ; to handle the non-RPN nature of things 2021-09-12 16:06:03 but I'm now running into trouble with the multi-line control flows: repeat and to (which is logo's way of defining a function) 2021-09-12 16:06:04 is this LOGO logo (as in, the entire programming language) or just a turtle graphics system? 2021-09-12 16:06:10 ah ok, the language itself 2021-09-12 16:06:18 just a little turtle graphics 2021-09-12 16:06:27 but yeah, it needs logo syntax 2021-09-12 16:06:33 I'm not entirely sure how you'd do that within forth 2021-09-12 16:07:03 I'd write an interpreter in a similar way as you would in less flexible languages, for seperate logo things 2021-09-12 16:07:10 I'd be stoked to have repeat loops, but the parsing-forward parts of it have pushed me past my forth comfort zone :) 2021-09-12 16:07:26 like logo is fun outside of the forth environment but implemented in forth 2021-09-12 16:07:28 but I'm boring 2021-09-12 16:07:34 there are probably better ways 2021-09-12 16:07:44 s/fun outside/run outside/ 2021-09-12 16:09:16 one option, that bums me out conceptually, is to run the logo in a webpage, so JS, or a python program, and then just spit the relevant movement commands to the forth 'bot core 2021-09-12 16:09:26 that's what you're thinking? 2021-09-12 16:10:19 not exactly, more like writing a logo interpreter in forth but doing it the "traditional" way 2021-09-12 16:10:42 like, rather than writing forth words that did logo-ing, writing it in forth but in a similar way to how you would in python etc 2021-09-12 16:10:58 reading and parsing input and doing stuff 2021-09-12 16:11:24 but it's more work to do that yourself when forth could do it. I don't really know 2021-09-12 16:11:36 ah so. yeah. maybe. I'm actually horrible with text parsing in forth 2021-09-12 16:12:10 same here 2021-09-12 16:13:39 although all the right words are just sitting there... maybe I need to play around a bit more 2021-09-12 16:17:26 do you know any other languages hexagon5un ? 2021-09-12 16:17:44 any parser combinator libraries will be suited for this 2021-09-12 16:19:58 they said that this was for a 'bot that was already running forth 2021-09-12 16:20:16 but implementing a simple logo-style interpreter shouldn't be very difficult in most languages 2021-09-12 16:21:45 yeah. the bot runs forth, but I'm not totally averse to just wedging an ESP32 (or whatever) in there and letting it do the LOGO and pass on commands to the forth bot. It needs wifi or bluetooth connectivity so he can get to it with a tablet, but that's about it for requirements 2021-09-12 16:22:59 truly simplest would be to whip up a single-page web app that does the LOGO, serve that with an ESP32, and then have it control the bot in its native language 2021-09-12 16:24:53 but thanks f-a, I'll have a look at some libs and see if that makes a lightbulb or two go off. maybe even a couple LOGO implementations. then maybe come back to thinking through the forth of it, or not. 2021-09-12 16:35:33 hah. this is fun: https://inexorabletash.github.io/jslogo/ 2021-09-12 18:00:54 Just teach your kid Forth #solved 2021-09-12 18:01:57 Trying to make Forth non-RPN with immediates is an anti-pattern 2021-09-12 18:02:28 that I agree 2021-09-12 18:03:20 Forth really isn't that much harder than LOGO for simple turtle controlling 2021-09-12 18:03:28 Forth actually shines when it comes to writing controller code 2021-09-12 18:04:34 why is it so, do you think? 2021-09-12 18:04:43 blargh, my grammar is degrading xD 2021-09-12 18:05:11 Well Forth is quite comfortable for just writing a dumb sequence of instructions in a program 2021-09-12 18:05:51 : washer wash spin rinse spin ; \ comes to mind 2021-09-12 18:07:09 : turtle 10 north 10 east ; 2021-09-12 18:10:34 well logo is like that, no? 2021-09-12 18:11:01 I can't remember, but probably yeah 2021-09-12 18:13:42 : turtle 10 forward 30 turn 20 forward ; \ looking it up, it's more like this 2021-09-12 18:16:19 Logo has "REPEAT 30 [ ... ]" which is just "30 0 ?do ... loop" 2021-09-12 22:55:34 In some ways I think it's kind of unfortunate that turtle graphics became so tightly associated with LOGO. That language has some sincere limitations and some rather strange syntax.