2024-08-30 00:58:19 hooray for dpansbot! 2024-08-30 00:58:41 veltas: plausibly, but it's also pretty common to have to dup that count and do something else with it 2024-08-30 00:58:57 *or do something else 2024-08-30 01:00:29 in surveying existing code, I found that a little over half of all for-loops in C started at 0 and counted by 1 up to a maximum count 2024-08-30 01:00:54 I'll have the [bot]dpans updated sometime tomorrow to provide links for words with descriptions longer than 3-4 lines 2024-08-30 01:02:02 but the denominator here includes C for-loops that do things like decrement a pointer until encountering a negative number in an array, for-loops that walk a linked list, and for(;;) infinite loops 2024-08-30 01:03:14 so I think that, of *counted* loops that you could conceivably express with do loop or do +loop in standard Forth, probably a clear majority of them start at 0 2024-08-30 01:04:04 (or ?do loop or ?do +loop) 2024-08-30 01:04:41 so if you wanted your Forth to be *either* efficient to interpret *or* convenient (rather than privileging compactness over all else) you'd want to have a version of do which implicitly starts at 0, so the question of 10 0 do or 0 10 do doesn't arise at all 2024-08-30 01:06:30 actually, probably even if you were privileging compactness over all else, because it saves you a 0 in your threaded code every time you have such a loop. and the space cost to implement it is on the order of 10 cells 2024-08-30 01:07:46 so it becomes a net win for compactness as soon as you have more than about 10 or 15 loops in your codebase 2024-08-30 01:12:05 efficiency of interpretation comes into the question because pushing the 0 onto the stack, processing the additional item with next, and popping the 0 off to set up the do-sys, are all time-consuming activities that can be avoided 2024-08-30 01:15:29 if the parameter order really is enough a nuisance, you could declare your own /od/ that does whatever's required to get swap do to work as expected in your forth, and maybe a /pool/ (of just loop) if you want symmetry 2024-08-30 01:16:50 ive been thinking about writing some loop words that keep the index on the return stack 2024-08-30 01:17:02 so you don't have to worry about preserving it on the data stack inside the loop 2024-08-30 01:17:35 and yeah i'd probably have N-0, 0-N and N-M as separate words 2024-08-30 01:20:29 so we have only today to abuse the dpans bot 2024-08-30 01:20:57 dpans: oh 2024-08-30 01:20:57 <[bot]dpans > not found 2024-08-30 01:21:00 i need to actually finish writing my from-scratch forth 2024-08-30 01:21:35 I'm making a concat lang in js again, with the goal of using it to make a spaceshooter 2024-08-30 01:21:43 but has nothing to do with forth actually 2024-08-30 01:22:38 btw crc I'm implementing that :var: thing and ::global:: thing, I liked your idea of making :var: save the value in a variable and push it at the same time 2024-08-30 01:22:58 I will always do that whenever I implement that syntax sugar 2024-08-30 01:23:49 it's kinda funny that VALUE and CONSTANT are identical in jonesforth 2024-08-30 01:24:37 this is what I have for now https://termbin.com/1aq0 2024-08-30 01:24:47 if you run it in node it will start a shitty repl 2024-08-30 01:25:13 if you run it in the browser it will execute all the