00:00:00 --- log: started forth/10.09.28 00:00:19 --- quit: gogonkt (Ping timeout: 255 seconds) 00:01:48 --- join: gogonkt (~info@183.27.209.60) joined #forth 00:36:24 --- quit: gogonkt (Ping timeout: 252 seconds) 00:38:08 --- join: gogonkt (~info@183.27.207.15) joined #forth 01:16:27 --- quit: gogonkt (Ping timeout: 272 seconds) 01:24:28 --- join: gogonkt (~info@113.105.204.43) joined #forth 01:33:43 --- join: azathoth99 (~g@pool-173-60-208-79.lsanca.fios.verizon.net) joined #forth 01:39:16 --- quit: gogonkt (Ping timeout: 245 seconds) 01:41:15 --- join: gogonkt (~info@183.27.205.203) joined #forth 01:45:54 --- quit: gogonkt (Ping timeout: 240 seconds) 01:47:57 --- join: gogonkt (~info@183.27.208.172) joined #forth 02:59:36 --- quit: azathoth99 (Quit: Lost terminal) 03:08:09 --- join: ygrek (debian-tor@gateway/tor-sasl/ygrek) joined #forth 03:43:24 --- quit: gogonkt (Ping timeout: 272 seconds) 03:44:34 --- join: gogonkt (~info@183.27.208.172) joined #forth 03:53:25 --- quit: bakaboo (Ping timeout: 255 seconds) 03:53:46 --- quit: gogonkt (Read error: Connection reset by peer) 03:57:32 --- join: gogonkt (~info@183.27.214.166) joined #forth 04:27:25 --- quit: gogonkt (Ping timeout: 264 seconds) 04:34:01 --- quit: gnomon (Ping timeout: 264 seconds) 04:34:17 --- join: gnomon (~gnomon@CPE0022158a8221-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 04:36:55 --- join: gogonkt (~info@183.27.212.68) joined #forth 04:42:18 --- quit: gogonkt (Ping timeout: 272 seconds) 04:57:15 --- join: gogonkt (~info@183.27.212.199) joined #forth 05:28:00 --- quit: mathrick (Read error: Operation timed out) 05:37:50 --- quit: gogonkt (Quit: leaving) 05:38:05 --- join: gogonkt (~info@183.27.212.199) joined #forth 06:11:06 --- join: mathrick (~mathrick@wireless.its.sdu.dk) joined #forth 06:23:41 --- quit: schmrkc (Ping timeout: 240 seconds) 06:25:20 --- join: schmrkc (~marcus@c83-254-197-212.bredband.comhem.se) joined #forth 06:25:20 --- quit: schmrkc (Changing host) 06:25:20 --- join: schmrkc (~marcus@sxemacs/devel/schme) joined #forth 06:48:15 --- quit: gogonkt (Ping timeout: 252 seconds) 06:50:15 --- join: gogonkt (~info@183.27.208.75) joined #forth 07:02:26 --- quit: gogonkt (Ping timeout: 265 seconds) 07:09:53 --- join: gogonkt (~info@183.27.206.116) joined #forth 07:20:11 --- quit: gogonkt (Ping timeout: 240 seconds) 07:22:03 --- join: gogonkt (~info@113.105.207.141) joined #forth 07:52:02 --- join: apot (~abg3x@unaffiliated/apot) joined #forth 07:56:28 --- quit: apot (Ping timeout: 265 seconds) 07:56:39 --- quit: gogonkt (Ping timeout: 240 seconds) 07:58:55 --- join: gogonkt (~info@183.27.206.187) joined #forth 08:10:46 --- quit: mathrick (Ping timeout: 276 seconds) 08:47:00 --- quit: LionMadeOfLions (Ping timeout: 252 seconds) 09:21:56 --- join: qFox (~C00K13S@5356B263.cable.casema.nl) joined #forth 10:00:24 --- join: LionMadeOfLions (~LionMadeO@70.114.155.182) joined #forth 11:15:56 --- quit: ygrek (Ping timeout: 245 seconds) 11:28:24 --- join: ygrek (debian-tor@gateway/tor-sasl/ygrek) joined #forth 12:58:10 --- quit: crc (Ping timeout: 265 seconds) 12:58:17 --- join: mathrick (~mathrick@users177.kollegienet.dk) joined #forth 13:00:03 --- join: crc (~charlesch@184.77.185.20) joined #forth 13:46:21 --- quit: ygrek (Ping timeout: 245 seconds) 13:59:25 --- join: ygrek (debian-tor@gateway/tor-sasl/ygrek) joined #forth 14:29:36 --- quit: qFox (Read error: Connection reset by peer) 14:31:58 --- quit: ygrek (Remote host closed the connection) 20:30:32 --- quit: Monev (Read error: Connection reset by peer) 20:49:57 --- quit: dinya_ (Read error: Connection reset by peer) 20:50:24 --- join: dinya_ (~Denis@92.255.128.235) joined #forth 21:36:54 --- quit: crc (Ping timeout: 272 seconds) 21:37:15 --- join: crc (~charlesch@184.77.185.20) joined #forth 21:37:39 --- join: chitselb (~chitselb@pool-173-79-113-101.washdc.fios.verizon.net) joined #forth 21:39:09 greetings. I'm implementing a Forth on a 6502 (PET 2001) and copying a lot of words from Blazin' Forth on C=64 21:40:02 I'm at the place where my outer interpreter sort of works, and number conversion is next. Blazin' Forth has a word M/MOD which isn't part of the Forth-83 standard. I'm trying to figure out the stack diagram for it. 21:41:03 12345678. 1234 m/mod d. . 10004 742 ok 21:41:58 12345678. dnegate 1234 m/mod d. . 3470519 1172 <-- clearly a wrong answer 21:43:14 UM/MOD works fine. I'm just not sure what the rules are for M/MOD which seems to be a signed flavor of UM/MOD 21:45:11 I believe it should be UM/MOD ( ud u -- +remainder +quotient ) and M/MOD ( d n -- +remainder signedquotient ) 21:53:23 Don't do that. 21:53:45 I remember helping someone with Blazin' Forth, it's obsolete. 21:54:02 m/mod comes from before 83-standard. 21:55:19 m/mod is invoked by "#" to build the output string 21:55:26 I know what it is. 21:55:41 when you say don't do that, what is "that"? 21:55:42 And I say, don't waste your time on Blazin' Forth. 21:55:59 It is obsolete system with roots before 1983. 21:56:12 I'm writing a forth for a pre-1980 commodore pet 21:56:20 That isn't excuse. 21:56:36 Why don't you write BASIC? 21:56:45 Isn't it as c00l? 21:56:53 http://github.com/chitselb/pettil 21:56:57 there's what I have so far 21:57:26 since I've already got about 10K lines of code, I don't want to scrap it and implement BASIC 21:58:14 Do you want to write Forth to throw it effectively away? 21:58:46 if by "throw it effectively away" you mean "run it on actual hardware" then the answer is yes 21:59:03 No, I mean what I write: throw it away. 22:00:11 Besides, I find it annoying to point to web frontend to VCS, 22:00:11 where do I find URL to checkout the source? 22:00:11 I want a Forth to run on my PET. I have a 7-year old son who appreciates the aesthetic value of the case design and the simplicity of the 6502 instruction set 22:00:23 github.com / chitselb / pettil 22:00:46 not sure if my URLs are being filtered 22:00:52 it's on github 22:00:59 under chitselb/pettil 22:01:12 * ASau``` sighs. 22:01:12 project name: pettil 22:01:14 fatal: http://github.com/chitselb/pettil/info/refs not found: did you run git update-server-info on the server? 22:01:28 Do you call it valid URL? 22:02:07 That's the right URL 22:02:28 Look, 22:02:30 $ git clone http://github.com/chitselb/pettil 22:02:30 Initialized empty Git repository in /tmp/pettil/.git/ 22:02:31 fatal: http://github.com/chitselb/pettil/info/refs not found: did you run git update-server-info on the server? 22:02:41 Obviously, it isn't right URL. 22:04:59 Yeah. 22:05:27 You're dumbfully copying long obsolete technique. 22:05:48 There's already more effective one. 22:06:07 git://github.com/chitselb/pettil.git 22:06:14 .byt (emit-*-1)|bit7 22:06:15 .asc "EMI","T"|bit7 22:06:46 This means that: 22:07:09 1. Your system isn't 8-bit clean, and you're asking for surprises. 22:07:44 2. Your dictionary search wastes time comparing names even when their lengths differ. 22:08:37 1. It's a Commodore PET. 8-bit clean has to do with SMTP and NNTP. Since I don't have a network stack on this box and never will, that's a non-issue 22:08:46 3. You have to maintain separate word to print word name. 22:09:00 2. my dictionary search is a lot more efficient than figForth 22:09:03 8-bit clean has to do with any text processing. 22:09:31 It still isn't as effective if you choose to store counted strings. 22:09:34 It's a PET 2001. It has the PETSCII character set. 22:09:45 all bets are off since upper and lowercase are swapped 22:10:01 do you read comp.lang.forth? 22:10:08 Yes, I read it. 22:10:31 there's a ridiculous thread there that I started about a month ago, "what are my options for dictionary hashing?" 22:11:10 Yes, there's such smart man as Hugh. 22:11:53 he recommends that I port 15 screens of his esteemed ANS Forth "symtab" package to 6502 primitive 22:12:23 You're strongly recommended to ignore him. 22:12:41 I've sort of figured that out, after I took the bait once or twice 22:12:55 Before you understand what the whole talk between him and John&Co. 22:13:09 ...is about. 22:13:49 I gather there's some history between them 22:14:14 I haven't done much in Forth since 1984-1985 or so 22:14:43 Then it will be tough for you. 22:14:48 not really 22:14:56 Yes, really. 22:15:03 The world has changed much since then. 22:15:15 I look at your code and it reminds me figForth. 22:15:22 I'm not implementing ANS Forth, I'm going Forth-83 22:15:32 And what's the point in that? 22:15:44 I don't want the bloat. If Chuck Moore were dead, he'd be spinning in his grave about the ANS Forth standard 22:16:01 This machine has 32K of RAM. That's maxed out. 22:16:02 ANS Forth supports less bloat than Forth-83. 22:16:27 When you know what you're doing, of course. 22:16:37 I was under the impression that ANS Forth presumes a 32-bit stack 22:16:47 and 32-bit wide cells 22:16:54 ??? 22:17:48 I don't remember this in standard, and I don't think it is there. 22:17:50 maybe I'm wrong about that, but I could swear I saw 32-bit wide all over the ANS Forth draft standard 22:18:43 You're definitly wrong. 22:19:01 The restriction is "not less than 16 bits". 22:19:11 See 3.1.3.2 "Integers." 22:19:59 I can explain where your model is ineffective: 22:20:36 1. You have to traverse strings comparing them even when you know exactly that they differ in length. 22:20:51 2. You have to maintain separate words to display strings from dictionary. 22:20:56 1 traverse is add the length byte 22:21:02 -1 traverse is seldom invoked 22:21:28 3. You have to copy words when interpreting to HERE even when you don't need that. 22:21:50 "2" is waste of memory, "3" is waste of time. 22:22:08 the root (FORTH) vocabulary is broken up into 16 threads, and I used a Pearson hash to balance them evenly (i.e. my hash function to select which thread for a given name is uniformly distributed) 22:22:11 "-1 traverse" isn't needed at all. 22:22:23 each thread is sorted by ascending length 22:22:58 so I hop through the link list until the length byte matches, then do string compares until the length byte no longer matches 22:23:25 it replaces the brain-dead figForth approach of scan every name field in a single linked list 22:24:01 4. Maintaining difference between CFA and PFA is useless too. 22:24:12 It is extra words. 22:24:58 consider B/BUF 22:25:16 it's got a 2-byte LFA which points to the next word in its thread 22:25:18 5. "?PAIR" brings ineffective solutions. 22:25:35 it's got a 1-byte length and flags, and the text "B/BUF" for the NFA 22:25:46 then it's got JSR DOUSER in the CFA 22:25:54 and then it's got a 1-byte offset into the user area 22:25:57 that's the PFA 22:26:07 how can I get rid of either the CFA or PFA in this case? 22:26:11 You don't need PFA. 22:26:16 same for constants, variables 22:26:23 vocabularies 22:26:32 secondaries 22:26:34 You just don't need PFA. 22:26:50 it's a direct-threaded Forth 22:26:54 Where do you use PFA explicitly? 22:26:59 In high level code. 22:27:13 I haven't written a lot of high level code for it yet 22:27:24 I'll probably do a game 22:27:26 Alright, where do you intend to use it? 22:27:35 on my PET 22:27:45 I have a machine I bought in 1979 when I lived in Ann Arbor. It still works. 22:27:46 In high level code. 22:28:11 I don't have a specific intention to use TRAVERSE or PFA 22:28:14 What constructs require knowledge of PFA? 22:28:25 Why do you want to maintain them? 22:28:26 off the top of my head, I can't think of one 22:28:50 That's why both were removed after figForth. 22:28:54 by "maintain them" do you mean "provide words to access their address"? 22:29:06 AFAIR, even Forth-79 didn't have them. 22:29:22 Yes, and all infrastructure around them. 22:29:41 Like high bit set. 22:31:08 This removal alone simplifies this shit: 22:31:09 .byt (count-*-1)|bit7 22:31:09 .asc "COUN","T"|bit7 22:31:17 into straightforward 22:31:25 .byt count-*-1 22:31:25 .asc "COUNT" 22:31:48 you see all those $DE $AD LFAs? 22:32:03 .word $adde (it's low-endian) 22:32:04 After that you don't need to: 22:32:19 a) reset that bit#7 to get word length; 22:32:36 b) maintain separate word to print dictionary entry name 22:32:46 (because it is "count type") 22:32:56 See? 22:33:16 that would break RETHREAD 22:33:25 What does it do? 22:33:39 it replaces all occurrences of $DE $AD with a real link 22:33:47 it runs at startup, and before FORGET 22:33:54 How does it do it? 22:34:28 it scans for $DE $AD, then checks to make sure there's a negative byte immediately following, and another negative byte exactly "count" bytes away, and all the bytes in between are positive 22:34:49 in other words, I don't want it to treat an occurrence of $DE $AD that is a data element as a LFA 22:34:53 Owww! 22:34:56 What a kludge! 22:35:25 I'm like a guy who crawled out of a 1980 time capsule and started doing Forth again 22:35:58 what's your typical Forth environment like? 22:36:31 You have labels for LFAs, why don't you just pass them to your "bootstrap loader"? 22:37:41 (Yes, kludges usually break when anything changes.) 22:37:44 the assembler has access to that symbol table and those labels (xa65 on Ubuntu) 22:38:05 they aren't a part of the object file, which is a PET binary 22:38:30 I know what a kludge is 22:38:45 I'm almost sure that it is absolute binary. 22:38:48 Not relocated. 22:38:50 Right? 22:38:52 correct 22:39:23 the ultimate goal is to metacompile, something along the lines of how volksForth does it 22:39:26 Then you can prepare table of real addresses and store them in the file. 22:39:48 that's one option. Have you ever used a PET before? 22:40:21 this particular machine has cassette tape, not even floppy disk 22:40:22 No, I started from ZX "Spectrum" compatible. 22:40:45 so I'm going to go with a file-based source code mass storage 22:41:20 I'd do it another way. 22:41:59 I'd use block storage instead. 22:42:05 was that Z-80? I had a Timex Sinclair and a Radio Shack Model I 22:42:12 It was KP580BM80. 22:43:50 the wikipedia zx spectrum article says it had a z-80 in it, the article on the KP580BM80 says it's an 8080 clone 22:44:57 I'm pretty sure Z80 and 8080 were source but not object compatible, and the Z80 was a superset of the 8080 instruction set 22:45:14 I haven't really messed around with those machines since 1979 22:46:13 I'm not sure it is 8080 clone. 22:46:48 Here's another source of inefficiency: 22:47:05 _existsq 22:47:05 #include "enter.i65" 22:47:05 .word bl ; ( c ) 22:47:05 #include "page.i65" 22:47:10 .word _word ; ( nfa ) 22:47:14 #include "page.i65" 22:47:14 .word _find ; ( nfa true | here false ) 22:48:10 I'm familiar with that section of code. I can't say I wrote it, but I debugged it. 22:48:27 "bl word" copies strings to HERE. 22:48:34 what's the inefficiency? 22:48:55 as opposed to leaving them in TIB 22:48:57 good point 22:48:58 This means that when you're interpreting any word, you make a copy of it. 22:49:17 New ANS "parse-name" doesn't have that defect. 22:49:50 In addition, "parse-name" can handle any whitespace symbols, 22:50:00 rather than only "bl". 22:50:06 I have admitted my unfamiliarity with ANS Forth, citing Chuck Moore's (alleged) unfamiliarity with ANS Forth as my mealy-mouthed excuse for not learning it. 22:50:53 there aren't too many whitespace symbols in PETSCII. I'm using the ROM routine screen editor code for EXPECT 22:51:25 Tabulations? 22:51:39 I don't understand the question 22:52:02 Do you have tabulation symbols in your character set? 22:52:10 control-I? 22:52:15 Yes. 22:52:29 no. There is no tab key on the keyboard. There's a RVS | OFF key where the tab key should be. 22:52:40 It's not ASCII. It's a close relative. 22:52:55 This architecture came out in 1977, when EBCDIC was common 22:55:13 What does "page.i64" do? 22:55:25 "i65" 22:55:30 you saw the NEXT routine, right? 22:55:39 inc ip; inc ip; jmp (ip) 22:55:48 that's it. 15 clocks 22:56:00 So? 22:56:42 so when the compiler sees it's about to hit a page boundary up above $xxFC or so, it will be inserting a .word PAGE into the secodary at that point 22:56:51 otherwise, nothing would ever inc ip+1 22:57:12 the NMOS 6502 has a very annoying hardware bug involving JMP ($xxFF) 22:57:44 it was corrected in the Western Design Center and Rockwell and other second-source chips 22:58:32 This is exactly the thing that is better done by preprocessor. 22:58:53 * ASau``` shrugs. 22:59:01 you must have missed the part where I said "the eventual goal is to metacompile" 22:59:23 I know it's not an economically viable project. I know there are a thousand better things I could be doing than this. 22:59:24 I'd rather start with metacompiler itself. 23:00:05 I want to boostrap a Forth on my old computer. It wasn't my first machine, but it was the first machine I actually owned. 23:00:29 not counting a TI-59 calculator and some other crummy programmable calculator I got in 1978 at Radio Shack 23:01:18 but before I bought the PET I got to use some Wang 2200 machines at my school, and stole time at the local community college running FORTRAN decks and stuff like that 23:01:41 there was also a TRS-80 Model I my senior year 23:02:34 In my experience even standard m4 helps a lot with this stuff. 23:02:55 At least you don't have to write pages long asm definitions 23:03:21 with repeated "dw this", "dw that". 23:03:34 yeah, it's a bit tedious 23:03:54 doneqlfa .word $adde 23:03:54 .byt (doneq-*-1)|bit7 23:03:54 .asc "DONE","?"|bit7 23:03:54 doneq jsr uservar 23:04:02 it's at the point right now where I get a welcome banner message, a blinking cursor, I can type stuff like 23:04:17 1 2 3 ROT SWAP DUP OVER DROP DEPTH 23:04:20 This could be "defuser(DONE?, doneqlfa, doneq)" 23:04:29 and then look in the monitor and it's all done properly on the stack 23:04:35 so I want to get . working 23:05:29 I could write it as .word foo, dup, twoplus, cstore 23:06:55 in xa65 the #if and other assembler directives have to start in column 1 23:07:22 it's open-source and I could enhance it, but that would be drifting afield 23:07:32 So what? 23:08:08 It isn't a problem to make m4 macro to emit anything at 1st column. 23:08:24 so if I write .word foo, dup, oneplus, cstore and one of those words gets cut in half at a page boundary, it will crash the system 23:08:43 I never used m4, looking into it 23:09:44 looks like sed on steroids 23:10:57 I'm surprised you weren't completely offended by my inclusion and use of Woz' "Sweet-16" package in there 23:11:54 it's something I discovered last week. I never used Sweet-16 back in the day 23:15:54 m4 is the kind of thing I usually throw a quick-and-dirty bash/perl/ruby script at 23:16:11 looks pretty good from what I've seen so far 23:19:14 In my experience m4 saves 2/3 to 3/4 of asm source. 23:19:27 At least it keeps size manageable. 23:19:58 I once spend a night implementing Forth from scratch with m4 and as. 23:20:07 it's a little tricky. Sometimes I use enter.i65, sometimes it's pad.i65 and other times it's page.i65 23:20:59 also if it's the last word within a secondary, there doesn't need to be anything between lastword and exit 23:21:18 I *could* put a call to page there, but the call to exit takes up the same amount of room 23:21:58 you brought up Forth from scratch in one night? 23:22:10 Well, I almost did. 23:22:28 But it was all hosted without backward compatibility and stuff. 23:22:34 the Forths I used in the 80s were MMSForth on a TRS-80 Model 4 and Blazin' Forth on a C=64 23:23:38 (Plus it was late spring.) 23:23:58 I'm sure I noodled around with Forth on the VAX but didn't spend the time with it that I did in MMSForth (getting paid to do it at work for over a year) and Blazin' Forth 23:25:13 so your advice would be: Ditch Forth-83, go with ANS Forth instead. The 16-bit cell falls within the standard. 23:25:14 ? 23:26:06 that's not a bad idea. I've got Gforth and there's allegedly (broken) support for the 6502 chip in there 23:26:45 I notice in Gforth when I type "words" it scrolls for about 200 lines. That's more than my poor PET can take. Is there some sort of minimum wordset for embedded systems? 23:28:53 Yes. 23:29:09 Get ANS draft and look for "CORE" word set. 23:29:37 You can reduce and replace words as you wish, if you don't want to maintain full compatibility. 23:30:29 http://code.google.com/p/pforth may help a bit. 23:30:49 http://ficl.sf.net/ or this. 23:31:05 I can help with both. 23:31:55 (When using any of them, use CVS or Subversion HEAD versions.) 23:35:02 I'll probably finish this project first, then write some applications (games) for it and teach my son Forth 23:35:30 but those links are in my deli.cio.us 23:37:31 I'm already pretty comfortable with the source code conventions I came up with in pettil.a65, but I'll take a look at m4 too 23:38:04 it seems like a better way than modding xa65 23:40:37 --- quit: gogonkt (Ping timeout: 264 seconds) 23:42:00 --- join: gogonkt (~info@183.27.211.167) joined #forth 23:42:13 and i'll look at those words to access the various parts of the definition to see which ones can be eliminated. Probably most of them 23:42:21 what am I missing? 23:43:07 Yes. 23:47:38 I spent quite some time fixing various bugs and defects in DragonForth when I owned Palm. 23:48:14 I had Quartus on my Palms 23:48:29 But I have less and less time for all this stuff as time passes. 23:48:32 didn't do too much with it, but it was nice to have it in my shirt pocket 23:49:45 there's a lot of hand-tweaked 6502 code in PETTIL. It should blow the doors off of any C=64 Forth I've seen. Those were all indirect-threaded. 23:57:28 No idea, if you want, I can help you with DragonForth meta-compiler. 23:57:45 But it is neither this week nor next one. 23:59:59 --- log: ended forth/10.09.28