2022-12-04 04:56:08 Is anyone around? 2022-12-04 04:56:18 hi Bobsyouruncle 2022-12-04 04:56:25 hey dave 2022-12-04 04:56:36 are you busy? 2022-12-04 04:56:44 nope? 2022-12-04 04:56:55 i must warn you i am still a forth newbie! 2022-12-04 04:57:24 you may be more educated than I am. I'm right out of the box, noob 2022-12-04 04:58:37 I built a circuit that works but there is something wrong with the code. I utilize arduino nano's ADC for the RF detector. Do you know anything about ADC's? 2022-12-04 04:59:10 no sorry :-( 2022-12-04 04:59:29 there should be an ardunio channel on libera somewhere 2022-12-04 05:00:08 there may be, but will they know Forth? 2022-12-04 05:00:16 ah there is #arduino 2022-12-04 05:00:27 Bobsyouruncle: only one way to find out! 2022-12-04 05:00:50 I'm on it 2022-12-04 13:55:47 The traveler has returneth. Daughter launched into the joys of matrimony. Here's hoping, at least. :-) 2022-12-04 14:04:40 Hell of a lot of driving, though. 2022-12-04 14:04:58 Still have to take the tux back to the store this afternon - they wanted that back the day after. 2022-12-04 14:05:26 And I paid them enough to have it for the one time - I don't wanna give 'em any more. 2022-12-04 14:07:34 Bobsyouruncle: one of the great things about Forth is that it's easy to learn. You get better at actually using it with practice, an that can take a little while like anything else; there's a "mind set shift" involved with it. But the "rules" so to speak are easy as pie to get down. And actually being a total noob might help - it might mean you don't have much of a mind set yet that needs shifting. 2022-12-04 14:07:53 I did my first programming on a stack-based HP calculator back in college, so Forth has always felt really natural to me. 2022-12-04 14:08:06 Maybe you'll have a similar experience. 2022-12-04 19:08:59 So, I think something lacking in Forth generally is ability to handle complex literals. We run into this earliest with strings, but it really applies to a whole class of things. Strings, arrays, lists, etc. The most direct way to deal with it is to write a "literal parsing word" and you call out that word before giving the literal in your input stream. Then it's responsible for everything from there to 2022-12-04 19:09:01 the end of the literal. What else you have to do (how you store that literal, etc.) might create other requirements, most likely some sort of memory management like a heap. But then you can leave a pointer to the literal on the stack, and we're back then to a normal Forth flow. 2022-12-04 19:09:39 When I'm thinking just about strings I tend to name that parser word s" but if it were more general a different name would probably be more appropriate. 2022-12-04 19:11:04 I was thinking over the weekend, memory-wise, about just a ring buffer that I stored things in, and just wrapped around and re-used it over and over. Maybe it would have some ability to detect wrapping over something still outstanding, or maybe I just make it big enough that I can "not worry" about that. 2022-12-04 19:11:47 Try to avoid getting into the whole business of a real heap with reference counts and so forth, which I guess would be the "proper" way to solve that problem. 2022-12-04 19:15:13 NUMBER could also be modified to recognize "first words of literals," and fork off to the literal parser, if you wanted to avoid having to insert a parsing word in the right places. At that point, though, you've busted the literal up in to "first word" and "the rest," so it's not terribly elegant. 2022-12-04 19:16:57 I guess re-windiNG >IN wouldn't be out of the question. 2022-12-04 19:16:58 I been toying with the idea of incorporating the object system I have described more fully into a Forth 2022-12-04 19:17:25 Ah, similar thoughts, then. I wouldn't call my thoughts a fully formed object system, but there may be some shared issues. 2022-12-04 19:18:05 I want to think that someone here (maybe crc?) has some sort of "rotating storage" system that handles PAD type stuff in his system. 2022-12-04 19:18:22 Someone mentioned something sometime. :-) 2022-12-04 19:18:43 basically, each word definition becomes an object with refs to the words it uses 2022-12-04 19:18:54 I use a rotating buffer for temporary strings & arrays in my systems 2022-12-04 19:19:18 One of my big waffles back and forth is whether or not to include a simple memory manager at the ground floor. There are things that make it useful. 2022-12-04 19:19:31 But SIMPLE - nothing too fancy. 2022-12-04 19:19:56 hmm… but that means the return stack must be empty when garbage collection is to happen 2022-12-04 19:19:59 A simple fixed size thing that you take management responsibility for is just such an easy thing to put together. 2022-12-04 19:20:44 Um, you're talking about your thoughts there? 2022-12-04 19:20:53 (cant have stale refs on the returnstack) 2022-12-04 19:21:12 yeb 2022-12-04 19:21:19 Yeah, makes sense. 2022-12-04 19:21:46 That is the thing about Forth - stuff you've gotten onto either stack has a tendency to become "anonymous." 2022-12-04 19:22:16 Stuff you want to keep up with about it you just have to know. 2022-12-04 19:22:59 which is fine by me as I plan to run this event loop style and gc would be done between event loop turns 2022-12-04 19:23:08 Re: strings, I usually figure any string with length > 1 would go into this ring buffer, and an address for it would land on the stack. 2022-12-04 19:23:22 Strings of length 1 would go directly on the stack as a char. 2022-12-04 19:23:46 Then I could do stuff like s" string alpha beta" s" " split 2022-12-04 19:24:01 That would end with the address of an array of strings on the stack, and the array in the ring buffer. 2022-12-04 19:29:21 Some really heavy application would probably need some more permanently reliable memory management, but with a decent size ring you could do bits of string processing here and there and just be done before it wrapped back around. 2022-12-04 19:29:41 String or other "array like" stuff. 2022-12-04 19:31:10 Another thing I've thought at times, though, is to have a Lisp system running alongside the Forth, in an entirely different RAM region and doing it's own usual thing - there would be a workable way of passing stuff between them. Then string work might better live over there. 2022-12-04 19:31:49 When we talked about Lisp in here a year ago or so I delved into it a little and decided it looked pretty straightforward to put a basic one together. 2022-12-04 19:33:25 I guess Chuck would make the Forth and Lisp different colors (not that he would ever do this at all). 2022-12-04 19:34:12 But lisp" ..." would work too.