00:00:00 --- log: started forth/06.06.28 00:37:27 --- quit: neceve (Remote closed the connection) 01:52:19 --- nick: segher_ -> segher 02:59:02 --- quit: JasonWoof ("off to bed") 02:59:54 --- quit: GoGinah (Remote closed the connection) 03:57:38 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 04:05:04 --- join: zpg (n=user@smaug.linux.pwf.cam.ac.uk) joined #forth 04:05:07 afternoon 04:08:18 --- join: nighty (n=nighty@fr-reims-gw.origami-systems.com) joined #forth 04:10:45 hi 04:14:06 hi virl 04:40:57 --- quit: zpg ("ERC Version 5.0.4 $Revision: 1.726.2.19 $ (IRC client for Emacs)") 05:34:26 --- join: zpg (n=user@smaug.linux.pwf.cam.ac.uk) joined #forth 05:42:37 --- join: PoppaVic (n=pete@0-1pool66-66.nas22.chicago4.il.us.da.qwest.net) joined #forth 05:49:24 --- join: timlarson_ (n=timlarso@65.116.199.19) joined #forth 05:51:59 --- join: Ray_work (n=Raystm2@199.227.227.26) joined #forth 05:52:45 --- quit: Ray_work (Client Quit) 06:04:05 --- quit: nighty (Read error: 104 (Connection reset by peer)) 06:04:49 --- join: nighty (n=nighty@fr-reims-gw.origami-systems.com) joined #forth 06:12:20 --- part: zpg left #forth 06:21:21 --- quit: PoppaVic ("Pulls the pin...") 06:31:34 --- join: silvousplait (n=trip_n_s@pool-151-196-179-211.balt.east.verizon.net) joined #forth 06:35:24 --- quit: silvousplait (Client Quit) 06:57:48 --- join: PoppaVic (n=pete@0-1pool73-111.nas24.chicago4.il.us.da.qwest.net) joined #forth 07:24:08 --- join: Queek (i=74081307@Orleans-ppp42653.sympatico.ca) joined #forth 07:43:51 --- part: Queek left #forth 08:14:39 --- join: Ray_work (n=Raystm2@199.227.227.26) joined #forth 08:41:45 You know..? I've been glaring for days, but I am beginning to think there are a variety of "depths" or "levels" or "contexts" or "states all thru most Forths. 08:42:28 state seems to be a member of a global struct, as does context and current 08:42:44 ..WHAT the latter two mean seems to be the issue. 08:43:48 are "threads" processes or states or vocstacks? are "words" no more than operators or operands? 09:03:07 --- join: rob1nhood (n=user@193.219.74.136) joined #forth 09:19:53 --- quit: nighty ("Disappears in a puff of smoke") 09:33:32 Quartus, well I'll just encourage him to use figforth until he can point to some legitimate reason not to use it on his 6502. 09:34:02 (I fell asleep before you guys responded to me. thank goodness for logs) 09:39:22 --- quit: PoppaVic ("Pulls the pin...") 09:41:20 --- join: ttuttle (n=tom@unaffiliated/ttuttle) joined #forth 09:41:22 Quartus: Hey. 09:44:47 --- part: rob1nhood left #forth 10:18:34 --- join: rabbitwhite (n=roger@136.160.196.114) joined #forth 10:20:47 --- join: JasonWoof (n=jason@pdpc/supporter/student/Herkamire) joined #forth 10:20:47 --- mode: ChanServ set +o JasonWoof 10:30:24 --- quit: rabbitwhite () 10:35:23 --- quit: ttuttle ("leaving") 11:18:51 --- join: nighty (i=nighty@sushi.rural-networks.com) joined #forth 11:48:21 --- join: zpg (n=user@85-210-112-48.dsl.pipex.com) joined #forth 11:48:29 --- join: I440r (n=mark4@24-177-235-246.dhcp.gnvl.sc.charter.com) joined #forth 11:48:36 evening 11:57:10 hi 11:57:19 zpg u new in here ? 11:59:01 i am indeed, as new as i am to forth (which is most new) 11:59:09 :) 11:59:16 welcome :) 11:59:20 many thanks 11:59:31 what os do u use? 11:59:40 what forths are u looking at ? 11:59:42 OSX or BSD depending 11:59:51 cool 11:59:54 gforth installed 12:00:09 are u an experienced coder but new to forth ? 12:00:17 yeah, something like that. 12:00:24 i dont like gforth but im biased 12:00:29 not professionally so, but i've been hacking in various languages for quite a while. 12:00:42 might you be a terp implementer/ 12:00:43 ? 12:00:43 know asm ? 12:00:53 isforth.clss.net 12:00:56 my forth 12:01:03 x86? yes, though my memory will likely disagree 12:01:11 I440r: how did i guess you'd written your own :) 12:01:30 everyone does :P 12:02:24 "My hobbies include listening to and playing blues guitar," <-- I'm listening to Dylan's World Gone Wrong 12:02:32 pretty strong record, not sure if you've heard it 12:02:46 :) 12:03:12 if u code x86 take a look at my kernel sources 12:03:20 they might help 12:03:37 so have you implemented isforth in asm? 12:03:49 i just had my wisdom teeth out so im not 100% atm 12:03:50 yes 12:03:56 gas? 12:04:04 (the assembler, not sideffect of denistry) 12:04:04 if its not done in asm its not forth 12:04:07 no 12:04:10 nasm 12:04:13 nice one 12:04:21 tinkered with that a few years ago 12:04:35 liked the portability (gas really threw me when i tried asm on linux) 12:04:52 gas is crap on x86 12:04:58 and arm 12:05:15 typo sir: "This code too me about 3 days to write." 12:05:30 aha :) 12:05:40 hang on, did you rewrite in PPC assembly? 12:05:49 i didnt 12:05:53 tathi did 12:05:58 i see 12:05:59 but its not osx 12:06:05 ppclinux? 12:06:14 an osx port would be good 12:06:17 ya 12:06:19 k 12:06:23 os it's all ELFed? 12:06:33 i did the fbsd port tho 12:06:38 on slavas box 12:06:43 good stuff 12:06:47 yeah, and syscalls are slightly different on OS X 12:06:50 ah ok 12:06:54 hey there tathi 12:06:55 but that part should be easy to fix 12:07:02 hi zpg 12:07:06 well, i'm still learning to walk in Forth at the moment. 12:07:11 literally began ... yesterday 12:07:32 been meaning to for a while; OFirmware is Forth, Raskin loved it, etc. 12:07:46 yeah, open firmware is nice 12:07:56 * tathi can't believe they dropped it for the intel macs 12:07:57 i'm looking at Brodie's Starting Forth at the moment 12:08:02 really? 12:08:11 didn't know that 12:11:52 yeah, they switched to Intel's Extensible Firmware Interface for x86 12:14:02 custom language? 12:14:26 I don't know much about it, actually 12:22:44 looks like Intel wanted something that was as backward-compatible as possible, so they wrote their own 12:23:07 backward compatible with what? 12:23:19 surely not bios 12:23:20 the old x86 (PC/AT or whatever) system 12:23:28 yeah, sounds like it. 12:24:16 yikes 12:25:02 yup. Apple should totally have gone with Open Firmware. 12:25:24 oh well 12:29:27 in other news, SWAP and OVER are confusing the hell out of me :) haven't exercised RPN-braincells in quite a while 12:29:53 hehe 12:30:29 one of those "i think i've got it, wait that makes no sense, ah the answers says ... hrmph?!" moments 12:30:41 1 2 3 4 swap 1 2 4 3 12:30:50 1 2 3 4 over 1 2 3 4 3 12:31:06 over adds a new element to the stack that is a copy of the one just under the top 12:31:13 indeed, in itself a fairly straightforward concept 12:31:19 it's the equation conversion that's confusing 12:31:30 swap swaps the top two 12:31:32 i.e., how to correctly use these words 12:31:39 over reaches over the top one and graps a copy of the one past it 12:31:42 as well as seeing the patterns <-- this is lacking 12:31:48 * zpg nods 12:31:48 ahh, usage 12:31:51 :) indeed 12:31:53 avoid using swap if possible 12:32:29 now, see, that's one of Jeff and Chuck's things that I totally disagree with. 12:32:45 there are quite a lot of situations where it's completely impossible to avoid using swap 12:33:47 heh 12:33:54 so Chuck Moore advises against swap too? 12:34:16 well, one of his little crazy-minimalist stack chips doesn't have swap, just over. 12:34:20 (incidentally, what do you guys use Forth for? I know I440r works in the Embedded realm) 12:34:26 heh don't kill the swap dragon! 12:34:33 it simplifies the hardware design slightly because you never have to write to the second stack element, I guess. 12:35:25 was that the seaforth chip? 12:35:52 mostly just for little stuff 12:36:13 I still don't have a forth that has good enough string support to easily do a lot of the scripting stuff that I do 12:36:47 virl: I don't think the actual specs on the Intellasys chips are out yet; I was thinking of his earlier designs. 12:36:57 I'm pretty sure c18 didn't, and possibly f21 also 12:47:54 * zpg gets off the phone and returns to SWAP 12:51:04 Avoid SWAP? I hadn't heard that one. 12:51:24 I'm the author of Quartus Forth, zpg, for the Palm OS. 12:54:21 Quartus: well, actually I've only heard it from Jeff. So don't take it too seriously :) 12:57:59 Ah. Disregarding now. :) 12:58:32 oh neat, hadn't even though of putting Forth on my palm 12:58:47 The evaluation version is free, if you're interested; http://www.quartus.net 12:59:49 Jeff [Fox]? 12:59:56 * zpg looks at quartus 13:00:28 I assume son. 13:00:30 -n 13:01:28 yes 13:01:34 Quartus looks neat, though I think I'd find programming with the stylus rather frustrating 13:01:51 luckilly Quartus did :) 13:02:04 Did? 13:02:23 zpg, it's not so bad, I wrote many apps with the stylus alone, but the external keyboard does come in handy. 13:02:32 thought of putting forth on a palm :) 13:02:37 Ah :) 13:03:17 good stuff 13:03:27 yeah i guess it's a matter of practise too, though external kbd would be handy 13:04:37 I recommend it for heavy use. 13:05:50 * zpg nods 13:06:01 so do your use forth predominantly on the palm? 13:06:16 It only runs on Palm OS, so yes. :) 13:07:16 Heard RIM and Palm may merge. 13:07:29 That'd be neat. 13:08:54 rim? 13:10:36 http://home.iae.nl/users/mhx/sf2/sf2.html, Quizzie 2-c, # 6 was a kick in the teeth :E ) 13:11:27 Research In Motion, Canadian company that makes the Blackberry wireless email device. 13:11:58 ah, Blackberry+Palm; that sounds pretty neat indeed. 13:12:29 Did you figure out 2-c? 13:13:29 1-5, yes 13:13:37 6 led to crosseyes 13:16:54 Bit trickier. 13:17:00 indeed 13:17:06 Solved? 13:19:08 well i looked at the answer when i thought i had a solution, it was wrong 13:19:23 i'll come back fresh later on and try again (when solution firmly forgotten - nearing that stage now) 13:19:56 any of you guys use forth as a main language outside the embedded context? 13:20:46 personally, i'm enjoying the different form of expression, RPN postfix and cleanliness (similar reasons to my enjoyment of lisp; an emacser in fact reminded me to check out Forth properly) 13:21:03 obviously lisp = prefix 13:22:33 heh. I thought their answer was wrong for a second there 13:23:26 nothing like that, we were just discussing the elegance of certain languages, and a chap mentioned factor and forth in the same breath as lisp, which really generated interest. i'd never looked into forth properly, it was little beyond a name and vague association with RPN 13:24:31 did you check out factor? 13:25:20 decided to begin with Forth before even looking at Factor. 13:25:48 ah. 13:28:00 I'm not sure they have much in common any more, beyond the RPN syntax 13:28:25 It's a primary language for me, zpg. 13:28:51 I use it for desktop apps, web scripting, etc. Not exclusively, of course, but if I have a choice. 13:28:57 interesting. 13:29:22 how's library support, ipc, etc? 13:29:37 Depends on the task at hand, and the Forth in question. 13:30:12 oh sure; but i take it you use a particular set of tools do achieve the scripting and app writing.... 13:30:47 I have yet to run into anything I wanted to do that I couldn't. I've used SwiftForth and Win32Forth under Windows. 13:31:19 im using isforth on this contract :) 13:31:24 hehe 13:31:37 --- quit: timlarson_ ("Leaving") 13:32:08 anyone tinkering with OSX + Forth (other than firmware)? 13:32:23 though i guess X11/Unix would work fine too, which is handy. 13:33:35 Not that you're necessarily leaning this way, but I recommend learning the language first, how to think in Forth, before worrying about how to take over the world with it. The techniques you'll learn will make you a better programmer in any language. 13:34:24 i agree and take the advice on board. 13:34:30 :) 13:34:51 as i say, at one level i'm simply engaged with the language-as-a-language, not a means but an end. 13:35:06 just intrigued to scout out how people in #forth are using the language in 2006. 13:35:08 I mention it only because I've seen quite a few newcomers who look at some distant target, don't see the specific library linkage they think they'll need, and so decide not to learn it. 13:35:19 * zpg nods 13:35:30 then opt for C(++) instead 13:35:43 Well, perhaps they were just looking for an excuse not to have to make the effort. 13:36:01 this is possible 13:36:05 "i hear forth can do this ..." 13:36:36 I've fielded any number of "can Forth interface with "? 13:36:43 it's also important, i think, to give a new language a chance, especially where there's paradigm shift (e.g., C->Smalltalk, Smalltalk -> Lisp) 13:37:21 Learning different languages is helpful, particularly when they're not all Algol-68 variants. 13:37:25 didn't mean to come across as tedious; as i say, just inquisitive about usage today 13:37:35 No, you're not coming across that way. 13:37:39 :) 13:37:59 i'm particularly fond of smalltalk and lisp which might indicate where i'm coming from re: forth 13:38:27 The Lisp will give you a head-start. 13:39:05 and #6 will give me a headache :) 13:39:13 Heh. 14:02:27 * zpg has installed isforth on the linux box 14:02:33 something to play with over ssh from work tomorrow :) 14:17:32 ok this postfix stuff is beginning to look very neat 14:17:49 http://home.iae.nl/users/mhx/sf4/sf4.html, definition of /check 14:32:44 What peaks your interest about /check ? 14:34:15 other than that the stack comment is wrong :) 14:34:35 hmm? 14:35:07 Quartus: definition of /check in the link provided; the ability to offer either an operator or a drop word is pretty striking 14:35:13 should be ( numerator denominator -- quotient ) 14:36:55 good point 14:37:09 got a question regarding ?dup 14:39:05 ask away 14:39:39 the equivalence of ": /CHECK DUP IF / ELSE DROP THEN ;" and ": /CHECK ?DUP IF / THEN ;" is mentioned. but doesn't IF check the top of the stack for truth? so in the case of ?dup, which doesn't duplicate false literals: where does IF look to recognise FALSE? 14:39:49 the return stack? (<--- wild guess) 14:39:57 nothing so complicated 14:40:20 if it's 0, then ?DUP leaves it alone 14:40:25 and then IF eats it 14:40:25 And then IF eats it. 14:40:31 ahhhhhhhhh 14:40:31 so you don't need a DROP. 14:40:32 Heh. 14:40:36 genius 14:40:49 Personally I prefer not using ?DUP, the first method is clearer on later examination. 14:41:01 i i think managed to forget the original purpose of the DUP in the course of trying to work that one out. 14:41:02 likewise 14:41:17 There's also an inherent conditional in ?DUP, so it's not an optimization in that regard. 14:41:30 thanks for the help 14:41:34 np 14:42:05 btw - is this channel usually quite active? 14:42:28 no 14:42:54 not unless someone (e.g. you) comes along with questions :) 14:43:42 heheh 14:44:11 as i say, the help is appreciated 14:44:32 Or PoppaVic issues a monologue like hte one he did this morning. 14:55:30 --- quit: Snoopy42 () 14:55:37 --- quit: I440r ("Leaving") 14:56:44 --- join: Amanita_Virosa (n=jenni@adsl-65-68-75-51.dsl.hstntx.swbell.net) joined #forth 15:04:47 time to get some kip, cheers for now guys 15:04:49 --- quit: zpg ("night") 15:06:15 good evening 15:06:34 my 0; word solves the above problem... 15:06:42 : /check 0; / ; 15:07:03 0; drops and exits if tos is zero. and does nothing otherwise 15:07:24 hi crc :) 15:09:31 two-level exit? that's not standard forth ;-) 15:12:46 --- join: Snoopy42 (i=snoopy_1@dslb-084-058-152-145.pools.arcor-ip.net) joined #forth 15:13:16 two level? 15:13:17 segher: is that a problem? 15:13:44 exiting not only from the current definition, but from the caller, too 15:15:24 you could implement it like that 15:16:14 or : 0; postpone dup postpone 0if postpone drop postpone exit postpone then ; immediate 15:16:32 or the two level exit: : 0; dup if exit then drop rdrop ; 15:17:01 ah yes, you can always make it a macro, sure 15:29:36 --- quit: Amanita_Virosa ("wemp.") 16:10:54 --- quit: nighty (Read error: 104 (Connection reset by peer)) 16:28:35 --- quit: Cheery ("Leaving") 17:28:19 --- quit: Hobart (Remote closed the connection) 17:44:22 --- quit: tathi ("leaving") 18:56:34 --- quit: uiuiuiu (Remote closed the connection) 18:56:38 --- join: uiuiuiu (i=ian@dslb-084-056-234-126.pools.arcor-ip.net) joined #forth 19:33:43 * ayrnieu fails at life :-( 19:39:25 --- join: Hobart (i=jb@jb.org) joined #forth 19:45:05 more specifically, at debugging this. 19:55:37 if anyone would like to help, http://sagacity.merseine.nu:8080/misc/nopaste.tgz contains a test and test data and the application and the libraries it uses. The problem I see is that the question-structure gets corrupted, somehow, so that the test provided will display the question, the first choice, the second choice, and then fail on the third choice. 19:56:19 and I've traced I think most parts of the system, and still can't see why this happens. 19:56:55 I'm going to do something else for a while, before coming back to run with answer D :-/ 20:00:24 (the stack-effects for A and ANS are wrong; they leave quiz% on the stack) 20:06:02 .q seems wrong... it does dup before calling q$@ which uses pick... looks bad 20:06:52 stackarry.fs's PICK , rather, which is ( u a -- x ) 20:07:06 oh ah 20:07:17 redefining standard words, bad boy 20:07:32 next thing you'll tell me you redefined 0 too :-) 20:08:27 PICK and DROP and DEPTH , but just in the context of stackarray -- so, that file and the indented part at the beginning of quiz.fs 20:10:14 tricky 20:11:58 what does "allocate" do? 20:12:26 ( u -- a ) ? 20:13:10 ANS Forth for dynamic allocation. Pretty much that: ( u -- a-addr wior ) , where wior is consumed by THROW 20:13:23 ah yes 20:13:54 i normally write in OF, which has alloc-mem instead, which throws by itself 20:14:14 stackarray's are doubly-indirect to account for RESIZE being able to return a new addressc 20:14:29 right 20:18:10 well i guess i don't see it 20:18:15 the problem, that is 20:18:31 but boy this looks worse than ioccc :-) 20:19:00 aw, it can't be that bad. Except by definition, since it includes a very difficult to spot bug. 20:20:31 well it has a few too many not-so-obvious-to-me abstractions 20:20:41 "new" should call align btw 20:21:03 though i doubt that is your bug, seems to work fine the way it's called 20:21:39 "swap DROP" means use the standard "drop"? 20:21:51 *nod*, I figure now that the problem is in Quiz::UI or that first indented portion of quiz.fs 20:22:08 "swap drop" is called "nip" 20:22:13 no, that's the drop defined in stackarray.fs 20:22:33 ah okay 20:22:40 why in capital then? 20:22:44 less obviously a warning, in retrospect, with the local PICK right in front :-/ 20:24:32 nice test question heh 20:25:22 esp. the correct answer ;-) 20:37:12 --- join: segher_ (n=segher@dslb-084-056-132-071.pools.arcor-ip.net) joined #forth 20:37:45 got disconnected 20:38:00 [05:33] segher resize ( a size -- a' ior ) and it resizes to "size" bytes? 20:38:00 [05:35] segher try : plumb ( a -- ) dup @ dup @ 1+ cells resize throw swap ! ; in that case 20:40:39 ayrnieu: ? 20:44:54 --- quit: segher (Read error: 110 (Connection timed out)) 20:52:15 (in that case, what?) 20:52:49 does resize do what i think it does? 20:53:03 if so, add that 1+ in plumb 20:53:15 yes, it does that 20:53:25 oh, didn't see your 'try' 20:53:33 heh 20:53:43 why the 1+ ? 20:54:02 because you actually need storage for n+1 cells 20:54:13 first cell itself contains the # items 20:54:21 the n 20:55:07 and "push" for example wants to store in cell number n 20:55:19 so you better have space for n+1 cells :-) 21:00:34 thanks, I think some confusion comes simply from keeping that number in dynamic memory 21:01:09 yeah, should have put that with the main pointer, in normal data space 21:01:32 it's a single number, doesn't need resizing ;-) 21:02:23 : new ( -- a ) align here 0 dup , allocate throw , ; <-- looks better already :-) 21:03:03 align here 0 , 0 allocate throw , 21:03:18 no need for the dup heh 21:03:28 pointer first is easier i guess though 21:03:43 align here 0 allocate throw , 0 , 21:04:03 mm, yeah 21:04:21 you always need the pointer, you don't always need the # 21:04:52 but yeah, looks simpler definitely 21:08:35 so did it work with the 1+ :-) 21:08:54 no change with that :-/ 21:10:05 heh i can test it myself 21:10:09 it's just gforth 21:10:20 it does change, it prints all questions now 21:10:29 crashes on printing the answer though 21:10:58 it used to print gibberish for the questions 21:11:01 oh? hm. 21:13:02 change .q to read ans@ ccount type 21:13:10 and it runs all the way through 21:13:41 what do i win? 21:14:11 the satisfaction of knowing that you beat your competitors! :D Also, thanks. 21:14:23 :-) 21:14:29 my pleasure 21:15:06 huh? why are you allocating a memory block with zero size/ 21:15:07 ? 21:15:32 can you give a 0 pointer to "resize"? 21:15:35 to have something to resize later 21:15:48 oh 21:16:55 stackarray.fs isn't the goal, really; I didn't even have it in my first iteration. I just noticed that I had two similar data structures with some header information and then an arbitrary number of cells ... 21:20:11 sure, such an abstraction can reduce the number of bugs you have -- once you get the abstraction implemented correctly ;-) 21:22:14 yow, I just realized that I put . at the end of my gforth search path, so my test keeps inexplicably giving me the same answer... because I'm editing nopaste/ files and not ~/forth/lib/ files. 21:22:45 heh 21:23:01 with that change, my new saner stackarray.fs also works 21:25:46 yay, now I can move on to do something useful. 21:26:07 have fun! 21:27:27 (for the curious, I updated that nopaste.tgz the aforementioned rewrites) 21:33:42 ahh, there's what's getting at me 21:34:03 it seems funny to allocate that little struct with the two cells, one of which points to a memory block. 21:34:12 (I'm guessing the first might be a count) 21:34:31 why not store that first cell in the memory block, then your data is in one piece 21:34:56 you could do: 21:35:21 : new ( -- addr ) 0 4 allocate throw dup ! 4 + ; 21:35:28 oops 21:35:44 : new ( -- addr ) 4 allocate throw 0 over ! 4 + ; 21:35:55 (that's what I did, initially. It just confused me.) 21:36:32 I need redirection, anyway, to account for resize. 21:37:09 indirection 21:37:18 ok 21:37:23 yes. 21:37:48 my approach to movable data is to keep an array of pointers 21:38:05 and reference the data by the array index 22:19:51 --- quit: Ray_work (Read error: 113 (No route to host)) 23:59:59 --- log: ended forth/06.06.28