00:00:00 --- log: started forth/06.12.05 00:44:25 --- join: ecraven (n=nex@eutyche.swe.uni-linz.ac.at) joined #forth 00:51:26 --- quit: arke (Read error: 110 (Connection timed out)) 01:06:18 --- join: arke (i=Chris@x275.vpn.hrz.tu-darmstadt.de) joined #forth 01:06:18 --- mode: ChanServ set +o arke 01:06:22 --- quit: arke (Read error: 104 (Connection reset by peer)) 01:06:34 --- join: arke (i=Chris@x275.vpn.hrz.tu-darmstadt.de) joined #forth 01:06:34 --- mode: ChanServ set +o arke 02:28:04 --- quit: arke (Read error: 110 (Connection timed out)) 03:36:14 --- quit: ellisway (Read error: 104 (Connection reset by peer)) 03:48:20 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 03:48:21 --- mode: ChanServ set +o tathi 03:55:15 --- quit: JasonWoof ("off to bed") 04:38:45 --- join: zpg (n=user@user-514d7663.l2.c2.dsl.pol.co.uk) joined #forth 04:41:53 Hi. 04:43:37 hi 05:05:10 --- quit: tathi ("leaving") 05:05:19 hi. 05:05:32 hey Raystm2 05:05:34 Leaving for work. Have a great day! :) 05:05:40 You too. 05:05:46 Or, I suppose you already are. :) 05:05:54 heh, 1pm 05:24:03 --- nick: Raystm2 -> nanstm 05:33:29 --- join: ellisway (n=ellis@host-87-74-241-174.bulldogdsl.com) joined #forth 05:44:09 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 05:44:09 --- mode: ChanServ set +o tathi 06:09:02 --- join: Ray_work (n=Raystm2@199.227.227.26) joined #forth 06:09:34 Good morning. 06:12:52 --- quit: segher (Nick collision from services.) 06:13:01 --- join: segher (n=segher@dslb-084-056-181-192.pools.arcor-ip.net) joined #forth 06:55:14 --- quit: Zarutian (Read error: 104 (Connection reset by peer)) 07:13:23 --- join: Zarutian (n=Zarutian@194-144-84-110.du.xdsl.is) joined #forth 07:36:26 --- quit: ecraven ("bbl") 07:38:36 --- join: Raystm2 (n=NanRay@adsl-68-93-115-175.dsl.rcsntx.swbell.net) joined #forth 07:53:29 --- quit: nanstm (Read error: 110 (Connection timed out)) 07:57:44 --- join: Razor-X` (n=user@user-11faadf.dsl.mindspring.com) joined #forth 08:06:23 --- join: virl (n=virl@chello062178085149.1.12.vie.surfer.at) joined #forth 08:06:47 --- nick: Raystm2 -> nanstm 08:12:35 --- quit: Razor-X (Read error: 110 (Connection timed out)) 08:48:19 --- join: rabbitwhite (n=Miranda@136.160.196.114) joined #forth 08:48:50 Hi rabbitwhite. 08:49:10 hey 08:49:18 Where were you yesterday? :) 08:49:26 I was taking a beating in hear over colorForth. 08:49:36 You might have liked to beat on me as well. :) 08:49:50 in here actually, 08:49:52 what did you say something especially offesnive about it? 08:49:53 :) 08:50:02 No, I was on the defence. 08:50:05 oh 08:50:14 i'm confused 08:50:14 --- join: neceve (n=claudiu@unaffiliated/neceve) joined #forth 08:50:22 why were you taking a beating 08:50:32 Because, I like to use it. 08:50:40 No one else does. 08:51:15 To be honest, most of my competition have never ever used it. 08:51:34 i didnt know other forth programmers frowned on it so much 08:51:42 --- join: snowrichard (n=richard@12.18.108.162) joined #forth 08:53:27 But to be fair, they are an experianced bunch, just not with colorForth. 08:53:44 it's not really useable 08:54:06 neither is windows but people continue to use it 08:54:19 rewritting it from scratch would make sense.. 08:57:02 how do you know, how much do you know about it 09:08:30 Got a tad busy there. 09:08:53 if I had any intention of ever using it, I would certainly rewrite it from scratch 09:09:02 why??? 09:09:24 well, maybe not totally from scratch 09:09:28 Ya, colorForth is to Forth as Forth is to ( pick favorite languages here ) in terms prejudice. 09:09:57 rabbitwhite: have you read the asm code? it's ugly. 09:10:45 really? i disagree, i think it's fairly neat and organized. 09:11:09 he did everything he could to simplify the process of programming it, for himself 09:11:19 thats why there are certain strange things about it, such as the short label names 09:11:25 --- quit: neceve (Remote closed the connection) 09:11:26 ok, never mind then 09:11:34 * tathi goes back to doing something productive 09:11:54 good, arguing about colorforth isn't productive 09:13:54 --- quit: crest_ (Read error: 60 (Operation timed out)) 09:14:58 let me know if you get my PM's Ray 09:18:06 understanding colorforth is like understanding a machine without a manual 09:19:25 so what youre really critiquing is its lack of a manual, not the design or makeup of the mechanism itself 09:19:32 and when I need to do that I prefer it much more to rewrite it completly from scratch, which has the plus that I have all the features colorforth is missing 09:19:55 can i say something in response to that? 09:19:56 a little bit I critize it's design 09:20:31 "features", to use the modern term, are like laws 09:20:35 its easy to add them 09:20:48 there isn't something like modularity and that is something I hate. 09:20:56 but people forget that adding functionality to a program is really expanding its rule set 09:20:59 in colorforth? no forget it, it's not. 09:21:10 wait let me finish 09:21:26 give it up 09:21:44 neither of you are going to change your minds 09:21:49 what you have in colorforth is an example of a system that works in the sense that Chuck Moore invented it to solve a specific problem that he both discovered and solved through cloistered iterative exploration 09:22:02 and part of the sollution was that it had the minimum word set 09:22:26 ok, first of all, it doesn't have "the minimum word set" 09:22:31 chuck moore talks alot about custom silicon and custom software, which i respect alot 09:22:32 that would be like 3 words 09:22:47 well, i'm talking about in terms of the problem 09:22:50 in a practical sense, there is no "minimum word set", it's just a question of what you decide to do without. 09:23:00 i'm not talking about THE Minimum Wordset 09:23:04 there is no THE Minimum Wordset 09:24:21 what i dont understand is when people say that colorforth is "missing things" when they dont understand the problem colorforth was intended to solve yet 09:24:33 yeah, it was intended to be a core for OKAD 09:24:45 anything other than that, it pretty much sucks for. 09:24:48 --- quit: snowrichard ("Leaving") 09:24:51 everybody knows that 09:25:04 but if you understand the CAD problem maybe you can come to understand colorforth a little more 09:25:16 here's hoping that cm releases okad 2 eventually 09:25:35 I understand colorforth just fine 09:25:38 what i'm saying is solutions aren't all about programming "computer services" to solve them all the time 09:25:52 well if you are satisfied with your understanding then everything i'm saying is irrelevant to you 09:26:00 I'm just saying that it has some dumb design decisions 09:26:09 which make it unnecessarily hard to maintain and upgrade 09:26:14 ok, let's hear about those 09:26:21 i am excited to discuss cf 09:26:50 ok, hang on, let me go take a look through my source 09:26:58 I didn't keep a list when I was disassembling it 09:28:59 I don't like that a bunch of stuff is in "forth" code with raw x86 opcodes. 09:29:24 they're written in assembly language, the source should express that. 09:29:45 either they should be in the kernel, or there should be a simple assembler which is used in the forth code 09:30:12 They don't seem to be things that you would need to change; why weren't they just put in the kernel? 09:31:20 I also don't like that he treats memory as an array of 32-bit words 09:31:33 I hate about cf that is really buggy, doesn't run on a lot of my x86 systems and is really^really bad^bad documented. 09:32:10 It sort of makes sense in context, but it would make things unecessarily difficult if you ever wanted to use bytes for anything 09:32:29 Because you wouldn't be able to use the same addresses for bytes as for words 09:33:20 I don't like that he hard-coded all the constants with no explanations. 09:33:47 Again, it kind of makes sense: if he was coming from "sourceless programming", the raw machine code would just have the numbers. 09:34:18 But he should know what all the numbers are, so why didn't he translate them to symbolic names when he was creating the asm source? 09:34:38 It doesn't take much time, you only have to do it once, and it makes it way easier to change things later. 09:35:13 Easily pays for itself the first time you want to change something. 09:37:07 I don't like his spaghetti code for accepting and encoding characters, but I didn't bother looking for an alternative, so maybe I'm talking through my hat there. 09:37:41 But in the asm source, that is NOT "neat and organized" -- it could be in an order that makes its function substantially more clear. 09:41:00 I think it's ridiculous that there was no search function until recently 09:41:39 It's trivial to code, it's a great method of navigation, why wasn't it there to begin with? 09:42:49 even if you know where everything is, it's faster to type the word name and hit a 'find' button than to navigate to the block and move the cursor to the definition 09:44:04 the fact that even experienced users seem to routinely corrupt their image in some way says to me that the system is flawed. 09:44:51 The image that Jeff posted about a year ago had 6 or 7 places where a cell or two had gotten overwritten somehow 09:45:04 Lunch, bbiab. 09:49:27 OOH I've had a point that I've been wanting to make for a while now... We got colorForth unfinished. Reason you have opcodes in the source? didn't know he needed them at that point, I suppose. Proper factoring will move these things to the kernel assembler section. He shouldn't of released it in the condition it was in, but there you go. 09:57:57 Infact, about the only preparation CM did to the code was to strip out the proprietary. 09:58:51 Interesting to me that he would work with such a system and be happy of the state it was in, back then, the one we got. 10:12:35 More 'interesting' to me is that anyone in the programming community would embrace such a thing. 10:24:17 I'm not in that community, not officially. 10:24:38 I don't mean it in some way that excludes you, Ray. 10:25:09 I do. If I were payed, maybe. 10:25:31 Even excluding you for whatever personal reason you may have for not considering yourself a programmer. 10:25:51 I'm not good enouph to be paid for it, therefore I should not argue by default. 10:26:03 I still wonder that it got any attention. 10:26:21 It really should not have got what it did. 10:27:02 It was unfinished, not completly thought out, had only one problem domain that anybody could point to... on and on. 10:27:37 * Ray_work went to bed last night, early, depressed that I even played with it. 10:27:38 ya, my only excuse is that I was looking into "historical" forth systems -- fig forth, eforth, colorforth... 10:27:46 none of these complaints seem to be very important, all of them are addressable, but i dont see the need to "hate" colorforth because of them. they're all cosmetic ... 10:28:37 i would guess that chuck expected people to want to clean up his source for him 10:28:48 he implemented things in a hurry 10:28:49 I can think something is a failure without hating it. Tathi's talking about more than cosmetic concerns. 10:28:59 That I don't have trouble believing. 10:29:09 i'm sure of it 10:29:11 And he was discussing just some of the design decisions and the state of the source. 10:29:29 Without ever looking at the source, there are serious issues with cf. 10:29:33 i would say just leave cf alone and learn from it to inform your own designs 10:29:56 the value isn't just in the source .. 10:32:50 i think that the audaciousness of some of the things he did are inspirational ... the weird memory access ... the way he kind of creates a "box" for himself to limit the complexity of what he's doing 10:33:46 I would say implementing it clearly again and well documented would be good. 10:33:50 all the while doing things that are totally (from an engineer's perspective) "inefficent" - really going against the code-data segregation idea, making non-optimal use of the Pentium caches. and yet it doesnt matter to him. 10:33:54 kind of cool i think 10:34:33 but wouldnt that just be a tribute to it? 10:35:15 I have the impression that most of what he did was putting together fairly typical tricks and techniques from early computer programming 10:35:35 hastily implemented, very poorly documented, inefficient, with questionable design decisions -- doesn't add up to 'cool'. 10:35:48 i think it does quartus 10:35:52 a dish isn't good because it's complex a dish is good because it's well made. 10:36:10 but forth isn't "food" 10:36:20 it's not a product, like a movie or a book 10:36:44 rabbitwhite, if you think bad software is cool, I'm afraid I don't follow. 10:36:50 i think colorforth is good software. 10:36:51 bah, rabbitwhite you can't see when I'm supporting you. 10:37:02 i dont need anyone to support me 10:37:06 sorry i missed it 10:37:49 None of the items I listed are accepted as elements of good software. 10:38:11 i'm quite tired of this 10:38:22 i think i'm going to say bye 10:39:52 --- join: Crest (n=crest@p54896AC7.dip.t-dialin.net) joined #forth 10:41:12 so what are elements of good software? I know that cf is a mess, but let's assume we can dream of a much much much much much much much much better implementation than it is. 10:41:31 You would first need to isolate what it is you think is worth preserving. 10:42:12 Colour as syntactic decoration, perhaps? The reduced-key keyboard? The 48-symbol character set? 10:49:53 Things like the absence of an assembler, the absence of most control-flow words, etc. you can easily emulate by simply not using those features in any given Forth. 10:52:09 hmph. I hadn't realized how complex it was to link with the standard C library. 10:52:38 What platform? 10:52:58 PPC GNU Linux 10:53:09 Does it being PPC add complexity? 10:53:29 I don't think so. I just didn't realize that there were parts that had to be statically linked. 10:53:46 I was hoping I could get my forth to generate executables without running through the linker. 10:54:03 Ah. I initially thought you were talking about ffi. 10:54:08 It seemed like generating relocatable files from Forth might be a bit tricky. 10:55:03 There's the time-honoured trick of compiling at two different base addresses and making note of the differences in the resulting images, using that to build a reloc table. 10:55:57 yeah 10:56:02 In Quartus Forth (I know, completely different environment), all generated code is position-independent. 10:56:11 right 10:56:13 So no relocation. 10:56:27 not so much the code I'm worried about as the data. 10:57:17 The two ways I understand to accomplish it are the one I mentioned, or alternatively using special operators to indicate which data needs relocating. Of the two I would prefer the transparency of the former. 10:58:14 The data in Quartus Forth is also position-independent, it's addressed as offsets from a base-pointer. 10:58:30 ah 10:59:03 that tactic is sometimes used on PPC, but I hadn't thought of using it exclusively. 10:59:23 There are caveats, i.e. you can't store an xt at compile time and expect it to be valid in the stand-alone app's world. Nothing that couldn't be overcome through the use of the double-compilation technique, but I considered the overhead too burdensome for the Palm. 11:01:09 the xt wouldn't be valid in the stand-alone app because you're only exporting the necessary code, and not all of it? 11:01:40 oh, or xt's are actual addresses? 11:02:05 The former. In-code references are all fixed while generating the stand-alone executable, but if you've gone and stored one in dataspace, there's no way for it to get fixed up -- no special marker. 11:02:21 xts are all offsets from a base, too. 11:03:16 Oh yeah tathi: you mentioned 48 characters cuz of the huffman, and the number of actual included icons, includeing the blank is 96. I suppose you'll find a "Shift Caps Bit" 11:03:56 --- join: glass (n=glass@cpc1-bolt6-0-0-cust18.manc.cable.ntl.com) joined #forth 11:04:38 exchange again :) 11:04:38 2dup @ swap @ 11:04:38 rot ! swap ! 11:05:00 isn't that what Quartus posted the other day? 11:05:09 he make use of the return stack 11:05:12 *made 11:05:32 2dup @ >r @ swap ! r> swap ! 11:05:37 Yes, in preference to ROT, as ROT is generally slower. 11:05:43 ah, right 11:05:48 And this is a common-usage factor, so. 11:05:56 interesting 11:06:35 --- join: Snoopy42_ (i=snoopy_1@dslb-084-058-102-083.pools.arcor-ip.net) joined #forth 11:07:05 --- quit: cmeme (Read error: 104 (Connection reset by peer)) 11:07:08 I like the tempo in the version with rot 11:07:11 I find the return-stack version a bit easier to follow, also -- I don't have to mentally figure out what ROT is pulling to the top of the stack. Personal preference. 11:07:25 tempo? 11:08:14 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 11:08:14 --- quit: cmeme (Remote closed the connection) 11:08:30 if you have rests for stack manupulations and beats for memory operations, that gives the word some kind of musical sense... 11:08:35 uh, ok. 11:09:10 If you have apples for stack manipulations and pears for memory operations, that gives the word some kind of delightful fruit-salady taste. 11:09:15 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 11:09:20 tasty! :) 11:10:11 I don't code for rhythm. 11:10:50 I know that the top of the stack is the easiest to work on, but it bothered me slightly that an exchange operation had unequal number of words to dealing with the topmost item and the item underneath it... 11:11:40 : exchange ( addr1 addr2 -- ) 2dup @ >r @ swap ! r> swap ! ; I'd write it like that, spaced that way, to isolate the phrases. 11:12:30 --- join: jackokring (n=jackokri@static-195-248-105-144.adsl.hotchilli.net) joined #forth 11:12:32 Pretty. 11:12:35 I'd be happy with any of the versions I've seen so far 11:13:01 I find it very helpful to use an extra space to separate phrases. 11:13:28 I was using line breaks for that when I was looking at them here 11:13:58 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 11:14:01 (and stack annotations because I'm a noob) 11:14:12 --- nick: Snoopy42_ -> Snoopy42 11:14:27 Ideally a word is short enough that it needs no annotations. There are rare exceptions. 11:14:33 * Ray_work likes phrase spaces as well. 11:14:35 --- quit: rabbitwhite ("Miranda IM! Smaller, Faster, Easier. http://miranda-im.org") 11:15:38 --- join: fik (n=fik__@200.181.84.119) joined #forth 11:16:20 speaking broadly, a need for a comment usually indicates a need to factor at that point. 11:17:04 * glass needs the training wheels for now 11:17:30 But from practicing with exchange, you can read : exchange ( addr1 addr2 -- ) 2dup @ >r @ swap ! r> swap ! ; just fine now, I imagine. 11:19:18 I can follow it. I'm not at the 'it leaps out at me' stage yet :) 11:19:42 You'll get there. It's a matter of becoming accustomed to idiomatic recurring phrases. 11:22:40 For yours, I'd suggest : exchange ( addr1 addr2 -- ) 2dup @ swap @ rot ! swap ! ; 11:23:54 It reads to me, as you see, as five phrases, whereas the return-stack version reads to me as four -- another reason I'd stay with the return-stack version. 11:24:54 One variant of yours would be : exchange ( addr1 addr2 -- ) 2dup @ swap @ rot ! swap ! ; which is four phrases, but I find that quite unnatural. 11:25:22 Difficult to say exactly why. 11:25:54 I was thinking: 2dup @ swap @ rot ! swap ! 11:26:04 thought the 2dup @ is slightly unclean 11:26:36 Yes, it's not 'atomic'. The 2dup sets up for the subsequent phrases, it stands by itself. 11:29:42 Another variant I don't like is : exchange ( addr1 addr2 -- ) 2dup @ swap @ rot ! swap ! ; 11:31:29 : de-ref2 @ swap @ ; ? Not used often enough? 11:32:00 it's not swap @ swap @ ? 11:33:03 oh, sure, you might like to return the stack to the original order. : de-ref2 @ swap @ swap ; 11:33:08 Ray_work, de-ref2 horrifies me as a name, for starters :) 11:33:13 :) 11:33:14 ya. 11:33:23 : 2x@ ( addr1 addr2 -- [addr1] [addr2] ) swap @ swap @ ; 11:33:23 : exchange (addr1 addr2 --) 2dup 2x@ swap rot ! swap ! ; 11:33:47 glass, yes, that's the garden path, unfortunately. You're now undoing in exchange something you're doing in a factor. 11:33:50 you're going to tell that that 'swap rot' is a cry for help, aren't you ;) 11:33:51 That's rarely a wise choice. 11:34:21 swap rot isn't the plea for help, it's swap @ swap @ swap that is. :) 11:35:13 well, how about : -2x@ ( addr1 addr2 -- [addr2] [addr1] ) @ swap @ ; ? 11:35:24 A peculiar factor. 11:35:28 And a horrible name. 11:35:30 very 11:35:55 @ swap @ is just fine idiomatically. It is not productive to factor all idioms. 11:36:52 However, I still prefer : exchange ( addr1 addr2 -- ) 2dup @ >r @ swap ! r> swap ! ; 11:37:27 I wouldn't factor any of those idioms, though @ swap ! comes closest to making me wonder if such an operation might have a meaningful name. I doubt it, though. 11:38:11 I would have thought that swap ! would have had a name 11:38:42 I can't think of a meaningful one that would be shorter than 'swap !' 11:38:49 -! :) 11:39:01 right, which is ugly as sin on a Sunday. 11:39:15 And confusing to boot. 11:39:44 Especially considering we already have +! which does something completely different. 11:39:55 oh. how about r! ? 11:39:58 * Ray_work has one that does ( n n a -- ) swap cells + ! 11:40:08 r! suggests a return-stack operation. 11:40:14 As we have R@ already. 11:40:14 it does :P 11:40:35 Again, not productive to factor all idioms. 11:40:53 glass: I would read r! as store to the address top of return stack. 11:41:15 I'm just trying to think of a prefix to indicate that the parameters were in a different order... 11:41:39 I recommend staying with pronounceable, meaningful names. Names are for abstraction. 11:42:31 otherwise you're doing a peculiar kind of optimization, and you may as well call it swap_! 11:43:55 : storevalue ( addr value -- ) swap ! ; 11:44:05 gah. 11:44:11 as opposed to storeinto which is ! 11:44:12 wrong way. Dead end. Turn back now. :) 11:44:26 THIS MEANS YOU! 11:44:43 did I get eaten by a grue? 11:44:53 No, but you are lost in a maze of twisty passages, all alike. 11:45:00 oh noes! 11:45:37 I recommend learning the actual language, instead of inventing a Forth Ebonics for all the fundamental idioms. 11:46:01 I do plan to read the standard next 11:46:08 * Ray_work thinks that the name of the word should not be more keystrokes then the actual definition. 11:46:43 In some cases the right name is longer than its definition. 11:47:01 Ya, I'm thinking better of that statement now. 11:47:17 But in the case of swap ! -- it doesn't need to be factored simply because it's two words. 11:47:21 A really good abstraction might need to be longer then the definition. 11:48:10 : := ( addr value -- ) swap ! ; \ Victory! ;) 11:48:16 --- quit: cmeme (Read error: 131 (Connection reset by peer)) 11:48:25 glass, you have fallen into a dark hole. 11:49:14 Look at what you did -- this is completely confusing now: : exchange ( addr1 addr2 -- ) 2dup @ := rot ! swap ! ; 11:49:31 Gah, so confusing I got it wrong. : exchange ( addr1 addr2 -- ) 2dup @ swap @ rot ! := ; 11:49:36 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 11:49:38 --- quit: cmeme (Remote closed the connection) 11:50:32 but your version still works: 2dup @ >r @ := r> := 11:50:38 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 11:50:45 Both "work", but again, gah. 11:51:07 the symmetry in my version is killed by := 11:51:16 And somewhere it also killed a kitten. 11:51:25 :( 11:51:34 * Ray_work are sad. 11:51:43 say, what's you cat called? 11:51:59 Various names. Beastie, most of the time. :) 11:52:05 heh 11:53:14 ok, ok -- I'm starting to see why it's silly to name swap ! 11:53:23 :) 11:57:55 I think @ swap ! is a dead-end for factoring, too. Storing words follow ( what where -- ) as a stack order, having a word with an opposite expectation would be clumsy. 12:08:43 I never knew the what/where convention. I hope such things find there way into your book. I've been lucky with that one, so far, for the most part it makes perfect sense. 12:09:56 it's in there. :) 12:10:07 ya, I like that. I've always thought of it as ( value addr -- ) but ( what where -- ) is way better. :) 12:23:24 it's all in the choice of name. 12:24:19 --- join: JasonWoof (n=jason@unaffiliated/herkamire) joined #forth 12:24:19 --- mode: ChanServ set +o JasonWoof 12:24:50 hey jasonwoof 12:25:49 Hi chaps. 12:26:01 hi zpg 12:26:03 I see #forth has witnessed much colorForth discussion. 12:26:06 hey Q 12:26:15 hey :) 12:26:19 hi Jason 12:26:31 it did for awhile, but then rabbitwhite left. 12:27:58 is this all up on a webpage somewhere ? 12:28:12 there's a log. 12:28:28 link? 12:28:40 try /whois clog 12:29:04 http://tunes.org/~nef/logs/forth/ 12:29:08 * glass acks 12:29:34 i didn't realise so much discussion could be garnered from EXCHANGE 12:29:48 cmeme keeps trying to join, too. 12:30:00 huh. 12:30:27 zpg, phrasing and idioms rarely get discussed, which is a shame. Useful. 12:30:46 hi zpg. :) 12:30:56 i can see that -- not a criticism, i'm just intrigued. 12:30:58 hey Ray_work 12:31:00 How's your evening going. 12:31:01 ? 12:31:16 not bad thanks 12:31:29 zpg, not a defense :) just saying. Naming, too. Vital stuff. 12:32:18 * zpg nods 12:37:32 I see the tpk page maintainer hasn't posted my forth version. 12:37:52 tpk? 12:37:53 still not? 12:38:08 http://forth.pastebin.ca/raw/263119 12:38:36 a useless algorithm intended to show the flavour of a language. There's a collection of 'em. 12:38:36 oh sure, saw this the last time you mentioned it. 12:38:40 Still not? 12:38:41 :) 12:39:15 I looked at it and the other languages on that page as well, last time. 12:53:45 http://www.metacafe.com/watch/88657/share_the_pain/ 13:06:07 --- quit: fik ("Leaving") 13:12:38 * Ray_work save link for later and... 13:12:42 Thank you jackokring. 13:29:24 --- join: fik (n=fik__@200.181.84.119) joined #forth 13:40:37 I'm a little late to the conversation, but is zpg using quicksort with his linked lists? 13:40:47 wouldn't mergesort have been the better choice? 13:42:17 why? 13:42:47 he is planning on it, but hasn't implemented yet. 13:43:07 mergesort is the classical sorting routine used with lists 13:43:14 it only needs sequential access 13:43:25 (it wouldn't be inplace though) 13:44:01 *linked lists 13:44:25 I suspect you'll see an overall win for quicksort. 13:44:28 i'm a little befuddled by how to factor a quicksort implementation. looking at C examples, lots of variables are being employed. 13:44:51 so stop looking at C examples. 13:45:07 heh 13:45:54 in terms of performance, probably (mergesort is O(nlog n)); in terms of implementation complexity? 13:46:00 look at the algorithm description in wikipedia, start from there. 13:46:06 I've always thought that writing a mergesort was like falling off a log 13:46:33 quicksort is a very short and simple algorithm, can be done very concisely in Forth. 13:46:35 yeah, starting from scratch is obviously my best bet. 13:46:55 quicksort on arrays, sure... 13:47:10 if you want it done already, I can post it later, but you'll learn more this way. 13:47:44 very true. 13:47:49 i'll give it a go myself :) 13:48:55 quicksort is the one where you split it in half and recurse to sort each half? 13:49:07 effectively. 13:49:48 the pivot doesn't have to be half, but that works. 13:51:35 partition, and recurse. 13:54:23 hmm, in which area could forth achieve a compareable speed of C? 13:55:23 startup speed is a minus of forth, also that it compiles everything at startup 13:56:30 depends on which Forth, and what you're measuring. 13:57:08 btw. which interpreter language is faster than Forth? at the moment I would say it's the fastest around. 13:57:50 again, what are you measuring? 13:58:47 pff.. that's a question which can't be answered simple 14:00:39 if you want an answer, you need a well-formed question. 14:00:39 most common tests and the results get translated to a ranking where C represents 1. something like that? 14:01:32 look up the language shootout for some benchmark results. 14:01:57 I think it currently shows bigForth results. 14:08:04 http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=bigforth 14:23:12 If you set all the multipliers to 1, bigForth:C is 1.3:1, which is respectable. FreeBasic is 1.4, Perl is 1.8, JDK-server is 2.0, Lisp is 2.1, JavaScript is 2.8. 14:24:47 On the Gforth page, it comes in at 1.4:1. 14:26:15 --- quit: Cheery ("Download Gaim: http://gaim.sourceforge.net/") 14:26:49 Forgetting memory use completely, and focusing only on speed, bigForth is 2.3:1, GForth is 4.9:1. 14:28:00 Now, that's probably stock GForth, not gforth-fast, though I can't see any notes about which one was used. 14:28:49 For a reference point on the speed tests, for speed only, JavaScript comes in at 17:1. 14:29:23 JavaScript Rhino (whatever that is) comes in at 115:1! 14:31:08 That's amazing. One second in C, nearly two minutes in JavaScript Rhino. :) That's a feat. 14:31:38 --- quit: jackokring (Read error: 145 (Connection timed out)) 14:32:05 Ah ha. "Rhino is an open-source implementation of JavaScript written entirely in Java." 14:34:32 I wouldn't be at all surprised to learn that Pelc's VFX comes in the 1-1.5 range vs. C -- it's a commercial implementation, mind you, so it won't be on that page. 14:36:20 The last factor of two is the hardest. 14:39:45 Now, a Forth written in JavaScript Rhino, that's probably be 563:1. :) 30 minutes in C, a solid week in JavaScript Rhino Forth. :) 14:42:21 Those GForth vs. bigForth numbers are in keeping with what I'd expect -- at least a 2X improvement for native code vs. a threaded implementation. 15:16:33 --- quit: Ray_work (Read error: 131 (Connection reset by peer)) 15:33:49 --- join: arke (n=Chris@pD9E05375.dip.t-dialin.net) joined #forth 15:33:49 --- mode: ChanServ set +o arke 15:56:31 --- quit: arke (Read error: 104 (Connection reset by peer)) 15:56:31 --- join: arke_ (n=Chris@pD9E05375.dip.t-dialin.net) joined #forth 15:59:17 --- quit: arke_ (Read error: 104 (Connection reset by peer)) 16:03:07 --- part: glass left #forth 16:04:55 Hmm, I'm getting /somewhere/ with this quicksort stuff. 16:04:56 :) 16:05:10 Re-implemented my arrays to contain length in the first cell, makes everything much cleaner. 16:05:22 And I have a PARTITION written, only problem being that it doesn't work 16:05:34 Shouldn't have any need to track the length that way. 16:06:03 Hmm? 16:06:24 --- log: started forth/06.12.05 16:06:24 --- join: clog (n=nef@bespin.org) joined #forth 16:06:24 --- topic: 'Welcome to #forth. We discuss the Forth programming language and a variety of technical subjects. Introduction: http://tinyurl.com/kvawv | Starting Forth: http://tinyurl.com/rm7pq | Thinking Forth: http://tinyurl.com/nsy4j | Gforth compiler: http://tinyurl.com/s8uho | ANS/ISO Forth Standard doc: http://tinyurl.com/nx7dx | http://quartus.net/search | Paste: http://forth.pastebin.ca' 16:06:24 --- topic: set by Quartus on [Sat Nov 25 22:45:21 2006] 16:06:24 --- names: list (clog fik @JasonWoof cmeme Snoopy42 Crest virl Razor-X` nanstm Zarutian segher @tathi ellisway zpg virsys madgarden @crc @Quartus_ TreyB madwork ccfg timlarson nighty warpzero) 16:06:26 Makes finding the right bound simple. 16:06:38 --- join: Quartus (n=trailer@CPE0001023f6e4f-CM013349902843.cpe.net.cable.rogers.com) joined #forth 16:06:40 --- mode: ChanServ set +o Quartus 16:06:43 myarray @ @ <--- that 16:07:00 --- quit: TreyB (anthony.freenode.net irc.freenode.net) 16:07:00 --- quit: madwork (anthony.freenode.net irc.freenode.net) 16:07:00 --- quit: nighty (anthony.freenode.net irc.freenode.net) 16:07:02 You should be able to point your quicksort at any range of cells in memory, and tell it to sort'em. 16:07:04 --- join: TreyB (n=trey@cpe-66-87-192-27.tx.sprintbbd.net) joined #forth 16:07:42 Of course, but that range is beginning-end of array. So the array stores its length. 16:07:46 What's wrong with that? 16:07:48 --- join: nighty (n=nighty@66.163.28.100) joined #forth 16:08:04 At least at toplevel 16:08:20 I mean you should be able to point at a sub-region of an array, have it sort that. No need for a special place where the length is stored. 16:09:03 Yes, I'm intending on a range based sort, taking beginning and end (from the stack). But when we call quicksort on an array, the toplevel call should surely look at the array and establish "sort from 1 ... end" 16:09:39 : qsort ( start-addr end-addr -- ) ; : sort ( addr u -- ) ... endpoints qsort ; 16:10:48 : partition ( array -- ) dup cell+ swap array-last ... ; ? 16:13:15 partition ( left right -- left1 right1 left2 right2 ) 16:13:49 Hmm. Confusing stuff. I think I might retire defeated for now. 16:14:31 Partition selects a pivot, and returns two sub-lists, those less than the pivot, and those greater. 16:17:27 For an in-place sort, it does this by walking the array in both directions and swapping pairs. 16:18:22 Hence 'exchange' from yesterday. 16:23:06 The Wikipedia quicksort article gives a pretty good overview. 16:28:03 er -- Partition selects a pivot, and returns two sub-lists, those less than the pivot, and those greater or equal. 16:28:34 Elements equal to the pivot have to go somewhere. :) 16:34:23 The factors in my qsort: 16:34:23 defer precedes ( addr1 addr2 -- flag ) 16:34:23 select-pivot ( L R -- pivot ) 16:34:23 partition ( L R -- L1 R1 L2 R2 ) 16:34:23 shorter ( L1 R1 L2 R2 -- L1 R1 L2 R2 | L2 R2 L1 R1 ) 16:34:23 qsort ( L R -- ) 16:34:25 sort ( addr u xt -- ) 16:37:47 sort is a wrapper for qsort, sets precedes, calculates endpoints. shorter is an optimization that isn't strictly necessary. 16:40:37 Doesn't give away too much to show qsort: : qsort ( L R -- ) begin 2dup < while partition shorter recurse repeat 2drop ; (again, shorter is optional) 16:42:44 All the fun stuff is in partition. 16:43:49 large paste follows: last chance to tell me no! 16:43:55 yikes sex change. 16:43:59 --- nick: nanstm -> Raystm2 16:44:12 could use the pastebin.ca if you're worried about it 16:44:20 http://forth.pastebin.ca 16:44:30 good idea. But better here but better in the paste bin. 16:44:43 You can set an expiry in the pastebin. 16:45:11 --- join: glass (n=glass@cpc1-bolt6-0-0-cust18.manc.cable.ntl.com) joined #forth 16:45:41 sorry, you're probably a little bored of these now, but here's another exchange :) 16:45:47 2dup @ 2>r 16:45:47 swap @ swap ! 16:45:47 2r> ! 16:46:23 Yes, that's ok, except there's a swap inherent in both the 2>r/2r> combo, so I prefer to move only what's required to be moved. 16:46:29 http://forth.pastebin.ca/268784 Forth Recipe. Fixable. 16:47:03 Raystm2, reminiscent of the problem-solving steps at the beginning of Polya's "How to Solve It". 16:47:15 I was not aware. 16:47:28 Thank you for that. I'll look it up. 16:47:33 An excellent book. 16:48:32 I recognised the title, I may have seen it before. 16:48:52 It's about mathematics, but the techniques are universally applicable. 16:49:46 glass, I think I spoke too soon. Have you tested that? 16:50:03 testing it now -- seems to go boom :( 16:50:14 Yes, it's broken. 16:50:41 I had assumed you'd tested it, so I only noted the use of the balanced 2>r 2r>. 16:54:21 Oh cool, the '67, David Niven Casino Royal, which i've never seen before. 16:54:32 Amusing in parts. 16:54:35 only 15 minutes late. 16:54:41 Is it? cool. 16:54:49 Kind of falls off toward the end. 16:55:13 Buring a tupee, hahaha. 16:58:16 --- quit: Razor-X` (Remote closed the connection) 16:59:05 Dinner, who's hungry? 16:59:16 Send me a pizza! 16:59:43 Toppings? 16:59:48 Chicken and mushroom. 17:00:28 Parmesian? Peppers? Crust Dipper Sause? Drink? 17:00:38 Ginger-ale. 17:01:15 Ooh, haven't had that in a while. Can't have it, I'm certain. :( 17:01:33 * Raystm2 is gonna miss a few things. :( 17:01:37 missing swap before final ! 17:01:52 glass, yes, that'll help. But again you're compensating for actions taken by your factors. 17:03:17 * glass ponders 17:05:44 Here's another one: : exchange ( addr1 addr2 -- ) dup @ >r over @ swap ! r> swap ! ; 17:07:48 so many variations :) 17:08:29 : exchange ( addr1 addr2 -- ) 2dup 2>r @ swap @ r> ! r> ! ; 17:08:36 They're variations, but trivial ones. 17:08:45 The variations are good to know because you can do different things "in between" them, iygwim. 17:09:22 --- join: nighty_ (n=nighty@sushi.rural-networks.com) joined #forth 17:09:29 Not that I can come up with a good example. 17:09:55 --- join: Razor-X (n=user@user-11faadf.dsl.mindspring.com) joined #forth 17:10:13 2dup @ swap 2over swap @ swap ! ! 17:10:44 2drop 17:10:57 Not an improvement, I think. 17:11:01 not so nice, that one :P 17:11:39 : exchange ( addr1 addr2 -- ) 2dup @ >r @ swap ! r> swap ! ; still my favourite. 9 light words, four phrases. 17:11:39 as well, I was thinking of moving this around in pairs this time around 17:12:45 I'll go to bed now :) 17:12:47 night! 17:12:51 ciao 17:12:56 --- part: glass left #forth 17:13:56 Hmm. What's this? 17:14:48 : exchange ( addr1 addr2 -- ) 2dup @ swap @ rot ! swap ! ; is the runner-up, save for the use of rot. 17:15:03 The Austin Powers movies make more sense now. 17:17:12 Thanks to Forth ? 17:19:42 Razor-X: That, and I'm watching the David Niven as 007, '67, Casino Royal, for the first time in my life. 17:20:47 About 40 minutes into the film there is a chase that is much like in AP. 17:21:46 That CR is itself a spoof. 17:22:03 And AP drew from the Our Man Flint spoofs, too. 17:22:09 :) 17:22:36 Don't recall if I've seen OMF. 17:23:05 Oh no, Woody Allen JBjr. :) 17:23:20 http://www.imdb.com/title/tt0059557/ 17:24:58 Ty. :) 17:42:53 --- quit: tathi ("leaving") 18:32:07 --- quit: fik (Remote closed the connection) 18:53:44 --- quit: zpg (Read error: 60 (Operation timed out)) 19:09:26 --- part: Quartus_ left #forth 21:36:25 --- quit: nighty_ (Read error: 110 (Connection timed out)) 22:30:51 --- quit: virl (Remote closed the connection) 23:45:51 --- join: ayrnieu (n=julian@pdpc/supporter/sustaining/ayrnieu) joined #forth 23:59:59 --- log: ended forth/06.12.05