2024-09-19 03:00:57 name that word: -1 cells and 2024-09-19 03:58:20 zelgomer: is the intent to clear the least significant log2(CELL) bits? 2024-09-19 04:11:25 floor to cell, yes 2024-09-19 04:15:18 sweep 2024-09-19 07:47:14 -align maybe 2024-09-19 14:59:16 oh i hadn't thought of that one 2024-09-19 16:10:53 anyway, i think i know how to do this magical meta forth 2024-09-19 16:11:16 i was really overcomplicating the memory type tracking, trying to come up with a binary tree scheme that would split when necessary and try types as they were written to memory 2024-09-19 16:12:25 the smallest granularity you need is a cell. anything smaller than a cell is either a raw chars type, which means @ is undefined because of unknown endianness, or it's a palindrome like 0 or -1 2024-09-19 16:14:09 so i just have two parallel memories: one is the "target" memory (in quotes because in this case, the target is actually an intermediate virtual machine), and its parallel memory is just an array of cells that point to metamethods tables 2024-09-19 16:15:54 the metamethods tables just define handlers for c@, c!, and @. ! is actually a common method for all types. and there are only four metamethods tables: palindromes (cell value is -1 or 0), chars (you wrote to memory there with c!), numbers, or relocations. 2024-09-19 16:17:23 then, i have objects to represent values on the stack, so a bunch of primitives like dup, drop, arithmetic, and c@, c!, @, and ! to keep track of their types while in flight. 2024-09-19 16:18:38 that sounds like it'll work, but you only need numbers and relocations 2024-09-19 16:18:54 unless you're trying to detect and error out on nonportable code 2024-09-19 16:19:38 on the stack that's true, but in memory i need to do something if you, for example, write "foo bar ! 69 bar 1+ c!" 2024-09-19 16:19:51 that's not just unportable, it can create a compile-time crash 2024-09-19 16:20:02 yeah, but you can implement that with whatever endianness you want 2024-09-19 16:20:42 70 isn't a relocation, so c! can abort when you try to 70 c! 2024-09-19 16:20:48 oh, sorry 2024-09-19 16:20:49 in that case, when c! is exectued, it knows that what was previously in that cell was a relocation (a cell-sized object), so it first zeros the memory before writing the char, then changes the metadata to flag the cell as raw chars 2024-09-19 16:20:55 I missed the bar 2024-09-19 16:21:14 yeah 2024-09-19 16:21:39 it doesn't have to zero the memory; it could 0xdeadbeef it 2024-09-19 16:22:02 actually now that i say it, remember the real reason why i wanted this. it was to avoid accidentally leaking uninitalized memory into the target binary 2024-09-19 16:22:25 potentially important yeah 2024-09-19 16:22:31 but you can just zero it when you allot it 2024-09-19 16:22:36 or deadbeef it 2024-09-19 16:22:42 yeah, it could initialize it with some magic number. 0 is nice though because if you're writing a zero, then it gets to become a palindrome cell field, which is more permissive 2024-09-19 16:23:15 right, but it's going to result in more debugging pain down the line 2024-09-19 16:23:41 because code will work when you test it in the more permissive environment and then fail when you're not testing it 2024-09-19 16:24:04 hmm. good point. 2024-09-19 16:24:53 code is more reliable if it fails more often when it's possible for it to fail, so that failures are caught and fixed earlier 2024-09-19 16:25:29 (it also helps a lot for the failures to be deterministic) 2024-09-19 16:26:47 yeah, that's true. i may change that. 2024-09-19 17:59:33 ACTION offers xentrac a dagger to go with that cloak 2024-09-19 18:02:38 ACTION gratefully accepts 2024-09-19 18:05:20 did you ever get around to working on a curses enhancement for wmaze? 2024-09-19 18:06:55 that turned out to be overkill. I just changed draw-dude and erase-dude to call a mvaddch which both updates board and draws on the screen with at-xy and emit 2024-09-19 18:08:04 that was enough to allow me to upload this color version of the asciicast: https://asciinema.org/a/672405 2024-09-19 18:09:15 oh also I wrote a color? which only changes the drawing color on the terminal if it isn't the current color 2024-09-19 18:09:30 doing curses-style change minimization might compress the victory animation somewhat, but those were the big wins 2024-09-19 18:11:55 the major remaining problems are that (a) I feel like the maze generation is too much code and (b) it still generates unsolvable mazes sometimes 2024-09-19 18:13:24 The best kind of mazes 2024-09-19 18:23:17 there's a mazes book that covers various algos (in Ruby). or you could chase down all those original papers and whatnot 2024-09-19 18:25:14 yeah, there's a lot of great material out there on maze generation. I linked some good resources in this comment on Character Assassination News 2024-09-19 18:26:13 xentrac: You might like n-gate http://n-gate.com/ 2024-09-19 18:26:44 https://news.ycombinator.com/item?id=41344164 2024-09-19 18:26:57 heh 2024-09-19 18:28:13 there are more resources in the thread: https://news.ycombinator.com/item?id=41327933 2024-09-19 18:31:19 user51: I don't think the author of n-gate has the intellectual capacity to understand any of the top-level comments in that thread, much less write one of them 2024-09-19 18:32:47 xentrac: I don't take it too seriously, so it's all humor to me, but I can see your point as well. 2024-09-19 18:32:58 fortunately people like them haven't driven away *all* of the worthwhile participants from the site 2024-09-19 18:33:02 yet 2024-09-19 18:35:05 I hope they stopped posting because they're dying of a very unpleasant disease like Alzheimer's 2024-09-19 18:35:36 how's that for humor? 2024-09-19 18:35:46 ha fucking ha 2024-09-19 19:00:25 xentrac: That's better than holding it in. :) 2024-09-19 19:02:44 But now it's time for forth as it always should be. Does anyone come across a need to operate on the data below TOS, maybe something like >r OPERATION r>. I've seen it called UNDER sometimes. 2024-09-19 19:08:58 I think Joy and Cat have a combinator for that 2024-09-19 19:09:48 usually I use swap op swap although of course that's only for the single-result case 2024-09-19 19:12:59 I tried writing a general approach but then realized that it also has to take into account the result. It might consume or even leave the stack deeper. That led me to think that a proper solution might need to take into account arity.. I'll call it stackrity. 2024-09-19 19:18:27 you may be interested in Cat and Kitten: https://web.archive.org/web/20150205160323/http://www.cat-language.com/ https://web.archive.org/web/20080716164715/http://cdiggins.com:80/blog/ https://web.archive.org/web/20161001153948/http://evincarofautumn.blogspot.com/2013/07/static-typing-in-concatenative-language.html 2024-09-19 19:19:40 also https://kittenlang.org/ and https://github.com/evincarofautumn/kitten 2024-09-19 19:20:28 I searched for Cat but ended up on https://en.wikipedia.org/wiki/Cat_communication 2024-09-19 19:20:46 Er, "Cat language" 2024-09-19 19:24:19 yes, that's why I linked you to the home page in the Internet Archive above 2024-09-19 19:24:42 and the archive of the author's blog 2024-09-19 19:25:22 for the time being you can still obtain the information from there but of course Google will not find it 2024-09-19 20:02:52 https://kittenlang.org/intro/#multiple-inputs-and-outputs looks like it, but that's just a touch too easy :) 2024-09-19 20:03:16 As in, switching languages. But mayb Chuck would agree, that does solve the problem. 2024-09-19 20:12:51 you might be able to apply Kitten's or Cat's conception of function typing to your stackrity problem