00:00:00 --- log: started forth/06.07.08 01:51:44 --- part: diverge left #forth 02:25:25 --- join: neceve (n=claudiu@unaffiliated/neceve) joined #forth 03:07:02 --- join: Cheery (n=Henri@a81-197-20-242.elisa-laajakaista.fi) joined #forth 03:11:05 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 03:34:38 --- quit: Cheery (Read error: 104 (Connection reset by peer)) 03:34:38 --- join: arke_ (n=f2@bespin.org) joined #forth 03:57:33 --- quit: arke (Read error: 110 (Connection timed out)) 04:08:29 a syscall handler? what should that do? 04:08:44 --- nick: arke_ -> arke 04:21:04 A syscall word on IsForth is basically a CREATEd word 04:21:32 they all use the same code, but each one has two bytes (?) of data -- the syscall number and the number of arguments it takes 04:25:22 so it's like the syscall word in retro? 04:27:28 probably 04:27:29 * tathi goes to look 04:28:20 the syscall word in retro takes the data the number of arguments and the syscall number 04:28:59 yeah, similar 04:30:32 more like if retro had a syscall class, and the arguments were stored in memory instead of passed on the stack 04:30:38 but the actual code is pretty much the same 04:31:29 : syscall: create , , does> dup @ swap cell+ @ swap syscall ; 04:31:37 yup 04:31:37 3 5 syscall: sys_open 04:34:34 crc, do you sort the stack for import stuff or does it gets 1:1 feeded into the C functions? 04:35:31 iirc, C, does it from right-to-left 04:35:45 or was it left to right? 04:37:29 the arguments are passed in the same order as in C 04:37:45 ah, ok. 04:37:48 e.g., open("foo", O_RDWR); 04:38:02 " foo" zt O_RDWR sys_open 04:38:14 (assuming that the O_RDWR constant is defined) 04:38:45 crc, is there any difference between freebsd elf and linux elf? 04:39:01 very slight 04:39:14 freebsd requires a particular field to be "branded" 04:39:22 branded? 04:39:23 telling it what OS the ELF is for 04:39:44 brand -t 04:40:50 The ELF file always has that field, but Linux only supports one value 04:41:08 BSDs usually allow you to use different ABIs 04:43:26 --- quit: ayrnieu (Read error: 110 (Connection timed out)) 04:44:48 --- quit: tathi ("butchering chickens") 05:22:03 --- join: crc_work (n=cchilder@h-64-105-207-163.phlapafg.covad.net) joined #forth 05:46:51 --- join: PoppaVic (n=pete@0-1pool64-118.nas22.chicago4.il.us.da.qwest.net) joined #forth 06:39:26 wooohoo i got signals working in isforth :) 06:42:10 so another cool stuff? 06:43:16 what does exactly your <..> convention mean? 06:43:41 or those (..) words, I440r ? 06:43:51 ? 06:44:06 what do you mean ? 06:44:48 for example 06:44:57 or (ncomp) 06:45:08 ok if its in angle brackets its a system call 06:45:16 thats just a convention not a rule :) 06:45:23 and (xxx) is a primative 06:45:25 >net< 06:45:42 thats a badly named word - it converts to/from network order heh 06:45:48 I asked after a convention not a rule 06:46:16 with (xxx) type words you usually have a corresponding xxx word 06:46:18 tho not always 06:46:29 have you somewhere documentation things like that? 06:46:34 xxx would refer to the primative 06:46:39 not yet 06:46:58 well, xxx vs (xxx) is pretty conventional 06:47:25 I find it urgh. 06:47:47 I find much irksome - it lets me know I am alive 06:47:57 but should still be documented 06:48:51 sure - all the conventions should be. Most are not (or they go really 'over the top' ;-) 06:50:03 when they would be documented then someone would think about simplifying them. 07:05:52 Ugh 07:06:01 its not all about simplify simplify simplify 07:06:05 sometimes you just have to get something done 07:06:15 so you just do what you can to do it quickest 07:06:16 sure is 07:06:24 if you constantly simplify you wont ever get anything done 07:06:28 ..although decomposition is soooo handy 07:06:40 quite right 07:07:25 As this is an avocation (hobby) for me, I like decomposition. If I was getting paid, I'd write the throwaway and be done with it. 07:08:29 I was referring to virl :) 07:08:33 But yeah 07:08:35 :) 07:08:38 arke i agree and disagree - theres a happy medium 07:08:42 but the line moves 07:08:56 im not gonna say never simplify 07:09:03 it always depends on what you're doing 07:09:07 i take shortcuts to get the thing up and running and then refine the code over time 07:09:18 once it works and works well i dont generally futz with it any more 07:09:27 unless it causes problems later 07:09:32 then i futz with it again :) 07:09:47 im what you might call a lazy perfectionist 07:09:49 :) 07:11:27 I would like to hope that a Real Company would maybe hire a few folks to take the "throwaway" (app) and work on decomposing to use a "utility lib" - or add to one, etc. 07:11:48 I suspect they do not - anymore than they hire tech-writers. 07:23:03 Hmm.. goddamnit, I am betting I need to rewrite some files and go top-down for awhile. 07:44:47 arke, simplification is essential, else bloatwere and today shit comes out of it. 07:45:29 No.. THink about what was said (almost 40 minutes ago) 07:45:34 if you code something and then suddenly decide you did it all wrong... rm -rf and start over 07:45:48 sometimes i just do tha anyway. code it. delete it. code it again 07:45:53 hmm, sometimes applicable 07:46:21 If you rm -rf, you are admitting even the outline/concepts were bad 07:46:28 yes 07:46:36 or that you can do it better 07:46:55 and the end result will validate the effort 07:46:58 Usually, you can change yer head - this is why I like .h+.c 07:47:25 The _hard_ part is learning that the .h is the "public interface" 07:49:22 OK.. I need to reverse-think (top-down) this fucker.. And make a beerrun AND start on dinner - laters, folks. 07:49:25 --- quit: PoppaVic ("Pulls the pin...") 07:49:42 anybody understood him? 08:21:08 I did. 08:28:55 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 08:29:11 --- join: PoppaVic (n=pete@0-2pool198-7.nas30.chicago4.il.us.da.qwest.net) joined #forth 08:57:48 is there a forth equivilent to .h files? 08:57:57 no 08:58:03 should there be? 08:58:23 I tend to think so, but I live in C and am a pervert. ;-) 08:58:58 a .hophile, eh? 08:59:20 I suspect that - because forth sees 'state' and can parse & 'compile' - there is really little serious need for true .h files. 08:59:48 I think we have far greater issues with .o, .a, .so/.dynlib/.dll 08:59:55 ..and plugins 09:00:16 docl, forth files. 09:00:21 BUT, in the last decade I have never seen a really sensible solution to that. 09:00:39 only that C needs them to get prototypes for libs. 09:01:00 ok what is meant by prototypes? 09:01:06 docl: remember: C is a "compiler to object" (plus linker/loader) 09:01:31 * docl things of a prototype as a throwaway first version of an invention 09:01:40 docl: "public interfaces" & "text substitutions" 09:01:45 they are 'stubs' for functions/words for the linker so he can find the function in the lib 09:02:12 docl, think of it as a vectored word without a initial content. 09:02:26 docl: virl is mostly right - and add macros. 09:02:30 so: : blah vector ; 09:02:40 ok, that's a prototype 09:02:56 so perhaps put that in a .fh file 09:03:09 this is partially cpp's fault, and partially C's, and definitely the interface of linker/loader/compiler/filters 09:03:22 ok, macros so the 'preprocessor' can do some magic-things 09:03:48 right.. cpp is a really mindlessly-lame forth of "immediates" 09:04:08 C is the place where it's STILL "immediate", but deferred 09:04:46 and the linker and such are the place where C binds it all together, instead of all in RAM like most forths 09:05:22 docl: it's really depressing to try and read either gcc or cpp source. 09:06:12 even trying to find a lexx/yacc source for modern cpp+c (and versions/standards) is depressing in the extreme. 09:07:10 Personally, I can almost suffer lisp/sexp forms - but I really prefer forthish. 09:07:25 sexp/sexpr 09:09:26 docl: prototypes (or "public interfaces") - expected or provided are _interesting_ - but there are a load of "issues".. Most seem to suggest multipass, multitool, or a common .o collection 09:10:27 Further, I should mention: forth does zero testing of arguments and such - whereas C compilers do check args and returns and whatnot (unless you override) 09:11:01 the reason why forth is 'unsecure' 09:11:06 yeppers 09:11:27 not that it ain't beatable, but none of the folks seem interested. 09:11:56 and when you do it, then you introduce types and that's not in the mind of forth 09:13:41 you could have a small type library for limited circumstances though 09:13:53 also, retro has classes which are similar to types. 09:13:58 they sorta' do - in a really weird way, docl 09:14:31 they don't use the stack well, or "compile" well, but they try to organize elsewhere. 09:15:06 gforth and generic "forth" structures (or the OO extensions) try 09:15:28 prototypes are for language that have some form of type checking 09:15:46 I think it might partially be the fault of ANS and also of semi-exposing "guts" 09:16:14 tathi: right, or expectations and fulfillment 09:16:34 yeah, I put that badly 09:16:51 prototypes are for languages where the compiler enforces type checks 09:16:56 s/compiler/system/ 09:17:00 btw, I have decided to break from current brain-loop and think "top-down" for awhile. 09:19:32 I believe I have to rethink: 1) input/script basics; 2) process/eval; 3) PLUGIN ideas here & now; 4) based on objects of; 5) klass (type?) over; 6) the abi for the above. 09:20:33 and, the ABI is using posix C for "machine" and "assembler". 09:21:45 I think the basics of RPN and the essential "datastack" (the commo-stack) are really powerful, but I need to do a lot of reconciliation. 09:22:37 I'm even tempted to make the "returnstack" nearly a "protected:"-style var/array/list 09:28:34 you want to use type checking? 09:28:44 I have to 09:29:05 how will you do it? 09:29:15 I want an OO stack and intristic ability to "see" what and who does what to whom. 09:30:09 I figure that "interactive" is too damned useful, and that "optimizing" is something like gcc does: beyond me and I don't care. 09:31:32 docl: also, I am sort of pro and anti "forth" - I prefer to think of "forthish" as RPN and datastack "simplicities" - but I don't care to go "over the top" - we have plenty that do that already. 09:32:06 :) 09:32:12 per the former: I never USE "lisp", but I sorta' see a reason for lisp predating forth and now "sexpr" 09:32:16 --- part: crc_work left #forth 09:33:06 docl: I plan to use gcc and C + posix as the "baseline 'assembler'" - nothing else should matter that deep. 09:34:22 * docl likes the fasm/retroforth combination 09:34:54 I try not to engage such, and I can't run it anyway 09:35:11 I refuse to accept "asm" at all 09:36:07 if we want "asm", given the reason and roots of forth, we need a VM like fovium. 09:36:29 it's a multi-layer thing, fasm is a powerful macro assembler and forth on top of that is an even more powerful macro assembler 09:36:30 a "nonspecific Emulator" 09:36:45 Don't care - ain't interested 09:37:45 every "assembler" is specific to a cpu and likely a platform: it ain't generic-enough to suit me. 09:37:58 yeah 09:38:43 afaik, no "assembler" will report - consistently and same-format - the abi. So, all you get is new headaches in a different "language" for the same silly reasons. 09:38:58 ahh, I see 09:39:47 fovium is intended to be the alternative to assemblers? 09:40:39 so you use gcc to develop it in, then it can be easily portable. 09:41:51 hmm - not exactly. You need to ask tathi about foviums reasons. BUT, it's not stupid - just too generic for my porpoises 09:43:21 Personally, I am thinking of building/installing - which means a "tool" and what underlies that mess is platform-specific. BUT, I keep seeing too much of interest to write a mere filter... Looks like a forthish-shell and vocs and words, to me. 09:44:44 For many weeks I was trying to reconcile tathi/foviums byte-codes. I no longer bother.. I think of stuff akin to a posix-sized void* (or something MORE specific) 09:45:31 docl: remember - even C (mostly C) lacks really decent feedback/reporting in a consistent manner. 09:46:57 Sooo, I am _trying_ to write C code that is OO and within an 'engine' that can consistently "reply" to "requests" - as consistently as I can envision. 09:48:49 and I have never had a prob with "datastack" - EXCEPT: I really despise the insane "expectations" of sizes plus order plus meaning. For an embedded-app that never really shares source, so what? For _other_ it matters like mad. 09:49:24 docl: this is likely where you see headers/source 09:49:50 could a stack diagram be used as a header, sort of? 09:49:56 yes 09:50:01 sorta' 09:50:15 ( a c -- ) means expect a counted string, e.g. 09:50:20 not as folks currently see "comments", though 09:50:36 right, it'd be a totally different thing 09:50:39 docl: still too specific - thus my OO view 09:50:52 { string -- } 09:50:56 right 09:51:11 it's not FUN, but it's sorta' "organized" 09:51:47 I'm trying to expand that nasty 'xt' think a notch or three further. 09:52:30 was afk there 09:52:53 fovium is a very very simple stack-based VM that JasonWoof is building his rewrite of herkforth on top of 09:53:01 ..it seems common in ##C as well - where folks want to pass arrays or want REAL size versus USED size, or unit-width, etc. 09:53:15 tathi: right - tis why I mentioned it 09:53:57 tathi: it's almost a synthentic-cpu "emulator", which I would applaud. 09:54:21 yah, I was just responding to "fovium is intended to be..." and your response 09:54:27 righters 09:54:44 tathi: I figured he might look it up, is all 09:55:31 I think we need a wiki for such things, to be honest. I know Quartus dislikes me, but the root-use is still apparent. 09:56:08 tathi: yeah I had heard a bit about it, but forgot temporarily 09:56:50 docl: no reason to remember it; it's nothing particularly special :) 09:57:00 btw: I am seeing a LOT of interest/activity in the zones of Metabuilder/Fovium/Forths/forth - from folks you would not expect. 09:57:13 your basic bytecode stack engine with 6-bit opcodes 09:57:30 tathi: well, no.. yer being humble - it's _interesting_ and workable. 09:57:51 ahh, it works on both ppc and x86. that's interesting. 09:58:07 sure, it's workable. I just don't see it as being particularly difficult to write something like that. 09:58:36 I do believe it'd be more INTERESTING if it used plain gcc and and posix expectations and did NOT screw with bitshifts, but that's me. 09:58:52 tathi: most things aren't difficult with enough expertise :) 09:58:55 tathi: issues - forests/trees 09:59:08 docl: yeah, that was Jason's main goal -- herkforth was written in pure PPC asm 09:59:22 he started wanting to show it to people, but most don't have the hardware to run it :) 09:59:29 sure 09:59:59 PoppaVic: what about fovium doesn't fit with "plain gcc and posix expectations"? 10:00:06 I lack a networked/flashcard/cd-burner on my debian-box - so the x86 is isolated from the ppc 10:00:42 tathi: not much - maybe jsut the opcode-shifting being a bit naked. 10:00:55 IIRC c99 requires that bitshifts work as multiply/divide by powers of two 10:01:24 fovium is probably dependent on twos-complement math, but that's practically everything these days 10:01:25 I do think we need an OO "machine" - which is where I run into walls regularly. 10:01:45 yeah, I don't see that as being terribly valuable 10:01:46 hell, then use java. 10:02:59 tathi: maybe, maybe not.. I keep thinking it will limit repeated code, And, between fovium (which prolly needs a full upload somewhere) and FICL, I can see assorted uses. We still need a wiki here ;-) 10:03:34 virl: well, Jaaba or XML ;-) 10:04:07 PoppaVic, you are only stupid. 10:04:29 such a braindead person like you only exists only once on this earth. 10:05:53 * PoppaVic sighs 10:06:20 virl: I felt the same about yer XML crap long, long ago - yer just plain insulting foolish. 10:07:00 "insultingly.." 10:07:46 Meanwhile, yeah - there are a whole lot of 'code' and 'concepts' that tend to be regular. 10:08:55 At some point the "code" becomes interface/methods - but I suspect most folks see my point. 10:09:32 docl: did you fins some sites and code to help? 10:09:39 fins/find 10:12:19 this is cool - when i resize my eterm my debugger windows resize :) 10:12:25 aint signals cool :)) 10:12:30 btw, virl fear not, I've managed to outlive/outlast most folks that feel I am "stupid" - You, (I suspect), will not be an exception 10:12:38 I440r: sure 10:13:05 I440r: what about "messaging"? 10:13:50 tying to termios is nice - like curses or xml - but... What about above that? 10:14:28 this is definatly tied to my curses code - bit its not ncurses 10:14:48 prob with "signals" on Nix-platforms is the limitations and "I stole it - fuck you" issues. 10:14:49 its my forth terminal handling words so it being tied in this way is a non isue 10:14:58 ahh 10:15:03 good afternoon 10:15:07 and the winch signal isnt tied to it exactly anyway 10:15:19 so, it's like a termios MODULE w/i yer forthish? 10:16:42 no, when I said "tied" - I meant the limited number of sys signals that folks seem to abuse all over the machine - not a dos/cpm/doze-like "layering" ;-) 10:17:15 interrupts is prolly the proper term, but "signals" usually tie to those. 10:18:38 I have not rebuilt a kernel in several years, but I recall how USR1 (signal) was exclusive of pthreads and - damn, that limits your options like mad. 10:19:23 I don't know how you manage to keep coming up with this nonsense 10:19:31 I also recall that there were not a lot of examples of "filtering" 10:19:39 but it sure is impressive :) 10:19:47 tathi: which "nonsense" in particular? 10:20:17 filtering/passdown (btw) 10:20:59 signals and interrupts? 10:21:20 come on now - be specific in yer flagellations ;-) 10:21:34 all of these "problems" you keep talking about 10:21:45 ahh, you mean "issues" 10:21:53 oh, right, issues 10:22:00 pick one 10:22:25 * PoppaVic respects tathi - this is just FUN ;-) 10:22:44 I just can't imagine actually coding something where I would need to care about any of them 10:23:08 which? I mean - where? what? 10:24:01 "coding" covers everything from shell to CLI to process, user, group or owner, etc - segs, registers, etc 10:24:45 "I mean this..." versus "execute these..." 10:24:51 bah, never mind; they're going to keep mattering to you whatever I say. 10:25:15 heh - ok, whatever - I tried, really. ;-) 10:25:26 He doesn't write code, tathi, so the conflict never comes up. 10:26:02 Quartus: and I don't bray about my cuteness or wax folks for variance - deal with it. 10:26:29 I don't have the hour required to unpack whatever the hell that means. 10:27:07 Quartus: hmm, I suppose you're right. 10:27:14 Yer prolly best served (Quartus) by banning me: I upset your universe. 10:27:26 * PoppaVic shrugs 10:27:48 tathi is mostly the person I talk with - so be it. 10:28:09 You assign yourself far too much importance and credit. You are not a player in my universe. You're an annoyance in this channel. You drive people away and confuse others with misinformation. 10:28:52 I assign myself dick I suspect you are merely bugged because I don't agree with you on almost anything. 10:29:23 perhaps you should be a Lert and get involved with all the folks that join? 10:30:04 Perhaps you need to get off yer ass and contrib at least dialog? 10:30:36 ..you can flame me, and I'm fine with that: step up or shut up 10:30:46 don't everyone get mad at once :P 10:30:58 docl: nahh, this was merely "fun" 10:31:18 you cruel boy 10:31:53 docl: I've no issue with folks heeding tathi or Quartus - that's fine with me, any day or time. I just get tired of the "bahh, humbug" level 10:32:07 well, it is humbug 10:32:18 ok, and see above. 10:32:31 whenever anyone asks a simple, concrete question, you jump in with your metaphysical bullshit that has NOTHING to do with whatever they're asking about 10:32:35 well I will say this, you do have a knack for making inscrutible, yet impressive statements :P 10:32:44 tathi: I'd try to debate some of it today, but I'm past concrete 10:33:03 tathi, clearly you'd be best served by banning him: he upsets your universe! 10:33:20 tathi: 99% of it is mindset and tools. Christ, even platform 10:33:31 it's not MAGIC 10:33:39 past concrete, in the sub-soil, and falling towards magma :P 10:33:41 Quartus: nah, just my concept of how you should treat newbies 10:33:47 or other people looking for help 10:33:51 tathi, I agree entirely. 10:34:28 somewhere, somehow, something is taking text into RAM and maybe mass-storage - and either building MC or RUNNIING (referencing?) MC. 10:34:56 anyway... q can swing in the breeze.. Laters, folks 10:34:59 --- quit: PoppaVic ("Pulls the pin...") 10:35:04 it's a matter of personality types, to some degree. PoppaVic is probably ENTP, which is tough(er) for *NTJ to get along with 10:35:23 ENTP isn't the problem. It's the bloviated verbiage he spews. 10:35:40 He does the same thing in ##c. 10:35:53 their strength is extraverted intuition 10:36:14 nice. I haven't seen anyone use the word bloviate in way too long :) 10:36:19 Heh. 10:36:28 but yeah I'm sure he could show more respect for others 10:36:43 would make him more fun to talk to 10:36:45 He'd have trouble showing less. 10:37:18 good point... 10:40:37 I wonder if he really does any harm though. it's only irc, and nobody is compelled to figure out what he's saying if they don't want to. 10:43:37 perhaps it's distracting people from discussing more important/relevant issues? 10:44:16 I think he does considerable harm. Newcomers drop by, this guy latches on and not only blithers about completely inconsequential crap that he doesn't even understand properly, but does so in some kind of bizarre dialect of English that he's created for himself. 10:46:17 you don't find it entertaining? at all? 10:46:34 No. 10:55:49 well some of us are at least a little bit entertained. 10:56:57 --- nick: ohub_ -> ohub 10:58:15 but if it is harmful to the quality of the channel and drives away newcomers, I can see your point 11:09:29 I guess ironic humor isn't for everyone. him accusing virl of being "insultingly foolish" was seriously a matter of the pot calling the kettle black 11:20:51 --- join: ayrnieu (i=julian@pdpc/supporter/sustaining/ayrnieu) joined #forth 11:22:15 'the pot calling the kettle black'? 11:22:41 --- join: Cheery (n=Henri@a81-197-20-242.elisa-laajakaista.fi) joined #forth 11:27:35 accusing you of doing the same thing that he does 11:27:38 well the kettle is white in this case 11:27:54 presumably from back when pots and kettles were all made out of cast-iron and thus being black... 11:29:20 is that a common english phrase or something specific to america? 11:29:40 eh, .us 11:29:44 * docl thought it was common 11:30:31 I'm only interested, because I don't have really much glue about such things ;-) 11:32:18 yeah not sure how widely phrases like that are generally distributed 11:32:31 could easily be us-only 11:34:11 it's not US-only 11:34:37 it has been around for longer than the US has, I believe. :) 11:35:29 good point 11:43:50 a 'good point' refers to something you knew, but didn't think of. 11:45:00 I knew that pots and kettles being black was fairly old, so that would indicate the phrase being fairly old 11:45:30 you knew that the phrase is older than the US? 11:45:37 no 11:46:13 not a 'good point', then :-) tathi made an assertion that, believed, answers your question. 11:46:23 I also hadn't taken into account that it's age would factor in. that was a good point. 11:48:59 http://en.wikipedia.org/wiki/List_of_English_Idioms -- this is fun. "pop one's clogs" : "to die". 11:49:14 cool 11:49:41 * docl has always wanted somewhere to look up idioms 11:49:46 some of those have narrower locations than they need, though. 11:55:09 several global ones I haven't heard of 11:57:28 --- join: ttuttle (n=tom@unaffiliated/ttuttle) joined #forth 11:57:33 Quartus: Hey. 12:31:33 --- quit: ttuttle ("leaving") 12:57:24 sad, apple computers won't come with openfirmware again. ok, one area less where forth is used. 13:29:45 --- join: ttuttle (n=tom@unaffiliated/ttuttle) joined #forth 13:29:48 Quartus: Hey. 13:39:14 Is there anything I should keep in mind when assigning registers for a native x86 forth? 13:41:36 for your Forth OS? 13:44:27 just curious -- I don't know enough to make recommendations 13:44:33 --- quit: tattrdkat (Read error: 104 (Connection reset by peer)) 13:46:29 both Retroforth and colorforth appear to use esi as the data stack pointer, and cache the top element in eax, if that's any help. 13:47:38 tathi: Does the data stack grow down or up? 13:49:47 down -- drop is lodsd, dup is 'sub esi,4; mov [esi],eax' 13:50:00 tathi: Ah. 13:50:23 I believe lodsd is the rationale for the use of esi 13:50:32 tathi: what's lodsd do? 13:50:46 and that eax is the obvious choice for top-of-stack, since it's the accumulator 13:51:04 load string doubleword (32-bit value) 13:51:07 tathi: What does that mean? On x86, can't you do math between any two regs? 13:51:15 mov eax,[esi]; add esi,4 13:51:37 yes, some instructions only work with certain registers, I believe. 13:52:31 actually, lodsd can go in either direction depending on a flag in the machine state register or whatever they call it. 13:52:48 Hmm, if you have a system where TOS is in a register, how do you represent no items on the stack? 13:53:00 MSR = model-specific register, IIRC 13:54:26 that's a little fuzzy 13:54:53 tathi: Yeah ;-) 13:55:04 you just never use the last value, I think. 13:55:21 What do you mean? You can't DROP the last value off the stack? 13:56:22 I think the "empty" state is just the same as if you didn't have a cache register. 13:56:35 (stack pointer points just past the top of the memory) 13:56:51 tathi: Does the stack pointer point to the top of the stack, or just past it? 13:56:56 just past it 13:57:00 okay. 13:57:09 if you're going down, you decrement before storing 13:57:31 *before* storing. so it points to the "top" (a.k.a. lowest address) item. 13:59:10 er...that doesn't sound right, but I may be just mis-reading it. 13:59:46 If you have to decrement *before* storing, then you have to do that *because* SP was pointing to an item on the stack, not the first empty space past it. 14:00:00 oh, right. 14:00:25 --- join: tattrdkat (n=virsys@or-71-53-74-48.dhcp.embarqhsd.net) joined #forth 14:00:26 but when it's empty, there is no item, so it points past the end of the stack array 14:01:18 So if the stack is from 0x1000 to 0x1fff, then pointing to 0x1fff means there are two items (one *at* 0x1fff, and one in TOS). Pointing to 0x2000 means there's one item, in TOS. So does it need to point to 0x2001? 14:01:26 (Assuming 1 cell = 1 byte, for simplicity.) 14:02:21 no, usually pointing to 0x2000 means empty, just as if you had no TOS register 14:02:42 But pointing to 0x1fff means there is a value at 0x1fff, and one in TOS. 14:02:53 Right? 14:02:57 yeah 14:02:59 but... 14:03:16 But? 14:03:24 the trouble is, you're not allowed to store at 2000 14:03:31 Yes. 14:03:32 I know. 14:03:46 So pointing to 0x2000 means that there's nothing in *memory*, but that doesn't say anything about TOS. 14:03:51 right. 14:03:58 but what if you drop? 14:04:00 With just a register (assuming nothing in RAM), you could have 0 or 1 items. 14:04:10 normally drop would fetch from the stack pointer, then increment the pointer 14:04:10 That's what I'm asking! 14:04:19 but fetching from 0x2000 is illegal 14:04:23 Yes. 14:04:32 But dropping the last item isn't, so it has to be able to do that! 14:04:50 so instead of having your words all check if sp is 0x2000 and not fetch or store, you just waste one cell in memory 14:04:55 and let that be the empty state 14:05:09 I don't get it. 14:05:24 pointing at 0x2000 means empty -- the value in TOS is just ignored 14:05:31 If SP = 0x2000, DEPTH = 0. 14:05:39 If SP = 0x1fff, DEPTH = 1. Item is in TOS. 14:05:47 if you want to put something on the stack, you do a DUP (set sp to 0x1fff, store TOS there) 14:05:58 yeah 14:06:01 If SP = 0x1ffe, DEPTH = 2. Top is in TOS, second item is at 0x1fff? 14:06:14 So the SP points to the first empty space? 14:06:16 second item is at 0x1ffe 14:06:19 Oh. 14:06:36 I get it. 14:07:00 yeah, it's different if you have a grows-up stack; then SP does point to the empty space. 14:07:12 Maybe I'll do that instead. Seems simpler. 14:08:01 whatever's easier for you to think about, I guess. 14:08:08 So when you DROP from SP = 0x1fff, a random value is pulled into TOS? 14:08:16 (Whatever was at 0x1fff) 14:08:26 yeah. 14:08:30 ok 14:08:47 the forth might initialize TOS to zero, but it doesn't really matter 14:08:54 since you shouldn't ever use it 14:09:04 So if it were grows-up, then 0x0000 is wasted? 14:09:25 Since pointing to 0x0000 means no items, 0x0001 means one in TOS, 0x0002 means two (TOS and at 0x0001)? 14:09:26 I think so. 14:09:29 ok 14:10:00 What's a reasonable size for a stack? 4k? 14:10:18 that's tons 14:10:20 Hey, did you know (IIRC) that x86-64 offers the ability to use groups of registers in ring or stack arrangements? 14:10:27 but it's about what I usually do 14:10:29 1k? 14:10:47 I can't do any smaller without screwing with the descriptor table :-b 14:11:04 yeah, there's plenty of RAM, so it doesn't matter. 14:11:50 in practice, most things use less than 16 cells, and you rarely go deeper than 50-60 cells 14:11:57 (in my admittedly limited experience) 14:12:12 didn't know that about x86-64 14:12:13 interesting 14:12:27 I think so. 14:14:21 I wonder why they added that? 14:14:33 Probably to make looping stuff faster. 14:14:50 I would bet that few compilers use it, but that assembly language programmers will love it. 14:15:13 hmm, DSP stuff too maybe -- I have the impression that uses ring-buffers and stacks a fair bit. 14:15:24 It's gonna be hard to have a compiler use it without overhead for starting and ending the loops. But asm programmers know better. 14:15:32 Yeah. Bet it's insanely fast for crypto and media stuff. 14:22:00 Quartus: You around? 14:27:54 --- quit: Cheery ("Leaving") 14:30:00 --- quit: crc ("hardware work") 14:36:45 --- quit: neceve (Remote closed the connection) 14:53:07 --- part: arke left #forth 15:12:02 Quartus: ? 15:12:50 Is it possible to build a Forth where data, code, and dictionary space are shared? 15:18:10 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-161-076.pools.arcor-ip.net) joined #forth 15:18:10 --- quit: Snoopy42 (Read error: 131 (Connection reset by peer)) 15:18:13 just released isforth 1.17b 15:18:34 --- nick: snoopy_1711 -> Snoopy42 15:18:48 I440r: What is isforth? 15:22:13 my forth compiler for linux 15:22:28 only updated the x86 linux version so far 15:22:46 I440r: Ah. 15:23:24 isforth.clss.net 15:23:27 I440r: Hey, I'm writing an x86 forth (bootable). What sort of division between code/data/wordspace would you recommend? 15:24:34 heh i mix code and data but i have headers separated 15:24:55 how far have you gotten your forth ? 15:25:00 I have the entire 4GB memory space to play with. What's a good way to divide it up. 15:25:12 Not very far, I gotta make these decisions to write the bits of assembly code that load it. 15:26:12 I know there's something pesky that prevents combining wordspace and code/dataspace without a lot of work, but I can't remember it. 15:26:19 not sure how i would do that 15:26:28 What's a good dictionary size? 15:27:01 what do yo mean ? 15:27:22 How much memory should I allocate for it? I figure I'll give some space to the dictionary, and then have the rest of it be code/data. 15:28:43 for what ? 15:28:50 what do yo mean by "the dictionary" 15:28:52 The dictionary. 15:28:53 the headers ? 15:28:57 Yes. 15:29:05 Why, what else would you put there? 15:30:46 will all applications share this header space too ? 15:30:50 if so you cant limit it 15:30:59 yo have to have a memory manager 15:31:09 but i think you will need separate head spaces for all applications 15:33:09 Can I store headers in data space? 15:33:23 yes 15:33:52 i guess 15:34:05 Are there any quirks about doing that? I don't remember what I did, but in my last forth, there was some word that made sharing header and code space impractical. 15:34:06 but isforths memory space is ALL +r +w +x 15:35:33 do you seperate the dictionary headers from the actual compiled code? 15:35:43 yes 15:35:50 that way i can turnkey 15:35:56 I440r: Is that necessary? 15:36:17 turnkey strips off headers and saves a smaller executable 15:36:32 brb 15:36:59 ah, ok, I wondered always why some forth seperate them 15:49:34 how do you add a tab to html ? 15:50:52 how good works turnkey on your side I440r ? 15:51:21 dumping the code into a file doesn't work yet or? 15:51:52 wht do you mean how good ? 15:52:22 are there bugs/problems? 15:53:38 not that i know of 15:53:54 you have to ' my-main is quit first thi 15:53:55 tho 15:54:00 or ' my-main is default 15:54:15 and your main has to bye at the end 15:56:05 --- join: Amanita_Virosa (n=jenni@adsl-65-68-75-51.dsl.hstntx.swbell.net) joined #forth 16:30:08 Quartus: You here? 16:34:26 --- join: crc (n=crc@pool-70-110-215-240.phil.east.verizon.net) joined #forth 16:34:44 --- mode: ChanServ set +o crc 16:37:33 --- join: segher_ (n=segher@dslb-084-056-138-027.pools.arcor-ip.net) joined #forth 16:39:04 Hey, I'm writing a bootable x86 forth... I'm trying to figure out how the different kinds of threading work. I get indirect threading--each cell of a definition points to another definition, and the first cell of the definition points to the machine code that executes the rest of it. But what about direct threading? If it points straight to machine code, how can it be used to execute other threads of forth code? 16:40:31 damn, it's been too long since i wrote mine 16:40:50 i don't even remember anymore :P 16:43:08 --- join: tlockney (n=tlockney@c-24-20-172-87.hsd1.or.comcast.net) joined #forth 16:45:57 in direct threading, each definition starts with machine code (typically a jump or call insn), and the rest of the definition is just like in indirect threading 16:47:41 Oh, I get it. 16:49:13 good :-) 16:49:19 --- quit: segher (Read error: 110 (Connection timed out)) 16:53:04 --- part: tlockney left #forth 16:53:31 --- quit: tathi ("leaving") 17:23:26 Hey. 17:32:17 Quartus: Hey. 17:32:35 Quartus: /me is trying to decide which kind of threading to use. Indirect threading is pretty but not as efficient. 17:32:41 Quartus: Should I use subroutine threading? 17:32:56 i think i originally started with DTC 17:32:59 then moved to STC 17:33:07 i don't recall tho, it's been a long while since i wrote my forth kernels 17:33:22 ttuttle, I would. 17:33:31 Quartus: Ok. 17:33:31 Allows for easy optimization later. 17:33:38 it does, at that 17:33:44 STC is great, but it can be a smidgeon tricky to set up 17:34:06 Harder to optimize, and isn't nearly as cool anyway. :) 17:34:24 Quartus: Wait, STC means that the return stack *has* to be the hardware stack, right? 17:34:35 Generally. 17:34:36 generally yes 17:34:38 ok 17:34:40 It's not an absolute. 17:34:54 But it's likely to your advantage to do that. 17:35:11 Mmm, STC makes ENTER, EXIT, and NEXT pointless. 17:35:13 Does it not? 17:35:16 Yes. 17:35:25 ENTER is a moot point, EXIT is just return, and NEXT is automatic. 17:35:29 Cool. 17:35:36 i used ES:EDI for parameter stack 17:35:46 Simplifies a lot of things in my view. 17:35:51 Amanita_Virosa: All my segments are the same, I'm running in protected mode :-b 17:36:05 Quartus: It's the speed and simplicity of native code, without having to really compile code. 17:36:21 and used EAX to hold TOS 17:36:30 so i could use STOSD to push the top of stack 17:36:31 If you add inlining, you get a whole bundle of optimization pretty much for free. 17:36:32 it worked pretty well 17:36:47 ttuttle - i know, mine uses protected mode too 17:36:51 and flat segmentation 17:36:55 but it's still ES:EDI 17:37:21 actually... hrm, now that i think about it, i'm not sure about that 17:37:25 i may have used segment protection 17:37:48 Amanita_Virosa: Is that so much faster than mov [edi],eax; add eax, 4? 17:37:57 Amanita_Virosa: (Seriously. I don't know the cycle counts.) 17:38:26 add edi, 4, no? Or am I confused? I'm not joe x86. 17:38:31 no, actually i think it's slower on new systems 17:38:32 Quartus: Yes, sorry. 17:38:36 but meh 17:38:39 it's a good bit smaller 17:38:42 Amanita_Virosa: Ok. 17:38:49 1 byte instead of something like 6 17:39:15 I'd macro push() in your build environment so you can choose between building for speed, or for space. 17:39:43 Quartus: Ok. 17:39:52 Quartus: But isn't STOSD faster in both ways? 17:39:57 Quartus: I mean faster and smaller? 17:40:09 Quartus: /me hates having to indent code for the assembler. 17:40:09 Amanita_Virosa just said STOSD was slower. 17:40:17 oh hey, i *did* use segmentation protection 17:40:23 Quartus: ah 17:40:28 i think they're really about the same 17:40:31 Quartus: /me prefers the other way, 'cause it's clearer. 17:40:39 STOSD turns into the same microcode or something 17:40:40 or nearly so 17:40:42 but it's a lot smaller 17:40:46 and that means fewer cacheline misses 17:40:51 so it's a tradeoff 17:40:55 Well, in general terms you want to abstract most things through macros so you can alter them at will. 17:41:05 cacheline misses hurt a lot more than an extra cycle 17:41:29 indirect threading and token threading are the fastest on modern machines, due to cache effects 17:41:53 Taken strictly as threading methods, yes. But if you start adding simple optimization to subroutine-threading, you quickly win. 17:41:57 or compile to native code -- but you'd better have a _good_ code optimiser then! 17:42:15 Even simple optimization gives big wins under subroutine-threading. 17:42:20 subroutine threading is _awful_ on most architectures 17:42:41 Amanita_Virosa: So then drop becomes mov TOS, [ES:EDI]; sub EDI, 4? 17:42:52 Taken strictly as threading, it's not ideal. Somehow I think I'm repeating myself. :) When you add inlining and a few simple optimizations, you're well ahead of the game. 17:43:39 Does ESI do anything useful? 17:43:45 ttuttle - something like that, i don't recall 17:43:52 i'm reading my source to figure out how i wrote this 17:43:54 it was years ago now 17:44:19 I would assume you could use ESI and the string instructions to quickly load many cells on the stack... but that's not very useful. 17:44:43 ttuttle, rarely required. 17:44:49 quartus: as soon as your code ever messes up the "native" return stack, you're in 100% branch misprediction land 17:44:49 Quartus: Yeah, I know. 17:45:05 messes up? 17:45:28 pops a return address, or something 17:45:33 or pushes one 17:45:43 Quartus: As in, uses R> >R and company to "optimize" a quick Forth routine, but actually confuses the processor's branch prediction. 17:46:19 Quartus: How do you prevent push and pop from getting in the way of the asm instructions of the same name? 17:46:22 not such a big issue on x86, as it has an architected fucked-up return stack anyway 17:46:30 heh 17:46:31 segher_: why? 17:46:33 brb 17:46:38 A native-code (that's subroutine-threading with inlining, at least) system, even with branch misprediction, outperforms both direct and indirect threaded systems. Forth, Inc. switched to native-code many moons ago for this reason. 17:46:58 that's on simple in-order machines 17:47:02 ttuttle, wasn't an issue for my assembler, I used pop() and push() macros, but you could call them dpop and dpush. 17:47:15 segher_, that's on x86 as well. 17:47:23 same thing heh 17:48:32 If branch-misprediction because of the return stack makes you lose sleep, you could experiment with an entirely separate return stack; perhaps there's a win, I don't know. 17:48:47 the bulk of mine is written in FORTH. 17:48:56 i got the bootstrap in very little assembly code 17:49:35 quartus: if it's separate, you cannot (portably) mess with it, so if you don't do that anyway, there's no issue 17:50:03 well it's not *really* portable anyway, heh 17:50:07 I can envision a system with a separate stack for >R and R>, and special instructions for messing with the native stack too. 17:50:37 sure, it's commonly called the "ip" stack, with words like IP> and >IP 17:50:48 I haven't run into that naming, but whatever works. 17:52:32 i _like_ to manipulate return addresses though :-) 17:52:43 Nothing stopping you with either setup. 17:54:15 ttuttle, with code-copying inlining, it simplifies the implementation of some words like >R and R>. 17:54:39 ah there we go. wow, that's subtle 17:54:52 yep, i set up ES to be a small 2-page protected segment 17:55:04 so that when i underflow the stack, it causes a segv, which is caught by the monitor tss 17:55:10 which restores it to safety 17:55:49 Handy. 17:56:30 yep 17:56:44 i saw no real downside to using segment protection 17:56:53 Sounds like a win. 17:56:55 it means you can't directly address the stack segment, of course, but even that's not so big 17:57:17 you can address it with its linear address, or use a special word to address it through ES 17:57:19 and that works fine 17:59:38 why would you ever want to address it? 17:59:51 exactly 17:59:56 there are few reasons to 18:00:02 except for pick 18:00:07 and other stack manipulation words 18:00:12 pick and roll can be done partably 18:00:17 portably 18:00:17 sure can 18:00:30 especially since i have a few spare registers anyway 18:00:31 and people using them _deserve_ for their code to be slow 18:00:37 lol 18:00:39 hey now 18:00:51 i optimized all the simple words like that with a bit of good assembly code 18:59:20 --- quit: uiuiuiu (Remote closed the connection) 18:59:25 --- join: uiuiuiu (i=ian@dslb-084-056-236-206.pools.arcor-ip.net) joined #forth 19:05:44 --- quit: Amanita_Virosa ("The mushroom singularity") 19:24:32 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-136-004.pools.arcor-ip.net) joined #forth 19:25:58 --- join: nighty (n=nighty@CPE00508be190fc-CM0012253ec1bc.cpe.net.cable.rogers.com) joined #forth 19:30:19 G'nite. 19:30:33 --- quit: ttuttle ("leaving") 19:32:49 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 19:32:53 --- nick: snoopy_1711 -> Snoopy42 19:34:05 --- quit: I440r ("Leaving") 19:34:50 lo :) 22:22:05 --- join: virsys (n=virsys@or-71-53-74-48.dhcp.embarqhsd.net) joined #forth 22:34:34 --- quit: tattrdkat (Connection timed out) 23:20:20 --- nick: segher_ -> segher 23:59:59 --- log: ended forth/06.07.08