00:00:00 --- log: started retro/10.01.09 03:59:43 --- join: nigol (n=nigol@63.120.broadband10.iol.cz) joined #retro 03:59:51 hi 04:08:52 hi 04:42:36 --- join: crcx (i=d8012b82@gateway/web/freenode/x-fjrmndaqrwsnfyyy) joined #retro 05:14:01 --- join: probonono (n=User@unaffiliated/probonono) joined #retro 05:44:11 --- join: Mat2 (i=59f7f7b9@gateway/web/freenode/x-iadnkplgosivdcdw) joined #retro 05:44:19 hello 05:45:10 hello 05:45:47 [crcx/retro10] 2ce918: use ;then in after 05:46:17 hi, i've seen there is something new in the repro 05:47:00 lots of new stuff :) 05:47:20 that's good :) 05:47:46 [crcx/retro10] 546b40: metacompiler now checks to make sure enough heap i... 05:47:49 vocab looks nice 05:48:42 I still have this idea behind to base vocabulary support on set theory 05:52:16 have a nice weekend 05:52:17 ciao 05:52:28 you too 05:55:17 --- quit: Mat2 (Ping timeout: 180 seconds) 05:56:07 http://retroforth.org/ngaro.txt (current) and http://retroforth.org/ngaro2.txt (with 'over' and 'nip' as opcodes) 06:03:31 over isn't nearly as popular since I re-wrote the string compare 06:05:07 wow, the literal -1 is about as popular as the ne or eq jump. 06:08:20 Wonder how many times dup is called just before an if? (i.e. "should if's drop or not?" 06:10:49 around 20 times in the image source 06:11:15 out of 100 occurances of the if forms 06:11:16 I mean at runtime how often is "dup if" compared to "(not dup) if" 06:11:37 that I'm not sure of 06:12:13 me either. But the 20/100 is a nice number. Seems to say "usually programmers want the drop" 06:12:26 Doesn't say anything about programs/cpu's though. 06:13:10 I am always intrigued by the poularity of VM_ZERO_EXIT. 06:13:36 Always tempts me to get rid of all conditional jumps. 06:15:44 Having a VM sure makes profiling easy ^_^ 06:21:07 Most of, if not all, those xor calls are really doing LIT 0 06:21:14 actually DROP LIT 0 06:21:28 DUP XOR instead of DROP LIT 0 06:23:00 So probably LIT 0, if it were a VM op code, would rank about #12 in popularity, and LIT -1 would rand about #16. 06:25:10 Wow, something big changed too... the mode stack depth is down to 3 from 5 in the past. 06:27:20 --- part: nigol left #retro 06:28:03 can you easily re-write the kernel (core, meta etc.) so that the code looks like 0, -1 and 1 are instructions? Then you can either inline the correct LIT XXX or actually try out an instruction... 06:28:34 probably not easy... 06:43:18 I think most of the forth comunity would agree, a sign of well factored code is shallow stacks. So the code quality has increassed by that metric. 06:43:44 bbiab... 07:16:14 nice 07:23:58 http://gist.github.com/272946 - a simple class that tries to inline code into definitions 07:27:14 js4: didn't many forths used to have words for 1 and 2 that hid the numerical meanings? 07:28:14 yes 07:33:25 --- join: erider (n=chatzill@pool-173-69-160-231.bltmmd.fios.verizon.net) joined #retro 07:34:18 hello 07:34:46 [crcx/retro10] 7840a2: add "if" to metacompiler; use in core 07:34:49 hi erider 07:35:00 Hi erider 07:36:07 SimonRC: Yes, on many byteaddress machines the constants 2 and 4 are very popular. Ngaro is not byte addressed, and it isn't well specified howmany bits per cell it has. More than 8 for sure though. 07:37:27 js4: standard image assumes 32-bits per cell. less will work, since we don't have any values that require a 32-bit range though 07:38:16 OK, well the Elisp implementation is only 29 bits. Seems to work though. Maybe make it formal: Ngaro has atleast 24 bits per cell, but an unspecified number more than 24. 07:38:40 That will kill 16 bit implementations. 07:39:02 crcx: you have a plugin for vim right? 07:39:33 erider: a plugin? 07:39:44 addon :) 07:40:08 like js4 has for emacs retro.el 07:40:14 no 07:40:15 Are you asking if there is a VIM implementation of Ngaro? *giggle* 07:40:29 nah 07:40:53 but what if there were ;) 07:40:55 The .el isn't really usefull till someone get's arond to writing ngaro-interaction mode for emacs. I may do that. 07:41:28 It shouldn't be too hard, VIM is open source, just grab the source, the ngaro consolse source, two cans of red bull.... 07:41:44 maybe 3 cans... 07:50:18 hmmm.... any one done a windows port? Like with graphics and all? 07:51:05 the sdl-backed port can be built on windows 07:51:29 hey crcx will retro work in opensolaris 07:51:51 erider: it should 07:52:23 erider: I've built earlier releases under opensolaris, but don't have it installed at present 07:52:30 can you give me that link again to retro 07:52:41 js4: I'll see if I can get a current executable 07:53:17 erider: http://s3.retroforth.org/download/10.x/retro-10.3.1.tar.gz for the latest stable release 07:53:18 Hmmmm my fork queue for ngaro at git hub... looks like you applied my emacs, and now it's complaining I can't apply your change to my fork... what is the right thing for me to do? 07:53:36 crcx: put it at the bottom of your todo list. 07:53:50 crcx thnks 07:53:52 I didn't change anything... ignore mine 07:54:14 * erider is wget http://s3.retroforth.org/download/10.x/retro-10.3.1.tar.gz 07:57:46 [js4/wheke] 079c6c: move testing stuff to a separate directory 07:57:46 [js4/wheke] fa3f4f: Add some unit test tools 08:16:17 crcx: hey is the image automatically loaded when ./retro is run? 08:18:17 yes 08:18:53 ./retro will load retroImage from the current working directory 08:22:34 crcx: a build needs to happen in the image folder right? but should I move retro to that folder as well? 08:23:22 erider: you only need to do a build if you want to create a new image. the existing one there should work ok. 08:23:49 if you want to build the image, edit the makefile's VM line to point to your copy of 'retro' 08:24:20 * erider is not at the level yet :( 08:24:30 that* 08:24:46 just use the standard image unless you need to alter it :) 08:26:01 cool it is working fine 08:27:33 good 08:27:45 * crcx will upload the latest image file in a minute... 08:30:14 http://retroforth.org/retroImage.gz\ 08:30:17 http://retroforth.org/retroImage.gz 08:34:42 bbiab 08:40:30 http://retroforth.org/r4w.zip - sdl-based Retro for Windows. binary, dll, and image file 08:40:49 hmm 08:43:13 ? 08:46:14 nah just that its interesting 08:48:46 [crcx/retro10] 80b01c: canavs words now in a vocab 09:11:36 js4: would you be up for a trip to portland on the 12th? there is a cryonics meetup then, which I'll be at. 09:14:22 chana has had a hard time rustling up enough guests so I am inviting everyone I can think of 09:20:40 Guests for what? 09:21:22 Oh... sorry, now I see the whole message... I dunno. I have no income, not much left in the bank... but plenty of free time... I'll pencil it in. 09:22:58 If I am really lucky I will cancel cause I started a new job... but that's not likely v.v 09:25:43 Will there be free food? 09:48:07 --- join: Mat2 (i=577b77ba@gateway/web/freenode/x-wljvsrbzhjfuzcdz) joined #retro 09:52:37 --- quit: Mat2 (Ping timeout: 180 seconds) 09:59:53 [crcx/retro10] 49478e: move location of canvas file 10:00:43 bbl 10:00:48 --- quit: crcx ("Page closed") 10:45:40 I can't decide... "Retro interaction mode" or "Ngaro interaction mode" 10:46:01 It's working more or less. Kinda nice to do M-x retro 11:04:16 --- quit: erider (Read error: 113 (No route to host)) 11:04:27 js4: my understanding is yes. http://www.cryonet.org/cgi-bin/dsp.cgi?msg=32279 11:21:55 js4: are you likely to be willing to relocate for a good job? 11:47:35 back 12:13:48 --- join: erider (n=chatzill@pool-173-69-160-231.bltmmd.fios.verizon.net) joined #retro 13:22:54 [crcx/retro10] 1626df: add "space" and "rdrop" 14:04:58 one thought about vocabs. we could make the vocab word automatically open and shut itself when executed 14:08:29 * erider does not understand the purpose 14:08:41 of vocabs? 14:08:58 docl: I'm ok with the current implementation 14:11:23 yeah 14:11:28 vocabs 14:11:38 what are there purpose 14:12:59 vocabs let you package related words, exposing them only as necessary 14:24:26 exposed to who? 14:24:35 or what 14:24:42 the dictionary 14:25:07 so the dictionary can see the words in the package 14:25:17 or can't? 14:25:45 if the vocabulary is open, words in it are visible 14:25:55 when the vocabulary is closed, the words are hidden 14:26:19 and why is that useful? hidden in the dictionary? 14:26:33 sorry I want to understand 14:26:38 consider things like the block editor 14:26:59 we have a visual interface to it, but each key handler is a separate word in the dictionary 14:27:27 ok 14:27:36 rather than reveal all the handlers, we can put them in a vocabulary that's visible while the editor is running 14:27:42 and not have them visible when it's closed 14:28:17 visible to the dictionary right? 14:28:34 we are talking in terms of the dictionary 14:28:40 yes 14:29:34 ok packages are hidden from the dictionary until they are being used? 14:29:43 yes 14:30:23 ok and how is that being done? 14:31:23 packages are places in a memory region where the dictionary doesn't have access 14:31:33 no 14:31:55 the dictionary is a linked list of headers 14:32:08 vocabularies are structures, given names in the dictionary 14:32:52 the vocabulary structure holds several values that are used to relink the dictionary when a vocabulary is opened or shut 14:35:59 crc: are we talking about in the C code or retroImage 14:36:05 retroImage 14:38:11 crc: yeah retroImage is a binary file 14:42:02 yes it is 14:42:40 its opcode for the words? 14:42:52 yes 14:55:16 erider: the retro language is entirely stored in the retroImage 14:56:24 yeah I know I just opened it in a hexeditor and I just tried shut and open 15:29:38 retro has a different conditional words 15:33:59 --- quit: virl (Remote closed the connection) 15:36:41 yes it does 15:43:16 retro does have traditional conditionals (< > = <> if/else/then), but also has its own set (=if !if if 0; ;then) of extensions 15:45:09 what are the differences or is it just syntactic sugar 15:45:27 the combined forms (=if and so on) are more efficient 15:45:54 really 15:46:13 yes 15:46:20 they map directly to ngaro opcodes 15:46:31 = < > and <> are words built over them 15:46:39 'if' is built over them too 15:46:54 are they operated faster from ngaro's prospective 15:47:07 yes 15:48:21 I see so =if was built-in command and = is wrapper 15:48:40 yes 15:49:56 what is the best way to get a good look at retro's internals 15:50:04 see 15:50:09 it'll show the decompiled code 15:51:20 yeah but that is just a snapshot I wonder if I can attach gdb to ngaro while it is running 15:51:42 yes, if you compile with -g or whatever to have debugging code 15:53:32 * erider goes to look at some sample code 15:55:54 crc: what is 'last' 15:56:04 last is a variable 15:56:16 it holds a pointer to the most recently created dictionary header 15:56:52 could I 'last count type' 15:57:01 no 15:57:06 retro has no count 15:57:17 last @ d->name type 15:57:35 would display the name of the most recently defined word 15:57:38 last @ d->class . 15:57:48 would display the address of the class handler for the most recently defined word 15:57:54 d? 15:57:58 err. @ . 15:58:03 last @ d->xt @ . 15:58:06 is there a series 'd' 15:58:09 no 15:58:20 d->class d->xt and d->name are words 15:58:35 for the xt of the word: 15:58:39 what do the d stand for 15:58:40 last @ d->xt @ . 15:58:44 does* 15:58:44 "dictionary" 15:58:54 d->xt = "dictionary header to xt field" 15:59:03 d->name = "dictionary header to name field" 16:00:04 so d->name returns an addr 16:00:15 yes 16:00:25 what about 'state' 16:00:38 compiler 16:00:39 use 'compiler' instead 16:00:56 addr too? 16:01:32 it's a variable, so provides an address 16:01:36 I guess everything returns a pointer but I guess to where is the most important part to understand 16:02:33 look in the image directory, the words (mostly) are covered in the doc/RetroLanguage.rst file 16:02:52 ok 16:03:06 I was looking at the sample dir 16:03:34 which sample? 16:03:46 hanoi 16:05:46 the code for 'value' uses a few tricks 16:06:44 black magic ;) 16:06:58 no, just detailed knowledge of how retro works 16:07:07 I'll write a commentary on it sometime 16:08:24 the 'state' in it is for determining the runtime action of a words with a class of .value 16:08:55 if it's on (TRUE), the value will be updated with the current value on the stack 16:09:08 if it's off (FALSE), it'll return the current value 16:09:09 so it would be a true statement to say "understanding how the parse/interpreter is very important and maybe more important than understanding pointers" 16:09:27 pointers are just addresses 16:10:11 value could be written pretty cleanly, but value| is where the tricks come into play 16:10:15 variable that can hold an address 16:11:16 crc: can you explain to me how the parse/interpreter works? 16:11:27 so we are at the ok prompt 16:11:35 ok 16:12:34 1) intepreter loop ("listen") displays prompt ("ok") 16:12:45 2) pushes 32 (ASCII for space) to stack 16:12:46 is it a buffer or is the interpreter stepping whitespace to whitespace 16:12:50 3) calls "accept" 16:12:56 whitespace to whitespace 16:13:20 4) accept reads in a string, and stores it in address starting at "tib" 16:13:42 5) calls a search function 16:14:11 6) if found, pushes the xt and class handler addresses to the stack and calls "with-class" 16:14:36 hold on 16:14:40 question 16:14:42 http://gist.github.com/273222 16:14:43 7) if not found, tries to make it a number 16:14:44 yes? 16:15:32 accept reads in strings into tib right? then that is parse to see if the string is in the dictionary? 16:16:05 8) if conversion works, push to stack and call ".data" class 16:16:18 9) if not found, display an error ("notfound") 16:16:21 10) repeat the loop 16:16:42 ok is the listener? 16:16:47 ok = the prompt 16:16:58 listener = "listen" word; it's called on startup 16:17:05 but the loop is in wait state 16:17:11 erider: accept reads strings into tib. accept *is* the parser 16:17:16 loop waits for input 16:17:30 ok 16:17:39 docl: I'll study this in a couple hours; it's just about dinner time 16:17:43 ok 16:17:53 it uses a class :) 16:18:12 my first custom class word :) 16:18:27 docl: nice 16:18:41 docl: does this alter the existing implementation, or just extend it? 16:19:23 extend 16:19:27 ok 16:19:42 if this was the stream: "1 2 + " 1 push to the stack 2 push to the stack + is it a number? No look it up in the dictionary ok is it there call it 16:20:05 dictionary check comes before number check 16:20:34 so it looks up numbers in the dictionary 16:21:01 all tokens are checked against the dictionary 16:21:09 what it looks up everything in the stream 16:21:37 yes 16:21:48 as long as it is separated with whitespace 16:21:51 yes 16:22:06 bbl (2-3 hours); dinner and family time. the kids are calling me 16:22:14 ok 16:22:17 so that is the parse in action? 16:22:25 ok 16:22:51 docl: do you want to continue with conversation? 16:22:54 sure 16:23:10 sounds like you have the correct idea 16:23:37 want to try and decipher my vocab class code? 16:23:54 so it is the parse that is in actions looking up everything that is in between whitespace right? 16:24:13 yep 16:24:44 yeah I thing I need to understand the parse/compiler to understand some of you guys examples 16:25:02 think* 16:25:31 :find is a stack-only (nonparsing) implementation of find 16:25:33 so the compiler is in action when new words are created? 16:25:44 right 16:25:52 as soon as it figures out which name to use 16:26:16 so immediate is doing what 16:26:34 reclassing the word 16:26:47 class is what it does with the word 16:27:01 (when encountered in interpreter or compiler) 16:27:38 what do you mean by reclassing I am not to familiar with forth terminology 16:27:40 .data class leaves the xt on the tos if interpreting, or compiles as a literal if it is in compiler mode 16:27:49 * docl will explain 16:28:09 class is a kind of word that is attached to another word to make it do something in particular 16:28:13 xt == address of word? 16:28:15 yes 16:28:22 "execution token" 16:28:54 entry point in other words 16:29:32 a dictionary header looks like this: [ link to next word ] [ xt ] [ class ] [ name string, zero terminated ] 16:29:39 right 16:30:19 the listen loop is going to first put the xt on the stack, then call the class 16:30:20 ok 16:30:41 class? 16:30:48 it is a marker 16:30:57 the class then does what it is supposed to with the xt 16:31:04 .data is a simple class 16:31:15 .data 16:31:25 ok what else 16:31:34 what it does is leave it on the stack if not compiling, or compile as literal if it is. 16:31:43 the .word class is very commonplace 16:31:49 I think I don't understand what class refers to 16:32:17 compile with the "call" opcode in front of it if in compiler mode, or run it now if in interpreter mode. 16:32:39 the class is what the interpreter loop does with the xt 16:32:53 tells it what to do 16:33:12 xt tells accept what to do? 16:33:46 class tells listen what to do with xt 16:34:07 I thought xt was just a simple address to the entry point of word 16:34:08 accept tells listen what xt/class to look for 16:34:12 yep 16:34:28 but the dictionary header has xt and class as well as name 16:34:30 so class is a tag 16:34:45 yeah. it's actually a word that is called. 16:35:23 class is an address just like xt is 16:35:40 the address of code to be run 16:36:29 struct interpreter { char *name; char *hdr; char *xt; char *class;}; 16:36:29 if I want the last word to be a ".data" class instead, I do this: 16:37:34 oops I forgot the struct interpreter *next; 16:37:56 last @ ( gets the dictionary header of most recent word ) ' .data ( gets the xt of .data, which is a word that has .data as its xt ) swap d->class ( moves over from the link address to the class address ) ! 16:38:04 here is an example 16:38:07 stub foo 16:38:12 ' .data 16:38:28 last @ d->class ! 16:38:51 struct dictionary_header { dictionary_header *next; char *word_name; code *xt; code *class; } 16:40:02 close 16:40:12 char *word_name would be the last one 16:40:23 so the others can be accessed by numeric offset 16:41:05 struct dictionary_header { dictionary_header *next; code *xt; code *class; char *name; } 16:41:38 struct interpreter { 16:41:40 struct dictionary_header { dictionary_header *next; code *class; code *xt; char *name; } 16:41:40 char *hdr; 16:41:42 char *name; 16:41:43 char *xt; 16:41:45 char *class; 16:41:47 struct interpreter *nexthdr; 16:41:49 }; 16:42:57 docl: so there is two classes 16:43:03 .data .word 16:43:05 : make-blank-word last @ , 0 , 0 , s" foo" here 3 copy 3 allot 0 , ; <- the zeros would need replaced with xt and class. 16:43:13 yes those are the main ones 16:43:20 struct dictionary_header { dictionary_header *next; code *class; code *xt; char *name; code body[];} -- often the body follows the header as a list of code. Sometimes the body isn't right by the header though. 16:43:57 ok 16:44:01 but not all words are compiled when the compiler is on. some are executed instead... these are called macros 16:44:59 what are the differences between .data and .word and do they get compiled 16:45:28 .word gets compiled as a call. .data gets compiled as a literal. 16:45:30 what you were saying things are compiled based on their class 16:45:39 call and literal are different ngaro machine code 16:45:49 yep :) 16:45:52 try "see .word" and "see .macro" and "see .data" 16:46:38 also see .compiler, see immediate, see compile-only 16:47:05 immediate words are executed regardless of the state of the compiler flag 16:47:48 so "immediate" makes something the .macro class which simply executes them 16:48:06 so what I should be noticing is call 178 and jump 314? 16:49:02 .compiler words which are made that way by compile-only and compile or do nothing depending if the compiler is active (meaning compiler variable is -1 vs 0) 16:49:17 178 = execute 16:49:32 put an xt on the stack and execute will call it right away 16:50:30 jump 314 == literal 16:51:14 so looking at the opcode what show I be trying to understand 16:51:18 see literal, 16:52:01 literal, compiles in a 1 followed by the tos, which is the signal to ngaro that it is a literal number instead of a call 16:52:19 literal numbers are put on the stack when you are executing the word 16:52:30 : foo 1 ; 16:52:49 puts 1 on the stack when run because 1 is compiled in as a literal number 16:53:37 : foo [ 1 literal, ] ; does the same thing. [ ] exit and enter compiler mode by changing compiler variable off and on 16:56:38 in my .vocab class, I make it look to see whether the word in its "hidden" field (located at xt + 1) is visible in the dictionary. if it is visible, I assume it is open and we want to shut it. if not, it is shut and we want to open it. 16:59:00 hold on 16:59:09 the open and shut words take an address as an argument -- which must be a vocab word. based on that vocab word they make changes to the dictionary links that hide or show the words in a certain range. 17:08:20 docl: how do you make a class 17:08:52 a class is made like any other word really 17:09:02 The retrolanguage.rst talks about how to make a new class called .string 17:09:04 it needs to handle an xt as an argument 17:10:09 *giggle* In interpret mode, type accept 17:10:15 ' makes a literal right 17:10:28 although instead of an actual xt that is an address you can put an integer in there... this is what a constant actually is 17:11:00 ' returns the xt of a word 17:11:15 how to you switch from compiler mode to interpreter mode and what are the benefits 17:11:22 ` 17:11:58 js4: 10 constant foo ' foo foo <- returns 10 10 17:12:32 .data basically just returns whatever is in the xt field 17:12:55 ' is like a pause then because if it return xt to the stack then you will need something to call xt to get the call to execute 17:12:59 when compiling it compiles it as a literal (which is what happens to numbers anyway) 17:13:21 +--------------+--------------+------------+---------------+ 17:13:21 | ' | .word | "-a | | 17:13:21 +--------------+--------------+------------+---------------+ 17:13:21 | Parse for a word name and get the address of the word. | 17:13:21 | Inside a definition use **[']** instead. | 17:13:21 +--------------+--------------+------------+---------------+ 17:13:41 lol, sorry for the spam, cut-n-paste from the manual is bad v.v 17:14:55 ' is like a pause then because if it return xt to the stack then you will need something to call xt to get the call to execute 17:15:17 variable is essentially a constant with the value of address to one (allocated) cell on the heap. 17:15:32 create is the same except without the cell being allocated 17:15:52 docl: so if I execute ' see how can I get the xt on the stack to execute 17:16:06 ' see execute should do it 17:16:34 of course it needs to parse something after that 17:16:42 ' see execute words = see words 17:17:24 ok what is the benefits of doing stuff like that 17:17:40 it is very flexible 17:18:06 is that changing the modes? 17:18:12 if so which one 17:18:31 no, ' see execute words is all in interpret mode 17:18:50 : foo ['] see execute words ; is in compile mode though 17:18:51 how so 17:19:23 so things in between : ; is in compile mode? 17:19:39 (but that won't actually work since it does not parse words at the right time) 17:19:44 yes 17:20:21 ok loop is interpreter mode and : ; is compile mode 17:21:05 docl: ls that right 17:21:53 yep 17:22:25 flexibility that this brings I don't understand 17:23:33 many computer languages are either interpreted or compiled. Forth is both. It gives you the immediate feed back from the interpreter, and will compile words so they run faster. 17:23:52 c is compiled, but usually there is no interpreter to try things out 17:24:16 I get that 17:25:01 but I don't get why you need to play with the modes to make things happy 17:25:55 it lets you basically write your own language the way you want to. 17:26:47 the compile/interpret mode thing is only one way to get this behavior. It is the traditional forth way. Freeforth takes a different approach. It always and only compiles. But sometimes it lets youcompile a word with no name, and as soon as you are done with the definition it runs the word and forgets it. 17:28:49 so it takes a buffer of strings/numbers and interpreters them into literals and code them compiles them (creates opcode out of the buffer) 17:29:29 : x ' execute ; immediate 17:29:40 : foo x words 17:30:28 * erider forgot what immediate did 17:30:41 makes it do the same regardless of mode 17:30:57 should 17:31:11 doesn't for various annoying reasons. 17:31:48 type if in interpret mode. 17:31:50 : foo x ' words ; is now the same as : foo ['] words ; 17:32:10 no actually it isn't, I take that back 17:32:58 the point is: 1 compile stuff so it runs fast. 2 provide an interactive quick feed back mechanism (retro interprets). 3 let you extend the language to make new syntax and words that match your problem. 17:33:30 Lots of languages try to do all this, forth has a clever and some think beautiful way to do it. 17:33:54 retro seems to be fast since it interpreters words immediately 17:37:01 Input 17:37:03 is parsed as it is typed 17:37:37 yes 17:49:01 lol "I've heard guys with 10-megabyte hard disks complain of feeling cramped." 17:49:51 I remember how happy I was with my new 80 MB drive. 17:53:23 :) 17:54:29 ok docl lets talk about , 17:54:50 In one sense, "," is the compiler. 17:55:04 : .string ( a â ) 17:55:06 compiler @ 0 =if type ;; then 1 , , ; 17:55:15 why is there two , , 17:55:19 everything in "compiling" comes down to "and then put the number there" 17:55:36 it's putting two things into the dictionary... let me read... 17:55:53 ok not so well done... 17:56:13 It could have said "..... then LIT, , ;" 17:56:20 , = here ! 1 allot 17:56:31 : .string ( a â ) compiler @ 0 =if type ;; then 1 , ['] type compile ; would make sense to me 17:56:33 LIT is an operation supported by the Ngaro VM. 17:56:51 here = heap @ 17:57:01 The numeric representation of LIT is 1 17:57:27 so "1 , ," means "put a LIT op code in memory, and then put the number from the stack in memory" 17:58:22 ah 17:58:33 ok I thought 1 == push 17:58:49 "in memory" is "at the end of the heap where we are compiling a new word" 18:00:24 so in compile you need to place everything in to memory 18:00:53 yup 18:01:03 If you have stage3.retro, look at the source code near the end where it is defining see. It has a nice list of opcodes and their numbers. 18:01:37 When you type "see foo" it is showing you what the compiler created for foo. 18:04:02 is the a .s in retro 18:04:47 don't think so, but I wrote one if you want... 18:05:04 : (.s) dup 0 =if drop ;; then 1- swap push (.s) pop dup . ; 18:05:04 : .s cr ." ( " depth (.s) ." )" ; 18:05:09 Probably more than you want 18:05:59 retro --with ../wheke/debugger/dots.retro 18:06:03 also a really lazy recursive implementation... I didn't bother to do the faster iterative solution cause it's a i/o word used during development 18:06:57 retro --with ../wheke/debugging/dots.retro 18:08:52 slightly cleaner... 18:08:59 : (.s) 0; 1- swap push (.s) pop dup . ; 18:08:59 : .s cr ." ( " depth (.s) ." )" ; 18:09:27 shows the bottom of the stack at the left... that's why I put it in ()'s like a stack diagram. 18:11:34 you would need a loop to display all items on the stack 18:11:52 (.s) is recursive instead of having a loop 18:13:24 ah ok 18:13:40 here is an example of later: 18:13:41 : wrap s" ( " type later s" ) " type ; 18:13:41 : (.s) 0; 1- swap push (.s) pop dup . ; 18:13:41 : .s cr wrap depth (.s) ; 18:14:07 later waits for the calling word to exit before it finishes 18:14:38 did you test that? 18:14:42 yep 18:15:47 so the first half of wrap executes right after the cr, and the second half waits for the ; before it executes 18:15:55 tricky 18:16:07 took a while for me to grasp it 18:16:25 : later pop pop pop swap push push push ; ??? 18:16:58 pretty much 18:17:06 hmmm no just : later pop pop swap push push ; 18:17:12 I'll think about that... 18:17:12 as a macro I think it is just pop pop swap push push 18:17:35 Oh yeah, I keep meening to make see tell you the class... 18:17:49 that would be handy 18:17:49 does push and pop play with the data stack 18:18:25 yes. pop takes an item off the return stack and puts it on the data stack. Push goes the other way. 18:18:27 yeah. return stack too. 18:19:03 usually it's used like in (.s) to temporarily save something like "... push .... pop ..." 18:19:17 in the middle the TOS is out of the way but not forgotten 18:19:18 >r r> 18:19:35 erider: exactly 18:19:45 those are the traditional names, and very very very confusing for me. 18:19:47 those are the equivalents still used in reva 18:20:29 >r push r> pop 18:20:36 right 18:20:55 push = to r, pop = r from 18:23:37 with vocabs you can load all your libraries into a vocab, each with their own shut vocab 18:25:14 yep. I keep meaning to get around to making an image with all the words I like. Then I get tempted to make other changes though... 18:28:09 words 18:28:11 oops 18:28:16 wrong window 18:32:02 * docl definitely prefers vocabs with the class instead of open/shut. for the interpreter anyway. 18:39:00 here is like malloc? 18:43:29 * docl is not sure what malloc is like 18:43:39 allot probably is more like it 18:43:58 allot means increasing heap's value, which is what here is 18:44:07 : here heap @ ; 18:44:28 : allot heap @ + heap ! ; 18:44:59 so allot keeps you from overwriting the same memory with something else 18:46:33 depth could be added to the (.s) to make things easy 18:47:09 what do you mean? (.s), the one I wrote, expects depth to be on TOS 18:50:19 (.s) crashes my retro 18:52:21 --- quit: erider ("ChatZilla 0.9.86 [Firefox 3.5.7/20091221164558]") 18:52:47 call .s 18:53:01 : .s depth (.s) ; 18:53:33 if you don't do "depth (.s)" you will usually crash 19:19:43 eep! "forget this-word-does-not-exist" forgets everything 22:11:36 hmm, I can work on that 22:14:47 [crcx/retro10] 91fadc: fix bug causing all words to be lost if "forget" w... 22:37:47 [crcx/retro10] 47ad7c: refactor see into :see and see (non-parsing and pa... 22:40:37 docl: your .vocab class doesn't handle use in a definition... 23:17:46 [crcx/retro10] 9de928: minor tweaks 23:20:38 docl: for 'as-vocab': : as-vocab ( a- ) ['] .vocab reclass ; 23:34:57 docl: http://gist.github.com/273364 23:35:17 docl: a quick refactoring to try and simplify :find a bit 23:59:21 looks good 23:59:36 http://gist.github.com/273370 23:59:59 --- log: ended retro/10.01.09