2024-01-20 01:40:43 Damn nonconformists... 2024-01-20 01:52:26 Zangband made the 64-bit transition... poorly... and had a soft-lock in character creation as a result 2024-01-20 15:43:51 forth: a little for allot 2024-01-20 16:01:43 thrig: 32 bit -> 64 bit is a pretty major change. It's not exactly easy in a complicated application to not let that size "matter" anywhere at all. And you only have to miss one spot to run into trouble. 2024-01-20 16:02:41 I used to think about trying to write my Forths so that I could just change a symbol value to change the cell size. I mostly have given up on that; there's just a lot to juggle. 2024-01-20 16:03:02 I think I'd feel more at ease with a GC forth :d 2024-01-20 16:03:13 But that's Factor I guess. 2024-01-20 16:03:17 It can be done; I've done it. 2024-01-20 16:03:57 No doubt 2024-01-20 16:04:13 In the end it ran entirely as a proper Forth, except I never got around to replacing the c stubs that implemented my primitives. 2024-01-20 16:04:19 Wonder if factor still has the create/does mechanics 2024-01-20 16:04:35 My c source wound up awfully ugly, though. 2024-01-20 16:05:09 Hehe 2024-01-20 16:05:09 By the time I'd added everything - create/does> in particular contributed to the ugliness. 2024-01-20 16:05:25 And after setting it aside for a year or so it was really hard to decipher the c source. 2024-01-20 16:05:48 I guess a more modern forth dialect would just use constructor and invoke logic instead of create/does 2024-01-20 16:06:09 could* 2024-01-20 16:06:44 The biggest downside of it performance-wise was that it used variables for all the stuff you'd normally want to use registers for. 2024-01-20 16:07:01 Hm 2024-01-20 16:09:07 And since I was still running *some* bits of C code I couldn't change that. 2024-01-20 16:09:25 Since there really wasn't any way to know what those C bits were doing with the registers. 2024-01-20 16:11:25 I did look at the generated code some, and gcc hadn't really done the best job in my opinion. There were numerous extraneous jumps. 2024-01-20 16:16:26 Yea? 2024-01-20 16:16:35 Well well 2024-01-20 16:16:49 Can't beat hand-crafted ASM I guess :) 2024-01-20 16:21:52 geez i only just now realized abort" is supposed to be conditional 2024-01-20 16:22:03 why is this not ?abort" ?? 2024-01-20 16:22:14 sometimes the naming inconsistencies confuse me 2024-01-20 16:25:08 Yeah, there definitely is some inconsistency in that kind of thing. 2024-01-20 16:25:31 I agree with you that trying for some rigor on that front is a desirable thing. 2024-01-20 16:26:07 I've been a little inconsistent about where I put the ? - I think I do like putting it at the front like you just did. 2024-01-20 16:27:08 And if a word can potentially produce the effect of a return (even if it's conditional), I usually try to put ; at the end of the name. 2024-01-20 16:27:41 I'm not 100% consistent with the ?, though - for example, I have 0=; instead of ?0=; 2024-01-20 16:28:00 Just because 0= has such a strong 'traditional behavior.' 2024-01-20 16:28:49 You can see 0= as not asking a question but transforming a value 2024-01-20 16:29:33 that's true, but when you put ; onto it it's now conditionally 'doing something." 2024-01-20 16:29:48 Ah 2024-01-20 16:31:01 At any rate, the ability to name tings "arbitrarily" is nice, but I think trying for some level of consistency makes things easier to remember. 2024-01-20 16:31:42 ACTION needs a hash table implementation in C 2024-01-20 16:31:43 I've got over a hundred conditional return or recurse primitives, but they're named in a systematic enough way that I never have any trouble popping out the right name. 2024-01-20 16:31:57 olle: That's got to be "out there." 2024-01-20 16:32:52 KipIngram: yea, checking glib source... also stackoverflow. or even chatgpt lol. 2024-01-20 16:37:14 KipIngram: i usually put the ? at the back when something returns a flag, and ? at the front when something consumes a flag. although it sometimes results in weird patterns like foo? ?bar 2024-01-20 16:41:36 Oh, that seems like a nice touch. 2024-01-20 16:42:08 I've mostly transitioned to conditional actions and I'm pretty light on "flag use" these days. 2024-01-20 16:48:14 I think GeDamo's point about looking at things as a function/transformation is a good one, though. 0= always takes something and always leaves something; it's not like it might or might not leave a result. 2024-01-20 16:48:33 Whereas 0=; might or might not cause a return in my system. 2024-01-20 16:50:12 olle: i have written several. they not that hard 2024-01-20 17:02:07 I seem to recall that in hash systems where you do additional probes if you get a collision, generating the "next" value is easier if you still have the intermediate results for the previous one. I've seen algorithms that generate the whole list, and you'd then just check them until you found one available. 2024-01-20 17:04:07 I think of it as somewhat like cryptography - if I were doing it I'd definitely find the algorith documented and copy it. I might "re-arrange" the pieces a little bit, but I figure someone has figured this out - may as well use it. 2024-01-20 17:05:24 folks have written very bad hash functions 2024-01-20 17:05:46 there are several ways to handle open addressing. the way i usually do it is you generate the primary hash and then you hash that to come up with a secondary hash. or 1 into the secondary hash to guarantee that your stride isn't an even multiple of the table (which is a power of two), and then loop nbuckets times until you find what you're looking for 2024-01-20 17:05:49 Definitely. It would be code worth testing. 2024-01-20 17:06:11 And the goal is straightforward - you just want there to be an equal probability of each storage slot in your table being chosen. 2024-01-20 17:06:37 So a histogram made using random strings would be simple enough to create. 2024-01-20 17:07:20 I didn't mean to imply you could just blindly copy the first thing you ran across. :-) 2024-01-20 17:07:38 But the experts have been working on this for a long time. 2024-01-20 17:07:41 http://burtleburtle.net/bob/hash/evahash.html 2024-01-20 17:07:45 Some hash functions 2024-01-20 17:08:25 http://www.partow.net/programming/hashfunctions/#AvailableHashFunctions 2024-01-20 17:08:27 And that 2024-01-20 17:09:05 and you may need a better function if random (malicious) users can supply keys 2024-01-20 17:10:13 no, this is just for a hobby compiler project ^^ 2024-01-20 17:24:36 That's where I usually am. Writing it for me, so I don't spend much time worrying about "malicious users." 2024-01-20 17:25:10 Forth offers you any number of ways to completely slag your system. Preventing all of them would put a lot of overhead on the system. 2024-01-20 17:26:07 I did go to the trouble to put exception handling in there for bogus address references, but that was really for me - I just got tired of having to start all over after the resulting segfaults. 2024-01-20 17:26:46 Now it just handles those things the same way it handles the usual "handled errors." 2024-01-20 17:27:58 Plus it was kind of fun figuring out how to do it. That turns out to be something that's not documented very well "out there."