00:00:00 --- log: started retro/09.12.26 00:01:00 * docl should get some sleep 00:01:04 'night 09:32:19 --- join: erider (n=chatzill@unaffiliated/erider) joined #retro 10:01:01 hi erider 10:01:57 hi 10:16:14 * docl has been debating cryonics 10:17:18 and programming retroforth too :) 10:39:48 brb 10:39:53 --- quit: erider ("ChatZilla 0.9.86 [Firefox 3.5.6/20091201220228]") 11:03:38 --- quit: virl (Remote closed the connection) 12:48:03 : sav ` push ` r ; immediate 12:48:26 more optimal: : sav ` dup ` push ; compile-only 12:48:47 but the question is, is sav really a good name for the word? 12:49:02 maybe "pr" for "push r" or something 13:24:17 --- quit: docl (Remote closed the connection) 13:24:32 --- join: docl (n=luke@67-60-48-82.cpe.cableone.net) joined #retro 13:25:04 http://gist.github.com/264046 13:25:46 I'm not sure why, but when I try to compile calls to the commands "+ @" after an eval it messes up. 13:29:52 I must have messed up the return stack somehow 13:42:07 of course I can simplify the word to get around such issues, e.g. : access ( n"- ) ' + @ ; 13:52:12 here's a simpler example: 13:52:14 : test s" 10 . 20 ." dup getLength eval words ; test 16:06:30 docl: the output is missing due to remapping of "emit" by the "eval" function 16:17:23 oh yeah, that makes sense 16:17:33 I should document that 16:18:15 or maybe change eval to revector accept 16:25:48 docl: try this eval function: http://gist.github.com/264093 16:28:53 hmm. 16:29:00 : access ( n"- ) 32 accept tib dup getLength eval + @ ; 16:29:00 create mylist 1 , 2 , 16:29:00 1 access mylist 16:30:25 tos: 7293 nos: 2486 16:33:09 evidently 2486 is the number stored at memory address 1 16:33:53 perhaps the addition is being delayed until after the @ somehow? 16:39:22 * crc is trying to find out 16:42:38 generating an execution trace at present 16:43:31 67mb trace generated :) 16:52:43 docl: why are you using eval here? (just out of curiosity) 16:56:39 well I'm not anymore, since I figured out that ' does the job in this context 16:56:43 : access ( n"- ) ' + @ ; 16:59:46 I seem to recall "wsparse eval" used to work in the older versions of retro. 16:59:52 imo, it's best not to use eval unless there's no other way 16:59:59 docl: yes it did 17:00:24 the new eval is likely more limited, and definitely less well-tested than the one in older retro systems 17:01:00 you just added it recently right? 17:01:06 yes 17:03:11 [crcx/retro10] 261ca3: cleaner "accept" in core; added "ekey" (replaces "... 17:04:09 since this eval is substantially different than the old one in how it works, it may break/alter things 17:04:57 understood. 17:05:16 the old one was actually a duplicate of the interpret loop, using strings as input 17:05:36 this one remaps the 'ekey' word used by 'accept' 17:06:02 the devectoring may be causing issues with code following the eval 17:11:57 hmm. I can't figure out why + or @ would be affected by key or emit 17:12:25 and those devectorings happen at interpret time, not compile time... 17:21:40 --- quit: yiyus (farmer.freenode.net irc.freenode.net) 17:21:40 the 'eval' doesn't happen until the word exits 17:22:05 --- join: yiyus (i=12427124@je.je.je) joined #retro 17:23:55 docl: try this to see what I mean: 17:23:56 : access ( n"- ) 32 accept tib dup getLength eval words ; 17:23:57 create mylist 1 , 2 , 17:24:15 err, let me paste again 17:24:25 : a cr ." hello" cr ; 17:24:25 : access ( n"- ) 32 accept tib dup getLength eval words ; 17:24:25 create mylist 1 , 2 , 17:24:25 1 access a 17:26:15 hmm. it never gets to "words" 17:26:47 docl: it does with the newest eval (pull from my retro10 repo and build a fresh image) 17:27:39 docl: words doesn't show any output with the old image, since 'emit' is changed to a non-op in that 'eval' 17:28:25 docl: the new one has been restructured to display output properly 17:29:52 ah ok 17:30:19 : test1 @ + ; 17:30:19 : test2 ( n"- ) 32 accept tib dup getLength eval ; 17:30:19 : access test2 test1 ; 17:30:19 create mylist 1 , 2 , 17:30:21 0 access mylist . 17:30:27 still doesn't work 17:30:58 docl: the eval still doesn't happen until the calling word exits 17:31:17 interpreter calls word, word (or something it calls) invokes eval, which remaps input 17:31:19 so the word that calls from the interpreter, in other words? 17:31:28 new input isn't processed until the interpreter gets control again 17:31:48 oooh ok 17:38:48 docl: see if this is clear enough: http://gist.github.com/264114 17:41:43 looks pretty clear. 17:44:56 [crcx/retro10] f9e1dc: add notes on "eval" 17:45:34 I'm probably going to start dividing the documentation into smaller files, to make it easier to manage 17:53:25 here's something that works: 17:53:26 : prepend ( $$-$ ) here -rot 2 for dup here swap getLength dup allot copy next 0 , ; 17:53:29 : access ( n"- ) 32 accept tib s" + @ ." swap prepend dup getLength eval ; 17:53:32 create mylist 1 , 2 , 17:53:34 0 access mylist 17:53:57 [crcx/forthlets] 4c4d47: use ijkl in console game demos 17:58:19 seems like overkill though 17:58:40 yeah, but it proves it can be done that way :P 17:58:55 true 17:59:01 : access ' + @ ; is the simple way 17:59:08 yup 17:59:36 but I'm thinking for some kinds of scripting, it might be more convenient to be able to use text. 18:00:22 true 18:00:30 in which case you want something like prepend 18:00:34 some macros could go a long way towards making it readable 18:02:21 something like "code { }" maybe? 18:03:30 that could work nicely 18:05:25 bbiab, dinner time 18:05:28 ok 19:11:04 http://gist.github.com/264138 19:21:57 [crcx/retro10] 3a6a6d: add ifNotExists 19:22:53 docl: looks good 19:23:09 with ifNotExists, you can do: 19:23:11 ifNotExists prepend { : prepend ( $$-$ ) here -rot 2 for dup here swap getLength dup allot copy next 0 , ; } 19:23:25 to only define prepend if the string library isn't loaded 19:48:56 [crcx/retro10] 94f699: add some more rst files to docs/notes 20:03:05 ooh, nice 20:06:52 btw, I've updated my online demo at http://crcx.ath.cx:52850/ with a toggle on the html filter and more of the forthlets 20:10:27 * docl is taking a look 20:13:01 is the chorder loaded? 20:13:12 yes 20:13:27 wait a second... 20:14:19 now it is 20:14:34 * crc forgot to change the ifExists line to the new syntax in it, sorry 20:14:39 ok :) 20:19:13 nice 20:19:38 is it still running on a canvas? it seems faster, but that could be my imagination 20:19:56 [crcx/forthlets] 6e8080: new ifExists syntax 20:20:02 the text is no longer drawn to the canvas, just layered over it 20:20:39 cool 20:20:55 it still takes some time to render though. 20:21:05 I've still not figured out how to deal with the scrolling issues... 20:21:28 docl: yes it does. I'm still evaluating options for improving display speed :( 20:22:01 would it be possible to just update the changed areas? 20:25:19 I have no way of tracking changes yet 20:26:24 would a position-specific emit be possible, I wonder? 20:26:36 pos-emit 20:26:47 ( xyc-" ) 20:26:50 yes, but it'd have to be tailored for each vm/host os 20:27:15 yeah I can see how that would be a pain. 20:38:23 well, using ifExists we can probably write fairly portable code even so. 20:38:56 even that won't help much with system-dependencies though :( 20:47:15 does the sdl version have the layering improvement? or is that just javascript? 20:47:24 just javascript 20:47:33 sdl is *brutally* slow at present 20:48:24 it seems to take as long to print blank spaces as it does regular characters 20:49:13 yup. 20:49:43 the font drawing could be improved a lot (use of clipping, bitblt, etc) but I've not had a lot of time to play with it 20:52:16 * docl will look at it some more 20:58:01 * crc seldom runs the sdl port anymore 21:15:45 hmm, if you set the window height to 150 you can still see the entire block editor and it renders faster. still impossible to type in rem though since it does not accept input during refresh. 21:25:02 using red with it is not so bad. 21:30:44 docl: load this and save: 21:30:47 fastdraw ; 21:30:47 here is v ] ['] fastdraw ['] redraw :is (v) ['] redraw :devector ; 21:30:54 see if that helps 21:37:28 speeds it up tremendously! 21:37:46 not in rem though, at least not the way I loaded it. 21:38:57 [crcx/retro10] fbcf1f: add "fast-render" to stage3 21:40:48 (v) now uses this and I'm starting to add it to the forthlets 21:41:02 fast-render seems to break the console version though :( 21:41:20 odd 21:41:24 * crc is checking now 21:43:10 docl: the console stuff still works for me 21:43:50 it's weird. I just see the bottom bar and the status bar. 21:44:00 run new again 21:44:11 ahh :) 21:44:16 works 21:44:34 why would it do that? 21:45:02 the memory is likely filled with ascii 0, which displays nothing 21:49:15 hmm, rem now seems to have been broken, it waits until you exit the key loop by pressing z before displaying the screen. 21:49:23 (in sdl) 21:50:41 so what you end up seeing is a blank screen 21:51:11 I just pushed a fix to fast-render 21:51:57 [crcx/retro10] 0a4267: fix to fast-render 21:53:27 cool! 21:54:42 it should work ok now 21:56:42 works great! 21:57:56 [crcx/retro10] 628c4e: move "words" to stage3; use "fast-render" in "word... 22:00:56 [crcx/retro10] 8b3f24: tweak to "see" with fast-render 22:02:00 [crcx/retro10] b9f73c: drop fast-render from see; didnt like the results 22:15:04 [crcx/forthlets] 39951a: fast-render in console games 22:16:15 does "forget" unallot heap space? 22:16:41 yes 22:17:19 nice 22:51:50 : :screen (block) create here 512 copy 512 allot 0 , ; 22:55:46 : screen: (block) over getLength copy ; 23:01:56 [crcx/retro10] c9ae49: reformat to rst 23:08:05 [crcx/retro10] 305480: LICENSE now rst format 23:21:17 docl: stack comments please ;) 23:29:38 ok 23:30:30 : :screen ( "- ) (block) create here 512 copy 512 allot 0 , x ; 23:30:30 : screen: ( a- ) (block) over getLength copy ; 23:31:24 example: 23:31:24 :screen temp n temp screen: forget temp 23:31:44 the names don't feel quite right 23:32:56 maybe block-as ( "- ) and as-block ( a- ) 23:38:53 new 23:38:57 0 i : block-as ( "- ) (block) 23:38:57 1 i create here 512 copy 512 allot 0 , x ; 23:38:57 2 i : as-block ( a- ) (block) over getLength copy v ; 23:38:57 e 23:38:57 block-as temp n temp as-block forget temp 23:59:59 --- log: ended retro/09.12.26