07:58:42 --- log: started retro/06.06.25 07:58:42 --- join: clog (n=nef@bespin.org) joined #retro 07:58:42 --- topic: 'RetroForth: You. Forth. The Machine.' 07:58:42 --- topic: set by ChanServ on [Sat Jun 24 21:11:36 2006] 07:58:42 --- names: list (clog neceve arke Snoopy42 @Raystm2 docl crc_ thin [Shain] nighty_ crc Cheery @ChanServ) 08:04:48 whups, figured it out. forgot to dup before c! 08:04:55 : input here dup repeat key dup 32 =if 2drop ;then swap 1+ tuck c! again ; 08:08:43 or (I suspect this could be simplified) 08:08:45 : input 0 here dup repeat key dup 32 =if 2drop swap ;then swap 1+ tuck c! rot 1+ -rot again ; 08:16:55 this is more readable: 08:16:56 : input here 1 repeat key dup 32 =if drop tuck - 1+ swap ;then rot 1+ tuck c! swap 1+ again ; 08:18:26 : input here 0 repeat key dup 32 =if drop tuck - swap 1+ ;then rot 1+ tuck c! swap 1+ again ; 08:19:46 cool, I'm at the top of the logs :P 08:59:08 docl: what are you coding? 09:14:39 a multi-line parse word 09:15:07 hiya thin 09:31:18 also trying to make a chording reader 09:35:27 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-177-126.pools.arcor-ip.net) joined #retro 09:44:23 good afternoon 09:53:37 --- quit: Snoopy42 (Read error: 110 (Connection timed out)) 09:53:45 --- nick: snoopy_1711 -> Snoopy42 09:59:37 docl: I did a factored out version, though it is longer 09:59:38 http://paste.lisp.org/display/21722 10:04:47 cool! 10:05:32 if you want, I can do a version of that using the case words to allow more flexibility (I was beginning to work on that already...) 10:07:04 that would be good 10:08:35 http://paste.lisp.org/display/21722#1 10:08:52 in a case approach, break exits the word, with tail call elimination 10:09:31 there is a tiny bit more overhead with this, but not much. And if you want to track cr/lf, it'll be a lot cleaner than with if/then approach 10:51:15 * crc has added some bugfixes to the netbsd port 11:12:39 a question: should I change [[ ]] to allow it to be used at the interpreter level? 11:22:22 pro: doing so would allow for some loops and conditionals to be performed without defining a full word 11:22:47 con: it would make it significantly more complex 11:28:47 * crc is actually impressed with the ram use of the version of FireFox 1.5 built from pkgsrc. It is using an average of 96mb ram with 20 tabs. 12:07:29 heh, firefox works a lot better in windows than linux, like two windows of 30 tabs each before i notice a slowdown 12:07:58 and this is on my slowass comp 300mhz/256mb ram 12:34:47 hmm. I'm not entirely clear on how [[ and ]] work yet. but it seems like loops and conditionals from the interpreter would be nifty. 13:49:26 --- join: swalters (n=swalters@dt080n87.tampabay.res.rr.com) joined #retro 14:32:32 --- join: virl (n=virl@chello062178085149.1.12.vie.surfer.at) joined #retro 14:37:52 Thank you crc! :) 14:38:07 hi all 14:38:09 ping 14:38:14 --- quit: nighty_ (Read error: 104 (Connection reset by peer)) 14:38:24 hi virl :) 14:39:05 are you up late night? 14:40:15 yeah, in half an hour it's midnight 14:40:30 Are you working on something? 14:40:41 no, I'm not 14:41:26 Me neither. 14:42:44 something I'd like todo in the future is a workshop about retroforth. 14:43:37 Great idea, I would gladdly join. There is much i'd like to learn about it. 14:47:04 it will be a workshop for forth noobs 14:47:47 A boon for a noob. 14:48:44 a boon? what's a boon? 14:49:04 a gain. 14:49:10 a plus. 14:49:12 value 14:49:39 ok. 14:50:16 so you think after colorforth.info that you are a noob, or how should I interpret that? 14:51:33 I'm pretty good, I think, at understanding the simplicity of colorforth. Retroforth has more to concider. Vocabularies, Locals, Vectors, Aliased words, it goes on much like that. 14:51:58 also library bindings... 14:52:14 I've done such things in c but have yet to really grasp how forth does such things. 14:53:15 I still have to learn about how to drive devices properly, even in colorforth. 14:53:17 ah, ok. 14:54:07 well, and I don't know how to drive them in colorforth or generally. 14:54:29 I also need to learn how to create and drive a large database. 14:54:34 vectors, locals, and aliases are really simple 14:54:47 I realize it has to do with word hiding... 14:55:29 vectors are a spot at the beginning of a word where you can easily put a jump to a different word. 14:56:12 and that gets reassigned. 14:56:18 it's 5 bytes long: 1 for the instruction, 4 for the address of the word you are jumping to. 14:56:32 docl, was it you who is working on a lisp in retro? 14:56:34 the address of a word is called the "xt" or execution token 14:56:40 1 for the instruction? the instruction name? 14:56:43 or was tathi? 14:56:52 oh I forget such things easily. 14:56:54 I was trying to 14:57:00 but didn't get very far 14:57:07 well why? 14:57:18 Raystm2, the asm instruction for a jump 14:57:28 1 for the jump instruction? and 4 for the address to jump to. 14:57:41 *nod* 14:57:48 e something i think 14:58:27 virl, the parsing on retro is a bit too closely integrated to modify easily. I've been working on that lately 14:58:44 yeah, $e9 I think 14:59:24 if the vector is empty (the default) it's $9090909090 I think 14:59:36 yes. 14:59:38 nop 14:59:44 x5 14:59:49 right 15:00:02 a very simple mechanism, really 15:00:12 yes. 15:00:30 could be used to great power i think. 15:00:33 you could put the vector anywhere in the word, as long as you knew it's exact offset. it's just easiest to do it at the front. 15:00:39 awesome magic. 15:02:27 You could litterally have a one word application that was all just previous definitions of the very same word. I think. 15:02:30 locals are just the same as regular words, but their names are erased from the dictionary right after they are used 15:02:36 right 15:03:21 $90 is nop? whoho... I'm getting always problems with those numbers. 15:05:34 the loc: function saves the address at the end of the dictionary, then ;loc restores it. the names and dictionary data defined between them are overwritten next time you make a word. 15:08:00 the top of the dictionary (which is a heap just like any other memory area) is pointed to by a variable called "last". this is used by the interpreter, "words" etc. so any words at a higher address aren't going to show up, and will soon get overwritten. 15:08:43 last @ <- top element of dictionary 15:08:57 last @ @ <- second to top element of dictionary 15:10:34 last carries a pointer that is a pointer to the second to last element on the dictionary, or did you mean last + @? 15:11:25 last is a variable, @ gets it's value 15:11:46 that will be an address, so you can apply @ to it as well 15:11:53 it's a linked list 15:13:04 there's some brief data above the address at "last @", which the accessor words like :name will show 15:13:32 the pointer is the beginning of the word's dictionary definition 15:15:03 last @ @ last ! <- makes the dictionary shorter by one word 15:15:41 the value of last = the beginning of the top word on the dictionary 15:16:02 also is the pointer to the previous word in the dictionary 15:16:22 you can exploit this to hide words without really deleting their dictionary data 15:17:08 --- join: nighty_ (i=nighty@sushi.rural-networks.com) joined #retro 15:17:45 last @ @ @ @ last @ ! <- hides the two words above the top one, by pointing to the fourth word instead of the second 15:18:24 you could actually change the whole dictionary order around if you wanted to :) 15:20:58 --- quit: Cheery ("Leaving") 15:22:57 anyhow, removing them from the top is trivial, and frees up memory in the dictionary 15:25:07 last @ list ! : foo ." blah" ; : bar .s ; list @ last ! <-- makes words, then deletes their dictionary info 15:26:00 an alias is simply making more dictionary info for the same word, using it's xt. 15:26:24 ' words <-- leaves the xt of words on the stack 15:26:35 docl: in your mention of vectors above, the default vector is now $e900000000 15:26:49 a jump to the next instruction, 0 bytes ahead 15:27:03 * docl updates his mental database 15:27:27 I changed it in 9.1 to simplify the workings considerably 15:27:48 alias foo <-- puts whatever is on top of the stack as the xt address for a new word named foo 15:28:36 so now if you look up foo in the dictionary, it's :xt value is identical 15:28:54 ' foo ' words <-- identical values 15:31:45 --- mode: ChanServ set +o crc 15:32:13 any questions? 15:32:55 * crc would like to mention that using alias is more efficient than doing : foo bar ; to create a word 15:33:14 ' foo alias bar ( this takes *no code space* ) 15:33:19 right. the colon-define makes a brand-new xt 15:33:24 : foo bar ; ( this takes 5 bytes of code space ) 15:34:37 also in that case: ' foo ' bar <-- different values 15:34:48 true 15:36:54 last @ :xt <-- same as ' foo if foo is the most recently defined word 15:37:38 no wait, sorry 15:37:53 last @ :xt @ 15:38:53 Raystm2, how does colorforth handle dictionary data? 15:41:18 Thanks docl, I will chew this over and over. 15:41:39 crc: that new vector jump, dang clever sir. 15:42:26 colorforth has a two part dictionary, macro and forth, and each part is 2 peices, names and addresses. 15:42:56 the name is the same depth in the names part as the address is in the address part. 15:43:10 so a find of a word returns the address depth automatically. 15:43:46 this dual dictionary provides for all of the word 'classes'. 15:43:50 ahh, ok. so it's not all in a row like in retro 15:43:54 no 15:44:04 there are actually 3 parts to the c4th dictionary 15:44:18 a) a counter storing the number of defined words 15:44:33 b) an array of names 15:44:38 c) an array of addresses 15:44:54 nice simple arrangement 15:45:32 okay, but that's split between a macros and forth area of each array. 15:45:43 macros are search first, obviously. 15:46:05 yes, there is a slit between the dictionaries. Retro used to have this as well, before word classes were added 15:46:57 c4th's setup seems like it might be easier to visualize (rows 3 columns wide) than retro's 15:47:25 there is room for adding a limited number of macros and forth words and it sometimes becomes neccesary to rearrange an image to add more . 15:47:29 retro has more columns 15:47:44 128 macros, and 512 forth words in the original 15:47:49 yes. 15:48:31 docl: I have experimented with an array based dictionary model in retro, but I haven't been satisfied with the results yet 15:49:11 this resource becomes limited with each variable, which has information in each of the macros and forth dictionaries. 15:49:36 I 15:49:54 I've read recently where Chuck is removing the green variable. 15:50:07 He say's it's not used, but i've used it. 15:50:14 maybe incorrectly. 15:52:21 I tend to think that a colorforth could be done with one dictionary, adding a single extra array storing the word class ("color") for the word to use by default 15:52:48 there seems to be a natural progression when working with colorforth, from using variables until you understand your structure, then moving everything into an array that handles all of your data. 15:54:37 yeah arrays rock 15:55:27 my biggest issue with using an array for the dictionary is how to determine the maximum required length for word names 15:56:34 hmm. you could just cap it at 8 bytes and make people be creative :P 15:57:35 4 bytes is often plenty 15:58:11 I would want more than 8 bytes :) 15:58:25 My longest names at present run about 12 bytes 15:59:10 hmm. words like #-of-blocks 15:59:34 yes 16:00:27 as I (and others) start exploring higher-level languages like python and lisp in forth, longer names are needed 16:01:00 maybe you could have multiple levels somehow 16:01:26 or a parser delimiter that is automatically added and subtracted from names as necessary. 16:01:38 the basic forth being limited to 8 bytes, longer names go in a different dictionary 16:01:48 then you get back into search order issues 16:02:03 as with ANS vocabularies :( 16:02:27 ' frabjous alias foo 16:02:59 whups, too short of an example 16:03:15 ' frobnicate alias foo 16:03:58 ' frobnicate (somehow change the active dictionary) alias foo 16:03:58 hmm. if called as frobnicate it's still going to take longer. 16:04:23 I moved to word classes primarily to get away from multiple dictionaries 16:05:31 : bar ~ frobnicate baz ; <-- temporarily changes dictionary to speed up frobnicate 16:06:15 hmm. once compiled, there's no search order issues anyway. 16:06:43 you would also be relying on a "lookup" that can handle various name lengths in multiple dictionaries 16:07:25 from my pov, it just seems to move complexity to other areas of the system 16:07:59 I guess in colorforth, the prepacking of words allows for a word name extention flag. 16:08:29 the only time i see that fail is when typing to the screen all caps. 16:08:56 the all caps mechanism doesn't recognise the extention and types them lowercase. 16:09:04 Raystm2: that would still neccesitate find/mfind having more support code to deal with the longer names when an extension flag 16:09:11 is found 16:09:15 agreed. 16:09:42 while the word is unpacking, it doesn't return untill all of the extention is parsed. 16:11:02 BUT find and mfind dont bother with the extentions in colorforth and your word name differences must come in the first 28 bits. 16:11:30 a simple rule to follow. 16:12:38 but you can fit as many as 5 chars in the first 28 bits. 16:12:42 again though, it's simple enough until it has to deal with an extended name 16:12:53 where does the rest of the name get placed? 16:12:55 3 is plenty, or so says Chuck. 16:13:14 no mfind and find don't bother with the extention. 16:13:22 just the first 'word' of a word. 16:13:24 3 is plenty for smaller applications. Try interfacing with external libraries and see how quickly that fails to apply :) 16:13:31 hehe ya 16:13:44 Raystm2: 3 would view *all* gtk functions as the same 16:13:46 only pack and unpack deals with word lenght. 16:14:02 length even. 16:14:04 ya. 16:15:40 but your ffi would be different with 3 letter names. I assume a table where each funtion is numbered, then you could have as many functions as you could build out of all of the letters digits and punctuation in 3 place combinations. littereally thousands. 16:16:08 you'd need sub-words. gtk.win.opn 16:16:21 ya. 16:16:26 then you make lookup even more complex 16:18:18 hmm. if a word is of a certain type, it contains a dictionary 16:18:43 it still just seems like trying to hide the complexity of a linked list with variable length entries to me 16:21:39 I would like a sub-word feature like that, in any case. 16:22:08 I may add that at some point 16:22:14 but I would layer it through word? 16:22:27 possibly along with the prefixes I was considering for variables.... 16:24:46 well, I don't think you'd want to see every single sub-word when you type words. maybe words.complete :) 16:25:04 it'd be paired with the vocabulary model I use 16:25:11 e.g., asm words ^ 16:25:23 switch to asm, do words, then return to the main dictionary 16:25:48 asm.LODSD, access LODSD, from the asm vocabulary (if there is no asm.LODSD, defined in the main dictionary) 16:26:06 neat 16:26:25 can asm double as a regular word while also being a vocabulary? 16:26:44 no 16:26:49 vocabulary names are words 16:27:06 in 9.2, I think they will have a special .vocab class 16:27:10 I bet I could get around that :P 16:28:03 i.e. make it so they only work as a voc if you use a dot 16:28:52 hmm. with a .main or .start it would be fine for the oop look anyway. 16:30:15 with a convention of ending vocs with a dot, it would look oop-ish already 16:51:05 voc: myobj. 16:51:05 myobj. : main ." main!" ; ^ 16:51:05 : test myobj. main ^ ; 16:51:37 that's not a bad idea 16:58:59 --- quit: ChanServ (ACK! SIGSEGV!) 16:59:37 docl: I'll suggest doing that in the wiki page on vocabs 16:59:46 --- join: ChanServ (ChanServ@services.) joined #retro 16:59:46 --- mode: irc.freenode.net set +o ChanServ 17:02:54 cool :) 17:05:42 http://retroforth.net/wiki/?id=Vocabularies 17:05:51 at the bottom, see the tip :) 17:08:46 I will likely add the tip-div stuff to the markups in the wiki backend soon 17:11:08 neat 17:13:00 * crc will be making vocabularies more reliable in 9.2 (e.g., ^ with no open vocabulary will not cause a crash) 17:13:21 that will be good 17:13:41 9.2 will be a very nice release :) 17:14:12 yeah, lots of stuff coming together :) 17:14:13 * crc can now include the assembler and retrospect to allow more development options 17:16:18 If I can, I will also redo the GTK bindings completely 17:17:56 a lot of current stuff will be doable in oneliners if my ideas pan out 17:24:17 docl: do you have any thoughts on prefixes for variables? 17:24:20 e.g., 17:24:23 @foo = foo @ 17:24:26 !foo = foo ! 17:24:33 as a shorthand notation? 17:27:18 hmm, interesting thought. 17:27:46 crc: you read what I said about that, earlier today? 17:31:13 you're only saving one space. might be worth it though, if it increases readability. 17:31:37 kind of warns the reader of the reason the variable is being accessed, as well as telling them it's a variable 17:32:40 --- join: jas2o (n=jas2o@144.138.54.232) joined #retro 17:33:22 Raystm2: no, can you repeat for me please? 17:36:50 I said something along the lines that... 17:37:13 After looking over b18chess again, to rewrite in retro and isforth... 17:37:27 I found that i used the very convention that you mentioned the other day. 17:37:31 There were reasons. 17:37:41 cool 17:37:48 * crc will work on this then 17:37:55 --- part: jas2o left #retro 17:37:55 I have to run to the store, bbl 17:38:00 see ya 17:38:05 when you create a ! or @ you tend to do this locally around the word you are working on. 17:38:09 okay see ya. 17:38:35 later as the app grows you find it convenient to collect these words in one area of the app. 17:38:49 this is necessary to keep from re-inventing things. 17:39:11 also to redefine memory and arrays as the factoring process develops. 17:39:27 its easier to find these words if the ! or @ comes first. 17:39:32 they line up nicely 17:39:47 that makes sense 17:41:12 these are words that you might eventually like to combine. 17:41:29 into an array interface. 17:45:07 as for b18chess, I think that there might not be that much to do to convert it to retroforth. 17:45:25 mainly the save-file handling which is set up for gforth and win32forth. 17:46:17 does retroforth have case, of, endof with a default action? 17:46:25 * Raystm2 checks 17:46:47 oh and leave. 17:49:23 hmm. it has a case, but I haven't used it yet 17:51:27 oh yea and I used ' do ' in the original. 17:51:37 * Raystm2 would like to change this to for/next. 17:52:27 the code i use for the display/save loop is also way to large of a definition and needs to be better factored. 18:21:37 --- quit: nighty_ (Remote closed the connection) 19:05:22 back 19:05:33 switch 19:05:41 case: ... break 19:05:44 case: ... break 19:05:48 default action 19:06:03 (case) variable stores the check value 19:06:06 break exits the word 19:06:18 you can insert default actions between cases 19:06:20 case: ... break 19:06:24 action... 19:06:25 case: ... break 19:06:28 action... 19:06:28 case: ... break 19:06:32 default action 19:06:37 this is valid in retro's model 19:25:57 New markup: ^paragraph^ 19:26:08 this puts paragraph in the black box 19:26:20 (or whatever the CSS "hint" class is set to 19:29:51 and now off to bed. goodnight and I should be here tomorrow 20:20:26 good night. 21:13:32 : tack >r 2dup + r> swap c! 1+ ; 21:13:32 : input pad 0 repeat key dup 10 =if drop ;then tack again ; 23:01:15 --- mode: ChanServ set +o arke 23:59:59 --- log: ended retro/06.06.25