00:00:00 --- log: started forth/05.04.04 01:20:29 --- quit: Teratogen ("SKYKING, SKYKING, DO NOT ANSWER.") 01:31:34 --- quit: Al2O3 (Remote closed the connection) 02:48:31 --- join: ASau (~user@83.102.133.66) joined #forth 03:52:45 --- quit: aum () 05:44:55 --- join: tathi (~josh@pcp01375108pcs.milfrd01.pa.comcast.net) joined #forth 05:54:22 --- join: SeaForth (~SeaForth@c-24-1-126-202.hsd1.tx.comcast.net) joined #forth 05:55:24 --- nick: sk1p_ -> sk1p 06:03:13 --- quit: I440r ("Leaving") 06:29:43 --- quit: tathi ("leaving") 06:30:13 --- join: tathi (~josh@pcp01375108pcs.milfrd01.pa.comcast.net) joined #forth 06:43:14 --- quit: I440r_ ("Leaving") 07:05:40 --- join: I440r (~mark4@216-110-82-203.gen.twtelecom.net) joined #forth 07:20:57 --- nick: SeaForth -> Al2O3 07:21:48 --- quit: Al2O3 ("Leaving") 07:22:48 --- join: Al2O3 (~Al2O3@c-24-1-126-202.hsd1.tx.comcast.net) joined #forth 07:35:59 --- join: bbls (~bbls@80.97.121.133) joined #forth 09:06:58 --- quit: tathi (Read error: 104 (Connection reset by peer)) 11:01:40 --- join: qFox (C00K13S@82-169-140-229-mx.xdsl.tiscali.nl) joined #forth 11:04:05 --- join: tathi (~josh@pcp01375108pcs.milfrd01.pa.comcast.net) joined #forth 11:23:43 --- join: Herkamire (~jason@c-24-218-95-147.hsd1.ma.comcast.net) joined #forth 11:23:43 --- mode: ChanServ set +o Herkamire 11:55:25 --- quit: tathi ("leaving") 11:55:27 --- join: tathi_ (~josh@pcp01375108pcs.milfrd01.pa.comcast.net) joined #forth 11:55:53 --- nick: tathi_ -> tathi 12:47:25 --- quit: bbls () 13:51:37 --- join: arke (f2@bespin.org) joined #forth 13:58:10 --- quit: tathi ("leaving") 14:17:15 --- quit: YoyoFreeBSD_ (Read error: 110 (Connection timed out)) 14:19:57 --- nick: Raystm2 -> spike_anarchy 14:38:02 hi all 14:41:52 Hi. 14:41:58 Hi Quartus 14:42:08 What's up? 14:43:30 Not to much 14:43:41 working on documentation 14:44:03 looking over the ANS CORE wordset 14:49:22 I think I might expand lib/ans in rf8 to cover most of the CORE words 14:51:50 --- part: I440r left #forth 14:54:21 hmm, I mention ANS and I440r leaves... 14:56:12 --- join: I440r (~mark4@216-110-82-203.gen.twtelecom.net) joined #forth 14:57:03 :) 15:25:38 --- quit: qFox ("this quit is sponsored by somebody!") 15:27:51 heh 15:28:30 Working on docmentation here too. 15:29:01 Finding it's a good way to chase out certain things -- if I find I'm explaining around some 'feature' or other, it's a sign that I should smooth over that rough spot. 15:30:04 Quartus, exactly!!!!! 15:30:12 commenting helps me in the same way! 15:30:35 "if you have thought about your code enough to explain it you have thought about it enough to CODE it!" 15:30:40 -- me :) 15:30:59 not everyone agrees with that tho 15:31:53 I beleive it always better to comment after the fact as far as explaining how it does it.... Because then you go, errrr... it is not supposed to work that way... 15:32:13 hyrax agreed 15:32:27 I code by writing the comments describing the steps first, and then code to match the comments. 15:32:29 i think how i want it to be, code it that way (with tweaks) and then comment it 15:33:00 Quartus, what if the code doesnt quite work the way you commented it ? 15:33:06 now you have to change both ? 15:33:19 Yes. 15:33:27 Usually means a do-over. 15:33:40 thats another thing i often do 15:33:48 code something. dont like it. delete it, start over 15:34:34 same 15:34:54 If a task seems too large to write, the pseudocode->code process has always worked well for me. 15:35:26 i just dont like code with little or NO comments 15:36:21 You need a prologue for each word, and a stack-comment, at least. 15:37:56 agreed. on multi line words I usually comment every line after the word is done, mainly as a sanity check that yes indeed the word does what I meant for it to do. 15:38:35 stack comments are absolutely required heh 15:38:54 I do stack comments separate from the source 15:38:54 I also do inline tests; I code one before the word is written, and write the word to pass it. 15:38:58 I try my hardest to keep every word one line and very small so that a quick 2-second glance is all thats needed to understand how it works 15:38:59 And leave the tests in the code. 15:39:20 and pick a name that matches :) 15:40:21 When I write tests, I write words that test words individually 15:40:27 then write a word that does all the tests 15:40:42 I use tester.fs. { myword -> result } kind of tests. 15:40:43 so then, when I change/add something, I run the tests to make sure it works 15:40:55 With inline tests they get run at each compile. 15:41:57 * crc does very few automated tests 15:42:13 i dont like that 15:42:23 I'd rather just have the tests run when I want them to 15:42:35 compile time is usually 0, so it doesnt matter if they get compiled too 15:43:15 Inline tests have saved me on a number of occasions. 15:44:02 One of the strengths of Forth is that you can do inline testing; you don't have to set up scaffolding for it the way you would in, say, C. 15:44:04 Or Java. 15:45:25 They're switchable too, though -- easy enough make { a comment. 15:49:05 With : { postpone \ ; right I440r? :) 15:49:23 I wanted to work INVERT in there somewhere ;) 15:50:11 : { invert postpone \ invert ; 15:50:53 : { [ .( I440r H4T3S US) ] invert postpone \ invert ; 15:52:33 :) 15:52:48 ' \ alias { 15:52:53 that takes no code space 15:53:02 and doesnt use evil ans words 15:53:06 :) 15:53:46 I440r: not all words in ANS are evil 15:54:03 no not all 15:54:06 but postpone is :P 15:54:06 Probably at least one non-evil one in there. 15:54:19 I440r: I'll agree with that 15:54:32 Take that back. POSTPONE is a good friend of mine. 15:55:22 : postpone wsparse mfind ?if compile ;; then find compile ; 15:55:34 Quartus, then maybe you can show me a postpone version of the following... 15:55:34 (reva's implementation of postpone) 15:55:51 : blah [compile] x ; 15:55:58 : foo compile y ; 15:56:16 I'd have to dig up my F83 books to remember what compile does. 15:56:51 compile takes the next token out of the execution stream and compiles it into the definition currently being created (blah should be immediate there sorry) 15:57:10 Does it do something different with immediate/non-immediate words? 15:57:12 [compile] takes the next word out of the INPUT stream and compiles it into the definition currently being created 15:57:16 no 15:57:25 neither of them do 15:57:41 [compile] still lives and breathes, so you don't need to substitute that. 15:57:42 but [compile] only makes sense on immediate words 15:58:00 nobody ever uses it any more 15:58:13 neither compile nor [compile] are used by "modern" forthers 15:58:14 POSTPONE POSTPONE gets occasional use in my code. 15:58:25 You must really like that. :) 15:58:50 its not as bads as : blah postpone a postpone b postpone c ...... postpone z ; immediate 15:58:55 OUCH OUCH OUCH OUCH 15:58:56 OUCH OUCH OUCH OUCH 15:58:57 OUCH OUCH OUCH OUCH 15:58:57 OUCH OUCH OUCH OUCH 15:58:58 :) 15:59:19 If I really had to postpone a string of things like that, I'd use a macro facility. Wil Baden's, probably. 15:59:21 that "macro" mechanism really pissed me off so i wrote a real one for isforth 15:59:22 when is postpone used? 15:59:35 will badens USES that technique 15:59:50 Postpone is used to defer the compilation-sematics of a word. 16:00:01 in isforth i can make m: blah 100 0 do i . loop ;m a macro 16:00:01 hmm. Not 'defer' in the Forth sense, but in the English sense. :) 16:00:06 ok 16:00:11 and blah takes up NO space in the target 16:00:30 crc, so : my; postpone ; ; immediate would create an alias for ;. 16:00:39 ahh, ok 16:00:43 I have m: for that 16:00:57 Quartus, ' ; alias my; 16:00:58 : my; m: ; ; 16:01:06 if the word im ticking is immediate the alias is immediate 16:01:11 Sure, alias is present in some systems, but I was illustrating postpone. 16:01:19 yes 16:01:33 but the postpone method uses code (list) space 16:01:38 I also have f: in case you have both an immediate and normal word with the same name 16:01:41 the alias method uses only head space 16:01:47 It does. I'm not recommending it as an alternative to alias, just showing how postpone works. 16:02:04 k 16:02:06 * crc notes that his implementation of postpone will work after all... good 16:02:46 In Quartus Forth, postpone will cause the full gamut of compilation-semantics, correctly inlining inline words, etc. 16:03:08 Which is handy. 16:03:40 * arke notes F2 wont have or need postpone or compile or [compile] :) 16:03:55 arke: how will you avoid it? 16:04:25 same way as colorforth 16:04:36 By making your code terse and unreadable? :) 16:04:49 (f2 will be colored, :)))))) 16:04:54 lol thats how i find ans code to be 99.99999% of the time :) 16:05:18 I'd be more interested in colorforth if not for the large segment of the male population that suffers red-green colour blindness. 16:05:30 And the other segment that suffers blue/green colour blindness. 16:05:31 apparently not CM :) 16:05:35 heh 16:05:37 :. 16:06:00 actually, cf is more unreadable and obfuscated than ans forth 16:06:11 i cant even bring myself to TRY to read that gobbldegook 16:06:14 I440r: until you learn what the colors mean 16:06:15 I440r, I'll have to send you some of my source to critique at some point. 16:06:20 and its a CM thing! 16:06:30 * crc can translate between cf and rf pretty easily 16:06:42 Quartus, are you sure you want to do that ?? heh 16:06:45 * arke can do the same 16:07:00 if you spend the 5 seconds to learn the colors its almost laughably easy 16:07:10 sure, as long as it doesn't upset you too much to look at source that's at least somewhat ANSified. :) 16:07:15 Quartus: nooo, dont! I440r is a pedant 16:07:17 :) 16:07:24 He is? Isn't that illegal? :) 16:07:28 lol 16:07:43 no but ans forth should be :) 16:07:59 I'll try not to send anything with postpone in it. 16:08:09 lol i can skip over those parts :) 16:08:16 --- nick: spike_anarchy -> Raystm2 16:10:23 :) 16:12:03 Scanning through the library files I'm documenting, the longest one that isn't an assembler/disassembler is some calendrical calculation code. Perhaps I'll send it. 16:20:02 * crc stops working on lib/ans for the evening. now only 54 words left in the CORE worset 16:36:33 replaced the alternator (took me 3 fucking hours because it was under the power steering pump, grrrrr) 16:36:36 and the shifter SNAPPED OFF at the bottom 16:36:39 so, I'm going to get it welded later 16:36:51 crc: just words for lib/ans or a full emulation? :) 16:37:00 crc: (maybe both) 16:37:08 crc: that would be interesting. It'd still be miles faster than gforth ;) 16:43:09 --- join: tathi (~josh@pcp01375108pcs.milfrd01.pa.comcast.net) joined #forth 16:43:34 arke: lib/ans will implement 90-95% of the words in the ANS CORE and EXT specs. 16:44:09 once you load it, rf will lose some of the more interesting features though 16:46:53 Like what? 16:47:24 use of the x86 carry flag to store success/fail states 16:47:56 early bindings of names to definitions 16:48:03 multiple entry points 16:48:10 and other similar things 16:49:02 I see. 16:49:26 Perhaps you can arrange to be able to mix ANS with regular rf code? 16:49:27 * crc intends to use lib/ans to aid in porting ans programs to rf 16:49:37 Quartus: I might be able to do that soon 16:49:50 My namespace code is close to being ready to release 16:50:20 then I can create an ANS namespace to run alongside the retroforth words 16:50:55 Handy. 16:51:30 The namespace facility is one of the first things I built. 16:51:50 It's one of my last major additions 16:51:50 It's really a tiny twist in the hashtable implementation. 16:52:07 I use a linked list for my dictionary 16:52:28 I use a hashtable with separate chaining, lots of small linked-lists. 16:52:50 what threading model do you use? 16:53:00 hmmm... With namespaces and most of ANS, I might be able to use rf for cross compiler hosts. 16:53:01 Subroutine threading with optimizations. 16:53:12 cool 16:53:31 I use subroutine threading with very few optimizations :) 16:54:16 With the hashed dictionary, wordlists values are simply xored with the hash value for the word, and magically you have multiple namespaces. 16:54:39 --- join: Sonarman (~snofs@adsl-64-160-165-217.dsl.snfc21.pacbell.net) joined #forth 16:54:41 hmm 16:57:43 It's a beautifully simple thing. You can only have as many wordlists as you have hashtable buckets, but that's not generally a problem. 17:01:10 One benefit is that it doesn't occupy any additional space, not in the hashtable, nor in the dictionary entries.. 17:02:55 hmm 17:03:04 The only downside to a hashed dictionary is that it's more difficult to walk it in an ordered fashion. WORDS is a bit longer in consequence. 17:03:16 mine take up a bit of space, but not a lot 17:03:21 And then only because I prefer WORDS to list the most recent definitions first. 17:05:15 Well, I'd guess that you're storing a wordlist value in each header? 17:05:23 no 17:05:30 My namespace code is: 17:05:31 : ns: create last @ , does> last @ swap dup @ last ! ; 17:05:31 : ;ns last @ swap ! last ! ; 17:05:42 What's that when it's at home? 17:05:55 just some tweaking of the dictionary headers a bit 17:06:07 ? 17:06:26 The net effect of which is...? Does it break the dictionary linked list into multiple lists? 17:06:42 ns: foo 17:06:58 foo now points to a new list, which also has all previously defined words availible 17:07:16 ;ns sets the main wordlist back as the active one 17:07:19 Ah. So not independent namespaces, as such. 17:07:22 nope 17:09:24 Wouldn't map well to the ANS Search-Order idea of namespaces. 17:09:51 I don't plan to add ANS-style namespaces at this point 17:10:30 You're already close, it's just a matter of time. 17:10:40 hehe 17:10:51 all of this is loadable over the rf core, just the way I like it 17:11:25 As it should be. 17:11:28 * crc foresees a lot of this working it's way into reva, retroforth's ANS-ish child 17:11:54 Think about the hashtable/namespace idea; it's one of the neater things I've run across. 17:12:03 I will 17:13:18 Quartus: do you ever have overlap between the namespaces? 17:13:31 e.g. two words in different namespaces winding up in the same hash bucket? 17:13:39 or...am I missing something? 17:14:28 Words from various namespaces can wind up in the same hashbucket; they still don't collide. 17:14:53 Two words with the same name, each in a different namespace, have to wind up in different buckets. 17:15:20 It's easiest to imagine a hashtable with only two buckets. Words either hash to 0, or 1, and hence wind up in one bucket or the other. 17:15:40 oh right. 17:15:42 thanks. 17:16:37 This would give you two wordlists, with values of 0 and 1. If a word hashes to 0, xoring it with 1 puts it in bucket 1; if it's 1, xoring it with 1 puts it in bucket 0. 17:20:24 It's very slick. I did quite a lot of work on hashtables at the time; found out, among other things, that the prevailing wisdom suggesting prime-sized hashtables is not in any way necessary. 17:20:38 Yet I have a six algorithm books that insist it is. 17:20:47 -a 17:21:04 heh. 17:21:19 Also that, for Forth, a very simple hashtable function is more than adequate. 17:21:37 yeah, I did a tiny bit of experimenting at one point. 17:21:55 pjwhash is a monstrosity with really, really bad performance. It only starts to look passable when hashtable sizes are also prime; this hides it's horribleness a bit. 17:22:03 er, its. 17:22:04 goodnight\ 17:22:07 Goodnight. 17:22:10 goodnight 17:22:48 did you do much experimentation with large-ish data set sizes? 17:23:08 I ran /usr/dict/words against a range of hash functions. 17:23:21 For all <=31-length words. 17:23:28 ah. 17:24:33 interesting. I always assumed that by the time you got that big, it would start to matter how good your hashing algorithm was. 17:24:56 It does matter how well it distributes, yes. But simple ones can distribute English text very well. 17:25:40 yeah, that's what I assumed you were saying. 17:25:49 You want every bucket filled to more-or-less the same depth. 17:26:24 * tathi likes this channel -- people have actually tried stuff, rather than just going by the books. :) 17:26:58 The strength of using power-of-two-sized hashtables is that you can just AND with a bitpattern to size the hashvalue to the table size, instead of doing a MOD or equivalent. 17:27:18 And a good hashfunction distributes just as well over a power-of-two hashtable size as it does over a prime-sized table. 17:27:38 cool. 17:28:15 You can get near-perfect distribution with a fancy hashfunction, like, say, MD5; but you start to pay heavily in terms of cycles to calculate it. 17:29:22 right 17:29:54 And in theory you're using a hashtable in the first place to speed things up, so. :) 17:31:07 well, MD5 and such are more for signing things, aren't they? 17:31:32 Sure, you get far more bits out of MD5 than you'd ever need for a hashtable. But it's still a hashfunction. 17:31:53 yeah 17:32:36 A complicated one, to be sure, but in concept no different than multiplying by 5 and adding each character. :) 18:00:30 --- quit: Raystm2 ("User pushed the X - because it's Xtra, baby") 18:13:39 --- join: aum_ (~aum@60-234-138-239.bitstream.orcon.net.nz) joined #forth 18:15:33 --- nick: aum_ -> aum 18:29:18 --- part: Frek left #forth 18:32:18 --- join: Frek (372-ident-@h89n2fls31o815.telia.com) joined #forth 19:30:54 --- join: sk1p_ (alex@pD958CCC9.dip.t-dialin.net) joined #forth 19:44:21 --- join: Raystm2 (~vircuser@adsl-69-149-38-140.dsl.rcsntx.swbell.net) joined #forth 19:47:11 --- quit: sk1p (Read error: 110 (Connection timed out)) 19:47:44 --- nick: sk1p_ -> sk1p 20:04:54 --- quit: Quartus (Remote closed the connection) 20:09:01 --- join: Quartus (~trailer@ansuz.pair.com) joined #forth 21:25:48 --- quit: Herkamire ("off to bed") 22:08:58 --- join: I440r_ (mark4@rrcs-24-242-160-169.sw.biz.rr.com) joined #forth 22:25:10 --- quit: aum () 22:33:02 --- join: YoyoFreeBSD (~yoyo@219.144.190.88) joined #forth 22:47:50 --- quit: Sonarman (Read error: 110 (Connection timed out)) 23:09:09 --- quit: Quartus (Remote closed the connection) 23:32:18 --- join: bbls (~bbls@80.97.121.133) joined #forth 23:59:59 --- log: ended forth/05.04.04