00:00:00 --- log: started forth/05.11.25 00:10:55 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 00:11:29 --- quit: snowrichard (Client Quit) 00:26:04 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 00:27:18 --- quit: snowrichard (Client Quit) 00:38:27 --- quit: homeness (Read error: 110 (Connection timed out)) 01:07:15 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 01:08:12 --- quit: snowrichard (Client Quit) 01:36:46 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 01:37:32 --- quit: snowrichard (Client Quit) 03:18:19 --- quit: Snoopy42 (Read error: 131 (Connection reset by peer)) 03:37:26 --- quit: FiLa (Remote closed the connection) 05:34:20 --- join: PoppaVic (n=pete@0-1pool75-46.nas24.chicago4.il.us.da.qwest.net) joined #forth 05:53:07 --- join: Ray_work (n=vircuser@adsl-66-142-169-152.dsl.rcsntx.swbell.net) joined #forth 05:58:41 --- join: ThinkingInBinary (n=tom@pool-68-163-203-96.bos.east.verizon.net) joined #forth 05:59:08 Quartus: my forth works 05:59:11 Quartus: it's got an interpreter 06:00:14 congrats 06:16:03 PoppaVic: the input buffer system is basically from ANS... i realized I need SOURCE-ID to keep track of what "REFILL" will do, and I need SOURCE (or rather the two pieces of data it outputs) to keep track of what I'm reading... so it worked out. 06:16:28 fun-fun 06:16:38 PoppaVic: yeah 06:16:41 --- nick: ThinkingInBinary -> ashorternick 06:16:51 PoppaVic: have you ever tried irssi? 06:16:56 gods no 06:17:00 PoppaVic: why not? 06:17:14 I want a GUI, and I tolerate xchat 06:17:24 PoppaVic: oh 06:17:34 PoppaVic: yeah I guess irssi gets a 0/10 in the GUI category. 06:27:15 PoppaVic: is it okay for a forth interpreter to explode if you under/over-run either of its stacks? 06:27:41 crash? That's up to you 06:27:47 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 06:27:49 usually, you'd recycle 06:30:56 --- quit: snowrichard (Client Quit) 06:32:20 PoppaVic: like just print an error and restart the interpreter? 06:32:41 after emptying (zeroing the ptr) the stacks, sure 06:33:10 what happens if it occurs as you are defining a new word? 06:33:46 PoppaVic: er, it explodes? 06:33:49 PoppaVic: or maybe 06:33:58 think it thru, look a gforth and such 06:33:59 PoppaVic: the dictionary entry it was writing is still invisible 06:34:32 PoppaVic: ooh, ooh, I know just the phrase for this: "An ambiguous condition exists"! 06:34:39 PoppaVic: ;-) 06:34:57 I'd just make sure the def was lost and the ptr reset in dict 06:38:12 PoppaVic: if I have an interpreter, and I want to load the *rest* of my implementation as text, should I just copy it into a buffer, push the address/length on the stack, and evaluate it? 06:38:31 umm.. 06:38:49 Sounds like an imp-dev decision. I believe FICL does that 06:42:00 --- quit: ashorternick ("Lost terminal") 06:52:05 PoppaVic: Hope your Thanksgiving was good. 06:52:17 that's today for our family ;-) 06:52:24 But, thanks - you as well. 06:52:26 cool :) 06:52:35 Yes, it was a nice, relaxing day. 06:52:45 We went out to dinner, this year. 06:52:49 ahh 06:52:54 We don't live very close to family. 06:53:00 Too damn dangerous to drive around, this week 06:53:06 closest = 9hr drive. 06:53:10 yes. 06:53:53 ouch - 9 hours is extreme 06:54:14 Also, very convenient, if you get my drift... 06:54:26 hmm.. I need a method to ascertain what shared-lib types a platform uses. 06:54:35 Hmm... 06:54:43 np: I get damned tired of sib-squabbling 06:54:58 Yes. 06:55:25 THis month, #3 son is (again) pissed with #2 son.. *sigh* I can't keep track anymore 06:55:25 Would you try to import the lib and "report on failure to load" 06:55:47 Sorry to read that. Happens in the best of families. 06:55:52 well, I'm first thinking of .so (ELF) versus something like .dynlib (Mach-o) 06:56:12 I see. 06:57:03 * Ray_work We have to work today. We won't get many calls or visitors today. I guess Boss just can't seem to bring himself to pay us for a second day off. 06:57:06 hmm 06:58:01 Boss will make a visit, to sign checks, close the cash journal, then he'll go back to his second day off. 06:58:12 bastards 06:58:15 hehe 06:58:24 7 more hours to go. 06:58:32 ok, you on a linux boc? 06:58:35 box? 06:58:36 Ready to talk about nothing for about 7 more hours ? 06:58:44 sure - I doubt family will 06:59:16 I have 2 linux boxes at home, but I use a windows box at work and Raystm2 = XP 06:59:31 Here, I can do.. file -L /usr/lib/libc.dylib 07:00:00 so, it looks like I have to write a multiprong-test and do some parsing 07:00:16 Sounds good. 07:00:36 KISS Principle in action, for this configuration 07:00:40 looks like Jasonwoof and tathi got together this holiday and got fovium and mist working. 07:00:48 Cool 07:01:23 I can't wait to try them. 07:02:01 The drive the SDL, so I'll be trying to code some cool 3d stuff as soon as they can get a working situation out. 07:02:14 s/The/+y 07:02:22 the sdl requires them? 07:02:49 No, I beleive it's the other way around. 07:03:13 oh hey, we got a customer, after all , brb 07:03:36 cool 07:04:44 --- join: skylan_ (n=sjh@dialup-216-211-4-10.tbaytel.net) joined #forth 07:15:56 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 07:16:50 --- join: ashorternick (n=tom@2001:5c0:8bc9:1:20e:35ff:fe48:b958) joined #forth 07:17:17 PoppaVic: is there a traditional name for the actual parser loop? (not EVALUATE or QUIT, but the "read word, compile or execute, repeat" loop that they share) 07:17:34 hmm lemme' look.. 07:17:55 PoppaVic: okay, thanks 07:18:03 PoppaVic: i'm gonna call it _INTERPRET if I don't find a better name 07:18:06 --- quit: skylan (Connection timed out) 07:18:19 PoppaVic: btw, thanks for all your help so far 07:18:36 sent in a msg win 07:19:44 I would seriously suggest picking up the Ting books 07:22:07 PoppaVic: what is deferred? 07:22:16 Yeah, deferred words are like 'forwards' and vectors. 07:22:31 think of "function pointer" 07:23:00 PoppaVic: so a deferred word is like saying "PARSER = just go call INTERPRETER instead"? 07:23:18 well... 07:23:20 PoppaVic: so deferred as in you defer the work to another word, not deferred as in you leave it for later? 07:23:22 DEFER parser 07:23:36 : interpreter ...... 07:23:43 ' interpreter IS parser 07:24:15 right, I believe all deferred words initialize to a scream/reset 07:25:06 now, remember: this means other apps or words can "redirect" the deferred words - all the users of the deferred-word would have no clue 07:26:03 help is no prob.. Just gotta' remember I think C more than forth, and my books are all nearly antiquated references ;-) 07:27:20 PoppaVic: oh, it's a way to make two functions that recursively call each other, without redefining one. 07:27:27 not really 07:27:37 it's a way to write a vector or a forward 07:27:57 THe fact it has multiple uses is a golden plus 07:28:24 the drawback would be at least a double-fetch cycle 07:28:40 what kind of vector are we talking about? 07:28:54 i don't get what you mean by a forward. 07:28:55 umm... When I say "vector" I think of a func-ptr 07:28:59 ok 07:29:20 cuz in @#$% a vector is like a variable-length array (actually it's implemented as an array) 07:29:29 but they call it a Vector. 07:29:54 a 'forward' would mean... I need to define umpty words in terms of 'snarf' - but I need all this shit first (or I expect 'snarf' to point elsewhere occasionally) 07:30:06 yeah,I know 07:30:37 PoppaVic: okay 07:30:51 'defer' and 'is' are almost as powerfully-useful as 'does' 07:30:52 PoppaVic: so how would you implement defer? 07:31:08 very carefully - yer using asm, and I don't 07:31:46 basically, it has to act like the deferred word is executable - even though it's a form of variable 07:32:21 PoppaVic: should i implement it by generating a jump instruction and then filling it in later? 07:32:30 so, whatever it does - it's wangling the "registers" 07:32:51 PoppaVic: and how does IS work? 07:32:59 PoppaVic: does defer put an xt on the stack? 07:33:11 no, before you even define 'defer' and 'is', you'dwant to define a scream & die reset for "default" 07:33:18 PoppaVic: and then IS writes the pointer (in asm or bytecode or whatever)? 07:33:22 PoppaVic: ok 07:33:42 PoppaVic: i'm using @#$% exceptions for those, to put it in native code. 07:33:48 well, remember what I showed you: the tick word IS 07:34:05 you need to install and test with gforth, I'm thinkin' 07:34:40 deferred words are very,very powerful 07:34:56 PoppaVic: the thing is i'm not writing most of the lower-level words in forth, but i need to know how they work 07:34:58 ..iirc, there is also - somewhere - a sort of vtable version 07:35:06 PoppaVic: can you modify the destination of deferred words? 07:35:12 sure 07:35:22 ' now IS was 07:35:51 so that will make "now" call "was"? 07:36:15 there is even a way to get the value FROM the deferred-word, chuck it on the stack - run yer new shit - and restore it. 07:36:32 well, yeah: 'was' would execute 'now' 07:37:14 wait a sec 07:37:31 PoppaVic: i should really give dict entries a "type" field, so i can have code words, lit words, deferred words, native single-bytecode words, etc... 07:38:06 those two should help 07:38:41 I've always felt the "dictionary" was always sorta' busted 07:39:05 cfa: code-field-address; cfa, is a store 07:39:33 absolutely, gforth is a handy experimental platform 07:42:15 PoppaVic: whose dictionary was sorta busted? 07:42:21 all of em 07:42:43 ..either we are not using them well, or they are simplistic - I can't really tell. 07:43:14 ..it's a semi-personal issue - nm 07:43:53 PoppaVic: someone should make a dict with multiple code fields... one for execute, one (optional) for compile, maybe others 07:44:16 fields are easy.. Most folks worry more about ANS and asm 07:44:36 oh, and "optimized" and "speed" 07:45:22 PoppaVic: meh, i have an easy way to make it fast, i just write most words in @#$%. 07:45:31 Personally, I want a forthish system that allows for an interactive forth (shell) and a "compiler" 07:45:54 PoppaVic: what's wrong with colon definitions? 07:46:09 nothing, for interactive development and one-offs 07:46:20 ..I want to integrate my forth with C 07:46:27 PoppaVic: oh i see 07:46:31 PoppaVic: cool 07:46:56 if you can get it from forth to C, and thus to asm - you can create objects and plugsins, and libs 07:46:56 PoppaVic: see bye 07:47:16 see bye 07:47:16 : bye 07:47:16 199448 catch drop bye ; ok 07:47:28 PoppaVic: yeah, it's oddly recursive. 07:47:37 it'd be an earlier word 07:47:47 PoppaVic: mine used a different number before catxh 07:47:52 s/xh/ch/; 07:47:56 sure - different platforms 07:47:56 --- quit: snowrichard ("Leaving") 07:48:04 PoppaVic: ppc? sparc? 07:48:10 powerbook g4 07:48:16 PoppaVic: ah, shiny. 07:48:42 all I can say positive about it is: 1) it works; 2) I don't often dick with admin 07:48:43 PoppaVic: that explains your dislike of terminals and thus irssi, and your mere "tolerance" of the not-Aquafied GUI of xchat 07:48:49 PoppaVic: try Conversation 07:49:01 I hated irssi on my linux box as well 07:49:18 I tried aqua: I hated it 07:49:38 PoppaVic: how do you not use aqua on a mac? 07:49:47 the aqua-xchat 07:49:54 PoppaVic: oh ok 07:50:05 I don't like all the stupid twists and changes from x11 07:50:10 can't you convert a mac over to using x11 07:50:26 saon: X11 runs *under* aqua 07:50:37 I'm running the Z11 stuff now: xchat under x11, everything else is macosx/aqua 07:50:45 x11, I mean 07:50:50 saon: maybe you can totally convert it, but apple's X11.app is an aqua "client" 07:51:08 ah, okay. i don't actually have a mac, i was just curious 07:51:13 PoppaVic: hehe, Z11 is the one we all wanted, with widget-level network communication ;-) 07:51:31 prob with mac/aqua is the damned fools chose obj-c 07:52:06 PoppaVic: yeah i heard someone programming it once, he complained the method names are often huuuuuuuuuuuuuuuuge, like 80 char lines are an impossible dream 07:52:27 PoppaVic: But apparently Apple's APIs are quite rich. 07:52:29 well, that and - I swear to Bog - it looks the preprocessor has a preprocessor 07:52:44 reading objc is godawful 07:52:54 PoppaVic: Yeah, one preprocesses and one inserts the "Steve's Ego" section into the code ;-) 07:53:26 I never understood why the fuck C volken couldn't just write a NEW cpp - and still create C 07:54:31 PoppaVic: is lastxt a variable? 07:54:44 Personally, I've raged against the tide for a decade: My feeling is the asswipe-pundits that write the "standards" should be forced to provide a lex/yacc source for the cpp and c languages 07:54:52 PoppaVic: ;-) 07:54:59 ashorternick: if it isn't, it accesses one 07:55:09 PoppaVic: standards are just pathetic attempts at justifying non-standard behavior. 07:55:19 PoppaVic: ANS "QUIT", for example. dumb name. 07:55:34 well, the C std commies just piss me off - like the ANS forther-volken. 07:55:57 not really.. THey inherited that from the "for(;;)" of FIG, I am sure 07:56:14 PoppaVic: huh? 07:56:21 PoppaVic: what's "for(;;)" gotta do with it? 07:56:23 forever-loop 07:56:32 PoppaVic: oh yeah 07:56:55 "when all else fails" scream and recycle 07:56:59 PoppaVic: is : an immediate word? can you nest definitions? can you have a word that compiles a word that compiles a word that compiles a word? 07:57:14 I dunno why not 07:57:19 PoppaVic: hehe, i can add vibration and sound effects to my error messages? :-) 07:57:36 PoppaVic: can you nest : defs? 07:57:39 Unlike some folks, I always embraced "scream and die" 07:57:45 no. 07:57:50 PoppaVic: I could *literally* make it scream! 07:58:16 PoppaVic: Robots (it's a game that comes with GNOME) has a really annoying bloodcurling-scream sound effect! 07:58:18 folks with gui's will argue, but even in a gui - doze has lead the world in "Scream and die" 07:58:35 PoppaVic: i'll have a native SCREAM bytecode! 07:58:49 ..in a gui, you'd get an alert-dialog, and on closure you'd STILL need to recycle 07:59:23 ashorternick: write an extensible variant on errno/strerror() 07:59:23 --- quit: saon ("brb") 07:59:44 PoppaVic: it's done with @#$% exceptions, they can hold a message 07:59:58 I don't like exceptions and avoid them 08:00:16 PoppaVic: true, but they're much faster and easier for me ;-) 08:00:20 ..I know it's wrong, but I never liked the mechanisms I've been offered 08:00:25 PoppaVic: great, now I have to bleep out @#$% and !@#$%^&*() 08:00:54 PoppaVic: forth rocks 08:00:59 PoppaVic: it's such an elegant language 08:01:08 --- join: saon (i=1000@unaffiliated/saon) joined #forth 08:01:21 saon: welcome back 08:02:58 forth has a lot of interesting features, I agree 08:03:25 PoppaVic: it seemed like the only language simple and small enough to implement a full dev environment in @#$% on a !#@$ %^&*( 08:03:36 otoh, the developers have held it back for decades. 08:03:50 sure - see #openbios 08:04:26 I also believe that FIG was prolly the most portable damned forth for at least a generation 08:04:47 PoppaVic: biosen are insane, there was an article in linux journal about linuxbios and porting it to new chipsets... having to initialize a memory controller using only rom and registers is nuts 08:04:56 PoppaVic: is there a *cowers* spec? 08:05:02 for? 08:05:11 PoppaVic: FIG forth? 08:05:18 the #openbios folks are not only firendly, they are intelligent 08:05:49 FIG never had a "spec" - they wrote a master file and all that needed changes were some very low primitives. 08:06:12 crap, I dunno even how to read or write a spec anymore. 08:06:32 PoppaVic: just describe what all the words do ;-) 08:06:57 ashorternick: that was integral to FIG, and over 90% of the words were written in forth. 08:07:01 PoppaVic: and how the parser works... just go through the program and answer every questoin someone might have 08:07:09 PoppaVic: that's awesome ;-) is it available in source form online? 08:07:25 sure - they still offer FIG elsewhere - it just isn't ANS 08:08:28 THe prob with the Forth Interest Group became the too-pricey membership and the never-ending arguments in the (too infrequent) "newsletter" 08:09:40 PoppaVic: lol 08:10:24 I've still got all my "FORTH Dimensions" from the late 70's - I got sooo goddamned tired of the arguments and "clever people" 08:11:19 otoh, I plan to exhme them to add actual "macros" when I get back to my imp 08:11:30 PoppaVic: what did they argue about? everything? 08:11:30 "exhume" 08:12:11 christ yes, binary - formats, stacks, how controls worked - what stacks... forth-78, 79, fig, f83 - it never ended 08:13:04 about every OTHER issue (and we only got 6/year) had a neat idea. 08:14:50 I can recall first reading about "locals" and "macros". 08:15:01 anyway.. brb - lemme recycle the isp 08:15:05 --- quit: PoppaVic ("Pulls the pin...") 08:18:25 --- join: PoppaVic (n=pete@0-2pool198-32.nas30.chicago4.il.us.da.qwest.net) joined #forth 08:18:49 PoppaVic: welcome back 08:18:50 SO much for THAT sob 08:18:53 thanks 08:19:33 hmm.. It looks likely that my config format needs an if/else 08:20:19 PoppaVic: what config format? 08:20:28 oh.. 08:20:55 http://rafb.net/paste/results/bnCsvE67.html 08:21:16 this format would mean a total code rewrite, but it's looking more useful 08:22:04 PoppaVic: what's it for? 08:22:28 I'm working on a total-system that lets me never again EVER suffer autoshit 08:22:52 the make/shell would be in a forthish 08:23:13 ..combitorial: there is no reason for all the whacked variants 08:23:19 PoppaVic: cool 08:23:54 advisory: the "shell" would not be designed for the same interactivity of bash and sh and whatever 08:24:16 ..I'm targeting the make/sh/m4 stupidities 08:24:38 PoppaVic: a colon does what? parses a word, creates a header for it, sets the xt to the code-space here pointer, and sets state to 1? 08:25:18 creates a TENTATIVE header, and then starts running the equiv of tick and literal 08:25:30 PoppaVic: literal? 08:25:42 : flub 123 .s foo ; 08:25:52 123 is a literal destined for the dstack 08:26:00 OrngeTide: oh ok 08:26:03 PoppaVic: whoops 08:26:05 Hey ashorternick. Sounds good. 08:26:05 OrngeTide: sorry 08:26:08 Quartus: thanks. 08:26:22 Quartus: btw ashorternick = thinkinginbinary but it's shorter for PoppaVic's xchat window :-\ 08:26:27 Quartus: my forth can interpret stuff 08:26:31 This is good. 08:26:33 * PoppaVic appreciates it 08:26:54 PoppaVic: besides, then i can have two of myself if i need to drum up consensus for an idea >:-) 08:26:54 ashorternick, grab the coretest from somewhere; that's your target. 08:27:00 ashorternick: ok 08:27:04 Quartus: ok 08:27:09 Quartus: (talking to myself lol) 08:27:12 heh 08:27:31 ashorternick: yer getting overwhelmed and confuzzled ;-) 08:27:34 Quartus: does qf compile part of its code at startup as forth, or are all core words implemented as native code? 08:27:48 PoppaVic: yeah, giddy with delight. 08:27:56 yer skipping a possibility 08:28:11 PoppaVic: what? 08:28:18 PoppaVic: implementing them as forth but including compiled copies? 08:28:32 PoppaVic: like a binary image of a fully-initialized VM? 08:28:43 you can compile native; you can generate/layout 'forth', and you can feed a stream to the system. 08:28:53 ashorternick, it's all implemented as native code, but much of the native code source is written in a metacompiled Forth. So yes, and no. 08:29:05 PoppaVic: oh, so instead of using a buffer, pretend it's real input? 08:29:09 PoppaVic: that's a good idea 08:29:13 yeah, metacompiling is the "fourth" option 08:29:16 PoppaVic: oh 08:29:34 PoppaVic: well I "metacompile" by calling the native definitions of my forth functions in native code, occasionally taking shortcuts 08:29:41 PoppaVic: so it's basically forth expressed in @#$% 08:29:41 nonono 08:29:49 ashorternick, I do something similar to that. 08:29:51 PoppaVic: it acts just like the real forth, but it's faster 08:30:00 PoppaVic: i don't have to run through the bytecode switch constantly 08:30:02 Q can explain metacompiling better than I, I suspect 08:30:12 Quartus: so i'm on the right track? 08:30:20 ashorternick, if it's working, you're on the right track. :) 08:30:20 --- quit: skylan_ (Connection reset by peer) 08:30:58 THe thing with "metacompiling" is that it is sooo close to "cross compiling" 08:31:10 Well, my build environment is also a cross-compiler. 08:31:20 sure 08:31:30 I'm trying to explain to him, Q 08:31:33 Quartus: how do you hide the new definition of a word while compiling it so you can use the old definition? my dict entries are stored in a @#$% hashtable, so i can't have multiple entries. is that a bad idea? 08:31:55 Quartus Forth itself runs on native 68K Palm devices, and generates native 68K code; but when running under Palm OS 5, which are ARM chips, it still generates 68K code that runs under the PACE emulator on those devices, so it's a native compiler and a cross compiler at the same time. :) 08:31:57 Think in terms of a master HOST and TARGET voc/dict 08:32:18 Quartus: spiffy! 08:32:27 Quartus: no Universal Binaries for Palms yet? ;-) 08:32:28 ashorternick, while defining I'd set the xt to some invalid value in the dictionary header, making that xt result in unfindable entries. Set it right at ; time./ 08:32:43 oddly, the idea of host/target can also be the same machine: just not the same dictionaries. 08:32:50 ashorternick, the 68K code is the closest thing to universal binaries on the Palm. 68K is the VM. 08:33:03 Quartus: I guess this is a forbidden @$%$ question, but how do I keep track of the two different entries in a Hashtable? 08:33:11 Two? Forbidden? 08:33:16 Quartus: or should I *not* add it to the Hashtable until it's done? 08:33:21 Quartus: the old and the new 08:33:34 You can certainly add it to the hashtable at ; time. 08:33:35 Quartus: let's say I do : FOO 2 ; : FOO 1 FOO + ; 08:34:11 Quartus: Right now I keep the dictionary in two parallel ways... a Hashtable for fast word lookup and a Vector for fast "id" (what _header returns) lookup. 08:34:21 ugh 08:34:33 Quartus: so perhaps _header will add it to the vector only, and something like _make 08:34:42 Quartus: ..._make_visible will put it in the hashtable. 08:34:56 hide/show 08:34:58 PoppaVic: hey, remember my architecture before you gag... (never mind, it will make you gag itself) 08:35:01 PoppaVic: ok 08:35:06 ashorternick, it sounds like you're overcompilicating your dictionary, but ok. 08:35:09 PoppaVic: hey, this makes :NONAME words easy! 08:35:29 yeah. You can go "over the top" on the dictionaries 08:35:36 Quartus: nah, it seems to work pretty well... just think of the Hashtable as an optimization. i could iterate backwards through the Vector 08:35:49 ashorternick, while you're building your complicated dictionary, consider wordlists; you may want to build them in now, they're handy. 08:36:02 I would recommend them 100% 08:36:05 Quartus: wordlists = separate, selectable dictionaries? 08:36:15 see ANS and gforth 08:36:18 Conceptually, yes. But they can all be built into one dictionary. 08:36:32 a dictionary would be built upon a wordlist 08:36:52 diction/vocabul 08:37:17 Whatever is simplest, implementation-wise. A wordlist is a single-cell numeric identifier associated with a group of words. An overriding search-order, supporting at least 8 wordlists, controls which wordlists are searched and in what order. 08:37:48 ashorternick: I did a test a few years ago... Using wordlists, I could define words that parsed and looked-up words w/o vocs - interesiting 08:37:56 Quartus: whatever is simplest among what choices? 08:38:21 ashorternick, I'd do it with one dictionary, perhaps prepending the wordlist to the name. 08:38:35 Quartus: wordlists are in DPANS section 16? 08:38:41 I believe that's the section. 08:38:43 Quartus: ok 08:38:48 Quartus: so it's not CORE? 08:38:52 Right. 08:38:54 Quartus: i'll finish CORE first. 08:39:05 But since you're putting so much overhead into the dictionary now, I thought it might be prudent. 08:39:15 Quartus: it can be easily grafted on later ;-) 08:39:34 In Quartus Forth the wordlist number is XOR'd against the hash value, which is very slick; takes no space in the dictionary, and one hashtable serves all. 08:39:34 Quartus: ooh, i can use a space as the separator between wordlist and word, since it's illegal in word names 08:39:46 Quartus: ooh, that's AWESOME! 08:40:03 Quartus: i assume you found a relatively fast hash function? 08:40:12 I did. Quite a simple one. 08:40:52 hmm 08:41:09 It limits the max number of wordlists to the size of the hashtable, but that's not an issue. 08:41:15 Quartus: not a big deal 08:41:40 Think of a voc(wordlist) like this: struct context and members, or class context and members or memb-func. 08:41:51 I find that a confusing way to think of it. 08:41:58 They're just separate namespaces. 08:42:03 right 08:42:12 namespaces are a good way to think of it, i think 08:42:17 they arenot "vocs", but they relate to the contexts 08:42:24 I reserve a few in Quartus Forth; one of them is used to track INCLUDEd filenames, so I can implement NEEDS -- NEEDS won't include a file that's already been included, which is very handy. 08:42:29 PoppaVic: what's a vocabulary that a wordlist isn't? 08:42:58 any voc would hold a wordlist; only special words would have namespaces 08:43:04 Another reserved wordlist tracks module names, for module/private:/public:/end-module. 08:43:12 right, not bad ideas 08:43:49 ashorternick: it would have to do with the "context" - it always does anyway 08:44:07 I fear PoppaVic's explanations may be confusing you, ashorternick -- they confuse me! 08:44:17 Quartus: lol 08:44:25 ..the diff would (generally) be: you can't "extend" those 'namespaces' - if you could, they really should be vocs 08:44:40 sorry, I run in circles and thru the years 08:44:48 Quartus: okay, i have _SHOW and _HIDE now 08:44:57 Quartus: or should they not be "secret"? 08:45:07 ashorternick, I thought you were going to add the header at ; time? 08:45:32 Quartus: yeah, _SHOW will take the "dictionary index" and add its entry to the hashtable. 08:45:34 the ; should be the point where you expose the new stuff 08:45:39 and _HIDE? 08:45:43 Quartus: until _SHOW, the header exists, but is not lookup-able 08:45:48 Quartus: it removes an entry from the hashtable 08:45:52 no 08:45:53 Quartus: just to be symmetric 08:45:55 why do you need that? 08:45:57 Quartus: i dunno 08:45:59 nono 08:46:13 ashorternick, don't add things you don't need :) 08:46:13 PoppaVic: why not? 08:46:15 Quartus: ok 08:46:17 Quartus: gone 08:46:20 THe idea of hide/show is "building - can fail" and "passed - expose" 08:46:39 PoppaVic: but you never explicitly hide things? they're hidden until shown forever? 08:46:51 I am sure some forths use 'hide' for other things, but that is the gist 08:46:53 ashorternick, that's generally the nature of it, yes. 08:46:57 right 08:47:07 Java should have a "secret" access modifier that lets nothing access a method/variable, not even the containing class ;-) 08:47:13 For hiding methods you might want later. 08:47:45 ashorternick, that's Java thinking, hopefully you can rid yourself of it at some juncture :) 08:47:50 if you 'hide' it - and do so again, yer screwed on the inbetween expose 08:48:07 Forth protects you from nothing, unless you explicitly build a wall. 08:48:19 Quartus: it was a totally unrelated statement. i wanted to declare "_hide" secret in case i wanted it later. 08:48:22 Quartus: basically, I've shown him how gforth is working, and he's trying to assimilate 08:48:37 ashorternick, copy it to another file :) 08:48:43 Quartus: lol, or /dev/null 08:48:48 Quartus: it's one line different from _show(); 08:49:12 think of "show" or "expose" as the same as "publish" 08:49:15 From here you want to plug your way through CORE, adding what you haven't got, until CORETEST passes. 08:49:59 "hide" just gives you some room to work w/o confusing the dictionary/heap/mem 08:50:04 So you'll probably want an INCLUDED (and an 'include' for convenience that forward parses) 08:50:12 yep 08:50:36 Quartus: so, : : PARSE (header) DUP (get-dict-entry) nip here swap ( sets xt to here ) 1 STATE ! ; ? 08:50:44 I'm betting ashorternick still needs to structuralize to allow switching 08:50:57 PoppaVic: structuralize what? 08:51:06 ashorternick, in fact PARSE-WORD, which is discussed in the appendix. PARSE doesn't have quite the right semantics. 08:51:11 Quartus: oh. 08:51:16 Quartus: what's PARSE-WORD do? 08:51:20 : example foo #include bar snarf blat; 08:51:22 Just slightly different parsing. 08:51:34 Quartus: oh, at a minimum i need to do BL before PARSE 08:51:42 Yes, PARSE-WORD encapsulates that. 08:51:49 Quartus: does it do anything else? 08:51:54 Have a look at the discussion of it. 08:51:55 Q: ANS stuff? 08:52:00 Yes, ANS stuff. 08:52:01 * ashorternick ducks. 08:52:03 yah 08:52:18 But yes, : creates a new header, and sets the compilation state. 08:52:28 I don't LOVE "ANS", but it does codify much better 08:52:33 A fancy version might report a warning if you're redefining a word. 08:52:42 right 08:52:47 Quartus Forth says "redefining foo" or what have you. 08:53:24 hell, you might even check the source and let a console-user cry and abort 08:53:33 : also records (usually on the stack though this isn't critical because they can't nest) a pointer to the dictionary header so it can be finalized by ; -- I think you're doing that. 08:53:46 Quartus: yeah, it's the dictionary-id 08:54:39 Quartus: how can i DUP the third thing on the stack easily? 08:54:42 Just keep thinking 'simple'. If it gets complicated you've walked off into the woods. 08:54:45 ashorternick, why do you need to? 08:55:18 Quartus: I have dict-id xt flags. I need to do _SET_ENTRY (dict-id xt flags --) and _SHOW (dict-id --) 08:55:36 Quartus: how do you keep track of the last dict entry for IMMEDIATE? 08:55:45 Do _SHOW first and _SET_ENTRY second. 08:56:02 Quartus: okay, so ROT DUP _SHOW ROT ROT _SET_ENTRY? 08:56:05 ashorternick, store it in a variable named (traditionally) LATEST. 08:56:09 Quartus: okay 08:56:21 Quartus: that happens at ;, not :, right? 08:56:36 ashorternick, for now, ROT ROT ROT ROT, sure. :) That doesn't look optimal but we can talk about it later. 08:56:42 ashorternick, right. 08:56:53 Quartus: i could just pop everything off into variables in native code 08:56:55 use a var 08:56:58 By the way, conventially ROT ROT is called -ROT. 08:57:05 Quartus: oh yeah, I should implement that. 08:57:08 "usually" 08:57:36 ashorternick, yes, in your native routine that'd be best. 08:57:39 Stack-gymnastics are pretty much a core issue 08:58:19 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 08:59:11 I have to run; hope to hear the update later, ashorternick! 08:59:18 Quartus: okay, thanks for the help! 08:59:21 No problem. 08:59:45 ashorternick: I'm gonna' rafb a file-pair you might enjoy... 09:00:18 rafb header /DEV/CommonForth/bonus/abstrack.h 09:00:29 damnit 09:00:29 http://rafb.net/paste/results/PbOl9L30.html 09:00:45 http://rafb.net/paste/results/7JfkZ314.html 09:02:17 the code is almost obscure, but interesting 09:03:21 there really are less than a dozen funcs required for any stack-width 09:03:42 --- quit: snowrichard ("Leaving") 09:04:16 I'd recommend - and this is just me, thinking reusability and platforms - a decent stack "engine" 09:06:12 --- join: virl (n=hmpf@chello062178085149.1.12.vie.surfer.at) joined #forth 09:06:35 PoppaVic: unfortunately that's exactly the opposite of what my goals are. i'm coding for one platform, which doesn't even have concrete sized data types 09:06:45 badbad 09:06:47 PoppaVic: my stack engine is int[] dstack = new int[DATA_STACK_DEPTH]; 09:07:02 sure.. an array is groocy with me 09:07:08 groovy, 2 09:07:32 PoppaVic: what's qdup do? 09:07:44 there is no problem adding methods - I despise c++, though 09:07:56 ashorternick: java is so overblown, but it hasn't some classes for stacks? (/me doesn't want to search for it now) 09:07:59 Quartus: it's @#$%, not C++... 09:08:03 it better be a 4dup 09:08:15 or a ?dup 09:08:44 look over the code - I admit I had to allow for language-issues 09:08:47 virl: yes, but the J2ME CLDC doesn't include them, only a vector, and unless you're using Java 5, you have to manually wrap and unwrap primitive ints into Integers, and even with Java 5, they still have to be "boxed" as objects, which is slow. 09:08:52 virl: an array was easier 09:09:11 nothing wrong with an array 09:09:42 All it does is NOT expect a spare sreg and growth down 09:09:46 PoppaVic: so ; basically sets the dictionary entry up properly (with xt and flags), makes it visible, sets LATEST to reference that dictionary entry, and returns to interpret state 09:10:25 * virl is asking what exactly 'boxing' was 09:10:34 virl: Java has Integer objects and int values. 09:10:39 the ';' needs to check all the balances and shit, yes; THen it has to expose the generated code - maybe allocating shit and installing it. 09:11:09 virl: "boxing" is putting an int into an Integer object, which gives it all the methods 'n' stuff it needs to be held in stuff like Vectors, Hashtables, Stacks, etc... 09:11:11 aha, I thought they should be the same 09:11:19 PoppaVic: how does it check balances? 09:11:20 if you get to ; from : - it is expected to test/balance and make shit available. 09:11:41 ashorternick: a lot of code will leave markers on the stack to be removed/tested 09:11:48 PoppaVic: like magic numbers? 09:11:51 sure 09:11:56 PoppaVic: to make sure you didn't forget a REPEAT or something? 09:12:08 PoppaVic: or add an extra one? 09:12:14 like 'if' leaves a mark and 'else' and 'then' might mulch them 09:12:20 PoppaVic: yeah 09:12:36 * virl doesn't like the fact that he needs to learn java/.net more detailed 09:12:43 virl: you don't need to 09:12:58 virl: for yer XMLview, I'm not suprised 09:13:59 PoppaVic: I don't have an XMLview, how many times I need to say that? A little child understands that on the first try. 09:14:20 ooh, TLA-WARS! 09:14:43 you eschew ascii and text, and propose XML-forth; and then whine about java and .net? SPare me. 09:14:58 XML Forth? what's the point? 09:15:15 oh, lord - you opened the pandora-box 09:15:35 I'll let him entertain you 09:15:40 virl: just msg me, save PoppaVic the trouble 09:18:18 --- quit: saon ("Lost terminal") 09:19:37 --- join: saon (i=1000@unaffiliated/saon) joined #forth 09:19:37 virl: ? 09:23:23 "Fiiiive Golden Tooks.." 09:27:11 PoppaVic: : is not an immediate word, but ; is, correct? 09:27:25 wait it should be... 09:27:41 see ; 09:27:41 : ; 09:27:41 ;-hook ?struc POSTPONE EXIT reveal POSTPONE [ ; immediate compile-only ok 09:28:12 PoppaVic: ah, I also forgot the POSTPONE EXIT 09:28:17 yah 09:28:29 see : 09:28:29 : : 09:28:29 header (:noname) ; ok 09:29:07 I tell yah, gforth can't hurt to have around ;-) 09:31:51 PoppaVic: now, POSTPONE compiles code to compile a word, right? 09:32:11 postpone compiles immediates, iirc... 09:32:26 see POSTPONE 09:32:26 : POSTPONE 09:32:26 COMP' postpone, ; immediate compile-only ok 09:32:40 PoppaVic: mine doesn't say compile-only 09:32:57 see COMP' 09:32:57 : COMP' 09:32:57 (') name>comp ; ok 09:32:57 see postpone, 09:32:57 : postpone, 09:32:58 dup 13800 = 09:33:00 IF drop compile, 09:33:02 ELSE dup 131912 = 09:33:04 IF drop POSTPONE (compile) , 09:33:06 ELSE swap POSTPONE ALiteral compile, 09:33:08 THEN 09:33:10 THEN ; ok 09:34:21 PoppaVic: wait, I don't understand COMP'. What does it do, put the compiled version of the next word on the stack? 09:34:49 should push a field-value 09:35:05 remember: gforth is really portable 09:35:38 basically, it ticks a word - and stores the XT - rather than execute 09:36:42 PoppaVic: what does PARSE-WORD do other than BL PARSE? 09:37:08 I dunno parse-word 09:37:12 see parse 09:37:13 : parse 09:37:13 >r source >in @ over min /string over swap r> scan >r over - dup r> 09:37:13 IF 1+ 09:37:13 THEN 09:37:13 >in +! ; ok 09:37:33 I'm telling you again: install gforth 09:37:37 PoppaVic: i have it 09:37:44 then do this shit 09:38:19 you have to remember: all the ANS crap can be nothing more than a wrapper or layer or voc 09:38:30 PoppaVic: I can, it's just that ">r source >in @ over min /string over swap r> scan >r over - dup r> if 1+ then >in +! ; ok" isn't very clear to me 09:39:02 well, it shoves a value to R source is proll a var, >in is a modifier, etc. 09:39:17 'see' is yer best friend, this side of source 09:40:32 OK, time to go be "entertained" by family and holiday *sigh* 09:40:39 PoppaVic: bye 09:40:44 stay well.. be back in the AM 09:40:46 --- quit: PoppaVic ("Pulls the pin...") 09:49:10 what's the opposite of IMMEDIATE, like a word that will make the last definition a regular word? 09:49:30 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 10:07:27 woohoo, ' DUP EXECUTE does DUP like it should! 10:12:25 you writing a new interpreter? 10:13:41 snowrichard: yeah, in Java for cell phones ;-) 10:14:36 I had a java-enabled cell phone once but the bill got outrageous. I was outside of houston and it was roaming at $1.69 a minute and it didn't tell me. 10:15:24 plus excess data charges 10:36:24 snowrichard: hehe, I went over on data this month 10:36:43 snowrichard: but mine has EDGE/GPRS data (not billed as airtime), and it doesn't charge data roaming at all 10:36:54 if you aren't on a cell phone now you might take a look at http://richardsnow.net ;) 10:38:49 snowrichard: of course i'm not now ;-) 10:39:07 snowrichard: i'm over by 0.5 MB this month, my billing cycle restarts at midnight tonight 10:39:56 I think mine was charging airtime for data connects, because 2 months bill was almost 1000$ 10:41:00 finally got it paid off, along with all my credit cards. 10:41:53 only 1 creditor hassling me now, Capital one Auto finance, about a car I cosigned for that the person wrecked and let get repoed. 10:47:46 snowrichard: jeez, that's a lot 10:47:54 snowrichard: how long ago was it, what network were you on? 10:47:58 ATT 10:48:18 snowrichard: ah 10:49:09 my mom has a wireless (fixed antenna mounted on her roof) broadband service that just opened up here. Its pretty cool. 10:49:49 and she's also using 802.11g inside the house for several computers 10:53:13 <_james> 10:58:19 --- quit: snowrichard ("Leaving") 10:58:28 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 11:21:22 --- quit: snowrichard ("Leaving") 11:28:26 Hey. 11:37:17 Quartus: hmm, i'm having problems with my native code stuff 11:38:44 Quartus: here's an example. if I'm running some VM code, and I reach a native call that does several things--let's say EXECUTE, then DROP--any modifications to the program counter, return stack, etc... (such as those made by EXECUTE) don't apply until the top-level native function exits, returning to the VM. 11:38:50 Quartus: any elegant solutions to this? 11:39:20 Quartus: I've managed to hack in a short-term solution that works in some cases, but it's ugly. I won't disturb you with the details. 11:39:57 why don't they apply? Aren't those values global? 11:40:14 Quartus: because execution in the VM doesn't continue until the native function returns. 11:40:17 Quartus: it's like this: 11:41:30 Quartus: vm loop calls native function "foo", foo calls execute, execute sets pc to whatever, execute returns to foo, foo calls drop, drop is also a native function and happens immediately, drop returns to foo, foo returns to VM, VM continues executing at "whatever". 11:41:35 Quartus: so it happens in the wrong order 11:42:17 I'm afraid that doesn't clarify the problem for me. 11:42:35 Quartus: okay, basically it doesn't continue running instructions until the native instruction returns 11:42:43 And how is that a problem? 11:43:04 Quartus: so when EXECUTE tries to execute something, it doesn't happen until the VM is running again. 11:43:30 Quartus: well, the parser loop is native code. 11:43:48 Quartus: so it has to explicitly run the VM again to run VM code. 11:44:04 Sure. I still don't see the problem. Can you give an example of this that is really happening? 11:44:11 Quartus: Um... 11:44:21 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 11:44:57 Quartus: okay, if I were to implement if as native code (it will have to change pc), and then used it in another native function, the branch or call won't happen until that entire function is done 11:45:34 That isn't how IF works. Have you tried this yet? 11:45:57 Quartus: no, but IF definitely has to do a jump sometime, if the value on the stack is false (forward jump) 11:46:04 Quartus: lemme try to come up with an example. 11:46:08 IF does not do a jump. IF compiles code that later does a jump. 11:47:08 Quartus: yeah, that's what I meant :-b 11:47:58 Quartus: here's my code, i'm typing it as i'm writing it, so it might take a bit: 11:48:20 Quartus: : ' BL PARSE _FIND DROP DROP ( assume it worked, drop true and flags ) ; 11:48:30 Quartus: : FOO 5 ; 11:48:58 Again, you want parse-word for that,b ut conceptually it's ok. 11:49:02 Quartus: yeah 11:49:04 Quartus: then 11:49:15 Quartus: : BAR 1 ' 2 ; 11:49:20 or wait 11:49:27 Quartus: : BAR 1 ' EXECUTE 2 ; 11:49:32 And how do you use bar? 11:49:46 --- quit: snowrichard ("Leaving") 11:49:49 so BAR FOO should push 1, run FOO, and push 2 11:49:53 Ok. 11:50:16 Quartus: but let's say i implemented bar in native code. 11:50:24 Ok. 11:50:32 Quartus: so it does push(1); tick(); execute(); push(2); 11:50:39 Sure. 11:51:22 Quartus: push will push 1, tick will do it's job and push the address of foo, execute will pop that, save pc, and set pc = that, push will push 2, and *then* it will return to the VM, execute foo, and return. 11:51:36 EXECUTE has to actually initiate the running of code, not just set PC. 11:51:41 Quartus: yes, i know 11:51:50 Quartus: but normally, in the VM, setting the PC will do that. 11:52:03 Quartus: the problem is EXECUTE needs to be different in native and VM code. 11:52:12 EXECUTE has to start the 'inner interpreter' at the requested address. 11:52:24 Quartus: and there's no way to tell whether execute() is being called directly from the vm, or from another native function 11:52:38 Quartus: the "inner interpreter" is just the VM 11:52:48 I know it is. You can't have EXECUTE just set the PC. 11:52:56 Quartus: So what does it need to do? 11:52:59 Run the code. 11:53:08 Quartus: So always run the VM again? 11:53:10 Quartus: nested? 11:53:27 That sounds like a workable approach to me. 11:53:46 Quartus: I guess I could have two execute functions, one that the VM calls directly (that just sets PC, since it will work then), and one that native code uses (that calls the VM again) 11:53:47 In my mind EXECUTE *is* the VM. 11:54:09 Quartus: to me, EXECUTE is a = pop; call a 11:54:14 Quartus: i'll try this 11:56:41 Quartus: so, I'm going to modify the bytecode loop so if in_vm is set (by the VM loop), it will use the VM execute, which sets PC, but if in_vm is unset (outside the VM loop), it will add the native-return entry (so the VM loop returns to the native code at the right time) and run the vm as well 11:58:07 Quartus: oh, but if *that* VM loop calls *another* native function, it won't work... 11:58:38 Quartus: wait, native functions won't be using the bytecode loop 11:58:54 Quartus: except EXECUTE itself ;-) 11:59:10 Well, whatever works for now; it seems to me you shouldn't need two versions, but start with a working solution and refine it later. 11:59:22 As long as what you're doing now doesn't get in the way. 11:59:53 Quartus: it won't, I think. 12:01:25 If the only routine that calls the VM is EXECUTE, then EXECUTE is the VM. Rename it accordingly, and be sure that all the pointers (PC, stack, etc.) are globals. 12:02:27 Quartus: hmm, you have twisted my world around in an interesting three-dimensional way 12:02:36 --- quit: Ray_work (Read error: 104 (Connection reset by peer)) 12:02:38 Quartus: i figured out the *real* problem. 12:03:11 Quartus: the "native" EXECUTE, that started the VM, didn't handle one special case: if EXECUTE is passed the XT of EXECUTE, it needs to use the native version again, since there's *still* no VM loop running. 12:03:43 ashorternick, I'm confused. 12:05:00 Quartus: if I call EXECUTE and pass it the xt of EXECUTE itself, it would have called the bytecode loop, which would call the version of execute that doesn't run the VM loop. So if the "assume we don't have a vm running" version of execute is asked to execute execute, it needs to call itself, not the version that assumes there's a vm running. 12:05:41 Quartus: okay, this *appears* to work. 12:06:29 Quartus: i tried a bunch of absurd cases of EXECUTE calling itself, and it appears to work. 12:07:07 Quartus: btw, I added symbolic addresses to my debug routines. When it displays the PC and the return stack, it displays the word with the closest address below it, plus the offset. 12:07:20 Might be handy sometimes. 12:07:33 Quartus: yeah, *much* easier, especially when you don't trust CALL/RETURN/EXECUTE ;-) 12:07:47 I cannot see any circumstance under which you would not have the VM running when you wanted to call EXECUTE. 12:08:08 Quartus: my entire interpreter loop is native code. it is started directly from main(). there is no VM running yet. 12:08:12 Quartus: is that good? ;-) 12:08:42 Quartus: I tried to write it clearly enough that *if* I wanted to translate it into forth and cross-compile/meta-compile/whatever it, I could. 12:09:09 I suggest instead you launch the VM and have it call your interpreter loop, then the VM is already running and your EXECUTE issue disappears. 12:09:30 If I follow correctly. 12:10:27 Quartus: no it doesn't 12:10:52 I don't see why a) you need the VM already running to use EXECUTE and b) you'd ever not have the VM running anyway. 12:11:04 Quartus: the interpreter loop is native 12:11:16 Quartus: so it never touches VM code until it calls EXECUTE 12:11:18 Which is interesting but not relevant. 12:11:28 Quartus: the problem is that EXECUTE *assumes* the VM is running 12:11:32 Then be sure it is. 12:11:42 Have EXECUTE instantiate it. 12:12:08 Quartus: i guess i've changed it so execute() starts the VM and _execute() doesn't. The VM loop itself uses _execute (to prevent recursion in Java when it's not needed), and native code uses execute(), so things work right. 12:12:37 Quartus: anyway it works now 12:12:39 Ok. 12:13:03 Quartus: what word does the opposite of IMMEDIATE? 12:13:09 No such beast. 12:13:13 Quartus: no? 12:13:15 Quartus: that's too bad. 12:13:31 It isn't; it isn't needed. 12:13:34 Quartus: true. 12:13:43 Were it needed, it would exist. :) 12:14:15 Quartus: so, I assume the way to give a command both compile-time and execute-time behavior (like a word that allocates space at compile time, and uses it at execute time) is to make it immediate, and have it compile the stuff it wants compiled? 12:14:23 You'll never create an immediate word and then decide to un-immediate it; if you did, just remove the IMMEDIATE from the source. If you need an immediate and non-immediate version of the same word, they should have different names, so you can build one from the other. 12:14:45 Yes, that's the general outline. 12:15:49 You wouldn't generally allocate dataspace while inside a colon definition, mind you. I think it's verboten. 12:16:08 There might be some implementation-specific reason to do it, but I can't think of one right now. 12:16:10 Quartus: oh yeah, good thing, because otherwise it would allocate space inside the colon definition. 12:16:22 Well, it wouldn't if dataspace and codespare were separate. 12:16:36 Quartus: yeah, but ANS says HERE has to point to codespace sometimes 12:16:38 Quartus: i'll find it 12:16:44 It doesn't say that. 12:17:46 Quartus: oh, maybe i misunderstood it 12:17:48 It is a possible and allowable implementation strategy to have dataspace and codespace be the same space, so there are restrictions about moving HERE while compiling, but HERE does not ever need to point to codespace in a compliant system. 12:18:17 Quartus: is it verboten to mess with the stack during a : definition as well? 12:18:32 Had to remain balanced, but otherwise go nuts. 12:18:37 Has, rather 12:18:48 : foo [ 3 5 + ] literal . ; for instance 12:19:14 Quartus: literal is an immediate word that compiles a literal? 12:19:18 Right. 12:21:18 Quartus: what happens if you call an immediate word in interpret mode? 12:21:30 It executes like any other word. 12:21:34 Quartus: oh 12:21:50 If it then tries to lay down new code, the behaviour is undefined. 12:21:50 Quartus: so if (state == 0) || (entry.immed), then execute, else compile? 12:21:57 Quartus: ah, ambiguous 12:22:07 You *always* execute an immediate word, whether compiling or not. 12:22:23 Quartus: ok 12:23:40 Remember, simple simple simple. (entry.immed) there suggest to me you're interrogating a word header; instead I suggest you call your internal (find) and use the info it returns on the stack. Use what's already there, stay simple. 12:24:07 Quartus: that was pseudocode 12:24:18 Ok. 12:24:24 Quartus: it actually uses _find, and (it's native code) pops the flags and xt, then examines the flags. 12:24:47 That's good. Then later if you add wordlists and a search-order, nothing needs changing there. 12:25:23 Quartus: okay, time for IF and friends... 12:26:14 Quartus: wait, I should write POSTPONE first 12:27:09 You can IF without POSTPONE. 12:27:25 Working in a native-code routine, anyway. 12:27:40 Quartus: yeah, but i wanna write IF in forth 12:27:45 Because...? 12:27:50 Quartus: just so I can see how it would work 12:27:59 It works the same in either case. 12:28:55 Quartus: so IF should (at compile time) write a "jump if false" instruction, leave space for the address, push that adddress on the stack. 12:29:07 Correct. 12:29:20 The jump-if-false has to also consume a stack item, of course. 12:29:49 Quartus: and then THEN should (at compile time) pop that address off the stack, and write the current address to it 12:30:43 That's right. 12:32:04 And ELSE? 12:32:45 hmm, it will write another unresolved forward jump, and then resolve the *previous* forward jump to the address *after* it. 12:33:23 Right. The unresolved forward jump is called AHEAD in the Standard, if you want to give it its proper name. 12:34:22 Quartus: so IF is an unresolved forward jump if false, AHEAD is an unconditional unresolved forward jump, UNTIL is an backward jump if false, and AGAIN is an unconditional backward jump. 12:35:05 Quartus: what do you think are words I should consider writing in forth instead of native code? 12:39:58 Quartus: is there a word like RESOLVE I should be using to resolve jumps? 12:44:59 THEN does the resolving. 12:45:09 Quartus: ok 12:45:24 Quartus: yeah, because THEN has to pop it, then compile the jump, then fill it in 12:45:28 ashorternick, build them in native code from the internal routines, certainly -- that's the same as writing them in Forth. 12:46:10 If there are CORE words left over that you'd like to put in an optionally-loadable source module, do that. 12:46:12 I did. 12:46:14 Quartus: meh, I've just been doing mem[here++] = Bytecode.INSTRUCTION 12:46:20 Quartus: certainly number formatting 12:46:30 Quartus: although most of that would be easy in native code 12:46:31 Number formatting I put in the kernel itself. 12:46:54 .S uses . and so do the error routines, etc. So it needs to be there. . is built from <# #> and frien ds. 12:47:50 Quartus: oh yeah, i gotta make a "real" . 12:48:06 Quartus: (right now I do System.out.print(dstack[dptr--] + " "); ) 12:48:09 The pictured numeric output stuff is quite elegant and nifty. 12:48:11 Quartus: it doesn't handle bases yet either 12:48:26 For a handful of words, you get a great deal of power. 12:48:32 Quartus: how does it actually work, in total? ANS only describes individual words, it's hard to understand. 12:49:00 Can you narrow the question? 12:49:59 The broad view is that there's a static picnum buffer. <# begins a sequence, # extracts the next digit into the buffer, and #> ends the sequence. To bolster that, there's #S and HOLD and SIGN. 12:50:23 A sequence to display an unsigned double-cell value would be <# #S #> type 12:50:31 w00t, IF/ELSE/THEN works! 12:50:35 Keen. 12:51:19 Quartus: yeah, this is starting to rock. 12:51:45 Quartus: is AHEAD an official word? 12:52:18 Yes, but not in CORE. TOOLS, I think. 12:52:40 Quartus: oh ok 12:53:15 You're probably only a few days away from running coretest. 12:54:23 Quartus: =D 12:54:29 I started with coretest and successively added test conditions as bugs manifested themselves, and the entire script is run as a regression test for each new revision. 12:55:18 Of course, I have paying customers. But it's a great tool regardless, as is the general practice of writing { -> } inline tests in your Forth sources. 12:58:54 Does QF have any features like disassembling or "see"? 12:59:13 Yes, it has a disassembler that resolves what it can back to Forth words. 12:59:18 Quartus: cool 12:59:18 The rest shows as 68K. 12:59:34 Quartus: can it reassemble as well? 12:59:40 Also a 68K assembler and ARM assembler, yes. 13:00:03 Quartus: damn, you could have it dynamically detect ARM and have it assemble important, often-used words (dup, lit, etc...) as ARM! 13:00:12 Quartus: sell it as an upgrade ;-) 13:00:55 You can't mix & match instructions in the system, so it wouldn't be terribly useful. Far greater is the ability to write code and have it run on every Palm device from the very first to the most recent. 13:01:16 You can call ARM subroutines, but there's overhead, so you only do it for hard-crunching stuff. 13:01:22 Quartus: ah 13:01:31 Quartus: that's pretty schweet. 13:01:39 Quartus: Have you heard of pbFORTH? 13:01:57 Is that the one for the Lego brick? 13:02:02 Quartus: yeah ;-) 13:02:06 Quartus: it's pretty cool. 13:02:11 I met the developer. Nice guy. 13:02:27 Quartus: someone wrote a monitor for it that allowed you to use the buttons on the RCX to launch programs, like with stock firmware. 13:02:45 Quartus: there's nothing like having a bright yellow, battery-powered, IR-enabled development system and robot in one. 13:03:02 Neat. 13:03:40 brb 13:04:00 I have a Lego brick, I ran an early pbForth on it. 13:08:25 Quartus: I should extend KEY and EMIT to process all keys on my phone (including arrows, soft keys, etc...) and to control other stuff (backlight, vibrate, sound) 13:08:56 You can certainly do that. Look into EKEY in the Standard. 13:09:04 yeah, i guess I'd use that. 13:09:09 Or rather name it that. 13:09:17 KEY can be built from EKEY. 13:09:39 In Quartus Forth, EKEY is the whole event-handling system. 13:16:38 Quartus: Is it okay to define things like CELLS as a NOP if a cell = an address unit? 13:16:46 Yes, an immediate NOP. 13:16:53 Quartus: ah 13:17:18 I call that 'noop'. 13:17:38 Immediate, so it doesn't compile to a useless call. 13:20:19 and is it okay to ignore signed/unsigned/single/double cell stuff if i have no need to interface to external procedures that need data formatted a particular way? 13:20:29 I'm not sure what you mean. 13:21:08 Your interpreter needs to accept and handle double-cell values; the picnum stuff is all double-cell, as are a number of the CORE arithmetic words. 13:21:19 You'll need signed and unsigned output words, and division words. 13:22:04 Quartus: a cell to me is a 16-bit signed integer... 13:22:09 Quartus: (I'm using ints) 13:22:12 Right. 13:22:20 Quartus: so a double-cell is a 32-bit signed integer? 13:22:29 Quartus: actually they might be 32-bit, and a double-cell is 64. 13:22:35 Either way. 13:23:18 Quartus: but I need those? 13:23:31 a cell could be also 8bit, like my current forth 13:23:33 Quartus: and unsigned is a PITA--the only thing in Java that's unsigned is a char, and it's smaller than an int. 13:26:44 --- nick: Raystm2 -> tiff 13:27:29 brb 13:28:20 You need those. And it's not hard to implement. 13:28:35 A cell can't be 8-bit in a Standard-compliant system. 13:29:02 Plus I get a headache just thinking about working in an 8-bit cell system. 13:49:18 I think you know that I don't like the standard 13:51:23 An 8-bit system would be frustrating regardless of whether or not any other aspects of it approached the Standard. 13:52:47 for small numbers I don't think there would be a problem 13:53:05 The only time there wouldn't be. 13:53:42 Restricted to 256 xts, no data allocations bigger than 255, etc. 13:54:19 Virtually any arithmetic operation would require doubles, which would max out in the 16-bit range. 13:54:34 No memory accesses outside of a 256-byte window. 13:54:48 Those are the handcuffs that immediately come to mind; there are probably others. 13:56:25 Quartus: mine is 16-bit. 13:56:34 Quartus: I have 31.08% of the words in CORE done. 13:57:13 16-bit is not bad, Quartus Forth is 16-bit. It's the minimum allowed for a Standard system. 13:57:18 Good deal. 13:58:39 ashorternick, you can do the unsigned words without requiring unsigned operators in Java. 13:59:02 * virl will choose higher cell sizes, when they doesn't conflict with my ideas 13:59:06 Fractionally more challenging, but I think you're up to it. :) 14:00:13 virl, in what way could the cell-width of a system conflict with your ideas? 14:01:33 for example: 'easy implementation on a 8bit cpu' 14:01:55 On an 8-bit CPU with only 256 bytes of RAM, maybe. 14:03:00 I've spoken with a couple of developers forced to work with an 8-bit commercial Forth system in years gone by; they remembered it painfully. I'd be grafting on 16-bit operations immediately just so I could work without constantly hitting the limitations. 14:03:49 At any rate, 'easy implementation on an 8bit cpu' isn't so much an idea as it is a design goal, and there's no reason you can't build a 16-bit Forth on an 8-bit CPU. 14:04:06 --- quit: saon ("leaving") 14:05:22 --- join: saon (i=1000@unaffiliated/saon) joined #forth 14:08:10 Quartus: do you think it's better to keep each native word in a separate subroutine or keep them all directly in the switch statement? there's a doBytecode subroutine whose sole purpose is that huge switch statement, and things might be faster without all those procedure calls. 14:08:17 Quartus: it would also neaten my code a bit 14:08:32 Quartus: although it would make writing *other* native code harder. 14:09:05 I thought you had trouble managing to give each routine an xt without putting them in a switch. 14:09:31 --- join: TheBlueWizard (i=TheBlueW@ts001d0769.wdc-dc.xod.concentric.net) joined #forth 14:09:48 Oh, I think I see. I wouldn't think it would make much difference, it's just one procedure call. Does Java optimize? 14:10:00 Will it automatically inline those? 14:10:02 Quartus: no, the switch looks like this: switch (bytecode) { case Bytecode.FOO: foo(); break; case Bytecode.BAR: bar(); break; } 14:10:04 If so, I'd leave them out. 14:10:08 Quartus: i dunno if it optimizes 14:10:27 I'd leave them in separate routines and let the compiler inline them, best of both worlds that way. More readable and maintainable, and just as fast. 14:10:30 Quartus: if I make them private final maybe it will 14:10:53 Readable source comes first. If it's actually slower, you'd have to make the call. Benchmarking will be required. 14:11:20 Logistics, too. If a given native routine is going to be called from other native routines, it can't be embedded in the switch, can it? 14:16:34 Quartus: okay, how do you do LEAVE and LOOP? how do you resolve *all* the LEAVE words' jumps? 14:17:09 You need to record them in a chain. 14:17:24 Quartus: but they go on the stack, right? 14:17:30 No, they have to go elsewhere. 14:17:34 Quartus: oh. 14:17:38 Quartus: just for LOOP? 14:17:38 --- join: slava (n=slava@CPE0080ad77a020-CM000e5cdfda14.cpe.net.cable.rogers.com) joined #forth 14:17:48 Well, maybe they could go on the stack. I suggest keeping the LEAVE chain elsewhere, it's simpler. 14:18:00 LOOP doesn't need'em, except to resolve LEAVEs. 14:18:07 Quartus: why not a -1 terminated list on the stack? 14:18:12 Quartus: would that work? 14:18:34 I think there's some reason why it gets in the way, but by all means give it a try. 14:19:09 Quartus: well when you get to LOOP you have to deal with the LEAVEs before you deal with the DO 14:19:30 Quartus: how do you deal with DO? 14:19:37 Quartus: keep stuff on the return stack? 14:22:02 At run-time, yes, on the return stack. 14:22:47 Quartus: how do keep track of where I and J are? are they ambiguous anywhere but within the word where DO is used? 14:22:51 They are. 14:23:02 Only valid inside the DO loop. 14:23:58 Quartus: but if i do : FOO ... DO ... BAR ... LOOP ; and : BAR I . ;, that's ambiguous, right? 14:24:08 It is. 14:25:18 Remember, simple. If you need I in a called word, pass I to it on the stack. 14:26:09 * TheBlueWizard notes that in many Forth implementations, invoking BAR using : BAR I ; definition may actuallt retrieve incorrect value, as the FOR LOOP code uses the return stack for looping stuff 14:26:23 --- quit: slava ("Lost terminal") 14:26:24 actually* 14:26:34 Right, it's ambiguous, and will pretty much always return the wrong value. 14:28:00 --- join: Ray_work (n=vircuser@adsl-66-142-169-152.dsl.rcsntx.swbell.net) joined #forth 14:28:00 Quartus: I assume it's un-FORTH-like to try to prevent that? 14:28:41 --- quit: Ray_work (Client Quit) 14:28:46 --- join: Ray_work (n=vircuser@adsl-66-142-169-152.dsl.rcsntx.swbell.net) joined #forth 14:29:25 ashorternick, it's unnecessary. The situation that requires it doesn't arise. 14:29:42 Unneccessary is un-Forth-like. 14:31:02 the usual FORTH philosophy is to leave the responsibility of coding it properly to the coder, not to the compiler and whatnots 14:31:48 Parameter-pass using the stack; that's its primary purpose. It'd be hard to test a word that had an embedded I anyway. 14:35:33 42% done 14:35:34 yeah...it is a lot like being hard to debug code where ELSE get coded into another word (e.g. ... IF ... FOO ... THEN ... with : FOO ELSE ; --- I shall deliberately ignore the complaints from the ?COMP and the like ;) ... it is really a control flow thing. I and J are control flow words 14:36:02 makes sense, hm? 14:36:30 Quartus: I'm starting to implement some things as small pieces of bytecode... basically anything in the spec that says "semantically equivalent to" a small piece of code, I will try that code instead of native code. 14:37:22 ashorternick, you can do that, but you're in parlour-trick territory again. Those 'equivalent to' are for instruction, not for implementation. Do not deliberately avoid an obvious and better solution. 14:40:27 Quartus: yeah, but think about it. 2DUP and OVER OVER are basically the same, and will probably be about the same speed. 14:40:43 Quartus: especially given that I can't just load both cells at once into a "register". 14:41:31 If it really is just as fast, then it's fine. 14:41:57 I'm just suggesting avoiding the parlour tricks at all times, if there's no other compelling reason to do them than just as a stunt. 14:47:38 51.13%! 14:47:43 Aces. 14:48:28 After this you can do CORE EXT for dessert. :) 14:48:56 Have you run it on an actual phone yet? 14:52:51 Quartus: no not yet ;-) 14:53:00 Quartus: i don't have the UI set up, I'm still working on ANS 14:53:08 Quartus: right now I just patched in a stdin/stdout interpreter 14:53:34 Quartus: probably it's going to output to a textbox, and have an "input" key that will input a whole line at once... or i might give it more sophisticated input handling, i dunno 14:53:52 Quartus: perhaps normally it lets you enter 0-9, and if you press a soft key it lets you enter more text. 14:54:10 Quartus: that way you could make menu-driven apps that work well, and still input full text using the phone's input methods. 14:59:56 --- part: TheBlueWizard left #forth 15:01:15 Hi, sorry. 15:01:29 Sounds promising. I have to run; be back later on. 15:11:58 how do you run tests like coretest.fs 15:11:59 ? 15:12:14 include tester.fs 15:12:16 include coretest.fs 15:12:29 or, pedantically: 15:12:32 s" tester.fs" included 15:12:36 s" coretest.fs" included 15:12:43 include is a convenience word. 15:12:58 Quartus: or, if I didn't implement that yet, cat tester.fs coretest.fs | java Machine ;-) 15:13:32 Sure, but probably not on the phone itself! :) 15:15:08 ok, bbl 15:29:02 Quartus: ok 15:58:42 --- quit: crc () 16:06:57 --- join: crc (i=crc@pool-70-110-152-44.phil.east.verizon.net) joined #forth 16:07:18 hello? 16:07:21 Quartus: you around? 16:07:31 --- mode: ChanServ set +o crc 16:18:07 anyone know how to fill in the destination of EXIT commands? 16:18:12 (when compiling) 16:34:29 --- nick: tiff -> Raystm2 17:16:50 Quartus: you there? 17:27:24 anyone here ever written the code for LOOP? 17:29:00 * crc has 17:29:24 where-as /me has not. :( 17:29:43 but mine is x86-specific, and depends on RetroForth's internals a bit 17:29:44 but i've seen it in colorforth :) 17:30:02 my situation is similar. 17:33:08 colorforth uses NEXT instead of LOOP, and defined as... 17:34:45 : next $75240cff 17:34:45 : 0next , here - + 1, $4c483 3, ; 17:35:45 Raystm2: I don't get it. 17:35:55 please be aware that definitions in colorforth can fall thru the next colon if there is no semi-colon in the just previous definition. 17:35:57 the $.... are x86 opcodes in hex 17:36:03 yes. 17:36:23 the real work is all done in those opcodes; this can't be applied to java 17:36:54 of course, so sorry , I forgot the target was the phone, my appologies. 17:37:01 Raystm2: it's ok 17:37:37 Raystm2: is it basically "pop loop-sys off R, if limit < index, push loop-sys back on and jump back, else drop loop-sys" ? 17:38:18 pretty much yes 17:39:20 crc: okay thanks 17:39:28 With a for/next loop like Raystm2's code, the limit is fixed. With do/loop, you specify the limit yourself 17:40:01 crc: Nan says "Hi. Happy Holidays" :) 17:40:09 hi Nan 17:43:14 --- join: akebono (i=fujiwara@218.231.206.36.eo.eaccess.ne.jp) joined #forth 17:43:14 Quote: The first time I read an excellent work, it is to me just as if I gained a new friend; and when I read over a book I have perused before, it resembles the meeting of an old one. -- George Gissing 17:44:12 Don't let "the limit is fixed" stop you from using for/next for do/loop kinds of things. I've been fairly sucessfull using only for/next. 17:44:44 * crc has only used do/loop a couple of times in the last three years 17:45:01 is that right, whoa :) 17:47:46 That old b18chess is allmost all do/loop's and depth checking, yikes! 17:48:25 hehe 17:48:41 But it's still my favorite chess. Need to still do a colorforth and a retroforth versions. 17:49:47 I put c4thches3 into Glypher a few weeks ago, but this time it has a board that you can put anywhere with the cursor keys and you can smoothly zoom to any size. 17:54:24 The trick for c4thches3 is that you use the editor to play the game. 17:54:48 You edit a jumptable that represents the board. 17:55:32 The editor cursor has a neat function that allows you to DEL something, then INS it some where else. 17:55:52 You could DEL an entire block of code, if you wish, and INS it on another block. 17:56:39 Well, in this case, you just move the constituants of the jumptable around on the current block, which is a copy of the last block. 17:57:46 after you move the piece in the array, you load the block and execute it, which displays the block as a chess board, with the piece moved, but also copies the current executing block to the next block, for you to edit. 17:58:29 A two player net game would transmit this current block to the other players box, and update the display when it arrives, I suppose. 17:59:34 It would also have to edit his next block and move his block variable to be the current, move-able block. 18:00:03 Using the editor, now you can page thru each move. 18:00:14 or load that board position. 18:00:26 Wheee, I just finished DO LOOP +LOOP I J 18:00:33 excellent!!! 18:00:44 Raystm2: I'm 67.67% done implementing CORE. 18:02:12 Thats Great!! Well done, indeed! 18:03:23 * crc has been working on implementing most of CORE in his forth 18:03:40 http://www.forthworks.com/ans-status.pdf is the status chart so far 18:03:46 :) 18:04:17 how do you get EXIT to work on both colon definitions (where you want to do a return) and loops (where you want to jump past the loop) 18:04:31 I don't yet 18:05:12 me neither 18:05:16 crc: that's impressive. 18:05:33 afaik people do " do ... if unloop exit then ... loop" 18:06:07 I don't have unloop yet 18:06:07 JasonWoof: my problem is, normally EXIT just does a return from the word. but in a loop, it needs to do something else... 18:06:11 What is that , LEAVE right? 18:06:27 Raystm2: what is what? 18:07:04 oh, sorry, JasonWoof's pseudo-code, is what i'm thinking is equivilant to LEAVE in gforth. 18:07:10 ashorternick: you could have the number of elements on the return stack saved somewhere, and have 'exit' compile in enough code to clean all the loop indices before compiling the code to exit a word 18:08:31 not the most elegant approach, but it should work 18:08:40 crc: LEAVE just does UNLOOP AHEAD... EXIT doesn't deal with loops, it requires UNLOOP. 18:09:24 * crc isn't too picky. I don't do a lot with ANS 18:16:34 --- quit: akebono ("Leaving") 18:21:18 hey, if you do IF LEAVE THEN, how does it know to ignore the context for the IF when compiling? 18:22:05 I tried it, and as it's compiling it pushes the address for IF's jump on the stack, and then LEAVE pushes its address, and then they get filled in in the wrong order. 18:22:42 (IF gets pointed to the end of the loop instead of THEN, and LEAVE gets pointed to THEN instead of the end of the loop) 18:23:28 * crc has never done this, so he can't help here 18:27:04 anyone? 18:35:47 Even in ANS, it says that IF pushes an "orig" on the C stack and that LEAVE pops a "do-sys". obviously that wouldn't work, and do...if leave then...loop works in most forths, so what do they do differently? 18:45:17 Quartus: you there? 19:47:47 ashorternick: sorry, I never cared about complex control constructs like that 19:47:50 I don't even use else 19:50:28 ashorternick, yes, just here for a sec. *that* is why LEAVE can't use the control stack for its chain. 19:50:41 I knew there was something. 19:50:55 I chain them through their resolve address locations. 19:54:09 I just never do anything more complex than: "for if unloop exit then next" 19:57:54 Quartus: wait, how do you do it? 19:58:17 Quartus: how do you chain them? 19:58:25 Each LEAVE has an address to be resolved, I chain the address of the previous LEAVE in there. End of chain is 0. 19:58:38 And I keep a LEAVE pointer to the start of the chain, or 0 if there is none. 19:59:15 Quartus: wait, so in the place where the address *will* go, you put the previous value of LEAVE, and then set LEAVE to the address of that cell? 19:59:40 I set a leave pointer. 20:00:13 The leave cleanup in LOOP (some people call this RAKE, but I find it a less-than-funny pun) walks that chain and resolves any LEAVEs. 20:00:34 Quartus: hehe 20:00:57 * JasonWoof giggles 20:02:03 Quartus: how do you deal with nested loops/ 20:02:04 ? 20:02:19 The leave pointer is stored with the DO information during compilation. 20:03:05 Quartus: i still don't get this 20:03:31 Which part? 20:03:33 Quartus: is it a concrete memory location, or is it stored in some clever way *in* the code? 20:03:42 is what? 20:03:50 Quartus: let's say I'm in LOOP, how do I resolve the LEAVEs? Where do I start? 20:03:55 Quartus: is the pointer to the last LEAVE? 20:04:05 Yes. Pick up the end of the chain, resolve each link in it. 20:04:28 Quartus: where is the end? 20:04:59 When you hit a terminator, whatever value you determine to be useful as a terminator. 20:05:26 Quartus: no i mean you said "pick up the end". where is the end you *start* at? 20:05:31 Quartus: is it stored in DO? 20:05:40 Right, the end of the chain as pointed to by the leaveptr. 20:05:47 Chain has two ends. 20:06:00 Or as the old Murphy quote goes, "If a cable has one end, then it has another." 20:06:10 Quartus: and leaveptr is where? 20:06:15 Quartus: just some variable? 20:06:48 Yes, a global that holds the end of the leave chain. Store its previous value on the stack while compiling a DO/LOOP, restore it in LOOP after resolving the LEAVE chain. 20:07:13 Quartus: Ah! I get it! 20:07:54 Quartus: so, the DO address goes on the stack as well, so LOOP can jump to it? 20:08:17 Yes. 20:09:04 Quartus: so loop-sys is like OLD-VALUE-OF-LEAVE-PTR ADDRESS-OF-DO? 20:09:19 Yes, that's the idea. 20:10:50 so LEAVE compiles: drop index/limit from return stack, jump to LEAVE_PTR. and then sets LEAVE_PTR = the address of that jump. 20:11:14 and then LOOP follows the chain back, setting each jump target to the address after the end of the loop. 20:11:20 Jump to leave_ptr? No, LEAVES jump past whatever LOOP compiles. 20:11:59 Oh, wait. I follow you. Yes, for the purpose of keeping the chain. Ok. 20:12:07 Quartus: is that how you do it? 20:12:17 Sure. I don't think of it that way because I'm just using the temporarily-available space as a kind of tiny stack. 20:12:28 Quartus: ok 20:12:35 You could, in fact, keep a tiny stack for the purpose. 20:14:37 Quartus: damn, that's just some really sweet black magic there... keeping the linked list in the jumps is really cool. I love FORTH. 20:14:50 ashorternick, I like that little solution too. 20:16:30 Got to run. Good luck; let me know how it goes. 20:17:29 Quartus: okay, thanks again for all the help 20:17:40 Glad to help. You're making good progress. 20:18:28 Quartus: it works! 20:18:34 Aces :) 20:18:51 Quartus: I got : FOO 10 0 DO I 5 > IF LEAVE THEN I . LOOP ; to work, it prints 0 1 2 3 4 5 20:18:56 Quartus: (instead of crashing ;-) 20:19:47 Good deal. Ok, keep me posted. Gotta go. 20:40:04 * ashorternick is going to bed. 20:40:22 **w00t** 71.43% done with CORE! **w00t** 20:40:24 --- part: ashorternick left #forth 20:49:20 what's 74.43% done? 20:50:05 ashorternick's ANS Forth in Java for cellphones 20:55:01 oh, he is the one doing that 20:55:06 tathi asked me 22:20:29 --- quit: virl (Remote closed the connection) 23:40:25 --- join: akebono (i=fujiwara@218.231.206.36.eo.eaccess.ne.jp) joined #forth 23:40:25 Quote: Let us live for the beauty of our own reality. -- Charles Lamb 23:58:16 --- quit: akebono ("Leaving") 23:59:59 --- log: ended forth/05.11.25