00:00:00 --- log: started forth/06.12.01 00:16:07 --- nick: arke_ -> arke 00:35:29 --- join: ecraven (n=nex@eutyche.swe.uni-linz.ac.at) joined #forth 00:59:57 --- join: neceve (n=claudiu@unaffiliated/neceve) joined #forth 03:00:55 --- quit: cmeme (Remote closed the connection) 03:01:03 --- quit: Cheery ("Download Gaim: http://gaim.sourceforge.net/") 03:02:55 --- join: Cheery (n=Cheery@a81-197-54-146.elisa-laajakaista.fi) joined #forth 04:22:17 --- join: zpg (n=user@user-514d7663.l2.c2.dsl.pol.co.uk) joined #forth 04:29:02 --- quit: Cheery (Read error: 110 (Connection timed out)) 04:48:09 Hey. 05:00:34 Hi Quartus, up late? 05:00:43 Early 05:01:08 Ah ok. How's it going? 05:01:29 Not too bad. How are things there? 05:02:23 Pretty reasonable thanks. Lacking in caffeine, ought to go and make an Ethopian medium brew in a few minutes. 05:02:54 Wrote this as an example for Razor-X last night: http://forth.pastebin.ca/263146 05:05:38 That's pretty neat. 05:05:46 I thought it came out pretty well. 05:05:54 You're using "here" as a temporary storage area? 05:06:08 He was, in his code, so I carried on with that so he could follow. 05:06:10 --- join: Raystm2 (n=NanRay@adsl-68-93-115-120.dsl.rcsntx.swbell.net) joined #forth 05:06:23 I wouldn't normally. 05:06:28 I see. 05:06:29 Hi Razor-X 05:06:35 erm, Raystm2 05:07:07 : go ( c-addr u -- ) open begin read while display repeat close ; is neat, though. :) 05:07:14 i agree 05:07:25 would you normally use a variable for this situation to enable such clean concatenation? 05:07:29 i.e. fid 05:07:57 Yes, I'd store the incoming character in allocated space, likely create c 1 chars allot or similar. 05:08:46 * zpg nods 05:08:58 but for the file id? 05:09:36 Depends on the situation. Again, he did, so I carried it on. This is a very simple example that reads from one file; if I were reading from many I'd want to approach it differently. 05:09:47 of course. 05:10:26 My initial approach would likely be open >r begin r@ read while display repeat r> close ; or similar. 05:10:39 yep 05:10:54 Nothing wrong with storing a filehandle in a named variable, though. Probably a good idea. 05:12:18 of course. 05:12:38 input = open(...) 05:12:49 Sure. 05:13:37 But yes -- the example code looks really nice. 05:13:56 The original: http://forth.pastebin.ca/263121 05:14:47 Ouch. 05:15:21 Well, truth be told I've seen worse. It's illustrative of the conceptual gap, though. You can feel the C in the original. :) 05:16:10 Yeah. 05:18:06 Right, time for that coffee :) 05:18:09 His code does a . rather than an emit. 05:18:17 Yes, coffee, good thought. Perhaps I'll venture out. 05:25:22 --- join: virl (n=virl@62.178.85.149) joined #forth 05:26:26 --- join: Cheery (n=Cheery@a81-197-54-146.elisa-laajakaista.fi) joined #forth 05:26:49 Mine's brewing now :) 05:27:49 --- quit: segher (Nick collision from services.) 05:28:00 --- join: segher (n=segher@dslb-084-056-193-056.pools.arcor-ip.net) joined #forth 05:30:53 I did up Knuth's TPK program in Forth, submitted it to the guy who maintains a page of 'em, but he hasn't posted it. 05:30:53 http://forth.pastebin.ca/263119 05:31:13 http://www.cs.fit.edu/~ryan/compare/ 05:32:50 Is it me, or is there something missing from this Pascal version? http://www.cs.fit.edu/~ryan/compare/tpk.p 05:35:18 my brief test: http://forth.pastebin.ca/263355 05:35:56 http://forth.pastebin.ca/263357 <-- better 05:36:54 --- join: timlarson_ (n=timlarso@65.116.199.19) joined #forth 05:37:02 Better yet would be to use read-file to read the entire file into memory. 05:37:11 * zpg nods 05:37:29 I just thought I'd try amending the code to iteratively store to here 05:37:51 A nice little test. 05:38:19 --- nick: Raystm2 -> nanstm 05:38:44 here dup fid @ file-size throw fid @ read-file type or similar would do the trick 05:39:15 add a throw in there after read-file 05:39:43 Quartus: http://www.cs.fit.edu/~ryan/compare/ "Last modified: Mon Jun 9 14:14:14 EDT 2003" 05:40:12 I see that. I wrote him about the Forth version, he said he might take a look. 05:40:25 Ah ok, that's good to hear. 05:41:30 Heh, yes that Pascal code seems ... brief. 05:41:38 Rather. 05:42:31 it's about as long as the lisp version 05:48:02 : size ( -- u ) fid @ file-size throw drop ; 05:48:02 : inhale ( -- c-addr u ) size dup allocate throw tuck swap fid @ read-file throw ; 05:48:02 : go1 ( c-addr u -- ) open inhale type close ; 05:48:12 a first attempt 05:49:08 inhale should have an exhale :-) 05:49:16 heh 05:51:41 variable breath : slurp inhale ; : inhale slurp dup breath ! ; : exhale breath @ free throw ; 05:51:42 http://forth.pastebin.ca/263366 05:51:58 :) 05:55:34 : size ( -- u ) fid @ file-size throw drop chars ; for portability 05:55:44 or better, before the allocate 05:58:42 Of course my code doesn't bother to free the allocate, etc. 06:05:03 http://forth.pastebin.ca/263379 06:05:11 One of these days I'll stop auto-naming them all 'Improved TPK'. 06:06:11 --- quit: ecraven ("bbl") 06:09:57 Moved 'size' up with the other fid words: http://forth.pastebin.ca/263383 06:12:16 --- join: Ray_work (n=Raystm2@199.227.227.26) joined #forth 06:12:59 Good morning. 06:13:04 Hi Ray_work. 06:13:39 Say Quartus. Having a pleasant morning, i trust? 06:13:47 Hanging in. you? 06:14:48 Just crankin' things up here. 06:15:46 "When you're going no where, why run" <-- John Jones, Accounts Payable/Receiveable Casters of Fort Worth. 06:16:07 Any relation to Jim Jones, the koolaid guy? 06:16:31 There _is_ a strong family resemblance... 06:18:03 The last paste had a flaw -- if chars is not 1, it'd fall over. This is a fix, I believe. http://forth.pastebin.ca/263393 06:18:57 actually now there's a different flaw along the same lines. Ok, coffee, return later. :) 06:20:29 I faintly hope this resolves it. More later. :) http://forth.pastebin.ca/263394 06:21:34 * Ray_work checks link. 07:13:45 reHi 07:13:47 It's Friday! 07:13:54 That it is. 07:14:48 what on earth? http://groups.google.com/group/comp.lang.forth/msg/4e2e5d74d8a46ee6 07:20:13 I've read that before. Don't know where i've seen it... 07:22:25 Ah yes, I've seen it when I was a Pythoneer. 07:22:57 "... unless you're Dutch." triggered the memory. 07:23:06 The Python one, sure. The reply on the other hand is rather odd. 07:23:07 I should hope :-) 07:23:36 Speaking of Guido's baby: http://www.niallkennedy.com/blog/archives/2006/11/google-mondrian.html 07:26:22 Ray_work: did you like Python? 07:32:25 Yes, indeed, I did. But before Python, my only real programming experiance was mostly BASIC. 07:32:43 How about yourself? 07:33:57 --- join: erider (n=erider@unaffiliated/erider) joined #forth 07:39:27 --- join: timlarson__ (n=timlarso@65.116.199.19) joined #forth 07:53:53 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 07:53:53 --- mode: ChanServ set +o tathi 08:01:49 --- quit: timlarson_ (Read error: 110 (Connection timed out)) 08:30:26 --- join: crest_ (n=crest@p54895EC7.dip.t-dialin.net) joined #forth 08:35:22 --- join: marble (n=glass@cpc1-bolt6-0-0-cust18.manc.cable.ntl.com) joined #forth 08:39:30 --- quit: Crest (Read error: 110 (Connection timed out)) 08:46:24 --- join: timlarson___ (n=timlarso@65.116.199.19) joined #forth 09:02:31 --- quit: crest_ ("Leaving") 09:04:45 --- quit: timlarson__ (Read error: 110 (Connection timed out)) 09:06:17 --- join: Shine (n=Frank_Bu@xdsl-84-44-235-87.netcologne.de) joined #forth 09:25:37 --- join: I440r (n=spam@70.102.202.164) joined #forth 09:25:55 tathi! 09:25:56 hi :) 09:26:03 --- mode: ChanServ set +o I440r 09:26:05 hi 09:26:28 I440r erider tathi hi 09:26:45 hi Ray_work 09:27:00 FRI! DAY! 09:27:02 Hi I440r 09:27:12 hi all 09:27:15 * tathi is done with that farming thing for now 09:27:18 heh 09:27:26 no more milking bulls ? 09:27:32 lol 09:28:00 I still like farming, but I'm glad to be done with that particular farm :) 09:28:24 :) 09:40:02 --- join: timlarson__ (n=timlarso@65.116.199.19) joined #forth 09:50:28 --- quit: neceve (Remote closed the connection) 09:57:05 --- quit: timlarson___ (Read error: 110 (Connection timed out)) 10:10:23 --- quit: erider (Read error: 110 (Connection timed out)) 10:18:15 --- join: erider (n=erider@unaffiliated/erider) joined #forth 10:43:07 --- join: timlarson___ (n=timlarso@65.116.199.19) joined #forth 10:48:00 --- join: timlarson_ (n=timlarso@65.116.199.19) joined #forth 10:51:14 --- quit: timlarson__ (Read error: 145 (Connection timed out)) 11:03:06 --- join: Snoopy42_ (i=snoopy_1@dslb-084-058-112-107.pools.arcor-ip.net) joined #forth 11:05:54 --- quit: timlarson___ (Read error: 110 (Connection timed out)) 11:11:29 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 11:11:52 --- join: timlarson__ (n=timlarso@65.116.199.19) joined #forth 11:11:53 --- nick: Snoopy42_ -> Snoopy42 11:15:18 --- join: timlarson___ (n=timlarso@65.116.199.19) joined #forth 11:21:28 --- quit: timlarson__ (Read error: 60 (Operation timed out)) 11:29:48 --- quit: timlarson_ (Read error: 110 (Connection timed out)) 11:30:05 any excitement? 11:34:36 --- quit: Shine (Nick collision from services.) 11:34:40 --- join: Shine_ (n=Frank_Bu@xdsl-84-44-225-172.netcologne.de) joined #forth 11:34:53 --- nick: Shine_ -> Shine 11:35:56 --- join: erider_ (n=upirc@unaffiliated/erider) joined #forth 11:36:03 test 11:39:24 --- join: timlarson__ (n=timlarso@65.116.199.19) joined #forth 11:50:22 --- join: timlarson_ (n=timlarso@65.116.199.19) joined #forth 11:56:36 --- quit: erider_ ("Leaving") 11:58:02 --- quit: timlarson___ (Read error: 110 (Connection timed out)) 12:01:15 --- quit: I440r (Read error: 110 (Connection timed out)) 12:06:32 --- quit: timlarson__ (Read error: 110 (Connection timed out)) 12:37:49 --- join: mark4 (n=spam@70.102.202.164) joined #forth 12:44:01 --- join: neceve (n=claudiu@unaffiliated/neceve) joined #forth 12:47:13 --- join: timlarson__ (n=timlarso@65.116.199.19) joined #forth 12:50:24 --- join: snowrichard (n=richard@12.18.108.162) joined #forth 13:01:54 --- quit: timlarson_ (Read error: 110 (Connection timed out)) 13:06:46 hello 13:07:00 hey 13:08:00 tested the video capture thingy today. 13:09:04 how'd that go? 13:09:56 the tape we used only had about 40 seconds of video that we wanted. It was an old video of my son when he was three. 13:11:24 it captures the videos then you can arrange the clips on a storyboard and then make the disc. 13:13:28 the video also works as a webcam in the chat programs, so I guess you could broadcast tapes. 13:13:54 --- join: twobitsprite (n=someonee@cpe-075-177-191-014.nc.res.rr.com) joined #forth 13:14:36 just out of curiosity, why does CASE in gforth need the default case to leave the stack unmodified? 13:18:07 --- join: slava (n=slava@CPE0080ad77a020-CM000e5cdfda14.cpe.net.cable.rogers.com) joined #forth 13:18:07 --- mode: ChanServ set +o slava 13:24:33 twobitsprite, ENDCASE expects the case selector to be there; it discards it. 13:24:57 I see 13:30:29 --- quit: Cheery ("Download Gaim: http://gaim.sourceforge.net/") 13:31:35 --- quit: timlarson__ ("Leaving") 13:43:23 --- quit: snowrichard ("Leaving") 13:48:56 --- quit: twobitsprite (Read error: 110 (Connection timed out)) 15:17:40 --- quit: Ray_work (Read error: 104 (Connection reset by peer)) 15:25:48 --- part: erider left #forth 15:31:26 --- join: twobitsprite (n=someonee@cpe-075-177-191-014.nc.res.rr.com) joined #forth 15:31:44 hi again :) 15:31:48 Hey. 15:32:02 I can't find any information on this: does gforth optimize tail calls? 15:32:02 hi qau 15:32:07 hi Quartus 15:32:34 Hi slava! 15:32:40 (I'm assuming that because I can't find any information that it must not...) 15:32:49 twobitsprite, if it does, I'm sure it varies by the engine. What do you need it for? 15:32:57 recursion 15:33:15 and, I'm asking specifically about gforth... 15:33:22 Yes, gforth ships with more than one engine type. 15:33:26 (unless you meant something different by engine...) 15:33:29 ahh 15:33:34 Are you looking for tail recursion, or tail call elimination? 15:33:45 aren't they one and the same? 15:34:16 No. One optimization of : foo ... recurse ; is to have the recurse branch to the beginning of foo. Another optimization is : bar ... ; : foo bar ; where the call to bar is replaced by a branch. 15:34:43 They are akin to one another, but not the same thing quite. 15:35:03 Which one are you seeking? 15:35:07 I would imagine that in the second case, you would have the call to bar boil down to a jump instruction, much like in the first example... 15:35:49 I am asking which one you're after for a reason. 15:35:50 well... mostly tail-recursion... but I still don't see how they would be different... is there a way I can see the assembly of my programs when I compile them, or is there no asm step? 15:36:14 gforth is direct threaded 15:36:16 What is generated depends on the engine, again. SEE is available. 15:36:40 0.6.2 ships with ditc, itc, and whatever 'fast' comes out to. 15:36:59 ditc..? 15:37:14 : foo ... recurse ; is identical to : foo begin ... again ; so you can use that directly, or extend : and write a tail-recurse word. 15:37:17 slava: I'm not sure I know what you mean by "direct threaded" 15:37:36 factor does full tail call optimization! 15:38:03 is factor like forth? 15:38:16 its stack based 15:38:17 Only if you kind of squint. 15:38:29 hmm... I might have to check it out 15:38:38 --- mode: ChanServ set +o arke 15:38:42 I'm really starting to like the simplicity of stack based languages... 15:39:46 btw... do the pairs "if ... then" and "begin again" have to be properly nested? I.e. can I do "begin ... if again then"? 15:39:46 tail-call optimization is present in many implementations. 15:40:03 You can't interleave them that way, not portably. 15:40:39 right on... well, thank again! :) 15:40:58 (have to go... fiance want's to go out...) 15:41:05 later 15:41:14 It's possible to modify Gforth such that you have one control-flow stack for forward branches, and one for reverse, but you'd be writing extremely non-portable code. 15:41:19 Ok. 15:41:31 --- quit: twobitsprite () 15:45:14 I wish such queries would start with what they're trying to do, rather than asking for some specific and peculiar way to accomplish the unstated. 15:49:59 hehe 15:54:03 relying on tail-recursion optimization is a clumsy way to write a non-terminating loop. 15:54:25 in forth, yes, because you have looping constructs in the language 15:54:42 in factor, all looping constructs are really words taking code blocks on the stack, and at some level they're tail recursive 15:55:04 right. And begin ... if again then is Begin ... Until. 15:55:58 Sure, in absence of actual branching words, you'd have no choice to handle everything via recursion. 15:56:16 you mean looping words? 15:56:22 i have conditionals which are primitive to the runtime 15:56:27 i see no other way to implement them 15:58:47 I mean if you have no begin/again, begin/until, begin/while/repeat, if/else/then. 15:59:19 i have if 15:59:23 takes a boolean and a pair of code blocks 15:59:31 your only option would be recursion, with the hope of optimization. As you say, not Forth. 16:00:27 tail call optimization is trivial to implement though. 16:01:38 I'm not arguing that. Just saying that a desire to write begin ... if again then bespeaks a lack of understanding of the techniques and tools available. 16:01:49 indeed 16:03:02 I have encountered more than one beginner to whom it was a revelation that tail-recursion is equivalent to an unconditional branch to the start of the code block. 16:07:56 i dont consider that recursion myself, its just a begin again 16:09:55 yes. But if it's coded as : foo ... recurse ; and then optimized to : foo begin ... again ; it's tail-recursion optimization. Semantics. 16:23:34 Quartus: a tail recursion can be conditional 16:23:45 : foo blah if ... foo else ... then ; is a tail recursion 16:26:19 sure. 16:29:21 then is non-code-generating in every implementation I'm familiar with. 16:34:41 i can't think of a reason then would generate code. 16:34:44 perhaps it does in lse64 :) 16:34:57 heh 16:35:28 --- quit: mark4 (Read error: 110 (Connection timed out)) 16:42:49 --- nick: nanstm -> Raystm2 16:43:57 THEN doesn't patch the jump from IF, or if it does how does it do it without generating code. Don't answer this. This is suddenly homework. 16:51:19 --- join: nighty_ (n=nighty@sushi.rural-networks.com) joined #forth 17:09:31 --- part: zpg left #forth 17:14:54 --- quit: Razor-X (Remote closed the connection) 17:24:05 --- join: Razor-X (n=user@user-11faaoj.dsl.mindspring.com) joined #forth 18:40:25 Hey. Back at home base. 19:04:32 --- quit: tathi ("leaving") 20:44:31 --- quit: marble (".") 20:48:05 --- quit: virl (Remote closed the connection) 21:40:11 --- join: arke_ (n=Chris@pD9E07331.dip.t-dialin.net) joined #forth 21:47:46 --- quit: arke (Read error: 60 (Operation timed out)) 21:58:39 --- join: twobitsprite (n=someonee@cpe-075-177-191-014.nc.res.rr.com) joined #forth 21:59:33 would it be wrong to ask questions about Joy in here? (I know the rule about meta-questions, but some people can be topic nazis) 21:59:52 and a variety of technical subjects. <-- It's in the topic 22:00:28 I doubt you'll find much on Joy. 22:00:33 Razor-X: heh, thanks 22:00:48 Quartus: that's what I'm discovering, actually... 22:01:07 you'll likely have better discussion in #concatenative 22:01:14 a minor variant, now apparently deceased. 22:01:57 aye, but #concatenative will also try to get you to use Factor, which should be similarly interesting. 22:02:19 yeah, I've heard of factor... 22:04:47 these also class as variously Forth-reminiscent languages: postscript, [User|Sys]RPL, REBOL, slang, some muck language. 22:07:38 also cat. 22:08:52 slava - do you have a URL for that? 22:09:36 http://www.cat-language.com/ 22:11:30 ah, interesting. 23:22:42 --- quit: slava () 23:32:00 --- quit: twobitsprite () 23:33:37 --- quit: Shine (Nick collision from services.) 23:33:41 --- join: Shine_ (n=Frank_Bu@xdsl-81-173-248-101.netcologne.de) joined #forth 23:33:54 --- nick: Shine_ -> Shine 23:59:59 --- log: ended forth/06.12.01