05:38:09 --- log: started forth/05.03.09 05:38:09 --- join: clog (nef@bespin.org) joined #forth 05:38:09 --- topic: 'Forth: One language, many dialects. #forth - general forth discussion. #c4th - ColorForth. #retro - RetroForth. #c4th-ot - social channel. #1xforth - a secret channel for 1x forthers. #concatenative - the category of language that forth belongs to (sorta).' 05:38:09 --- topic: set by thinfu on [Sun Feb 13 21:19:07 2005] 05:38:09 --- names: list (clog docl Fractal aum skylan warpzero_ swalters ASau KB1FYR I440r Hyrax hrmpf saon SeaForth cmeme @I440r_ rastm2 arke thinfu ianp Frek onetom yumehito juhammed @crc) 05:38:56 --- quit: docl (Read error: 110 (Connection timed out)) 05:44:23 --- join: Quartus (~trailer@ansuz.pair.com) joined #forth 06:02:40 --- quit: aum () 06:35:37 --- join: TheBlueWizard (TheBlueWiz@modem-153.nyc-tc03a.fcc.net) joined #forth 07:20:09 --- quit: SeaForth (Read error: 110 (Connection timed out)) 07:33:34 --- join: Topaz (~top@cerberus.saywell.net) joined #forth 07:40:15 --- join: docl (~docl@dpcbw098001.direcpc.com) joined #forth 07:49:37 --- quit: hrmpf () 07:49:55 --- join: hrmpf (~hrmpf@gw.mastmoen.no) joined #forth 08:04:56 --- quit: docl (Read error: 104 (Connection reset by peer)) 08:09:25 --- join: SeaForth (~SeaForth@c-24-1-126-202.client.comcast.net) joined #forth 08:13:48 --- quit: hrmpf (Read error: 145 (Connection timed out)) 08:47:25 --- join: Serg[GPRS] (~z@193.201.231.126) joined #forth 08:56:47 --- quit: Serg[GPRS] () 09:43:24 --- join: hrmpf (~hrmpf@gw.mastmoen.no) joined #forth 09:49:55 bye all 09:50:01 --- part: TheBlueWizard left #forth 09:50:24 Good evening, hrmpf! 09:52:39 --- join: Herkamire (~jason@h000094d30ba2.ne.client2.attbi.com) joined #forth 09:52:39 --- mode: ChanServ set +o Herkamire 10:28:23 i had a whale of a time failing to to parse numbers earlier 10:28:28 neither CONVERT nor PARSE seemed to do what I wanted 10:31:41 Does ANS define NUMBER word? 10:32:37 I thought that FIG (NUMBER) is called CONVERT now, but NUMBER remained unchanged. 10:33:23 number conversion is fun 10:34:23 Well, Gforth has NUMBER word. 10:34:46 pforth doesn't, unfortunately 10:34:47 It looks standard. 10:34:58 Maybe >NUMBER ? 10:35:06 the arguments to CONVERT were cryptic enough, and whilst it appears to acknowledge the number in the input stream, it doesn't output it anywhere 10:35:33 hmm, how am I using >NUMBER? 10:36:03 Topaz: what sort of number do you want it to interpret? 10:36:43 a hexdecimal value, preferably 10:36:49 oh, i know what i did 10:37:02 Gforth info says this: 10:37:06 `>number' ud1 c-addr1 u1 - ud2 c-addr2 u2 core ``to-number'' 10:37:06 Attempt to convert the character string C-ADDR1 U1 to an unsigned 10:37:06 number in the current number base. The double UD1 accumulates the 10:37:06 result of the conversion to form UD2. Conversion continues, 10:37:06 left-to-right, until the whole string is converted or a character that 10:37:07 is not convertable in the current number base is encountered (including 10:37:09 + or -). For each convertable character, UD1 is first multiplied by the 10:37:11 value in `BASE' and then incremented by the value represented by the 10:37:13 character. C-ADDR2 is the location of the first unconverted character 10:37:15 (past the end of the string if the whole string was converted). U2 is 10:37:18 the number of unconverted characters in the string. Overflow is not 10:37:19 detected. 10:37:37 so what is ud1 meant to be? 10:37:45 It's accumulator. 10:37:54 It should be zero at start. 10:40:41 --- quit: KB1FYR (Remote closed the connection) 10:40:50 --- join: KB1FYR (~Alex@196-220.suscom-maine.net) joined #forth 10:45:20 : to-hex-digit dup 58 < if 48 - exit then 87 - ; 10:45:20 : hex-str->num ( addr u -- x ) 0 swap 0 do 16 * over i + c@ to-hex-digit + loop ; 10:46:16 oops, that leaves garbage on the stack. 10:46:30 : to-hex-digit dup 58 < if 48 - exit then 87 - ; 10:46:30 : hex-str->num ( addr u -- x ) 0 swap 0 do 16 * over i + c@ to-hex-digit + loop nip ; 10:47:27 anybody got 3D glasses? check out what I made with povray (red-green composition with the gimp): http://herkamire.com/downloads/anaglyph.jpg 10:48:22 In case of >NUMBER presence, it's better to go this way: 10:48:49 0 s->d 2swap >number 2drop 10:49:03 ( a c -- ud ) 11:22:33 Topaz, pforth has >NUMBER, righty? 11:22:35 -y? 11:29:02 yeah 12:27:56 0 s->d ... why not ust do 0 dup ? 12:43:32 --- join: docl (~docl@dpcbw101185.direcpc.com) joined #forth 12:48:21 --- join: tathi (~josh@pcp01375108pcs.milfrd01.pa.comcast.net) joined #forth 12:50:40 --- join: Freejack (~nicad@c-24-11-30-248.client.comcast.net) joined #forth 12:53:38 hmm, i think i need to modernise my INTERPRET 12:53:58 err no. 12:54:33 why modernize at all. forth hasnt invented anything new that is better than what we had before. 12:54:39 if it aint broke..... 12:54:57 well, i currently just have ] etc looping 12:55:08 i believe it's now common to use a state variable, and only one loop 12:55:17 at least, somebody was talking about it yesterday 12:55:47 yeah, I caught a little of some conversation about your INTERPRET 12:55:53 seemed kind of complicated to me :) 12:56:12 well, i'm just confusing myself horrendously ;) 12:56:27 cross-compilers require a rather firm grasp of the differences between compile time and run time... 12:57:00 since in one mode i need my literals compiled as load-immediate instructions, in the other i need them on the stack, and i'm trying to work out which ;) 12:57:19 :) 12:57:55 my main motivation behind fixing INTERPRET is that i was stalled today for hours by a really silly bug ;) 12:58:09 my current parsers don't allow anything except spaces between words 12:58:10 always assume it needs to go on the stack but if the next opcode is going to be a POP into a register.... 12:58:17 so tabs and newlines was breaking it horribly 12:58:28 no tabs is good! 12:58:29 well, this isn't optimisation 12:58:50 just the difference between pushing opcodes onto the host stack, and the target stack 13:07:40 What's up? 13:17:05 I'm hunting without success for a 16-bit Forth ARM assembler. 13:17:21 I'll have to convert a 32-bit version. 13:18:38 16-bit ARM? 13:18:46 32-bit ARM, 16-bit Forth on another CPU. 13:22:25 Figuring out how to reverse the order of "depth" elements of the stack without using "pick". 13:22:52 Or the return stack, or a variable. 13:23:34 If n is <=3, it should be easy. :) 13:24:08 Easy if n <= 4. 13:24:16 swap 2swap swap 13:24:24 Heh. 13:24:50 So you're done. Leave n>4 as an exercise for the student. 13:25:27 Quartus: I am a student. Heh. 13:25:35 *Another* student. :) 13:26:35 Is it specified just not to use 'pick'? 13:27:24 Nope. But, as I understand it, using 'pick' is considered bad form. Besides, this is more challenging. 13:27:51 I'd think ROLL was better suited. But both pick and roll are evil, yes. 13:28:08 * tathi would think that that sort of operation is the same sort of evil as pick and roll. 13:28:24 so...if you're going to make a stack reverse, you might as well use them... 13:28:29 Yes, I can't think of any circumstance where there'd be so much data on the stack you'd need a generalized routine to reverse them. 13:28:55 s/evil/"evil"/ :) 13:29:09 No quotes needed. There's actual evil there. :) 13:29:59 well, I certainly think that if you're writing code that needs pick and roll, then you're doing something wrong. 13:30:05 True. 13:30:07 but some people do seem to like them. 13:30:08 Well...I'm doing it as an excercise to help me figure out how to non-destructively operate on "depth" elements on a stack....for example, screen coords. 13:30:35 Have a routine that does "dup *" on "depth" elements of the stack. 13:30:40 Though there are some circumstances when working with foreign functions written in C, where the external function requires a dozen or more parameters; then sometimes there's occasion for PICK. 13:30:54 Quartus: True. 13:31:20 Of course, I'd probably use the return stack for something like that. 13:31:26 Freejack: I think that in that sort of case, _I_ would have things in an array in memory (or something) rather than on the stack. 13:31:37 Right. 13:32:47 Yeah, I suppose using a Variable isnt such a problem in those cases. 13:33:31 Forth seems to work best when you do most everything destructively, and try and factor so you have as few things on the stack as possible. 13:35:00 Learning how to manipulate large numbers of stack items isn't the trick. Keep your stack shallow -- that's the trick to learn. 13:35:16 Gotcha. 13:35:27 3 items is a good rule of thumb 13:35:49 but if you need to hit the 4th or 5th every once in a while then no problem :P 13:35:58 as long as u dont goo overboard with that :P 13:36:13 I'd go as high as 6, since there's 2OVER, but once you're beyond the reach of the usual stack operators, there's too many items. 13:36:27 pluck etc 13:36:29 bleh 13:36:52 2over is really for double sized numbers so its meant to be thunked of as TWO items on the stack not 4 :) 13:37:14 Well, it's not DOVER. I've used it many times on things other than doubles. 13:37:30 Hrrrmmm...Using create does> I could actually link something like "dup *" to each number I want squared. 13:37:36 yah, for me it's more about being able to remember what's on the stack than being able to reach them. 13:38:18 * tathi still can't juggle more than 3 or 4 stack items in his head. 13:38:34 It's never easy. That's the reason to keep it shallow. 13:38:38 yup yup 13:38:52 Gotcha. Keep it shallow. 13:39:13 Is there a blonde joke in there somewhere? ;-> 13:39:16 With the Palm OS, I have to sometimes stack up open resource handles so they can be freed later -- so the depth grows. But I'm not trying to access any of those; they're just hanging around waiting until later. 13:40:24 yea you can have 20945720948 items on the stack, its just bad form to be accessing anything except the top 3 usually 13:41:21 Gotcha. I can have a bunch of items on the stack, but I should only be working with the top three at any given time. 13:41:26 Give or take. 13:50:00 An interesting exercise is implementing . using only the stack. 13:52:25 hmm, so is PICK considered dirty and horrible? ;) 13:52:57 Yup. 13:53:52 2OVER sounds quite suitable... 14:05:28 Would anyone like to practice converting 32-bit code to 16-bit for me? :) 14:06:01 Hmm, I thought as much. Have to do it myself. grumble grumble 14:06:04 is that Thumb code? 14:06:40 No, Forth code -- an ARM assembler written for a 32-bit Forth. I need it to run on a 16-bit Forth, so all the values become double-cell values, the logical operators have to operate on those doubles, etc. 14:07:19 ah, sorry 14:07:56 Really I just have to go through and replace, for instance, OR with "2OR" or equivalent, and manage all the stack juggling accordingly. 14:09:16 am I right i thinking that PARSE works the same as WORD, just leaves two values on the stack (the length also) instead of one? 14:09:27 (can i feed the c-addr from PARSE to FIND? 14:09:35 WORD uses an external buffer. 14:09:43 FIND expects a counted string, so no. 14:09:59 ah, hmm 14:10:06 Many implementations provide a SFIND or (FIND) that takes an addr len pair. 14:10:10 what's a counted string? 14:10:19 first byte contains length? 14:10:21 A counted string is what WORD returns. Right. 14:10:27 ok 14:10:41 See if you have SEARCH-WORDLIST. 14:11:32 have got 'SEARCH' 14:11:36 and 'FINDNFA' 14:11:38 Different. 14:11:44 hmmrm 14:12:12 You can use an external buffer to create a counted string from what PARSE or PARSE-WORD returns, and then pass that to FIND. 14:12:31 so what does exactly does PARSE return? 14:12:36 Though really you're just re-writing WORD at that point. 14:12:51 The Standard PARSE? Got a copy of the Standard handy? 14:13:03 well, a c-addr and a length 14:13:15 --- join: zol1 (~l@ppp-62-245-163-219.mnet-online.de) joined #forth 14:13:25 g'day 14:13:30 but that is somehow not the same as a WORD c-addr, i'm supposing 14:13:41 Hi zol1. 14:13:47 hi 14:13:54 The WORD c-addr has a length stored there. 14:14:02 The PARSE c-addr doesn't. The length is on the stack. 14:14:11 ok 14:14:29 so i would indeed need to duplicate it in a buffer with the count first, etc etc 14:14:36 Or use WORD. 14:14:37 this is beginning to make sense ;) 14:14:55 i was using PARSE because my previous attempts at CONVERTing broke 14:14:59 although that was likely my own stupid fault 14:15:05 Use >NUMBER. 14:15:23 if you can use parse, that's fine 14:15:37 i'm using >NUMBER with PARSE now, it works beautifully 14:15:41 just i can't use FIND anymore :/ 14:15:42 id usually the cheapest stream input word 14:22:35 Topaz: dpans call CONVERT "obsolescent" 14:25:04 yeah 14:25:08 so i wanted to use >NUMBER 14:25:19 Quartus: where/how do you tell ?do and leave how to get to address behind loop ? 14:25:23 hmm, actually, i guess i could convert a counter string to a c-addr/u 14:25:26 counted* 14:26:29 zol1, you've lost me. 14:26:39 Can you explain further what you're trying to do? 14:26:54 Topaz, that's what COUNT is for. 14:27:16 both ?do and leave need to know tha address behind corresponding loop. but when ?do and leave are compiled, that address is not known yet 14:27:30 I'm getting lost at 'behind corresponding loop'. 14:27:41 Are you talking about implementing ?do and leave? 14:27:44 that means, loop needs to do something so that ?do or leave know there loop is 14:27:48 right 14:28:10 --- quit: I440r_ ("Leaving") 14:28:17 Quartus: ooh, COUNT, wow, thanks 14:28:26 Ah. LOOP and +LOOP create a branch back to DO, and also take care of resolving any LEAVEs in the loop. 14:29:02 Bear in mind you may have multiple LEAVEs in a loop, and that you may be nested within another do/loop that also have LEAVEs. 14:30:09 sure. unclear is, if loop branches back to ?do, where does your ?do know the branch offset to behind loop 14:30:10 ? 14:31:01 DO leaves a do-sys on the stack, and LOOP uses that to resolve the branch -- just as AGAIN uses the info left by BEGIN to resolve that branch. 14:31:35 but still, from *leaving* do-sys on stack, ?do still doesn't know where loop is 14:32:04 begin doesn't branch behind until, but ?do may branch behind loop 14:32:15 Ah. ?do. Sorry. That's a special case. It's equivalent to encasing a normal DO/LOOP in an IF/THEN, and can be implemented that way. 14:33:07 Quartus: i know how it *can* be implemented, and know several methods for, i'm interested specifically how you i.e. quartus forth does this. 14:33:19 Alternatively, LOOP could take care of patching ?DO to branch forward. 14:34:03 Oh. Ok. Quartus Forth handles ?do by compiling an IF DO sequence, and setting a flag so that LOOP (and +LOOP) compile a corresponding THEN afterward. 14:34:23 (i tend to add a literal behind do/?do which is patched by loop/+loop, and used (run time) by leave and ?do) 14:34:42 My LEAVE is statically-compiled. 14:34:46 ah, right. thanks :) 14:35:24 LEAVEs are chained from the do-sys, and resolved by LOOP. 14:37:05 Sorry for the confusion; when you ask "how do you do x" I imagine you're asking how it's done, not how I chose to do it. 14:38:13 right. though, general question, like "how does one do this or that" i wouldn't direct specifically at you 14:38:49 I couldn't think of any simpler way of managing ?DO. 14:39:00 And I didn't like the idea of LEAVE having to do any work at run-time. 14:40:01 well, work is "add contents of addr behind do (which is on stack compile time) to ip (ignoring the unloop)" which is pretty much what 0branch in if or until do 14:40:29 Yes. It's minor, but it can be eliminated at compile-time. 14:40:53 hmm 14:41:10 with threaded code, the offset has to come somewhere from 14:41:25 You can back-patch it when you compile LOOP. 14:42:14 whether it is, say, in address following leave, or behind do/?do, seems to be the same work to me 14:43:25 I see what you mean. You could save storing it behind do/?do, though, if I understand correctly. 14:43:32 Reclaim the space. 14:43:47 that's true, costs an extra cell per loop 14:44:23 --- quit: docl (Read error: 104 (Connection reset by peer)) 14:45:17 And if I am envisioning it correctly, you could eliminate a primitive and just use branch. 14:45:23 --- join: docl (~docl@dpcbw101185.direcpc.com) joined #forth 14:45:29 otoh, saves two cells by avoiding an extra if...then 14:47:46 I daresay LEAVE is more commonly used than ?DO. 14:48:57 question of style. some coders try do avoid wildly exiting structures, others use them to full extend 14:49:44 Herkamire would probably use them if he would like loop at all 14:49:52 *g* 14:50:06 crc probably the same 14:50:31 of most others here i wouldn't be sure 14:51:16 I'm not a language purist. I favour what works. 14:52:44 would crc have written "starting forth", the "stars" example would look like : 5stars star star star star star ; 14:53:00 I see. 14:54:52 and Herkamire's probaby : 5stars 0; star star star star star ; :) 14:55:08 ehm, no 14:55:12 not quite 14:56:13 maybe more like : star 0; for star next ; 14:56:42 Some convoluted personal syntax? 14:57:28 several ppl here seem to favour for next above do loop . the 0; (conditional exit) is Herkamire's favorite 14:57:42 I have a reputation :) 14:57:50 for/next is faster in my implementation. 14:57:58 it most often is 14:58:01 It'd be faster still if I didn't choose to make i available. 14:58:17 easier to test, less stack action 14:58:19 I don't make i available 14:58:57 you can of course grab the counter if you know the implementation, but it counts down to 1 instead of up from 0 14:59:06 Mine too. 14:59:13 I440 would probably say "if ans supports it, it ain't forth" or the like :) 14:59:41 I continue to be mystified by anti-Standard sentiment, but to each his own. 14:59:58 mine too (next exits at 1) 15:00:03 yeah, I'd do : stars 0; for star next ; 15:00:18 see :) 15:01:07 Quartus: much of the anti-standard stuff comes from people who don't like forth the way it is specified in the ANS standard 15:01:17 That's clear. 15:01:22 in my view there are several things in the standard which are just plain stupid. 15:01:22 zol1: actually, crc wouldn't have done :5stars star star star star star ; i actually had to explain that to him 15:01:35 like making it so such a loop: 7 for star next 15:01:40 thinfu: but now he knows 15:01:43 would not call star 7 times 15:01:52 sure, but he doesn't really care for it 15:02:07 I could be wrong about that actually... 15:02:08 for/next aren't in the Standard -- are you thinking of the equivalent do/loop? 15:02:12 he prefers readability (his own brand of readability at least). . 15:02:19 whatever. I gotta go for now 15:02:25 Herkamire: it probably would. index 7 .... 1 15:02:31 makes 7 iterations 15:03:22 Herkamire: gforth would afaik make 8 iterations from it 15:03:27 which i find odd 15:03:56 yes, just tested, it really does 15:04:47 Quartus: right, like the cmforth for next 15:05:31 I just checked Quartus Forth's for/next. It would do seven iterations. 15:05:42 originating on novix, which had a single-clock decrement and conditional branch for this purpose 15:06:52 * zol1 got used to for next during that period 15:07:33 I use the count register in for for/next in herkforth 15:08:02 makes sense 15:08:28 that's why tou don't like nested loops ? 15:08:43 nesting works fine 15:09:00 *works*, yes, at the expense of additional register pushing 15:09:03 I just like to factor more 15:09:10 for always pushes 15:09:19 ah, ok 15:09:28 it never clobbers the value in the count register 15:09:35 thought you'd do some compile time backpatching 15:09:52 what's that? 15:10:32 i wonder how to go about making my compiler optimising 15:10:33 ehm, never mind. wrong trail of thought. would need to push anyway, even if factored 15:10:34 somehow try to check if it's will be the outermost for and don't save the value? 15:10:46 an easy place to start is nuking redundant push/pops 15:10:59 Topaz: yeah, that sounds like a lot of fun 15:11:10 tis quite exciting :D 15:11:31 if you have a few registers to play with (or just two works pretty well I think) 15:11:44 well, I have 32 15:11:48 so i could go to town, rather :) 15:12:13 infact, could probably completely optimise the stack away in some places 15:12:26 you can make a cool compiler that stores the top two or three stack items in memory, and keeps track of where they are and uses them in place until it gets to a function call or something when it has to put them in the "normal" order 15:12:33 yeah 15:12:42 i was wondering how to go about it 15:12:47 a obvious trick would be 'windowing' 15:12:53 all words that are written as macros to compile code can be aware of that stack stuff 15:13:10 yeah 15:13:43 so an implementation of say + would be something like "give me the register for TOS and SOS, compile the add instruction with those. ok now drop" 15:14:17 yeah, that's what mine does atm 15:14:18 i *think* on the 1600 microcontroller you can link registers, so contents of one would be transferred to another when written to. with modern cpus, if the internal register renaming could be controlled explicitely, that'd make a good window into top stack elements. 15:14:28 wow yeah 15:14:56 i'm tempted to design a proc sometime, in VHDL 15:15:01 cool 15:15:02 (for FORTH) 15:15:08 done before, i know i know, but you could do lots of cheeky things 15:15:11 Topaz: you on ppc too? 15:15:20 x86, heh 15:15:28 the laptop was free, i can't complain... 15:15:40 Topaz: didn't think x86 had that many registers 15:15:46 there's quite a lot of cpus already, many of them with schematics and vhdl sources 15:15:48 oh, sorry 15:15:54 misunderstood :D 15:16:00 i'm compiling for an AVR (teeny little microcontroller) 15:16:07 ahh 15:16:07 they have little RISC cores with 32 8-bit registers 15:16:18 :0 15:16:19 :) 15:16:20 single-cycle maths, and some of them a two-cycle multiplier 15:16:22 which is good fun 15:16:50 Topaz: did you have a look at some of the existing forth cpus ? 15:16:56 yeah 15:17:07 but i figured it'd be more fun to make one myself ;) 15:17:08 you could optomize further, by having some of your words check if some of those stack items have constant values 15:17:14 ah, yeah 15:17:22 eg optomize "4 +" to the add immediate instruction 15:17:23 i forgot about constant folding 15:17:32 or whatever one calls it :D 15:17:48 "4 +" compiles baaaad code in my forth. no optomization 15:18:09 swap before commutative words can go too 15:19:20 oh, only 3 instructions 15:19:31 no, that can't be 15:21:29 it's amazing what an optimisation TOS-in-register does 15:22:00 oh! lol, it's only 3 instructions because the third is a branch to the + word 15:22:18 --- quit: I440r (Read error: 110 (Connection timed out)) 15:22:28 I keep tos in a register 15:22:28 mine is 2 instructions :P 15:22:34 never thought of it as an optomization 15:22:42 pop r17 ; 000A 15:22:42 add r16, r17 ; 000C 15:23:30 no autoindecrement indirect mode 15:23:31 ? 15:23:39 autodecrement ... 15:23:57 my drop is 2 instructions 15:24:37 no way to avoid it. on ppc either dup or drop has to be 2 instructions 15:24:38 pop tos 15:24:42 what's the second ? 15:24:50 no pop instruction 15:25:16 ppc you can adjust the pointer before loads/stores, but not after 15:25:17 you two should swap :) 15:26:49 ah, you use a predecrement push, postdecrement pop 15:26:51 pop/push instructions do make life rather easy 15:27:02 i tend to do so as well 15:27:03 my drop and dup instructions are one cycle each ;) 15:27:08 saves a few cycles :) 15:27:20 words* 15:31:02 what would it take to seperate the compiler and the compiled opcodes with your compilers ? 15:31:26 and all parts of the compiler which assume something about the cpu compiled for 15:32:07 well, my 'compiler' consists of a huge number of opcode-compiling words, and a redefined colon compiler to use them 15:32:28 i mean, if we throw together cpu independant compiler code in such a way that everyone is happy .. 15:32:50 the result could be used to compile to everybodies favoured target cpu ... 15:33:22 i'd have some x86 native compiler to contribute 15:33:40 was thinking about picking up that one again 15:33:43 well, FORTH is so low level that what you describe isn't simple 15:33:53 paused work on it 1.5 years ago or so 15:34:05 it is definitely possible, just probably (almost certainly?) not worth the effort 15:34:36 there'd be a bonus 15:35:21 like, right now i only generate x86 code. probably herkforth is best at ppc. 15:36:04 i don't know whether compiling natively to x86 would be any use for herkforth 15:36:26 i wouldn't mind to be able to switch targets easily 15:37:07 herkforth may end up being easy to port 15:37:14 http://wiki.forthfreak.net/index.cgi?NativeCodeCompilerWorkingExample this is about what it generates 15:37:31 I don't think it would be unreasonably hard now. 15:37:49 what is 'Z and 'A ? 15:37:52 there's quite a bit of asm sprinkled about, but that should be pretty straightforward to convert 15:37:58 [char] Z 15:38:12 ah 15:38:18 top is forth souce ... 15:38:39 rest is disassembly of generated code 15:38:53 tis cute 15:38:59 though you could throw lots of optimisation at that 15:39:04 right 15:39:19 there's no/hardly any optimization done with this 15:39:20 but i have yet to try with my FORTH ;) 15:39:29 i'm quite looking forward to messing with it 15:39:32 but first... bed! 15:39:44 (have to be up at 7:00 tommorrow :/) 15:39:50 Topaz: see Peter Knaggs PhD thesis for some interesting optimization stuff 15:39:56 (caching top of stack in registers) 15:39:58 http://dec.bournemouth.ac.uk/staff/pknaggs/papers/index.html 15:40:06 ooh, cool 15:40:42 --- join: I440r (mark4@rrcs-24-242-160-169.sw.biz.rr.com) joined #forth 15:44:47 Herkamire, does a url to your code generator exist ? 15:46:44 code generator? 15:47:03 http://herkamire.com/jason/herkforth 15:47:13 you can download a tarbal, or browse the source online 15:47:22 about 60% with mine is x86 opcode generating, 10 % target compiler implementation, 20 % words used with target compiler, 20 % primitives 15:47:30 well, that's 110 % :) 15:47:50 I just wrote a word for each mnemonic 15:47:59 well, each mnemonic I use 15:48:39 on ppc the mnemonic tells you what opcode to generate. 15:48:50 *g* hoped for a link to click and have the source in the browser :) 15:48:53 you never have to figure out what opcode based on operand types or that foolishness 15:48:59 http://forthfreak.net/compiler.f 15:49:23 block 4 has the beginings of the assembler in it 15:49:42 block 6 has the first mnemonics defined 15:49:59 mission .. goals ... tarball .. *searching* 15:50:01 http://jason.herkamire.com:5000/svn/herkforth/blocks/004 15:50:03 http://jason.herkamire.com:5000/svn/herkforth/blocks/006 15:50:46 if you have linux (even x86) you can run it, and browse the source in style 15:54:24 on what blocks are the primitives, using the assembler words ? 15:54:54 try 10 15:55:18 yes, good one 15:55:20 14 has more 15:55:40 16..24 15:59:05 you mind : http://wiki.forthfreak.net/index.cgi?HerkForth ? 16:01:27 thanks :) 16:03:27 --- quit: Topaz (Read error: 113 (No route to host)) 16:06:20 --- nick: warpzero_ -> warpzero 16:15:35 looks difficult to define the primitives in a platform-independent manner 16:16:01 too platform specific implementations 16:16:42 yeah, I know there are some standard things on x86 that are tricky on ppc 16:16:46 would thus duplicate the words 16:16:54 and probably vice versa 16:19:19 my - as far - hardest go at platform-neutral primtives would look like this: http://wiki.forthfreak.net/index.cgi?MetaStic (example on 50% of page) 16:19:41 but this misses one layer 16:20:20 that is, it still assumes the architecture the primitives have been coded for, as best case 16:20:58 as soon the cpu doesn't fit in neatly, this would be useless 16:23:13 hmm 16:30:31 it mapped quite well on the H8 line of controllers. those are motorolish 16:31:59 sort of trimmed 68000s 16:36:33 in fact, the only reason one would consider to write a compiler which can target several platforms is because different compilers would probably not compile the same sources :( 16:37:50 --- join: ccfg (ccfg@dsl-roigw3de0.dial.inet.fi) joined #forth 16:38:33 did you follow the c.l.f. thread on the 200x forth standard ? 16:42:51 I did. 16:43:49 i got ambivalent feeling about that 16:44:40 I think it's useful. I like the DEFER proposal. 16:46:22 creating a new standard by extending the prev. standard would be the logical thing to do. but as the recent standard did a lot to fragment, i'm afraid a new would do so even more 16:46:58 I don't know that the 94 Standard did any fragmenting. Those who wish to make their own non-Standard Forths would have done so regardless of the content of the Standard. 16:47:07 or, an alternative new standard would likely break existing code 16:47:43 Yes, I wouldn't want them to break the Standard. They might recommend certain words be deprecated. 16:48:04 200x won't be ANS anyway. 16:48:14 Unless somebody wants to pay to carry it through that process, I suppose. 16:50:14 --- quit: Freejack ("Leaving") 17:49:04 --- join: Zymurgy (thrud@NorthBay-ppp282302.sympatico.ca) joined #forth 17:49:56 --- quit: tathi ("leaving") 17:53:54 --- part: Zymurgy left #forth 18:01:01 --- quit: rastm2 ("leaving") 18:21:02 --- join: Sonarman (~snofs@adsl-64-160-166-104.dsl.snfc21.pacbell.net) joined #forth 18:26:45 --- quit: docl ("Leaving") 20:12:07 what about the 1x forth standard? 20:12:25 200x must mean 200x bloat? 20:13:04 agreed 20:15:06 * thinfu knows nothing of the proceedings of c.l.f or 200x standard or whatever 20:34:35 --- quit: KB1FYR (Read error: 104 (Connection reset by peer)) 20:35:12 --- join: KB1FYR (~Alex@196-220.suscom-maine.net) joined #forth 20:38:15 --- nick: KB1FYR -> KB1FYR|AFK 21:05:11 --- join: asymptote (~dmesg@68.48.8.92) joined #forth 21:58:44 --- quit: asymptote ("Free the mallocs!") 22:37:43 --- quit: Sonarman ("leaving") 22:55:02 --- quit: zol1 (Read error: 110 (Connection timed out)) 23:19:14 --- quit: juhammed (Read error: 60 (Operation timed out)) 23:59:59 --- log: ended forth/05.03.09