2022-11-01 01:55:46 I'm not sure how I feel about leaving CFA empty. Part of me think it may as well stuff something in there. Then you get what you want at least some of the time. 2022-11-01 01:56:04 You have to do the same thing after anyway if you want something different. 2022-11-01 01:56:29 Plus dovar seems like the... "basic" thing to do; the simplest most primitive thing. 2022-11-01 01:57:17 Also, given the flexibility of dictionary structures, how are you going to get that address if you do want it for something? 2022-11-01 01:57:50 Wouldn't that require some "address word foo" to traverse various aspects of the dictionary entry? 2022-11-01 01:58:04 In FIG PFA was immediately after CFA, but that doesn't have to be the case. 2022-11-01 01:58:18 Maybe it would just be FIND PFA 2022-11-01 01:58:35 My words of that sort aren't entirely standard, so I lose track of what the standard does. 2022-11-01 01:59:46 Anyway, maybe I'm just not thinking of some really good reason for leaving it blank. 2022-11-01 02:25:10 I think that people have a tendency to want to use that whole mechanism (DOES> type stuff) in ways that nibble at OO stuff from other languages. 2022-11-01 02:25:30 But I feel like that's not really quite what it's for. 2022-11-01 02:44:29 They don't really fit that well - for OO you usually want to be able to associate a *collection* of code routines with a data storing item. This mechanism really only gets you one. 2022-11-01 02:45:40 The best I've been able to think of for some sort of "data driven code selection" is to make the system aware of what's on the stack. As in types. 2022-11-01 02:45:50 Then that can steer word search. 2022-11-01 02:54:32 In other languages, like say Python, you're always typing variable names - if you want at a variable you type it's name. 2022-11-01 02:54:49 So it's easy enough to stick a . on there to run some code associated with it. 2022-11-01 02:55:11 But in Forth we type the name once to get a reference to the variable on the stack, and then may use it a bunch more without typing the name again. 2022-11-01 02:55:29 The only good way to get the same functionality is for the system to remember what's what. 2022-11-01 02:55:57 And then you're not really talking about "Forth" anymore - maybe it's "somewhat Forth like," but it's definitely a different beast. 2022-11-01 04:14:00 I want to implement vocabularies in my forth. I guess the words I need are DEFINITIONS VOCABULARY CONTEXT CURRENT, and perhaps an internal variable or two for state keeping. 2022-11-01 04:15:33 BTW regarding this was the link I quoted: https://amforth.sourceforge.net/TG/recipes/Builds.html 2022-11-01 04:16:09 crc has a slick vocabulary mechanism. 2022-11-01 04:17:21 I forget the details, but he has some way of saving and restoring full vocabularly contexts - you can set up a search order, do what you need to do, and then clean it all up and get back to whatever search path existed before. 2022-11-01 04:18:17 I've tried both a "vocabularly stack" for keeping a list of vocabularies to search and also using a linked list. Both work ok; I don't think either one trumps the other in any enormous way. 2022-11-01 04:18:47 But CURRENT is a single vocabularly, whereas CONTEXT can be a group of vocabularies, with an order. 2022-11-01 04:19:18 And you'll need to decide whether you search CURRENT when looking up words. I usually don't - that vocabulary usually winds up in CONTEXT anyway. 2022-11-01 11:33:23 Good afternoon, I have a question regarding handling exceptions in gforth. Is there a way to just print the error message associated with the exception? 2022-11-01 12:41:35 nature: it's on the return stack, no? 2022-11-01 12:41:37 I'm a noob tho 2022-11-01 12:46:06 I know when you do a try iferror you get a number on the stack, but I haven't found a way to get the message associated with the error 2022-11-01 12:47:19 the message I mean the one that is printed in the repl, "*the terminal*:2:1: error: Undefined word" here the message is "Undefined word" 2022-11-01 12:47:57 I want for instance to log the message in a file when the error happens 2022-11-01 12:48:43 Good question, I guess what's on the return stack is a pointer to the exception word or whatever? 2022-11-01 12:48:58 What about "see throw"? 2022-11-01 13:02:12 it then uses something called "fast-throw" but then I am not sure what it does since it's assembly 2022-11-01 13:07:32 Ah 2022-11-01 13:07:39 Guess we have to wait for a guru then :) 2022-11-01 13:08:00 this being gnu forth? 2022-11-01 13:18:56 Yes 2022-11-01 13:26:49 the only forths I have looked at in some detail is fig-forth and eForth 2022-11-01 13:27:16 plus the OpenFirmware FCODE stuff 2022-11-01 13:27:26 but gnu forth? no idea 2022-11-01 13:34:52 There's too many of them!! 2022-11-01 13:35:25 You just want to print the message, right? Not get the string itself? 2022-11-01 13:35:29 If that's the case, `.error` might do what you want. 2022-11-01 13:36:24 FWIW, in GNU Forth you can also define new exception error strings using `errstring`. 2022-11-01 13:48:22 schapla[m]: amazing thanks, that's exactly what I was missing, and if I want the string I saw that `.error` uses `error$`, that's exactly what I was looking for 2022-11-01 13:49:56 the reason being that when doing multi-threading the exceptions thrown just write "uncaught exception" and I sometimes struggle to find what was going wrong, now I can properly log what's up 2022-11-01 13:51:47 Glad I could help. :-) 2022-11-01 13:52:37 It will definitely save me a few grey hair :D 2022-11-01 16:57:40 I really like the general nature of Forth error handling. It's just a trapdoor - if you recognize an error, get out. Means my code doesn't have to do a lot of complicated "handling." 2022-11-01 16:57:59 I do think it would be nice to offer an opportunity to "hook" the error handlers, though. 2022-11-01 16:58:47 In my Forth, I can "hook" any word whatsoever, so I kind have that by default. 2022-11-01 17:37:53 KipIngram: What's your use-case for Forth btw? 2022-11-01 18:46:28 it runs his coffee pot 2022-11-01 18:47:06 10 MILK FORTH 2022-11-01 18:47:19 wait that's more an espresso machine than a pot 2022-11-01 21:57:39 olle: Mosly I enjoy writing Forth systems. :-) I have an "envisioned use case," and it has to do with building a system from scratch - soft core processor of my own design, everything my own design, and then programming it from scratch, in a Forth I wrote myself. 2022-11-01 21:57:56 Some of the features you'll hear me talk about have to do with things like scientific modeling. 2022-11-01 21:58:05 That's just one thing I can envision wanting to do with such a system. 2022-11-01 21:58:09 It makes no sense. 2022-11-01 21:58:21 I will never be able to even come close to building something as powerful as what I can buy. 2022-11-01 21:58:30 But it's the accomplishment that interests me. 2022-11-01 21:58:57 And I'd take a perverse pleasure in knowing FOR SURE I had a computer with no back doors / spyware. 2022-11-01 22:00:20 I've also imagined wanting to make my own tablet, because I just think tablets could do so much more than the little rinky dink toy applications they ship with them. 2022-11-01 22:01:03 don't need much more than rinky dink to put ads in front of eyeballs 2022-11-01 22:01:07 I once mentioned making a calculator, and MrMobius helps me not forget about that. :-) 2022-11-01 22:01:30 I've also thought about making an amateur radio rig, doing my own software defined radio. 2022-11-01 22:01:41 Programmed in Forth of course. 2022-11-01 22:02:04 But honestly I just love "messing with Forth." 2022-11-01 22:02:19 Making it work, admiring the simplicity of it. 2022-11-01 22:03:05 I'm prone to doing little things differently from standard / mainstream Forth, because I get these ideas and want to try them out, and because Forth is simple enough that I *can8. 2022-11-01 22:03:13 s/8/\*/ 2022-11-01 22:03:41 Once upon a time I swung a pretty big bat in my career. Led engineering teams and guided the development of really cool products. 2022-11-01 22:03:49 I don't do that anymore - I'm a cog in a great big machine. 2022-11-01 22:04:13 And have precious little opportunity to create things and no opprotuity to just declare how something's going to be. 2022-11-01 22:04:28 So I write Forths, and I do it EXACTLY THE WAY I WANT TO. 2022-11-01 22:05:05 It's something I leave untouched for long periods and then from time to time dive hard into it and make some big slug of progress. 2022-11-01 22:05:10 Then drift off to other things again. 2022-11-01 22:06:02 My latest one is tottering on the very very edge of being "working," in the sense I could actually start developing things USING the Forth. 2022-11-01 22:06:23 but - not quite there yet, and I haven't worked seriously on it for like a year or better.