00:00:00 --- log: started forth/03.11.21 00:00:33 --- quit: melinda_ (Read error: 110 (Connection timed out)) 00:38:03 --- join: Serg_Penguin (~z@212.34.52.140) joined #forth 01:21:05 --- join: schihei (~schihei@blueice1x.de.ibm.com) joined #forth 01:24:34 --- quit: Serg_Penguin () 03:15:04 --- quit: arke (Read error: 110 (Connection timed out)) 04:03:40 --- nick: Robert_ -> Robert 04:26:02 * warp0x00 is back (gone 14:28:57) 05:33:42 --- join: melinda_ (name@melinda.usercloak.freenode) joined #forth 05:34:15 --- nick: melinda_ -> melinda 06:07:00 --- join: arke (~chris@ca-cmrilo-cuda1-c3b-66.vnnyca.adelphia.net) joined #forth 06:23:16 --- join: I440r (~mark4@saturn.vcsd.com) joined #forth 06:48:14 --- join: madgarden (~bughead@216.94.153.178) joined #forth 08:34:29 --- join: Herkamire (~jason@h0000c5c18c35.ne.client2.attbi.com) joined #forth 08:56:16 --- quit: schihei (Client Quit) 08:59:38 How is EVALUATE input state normally saved? Address of the text, current offset into it, and pushed on a memory stack? 08:59:38 --- quit: Herkamire (Read error: 104 (Connection reset by peer)) 09:00:00 --- join: Herkamir1 (~jason@h0000c5c18c35.ne.client2.attbi.com) joined #forth 09:00:49 How is EVALUATE input state normally saved? Address of the text, current offset into it, and pushed on a memory stack? 09:00:55 oops 09:27:18 --- join: sophist (sophist@d053.wildapache.net) joined #forth 09:35:31 madgarden: I don't think there is any standard for it. 09:37:13 The ANS standard doesn't say how the input state is to be "saved", just that it is. 09:39:04 madgarden: ANS doesn't say much about implementation 09:39:27 --- quit: haroldo (Read error: 54 (Connection reset by peer)) 09:39:45 you probably need an input stack that keeps track of where input will come from when the current source runs out) 09:40:26 generally you need to support 3 kinds of input: files, user input, and strings (EVALUATE) 09:40:36 --- nick: Herkamir1 -> Herkamire 09:45:32 --- join: haroldo (~haroldo@r200-40-167-233.adsl.anteldata.net.uy) joined #forth 09:46:54 Well, I can treat them all as strings, really. 09:47:29 At least in my case, since the strings for evaluation get loaded using a C function. 10:13:57 --- join: ASau (~asau@158.250.48.197) joined #forth 10:14:30 Dobryjj vecher! 10:15:32 privet 10:16:06 Privet, mur! 10:16:21 One question. 10:16:55 Does ANTI standard provide a mean to get execution token of word being defined? 10:18:21 In my Forth I can get it by: LATEST PFA CFA 10:21:48 Another question: 10:21:59 Do we have a name for SWAP OVER ? 10:24:41 swap over is the same as tuck, no? 10:24:57 I haven't seen definition. 10:25:44 http://www.taygeta.com/forth/dpans.htm 10:26:46 swap over would be ( w1 w2 -- w2 w1 w2 ) - that's the same as tuck 10:29:29 --- quit: sophist (""Wisdom: that seems to the populace to be a kind of flight, a means and artifice for withdrawing successfully from a bad game) 10:37:39 --- join: XeF4 (~xef4@in-vitro96.gprs.suomen2g.fi) joined #forth 10:38:13 Dobryjj vecher, XeF4! 10:38:49 no ehtoota 10:39:45 Hm. Translate for the first time, I'll remember. 10:39:59 well (good) evening 10:42:07 Maybe you know ANTI-Forth well. Can I get "execution token" of a word I'm defining? 10:44:59 i.e. ANS forth? ' wordname 10:45:59 Hm. If I have two definitions of the same word... OK. An example. 10:46:03 : W A1 ; 10:46:07 : W A2 ; 10:46:21 : W [ 'W . ] ; 10:46:44 Which exec.token will be shown? 10:47:11 : W [ ' W . ] ; would show the one with A2 10:48:13 I want the latest one. 10:48:44 Can I get it? 10:49:04 not afaik 10:49:47 _usually_ you can get it with [ HERE ] but that's not guaranteed under ANS 10:50:35 : W W1 W2 [ HERE . ] ( ... ) ; 10:50:37 ? 10:51:00 : W [ HERE . ] ... ; 10:51:11 Hm. 10:51:30 In ITC it's not. 10:51:46 but that assumes a lot of things and might not work in native-coded forths among others 10:51:53 It's PF in my version, not an CFA. 10:52:45 then probably you would have to use defered words 10:53:12 or :noname 10:53:34 I used to do the mentioned by LATEST PFA CFA sequence. 10:54:15 in ANS you can't because CFAs are not guaranteed to exist at all 10:55:14 ANS' "xt" is CFA really. ;) 10:55:35 in practice usually but the standard explicitly says it doesn't have to be 10:55:55 : RECURSE LATEST PFA CFA , ; IMMEDIATE ( ITC assumed ) 10:55:57 it's permitted eg to have XTs as an index into some table that gets assigned after compilation finishes 10:56:32 Well, I need something to feed EXECUTE 10:56:36 noone is crazy enough to do that, but ANS says it's allowed =| 10:56:56 I've heard, it's called "xt" by ANTI-forthers. 10:57:12 can't you just make some word like : getxt r@ ; 10:57:23 oh wait no 10:57:24 nevermind 10:59:29 often HERE immediately before :noname will give the proper cfa 11:01:41 since :noname does not usually emit any header 11:01:50 XeF4, in my Forth it does never. Other Forthes are 10^{-many} probability. So, your "often" = 10^{many} Hz. :) 11:01:53 ans says this isn't guaranteed either 11:02:08 indeed 11:02:42 10^{-many} (mistype). 11:02:56 in bigforth and gforth it works fwiw 11:04:04 here :noname 666 . ; drop execute 666 ok 11:04:42 I haven't experimented with these ones to such extent. 11:13:44 I've just browed through dpans94 again and see no such thing 11:14:07 so either one must find another way to accomplish the same thing or just ignore the ANTI standard 11:15:22 actually requiring :noname to not emit a header and for execution tokens to be plain cfa pointers might be a legitimate "environmental dependency" under ANS 11:21:54 --- join: Nurf (~ray@soggy199.drizzle.com) joined #forth 11:23:00 Dobryjj vecher, Nurf! 11:23:18 Er, wotcher ASau! 11:23:46 How's life? 11:26:58 Life goes on. It beats us with a wrench ;) 11:27:18 :-) 11:29:12 I'm seeking an ANTI Forth features to get address of colon-definition's start and execution token of word being defined. 11:29:34 Actually, I can live without first. 11:29:53 * chandler wonders what ANTI is 11:30:30 ANSI 11:30:38 After Jeff Fox. 11:30:58 AS: http://low.fi/~xef4/dpans.tar.gz if you don't already have it 11:30:59 aah 11:31:42 Hm. 11:32:00 There's always the online version: http://www.taygeta.com/forth/dpans.html 11:32:05 It seems there is nothing such. 11:33:05 I am probably going to be writing my own forth over the next few weeks 11:33:10 * Nurf is a bit intimidated 11:33:33 Writing a Forth is joyous gleeful glee. 11:33:45 I'm having a hard time finding info on how the underside should look :-) 11:34:13 My two biiig priorities are code size and portability 11:34:18 Read the source. FIG-Forth, EForth 11:34:30 postForth 11:34:36 So I have made my own virtual machine that uses variable length literals and addresses 11:34:44 Now to write a forth in that 11:34:51 Hmm. postForth was one I didnt know 11:35:02 * Nurf looks for it with Google 11:35:06 Nurf. Doing this in C then? 11:35:18 http://dmoz.org/Computers/Programming/Languages/Forth/Implementations/ 11:35:54 madgarden: Well, the VM is in C. Its a completely general (and really tiny) stackish VM. I think the final version will be less than 300 lines of C 11:36:05 "Universal Answer: Do Not Do It!" (Mikhail Gassanenko) 11:36:31 :-P Its worth trying to redo things for the learning alone :-) 11:36:35 Privet :) 11:36:36 AS: I pasted that url to wget and it works 11:36:49 Privet, Robert! 11:36:57 Kak ty? ;) 11:37:09 Nurf: You may also want to look at the FICL sources: http://ficl.sourceforge.net 11:37:25 madgarden : Thanks, muchly :-) 11:37:34 Zhizn' b'jot kljuchom!.. I vsjo po golove ;) 11:37:47 I vsjo po golove too! 11:38:16 Look at RelF (or RelativeForth?) also 11:38:24 ASau: English or Swedish answer would be prefered... but as I supposed what you said wasn't important, I'll just go drink something instead. 11:38:47 It's minimal, it's in C, it's portable (VM). 11:39:18 Robert: Well enough, thanks. 11:39:46 ASau: Thanks. If I can find something good (and free), I'll use that. Size is really really important though. I have to squeeze it into the corner of an embedded sytem-on-a-chip 11:40:31 Than you should avoid C. 11:40:40 ASau: :) 11:40:42 Look at FIG-Forth and EForth. 11:41:05 ASau: Oh. I have no choice on the C thing. C is running on this system, so it makes sense to use a VM written in C 11:41:30 http://home.hccnet.nl/a.w.m.van.der.horst/ for additional FIG-Forth. 11:41:35 ASau: the forth engine runs as a task 11:41:55 ASau: This is on an ARM processor, btw. Big Endian too 11:42:34 I have the source for FIG-Forth high-levelled. 11:43:00 It's slow, but is has much less primitives than original. 11:43:13 --- quit: XeF4 ("TULISTIKUT POIS KAKAROITTE KÄSIST!!!!!") 11:43:32 ASau: is it 32 bit? 11:44:18 Assumptions are: ITC, byte access, adjustable word width. 11:44:32 ITC? 11:44:38 No, I run it in 16 bits. 11:45:00 But I have nothing that is tied to "16". 11:45:23 Or, it is not obvious if it is. 11:45:41 *nod* 11:46:13 Maybe, it can be DTC. I haven't tested yet. 11:46:49 Ah! I also assume your CPU to be two-complement. 11:47:01 *nod* 11:47:22 I am still not sure how I am going to implement it 11:47:57 If you get acquainted with FIG-Forth, I even can help you. 11:48:18 --- quit: oooo (Read error: 113 (No route to host)) 11:48:20 Well, I am willing to buy documentation etc.. I just need to know what to get 11:48:22 But you need assembly for this 11:48:25 --- join: oooo (o@virgo.bombsquad.org) joined #forth 11:48:41 I'm a bit overwhelmed with links and somehow not enough data :-) 11:49:05 I am not sure how I am going to thread the code.. Speed isnt important. Simplicity and speed of implementation is 11:49:15 I am quite competent in ARM assembler 11:49:40 BTW, find on FIG UK (http://www.fig-uk.org/) "Build Your Own Forth" pages. 11:49:46 I have been looking for a good breakdown of how forths are written at the lower level 11:49:47 oooh 11:49:54 *adds that to his bookmarks* 11:50:01 Looks like I have much reading to do :-) 11:50:03 Yea, BYOF was a big help for me. 11:50:08 That, and FICL. 11:50:26 Thanks 11:51:07 I also do reasearch how to boot-strap Forth since the very beginning. 11:51:27 Yeah, you guys are a mine of infomation :-) 11:51:49 One of my problems is that "forth" is an english word, so searching on Google isnt nearly as helpful as it could be 11:51:50 I.e. from something like "3 Instructions Forth" by Frank Sergeant. 11:52:59 Search for: forth swap drop dup ;) 11:53:55 You directories. 11:54:12 There is a good one at dmoz.org 11:54:36 Search through trees. 11:55:11 There's also the site associated with this channel: http://forth.bespin.org/resources 11:55:16 At third level you practically always are able to find useful thing you need. 11:55:34 Also: http://www.forthfreak.de/wiki/ 11:55:45 ta 11:55:51 http://wiki.forth.org.ru/ 11:56:17 news:comp.lang.forth 11:56:28 news:fido7.su.forth 11:56:44 I am lurking on c.l.f 11:56:49 Didnt know about the fido one 11:59:46 I haven't read c.l.f for few months. Something had happened with news server. 12:00:08 I just go through google groups. 12:00:19 (Should I contact our RuFIG or not?) 12:00:32 I don't like web access. 12:00:40 Yeah 12:00:45 me either... waay too slow 12:00:59 Bah. :P 12:03:50 Hm. What a name would you suggest for tail recursion word? 12:04:05 WAG ? :-) 12:04:11 curl 12:04:30 Why curl? 12:07:28 Tails curl, liek when an dog curls its tail between its legs. And also, you're "curling" the execution flow back in on itself. 12:07:37 Also, curl sounds a bit like recurse. 12:08:56 Hm. I don't understand. English is not my native language. 12:09:17 A tail curls 12:09:26 whent hings curl, they loop back on themselves 12:10:18 Ah! I've not said the main reason! 12:10:23 The sound and meaning of the word seems to fit nicely. 12:11:31 I can't accept "curl" 'cause my native word for "curl" is "zavorachivat'" it's associated with "return" and "turn". 12:11:47 Not that meaning. 12:12:16 Not for "redo with the very beginning but..." 12:13:04 It's not intuitively understandible to me. ;) 12:13:16 Heh 12:13:21 what about "recant" 12:14:00 It means "take back what you said and did" :-) 12:14:42 That's for Prolog-style back-tracking. :) 12:14:52 That would be like undoing, though. 12:14:58 Not "doing again". 12:15:05 rerecant? :-) 12:15:19 AGAIN and DO are reserved ;) 12:15:28 English doesnt really have a word for tail recursion :-) 12:15:46 what about something simple like "tailagain" 12:15:53 Well, it's sort of like an optimized or truncated recurse... so how about: RECUR 12:16:00 :) 12:16:19 And if your implementation is really fast, you can use "R" 12:16:32 or maybe just "RE" 12:16:43 Hm. Good idea. 12:17:10 Yes, "recur" is neat, I think 12:17:17 The meaning fits. 12:17:55 R is reserved. 12:17:59 Or how about something graphical: ---^ 12:18:13 Why not ^-- 12:18:30 Yea, or that. 12:18:31 ^- <-- <- <--- 12:18:48 BTW, also good idea. 12:18:51 <-- 12:18:57 let's make a bunch of forth words that look like emoticons 12:18:57 Or maybe: TAILRECURSE :P 12:19:02 :D 12:19:14 We could give Brainfuck a run for its money. 12:19:16 chandler ahah 12:19:22 chandler: Look at DWK assembler 12:19:25 emoti-forth 12:19:28 PDP-11 12:19:46 then we can promote forth to the 14-year-old SMS and AIM-using set 12:19:50 :)Forth 12:19:51 hahahah 12:20:03 1 2 + dup . :D LOL 12:20:06 BF would be pretty easy to write in forth 12:20:13 MOV %0,(%2)+ ==> %2 )+ %0 mov 12:20:28 mov %0,-(%2) ==> ... 12:20:35 hehe 12:20:40 1 2 uh thx like :D LOL 12:21:07 ianP: : LOL emit ; 12:21:32 so 1 2 uh thx like :D LOL l8r 12:21:42 : so : ; 12:21:46 :-) 12:21:54 : LOL [COMPILE] ; ; 12:21:59 immediate 12:22:00 Er, I just made a 1 word, oops. 12:22:12 : l8r immediate ; 12:22:23 : l8r postpone ; immediate 12:22:26 : uh [compile] : ; 12:22:38 Ahh. 12:23:03 : hehe [compile] forth definitions ; immediate 12:23:08 turn if / then into like / jk 12:23:18 else becomes asif 12:23:38 Haha! 12:25:02 what's the symbols for looping in BF? 12:25:11 [ and ] ? 12:26:04 I think so. 12:26:09 : RTFM RANDOM LIST ; 12:26:35 Just to be happy with RTFM. 12:27:02 It shows something new each time you are told it. 12:28:48 so myword 1 2 > like s" Bogus." type asif s" Cool." type jk im l8r 12:30:00 so stuff 1 2 uh 0 kinda like w00t! asif :( jk l8r 12:30:12 : l8r bye ; ( ? ) 12:30:43 : l8r postpone ; ; immediate 12:31:05 no, : l8r [compile] ; ; immediate 12:31:15 That's a new proposal, of course older one was good enough. 12:31:26 Same diff. :P 12:31:44 : im cr ; 12:32:10 --- join: dan_ (dan@pcp053338pcs.brlngt01.nj.comcast.net) joined #forth 12:32:24 Dobryjj vecher, dan_! 12:32:54 : :P . ; 12:33:08 ASau: dobryj 12:33:17 --- nick: dan_ -> jstahuman 12:34:19 : sux postpone catch ; immediate 12:34:22 : pwn throw ; 12:35:11 I'd maybe reverse those... sux = throw, pwn = catch 12:35:25 : sux abort ; 12:35:40 madgarden: good point 12:35:55 : j0 vocabulary ; 12:36:00 ahah 12:36:03 scriptkiddieforth 12:36:27 * Nurf waves 12:36:31 I'd better get back to work 12:36:32 http://images.ucomics.com/comics/ft/2003/ft031118.gif 12:36:36 Cheers guys 12:36:42 --- part: Nurf left #forth 12:37:00 quick, somebody make up a quick file with some of these definitions, write an example program or two, and submit it to /. 12:37:11 We should start a standards committee for it. ;) 12:37:19 I can just see it as a headline: "Developers: Program in 31337-speak" 12:37:42 ehehe 12:37:48 ahahaha 12:38:11 1337f0r7h 12:38:17 c001? 12:38:28 how do you do an infinite loop in ansi forth? 12:38:37 begin again 12:38:38 I thought it was begin/again 12:38:39 BEGIN AGAIN? 12:38:42 I win! :D 12:39:20 :D ? MSG #0 12:39:25 I.e. not defined. 12:40:21 BTW, I have also END as an alias for AGAIN 12:40:54 why? you don't END an infinite loop 12:41:11 I don't know. 12:41:59 It comes from the Past Era of 1978 or 1977. 12:42:03 That ages. 12:42:47 gforth doesn't like it. 12:42:50 bf:17: expected dest 12:42:50 : scan-back begin src-cur-- src-cur @ c@ dup >r ?} r> ?{ dup if again then ; 12:42:50 ^^^^^ 12:42:53 There is even ENDIF for THEN 12:43:50 Hm. Does gforth allow BEGIN IF AGAIN THEN ? 12:44:00 j0 foo foo sup mang ( vocabulary foo foo also definitions ) 12:46:51 oh, that would fudge up the control stack at compile time wouldn't it 12:47:11 yet another reason to use tail recursion. 12:49:15 I'm turning to it too. 12:50:37 I really miss my control words. 12:50:38 : RE ?COMP COMPILE BRANCH HERE LATEST PFA , ; IMMEDIATE ( pending ) 12:51:04 I have words that check a condition and exit if it's true: 0; if; >; <; <=; =; etc 12:51:04 Or, maybe <-- ? 12:51:35 Define them! 12:51:51 IIRC, it is 12:52:03 : ?; if r> drop then ; 12:52:13 etc 12:52:24 Here's a minimal ANS 1337f0r7h: 12:52:24 : so : ; 12:52:24 : l8r postpone ; ; immediate 12:52:24 : like postpone if ; immediate 12:52:24 : asif postpone else ; immediate 12:52:25 : jk postpone then ; immediate 12:52:27 : kinda = ; 12:52:29 : uh + ; 12:52:31 : um - ; 12:52:33 : hmm * ; 12:52:35 : hmmm \ ; 12:52:37 : LOL emit ; 12:52:39 : im cr ; 12:52:41 : :P . ; 12:52:43 : j0 vocabulary ; 12:52:45 : sup also ; 12:52:47 : mang definitions ; 12:52:51 haha 12:53:14 Need to reboot 12:53:17 --- quit: ASau ("Toffee IRC client for DOS v1.0/b535") 12:55:12 --- join: ASau (~asau@158.250.48.197) joined #forth 13:07:14 --- join: Nurf (~ray@soggy199.drizzle.com) joined #forth 13:07:30 hello again 13:07:43 I have a question about the data pointer in forth 13:07:44 Greetings. 13:07:54 Do I have to keep it seperate from the dictionary 13:08:08 I am wondering if I can keep everything in one dictionary 13:08:39 If you are not going to multitask, than you can. 13:08:51 Hmmm. 13:09:30 http://www.taygeta.com/forth/dpans3.htm#3.3 13:09:35 Hm 13:09:44 Yes. If you want to run several tasks you'll have to utilize user variables, otherwise not. 13:09:53 Why would using one dictionary break multitasking? 13:10:51 madgarden: write some example code in 31337-forth and make it a page 13:11:00 You have compiling words referring DP 13:11:24 Ah 13:11:35 Now what do you have after some of your tasks start defining new words? 13:11:35 Well, multitasking is rather important to me 13:11:38 Here's what I tested with: 13:11:39 so stuff 2 hmm 10 kinda like "w00t!" asif ":(" jk :P im l8r 13:12:13 Er, except that uses my string values. 13:12:18 ... yeah 13:12:36 ASau: I have yet to use a multitasking word set in forth.. I couldnt find a generic one I could just drop into pForth. I really have no idea what approach they use 13:12:59 Nurf: I don't know either. 13:13:19 ASau: Do you know of any high level multitasking word sets? 13:13:56 Nurf: I can't recall if I've seen one. 13:14:03 Never bothered before. 13:14:16 ASau: Oh? How do you do multitasking then? 13:14:46 madgarden: Thanks, I had read the ANS stuff on the data space. I was impressed by how unuseful I found it :-) 13:14:55 Nurf: Just I don't forget to make it in future. :) 13:15:58 haha. 13:16:25 *sigh* I guess I'll just have to have a seperate DP then 13:16:38 You should redefine COMPILE to compile a task switch word and I/O words with waiting. 13:17:08 Also don't forget about sharing and locking. 13:18:06 I am very comfortable with multi threaded programming... I just have no idea how its usually done in forth 13:18:12 * Nurf <-- Forth noob 13:19:08 Well, the most obvious way is compiling a special word before any other. 13:19:44 : COMPILE ' PAUSE , R @ , R> CELL+ >R ; 13:20:18 Don't forget to do this _before_ (I assume threaded code, not native.) 13:21:11 * Nurf tries to figure out what that does 13:21:58 PAUSE switches stacks and user-var. areas. 13:22:15 I cant find it in ANS 13:22:40 I guess that would be a word I'll have to include in my forth kernel then 13:22:42 It's not ANTI standard. It's common practice. 13:23:32 Is "R" ANS? I cant find it 13:23:39 Too many matches on capital Rs 13:24:23 I don't know. Consider : R R> R> DUP >R SWAP >R ; 13:24:40 What does it do? Its a _really_ good name :-P 13:24:41 Ah. It does the same as I 13:24:55 Top of R-stack. 13:25:19 Nurf: Have you looked through this? http://forth.sourceforge.net/standard/fst83/ 13:25:29 nope 13:25:35 * Nurf opens it 13:25:40 It's a bit easier to follow. 13:25:44 Than the ANS documentation. 13:25:48 *nod* 13:26:04 --- join: wossname (wossname@HSE-QuebecCity-ppp81557.qc.sympatico.ca) joined #forth 13:26:09 A lot less words to worry about. 13:26:31 The problem is that there is stuff that everyone seems to know, but there is no one place on the net to find it... and you have to know it before you can search for it :-( 13:27:07 Ah. There should be "Starting Forth" pages. 13:27:11 ASau: Ok. So you change compile to do a voluntary task switch at the beginning of each word 13:27:38 ASau: Well, I would prefer a "One place for all" Forth page. The net overflows with forth pages :-( 13:28:12 Lots of Forths out there. ;) 13:28:13 When you start multitasker (MT) it creates USER variables for each task. 13:28:51 Probably a good way to start from Wiki or Directory. 13:29:10 madgarden: Is there a version of the f-83 thing that is all in one file so I can search it easily? 13:29:48 ftp://taygeta.com/Forth/Compilers/native/... 13:29:52 something like this 13:30:10 ASau: Hm. Its a partial solution at best :-/ I have been looking for months and have yet to get any real idea of how forth multitasking is done. I've learnt more from you in the last hour :-P 13:30:21 This? http://forth.sourceforge.net/standard/fst83/FORTH-83.PRN 13:30:43 ASau: All the info I want in 50000 unsearchable pages isnt much help :-) 13:31:18 That PRN is linked from the Forth-83 HTML page also, in the "note" section. 13:31:29 Ta :-) 13:31:41 You can also use preemptive multitasker, if you can define interrupt driven routines. 13:32:14 You can also define them as CODE as well. 13:32:33 ASau: I have written my own RTos for this device, including pre-emptive multitasker and interrrupt dispatch.. Its all in ARM assembler.. I guess I can hook it in wherever 13:32:35 USER variables are the same. 13:32:50 ASau: I just wanted to do it in a Forth native way, and detach all that from my stuff 13:33:48 ASau: I guess I just dont know enough about how stuff works behind the scenes. It'll probably be quicker to just write my own forth and be done with it 13:34:36 Do you run any x86? 13:34:55 Er.. not on the embedded target, no 13:35:08 I have an x86 linux box I use as my desktop 13:35:23 How about storing variables in a seperate dictionary that is instanced for each task, and the core words are shared. 13:35:30 nurf your comment about learning more in the last hour... now you know where to go to learn :) 13:35:37 Possible way to go is to look at EForth. 13:35:50 It has Linux ports. 13:36:06 You can find it on Taygeta FTP. 13:36:14 ASau: Thanks. I'll look 13:36:27 ftp://ftp.taygeta.com/pub/Forth/ and deeper. 13:37:16 Now that I think about it, its weird I havent come across any ARM forths 13:37:29 Its an elegant little cpu and used in embedded stuff a lot 13:37:35 Stop! 13:37:49 There is ARM Forthes. 13:37:59 I've seen links. 13:38:15 Well, if I had an Acorn machine running RISCOS :-) 13:38:40 I must look again, and perhaps add that I meant "free open source ARM forths" :-) 13:39:08 I consider open source only. 13:39:40 Those fat C-written Gforth, PFE and pForth should run. 13:40:18 I can't recall asm-written, but you should look at EForth. 13:40:27 It has many ports. 13:40:33 *nod* 13:40:37 I am using pForth at the moment 13:40:41 And it is very fat 13:40:49 I really had to work hard to get it below 100K 13:40:53 And its still too big 13:41:23 Also, you might look at postForth, minForth and Camel-Forth. 13:42:00 If you find no ARM port, you will see small systems in any case. 13:42:09 Fig-Forth also. 13:42:43 I can help with later anyway. I use its derivative. 13:42:43 Thanks 13:43:06 About 6-7 KB for today for base system. 13:43:23 x86 in 16-bit I mean. 13:43:34 *nod* I dont need most of the ANS words. I could probably use around 100 words total and never notice the loss of the others 13:44:22 I can't recall how many of them, etwa 200. 13:44:39 about 200 13:45:12 But not of them are used. 13:45:26 There are intermediate ones. 13:45:34 *nod* 13:46:53 How's your VM work? Could you easily add forth words written in C as opcodes? 13:47:19 madgarden: I could, but I dont really want to 13:47:35 why the (*&#($* can't I read input with WORD? 13:47:37 madgarden: Speed isnt really something I have to worry about, and the less C the better. I want a tiny C vm 13:47:46 13 word isn't even blocking 13:47:50 (gforth) 13:48:03 madgarden: Why? 13:48:05 BL WORD returns immediately too (over and over) 13:48:46 Well, that's basically how I've done mine. the VM is pretty minimal, and I just write the words I need in C and export them to the system. From there I can define higher-level Forth words. I don't hvae to implement all of Forth in Forth. 13:48:47 ;) man aio ? 13:48:50 FICL is similar. 13:48:51 :))) 13:49:30 madgarden: Yeah.. I can see how that would save time. I am still wondering if I should do something like that 13:49:45 I dunno, just seems like the simplest method for a C forth. 13:49:51 And, it's so easy to extend. 13:49:53 madgarden: I would like to just have an untra tiny stack machine though, and write the forth in that 13:49:59 Nurf: Also Pygmy Forth. 13:50:27 ASau: ta 13:50:30 Well, you only need to export the C words you really need, and then write the rest in itself. 13:51:06 madgarden: I was planning to make a single opcode that I would interface in assembler that would allow me to call any C function 13:51:09 I just found that managing things like the dictionary was easier to do on the C side. But, I'm a C programmer. :) 13:51:27 madgarden: Yeah.. I can see the attraction :-) 13:52:05 All of my C functions are called through a Forthy stack interface. 13:52:12 A lot like Lua. 13:52:34 madgarten: How is it? It's always easier to manage dictionary in Forth rather than in C. 13:52:57 This even stops me from writing y.a. C-forth 13:53:39 Well actually, it is very simple, and it's about half C. But, all the compilation and so forth is done on the C side. the Forth doesn't have direct access to the return stack, even. 13:53:49 ASau: I think you have to be reasonably familiar with forth. One of the reasons I am considering dfoing my own forth is to force me to learn this stuff :-) 13:53:51 It's very crash resistant. 13:54:16 Heh yea, it's my first Forth, so that's a lot of the reason I did it this way. But also, I am using it for scripting/extension. 13:55:19 If you seat under Linux scripting is done pretty easy. 13:55:48 I've explained once a sed/awk-like Forth extension. Here. 13:56:07 Well, I'm a Windows loser. :-/ ;) 13:57:34 :/ 13:57:36 Yes. ProgrammingForAnOperatingSystemThatBasesOnlyOnCxxIsAHell 13:57:54 cxx? 13:58:10 cpp? 13:58:11 ==cpp? 13:58:26 + is not allowed in C++ names, IIRC. 13:58:43 x is a drunken + 13:58:48 $ is though, which quite suprised me. 13:58:52 And C as well. 13:59:02 --- quit: warp0x00 (Remote closed the connection) 13:59:10 No. Unix is C-based. 13:59:13 In fact: 13:59:13 int $ = 0; 13:59:15 is valid 13:59:24 But it is easily programmed in asm. 13:59:35 I've done this for Linux. 14:00:09 ASau: ag. 14:00:12 ASau: ah. 14:00:26 C++ is scary. 14:00:33 Clear API matters. 14:00:33 It's ugly. 14:00:50 C is crappy, IMO. I use it every day, and would much rather us Modula-2 or Pascal 14:00:54 it's eye-gougingly ugly. 14:01:07 it single-handedly scared be away from anything C 14:01:09 for years 14:01:11 when i was a child 14:01:20 Algol-68 foreva! 14:01:25 slow to compile, allows stupid unforced errors 14:01:28 i was like, "ok i want to learn a real language" 14:01:37 so i picked up these visual c++ manuals 14:01:39 OMG. 14:01:45 I still can't read that crap i bet. 14:01:52 c is ugly, and forth isn't? 14:01:54 And I dont want to think of the time I have wasted hunting down bugs made by people who didnt understand C pointers 14:01:57 C is ok 14:02:03 C++ is different 14:02:05 Ugh: 14:02:05 template 14:02:05 int Stack::push(const T& item) 14:02:05 { 14:02:05 if (!isFull()) 14:02:05 c is beautiful, just as forth is beautiful 14:02:06 { 14:02:08 stackPtr[++top] = item ; 14:02:10 return 1 ; 14:02:12 } 14:02:14 return 0 ; 14:02:16 } 14:02:22 one thing i found surprising about C++ 14:02:27 Yea, I prefer to stick to C whenever possible over C++. 14:02:29 is the way * and & are used differently 14:02:31 wossname: I find them both ugly. Forth is just very useful for embedded environments 14:02:38 in pass bt ref 14:02:38 And C++ suckers you into static inheritance traps. 14:02:44 wossname: Algol-68 foreva! ;) 14:02:46 Objective C, on the other hand... 14:02:47 rocks 14:03:36 I like the concatenative effect of Forth, and not necessarily the Forth language itself. 14:03:52 Naaah. Pascal is the thing. Compiles at 10s of millions of lines of code/sec, and beginners dont shoot themselves in the foot :-) 14:03:57 It just seems like such a "truth". 14:04:10 I remember Pascal. 14:04:12 Forth is useful. It could be prettier somehow though :-) 14:04:22 I was pissed off at the time because I had to stop using BASIC. ;) 14:04:31 madgarden: Hey. I still use it! :-) "remember" *sniff* 14:04:45 Forth just needs clearer words. 14:05:06 R> C@ ! 14:05:07 madgarden: I can write a pascal compiler that targets a new cpu in about 2 weeks. That's very hard to do in C 14:05:42 Cool! Write me up a C64 Pascal compiler would ya? ;) 14:05:51 I miss my C64. :'( 14:06:19 :-) 14:06:19 In Forth I can write: SYSTEM TERMINAL IS COLOR 80 COLUMNS 25 RAWS SET 14:06:27 I still like my amiga 14:06:53 ASau: Yes, that's what I like about "Forth". Though, it's not really Forth language itself that provides that concatenative effect. 14:07:17 I never did get a chance to program on the Amiga, though I had one. 14:07:39 That's about the time i was learning Pascal in highschool. 14:07:52 Even more: I can write this in Russian. :) 14:08:06 And with no net, it was hard to find good C stuff for the Amiga. And I refused to use AMOS. :) 14:08:18 madgarden: *nod* I was in the demo scene a bit. Also wrote a C64 emulator with a friend on my amiga :-) 14:08:26 Heh, nice! 14:08:40 madgarden: You just need AsmOne. Assembler was practically a high level language on the amiga 14:08:44 I just wrote a few games in highschool for our QNX Icon machines. 14:08:48 * Nurf sighs and looks a bit misty eyed 14:08:52 :D 14:09:55 You could open a CLI with full command history and searching in 12 lines of assembler on the amiga.. and that without doing anything fancy 14:10:28 :O 14:11:35 I *almost* got into Forth when i was about 12 or so, on the C64. Decided I didn't want to learn a new language though, and stuck with my line numbered BASIC. :-/ 14:12:48 :-) 14:12:51 ZX Basic was very good. 14:12:53 I started onthe Spectrum 14:13:02 Its basic was excellent 14:13:08 I could write INPUT a: GO TO a 14:13:14 There was the Jupiter Ace too! :D 14:13:31 madgarden: Actually, ZX Basic is probably one of the best basics I have ever seen 14:13:32 Go to a string? 14:13:48 * Nurf got annoyed with how slow it was though and ended up using Z80 asm for most things 14:14:02 Go to a line number got from a variable. 14:14:14 Oh, cool. 14:14:20 ASau: I loved the string/array handling 14:14:38 a$(TO x) ? 14:14:50 print somearray$(34 to 40) 14:15:00 C64 only allowed 2-character variable names. >-| 14:15:06 actually I think a$(40 to 30) also worked 14:15:35 madgarden: Yeah well.. the C64 basic is pretty much the worst I have ever used :-) Written by Microsoft, so no surprises there :-) 14:15:49 Heh. Even so, I loved it. 14:15:55 * MysticOne always hated using MS Pascal in his Pascal class a few years back 14:16:15 I'll have to write a C64-like BASIC when I get some spare time. 14:16:18 madgarden: Heh. Then I imagine you would have been over the moon with the ZX Spectrum Basic 14:16:30 Yea, sounds like I'd love the ZX BASIC. 14:16:49 But, I don't even think we had Speccies over here then. 14:16:49 for i=0 to 32: print at 0,0; a$(32-i to i) + a$(i to 32-i): next i ? 14:17:47 MysticOne: Watcom Pascal in highschool over here. Plus Watcom BASIC and Watcom C. Each new language pissed me off with how weird it was. ;) 14:18:11 madgarden: The borland pascals were nice 14:18:26 I do believe I used that in college. 14:18:39 TurboPascal rocks 14:18:55 hehehe 14:19:11 I suppose it's a bit similar to Lua, syntax-wise. 14:19:11 In TurboPascal 3.0 I'd been once caught by a possibility of: 14:19:28 goto 1; while ... do begin ... 1: .... end; 14:19:39 I worked. 14:19:46 It 14:19:52 eek 14:19:56 gotos in pascal :-) 14:20:04 my gforth source for brainfuck interpreter here: http://herkamire.com/jason/downloads/bf.fs 14:20:20 heh, cool Herk 14:20:21 --- quit: melinda ("Leaving") 14:20:21 --- quit: I440r ("brb") 14:20:25 not as easy as I was expecting. possibly because my code isn't the best. 14:21:08 Also, in TP 3 begin ...;end doesn't compile. 14:22:44 ASau: Hummm.. In C, ";" is a seperator. In pascal it is a terminator 14:22:56 In TP 5 you can't write: var a: array[1..10]of record ... end; 14:23:55 Nurf: Change. You'll be right. 14:24:35 Herkamire: As if my brain wasn't already fucked enough by just Forth. :P 14:28:19 Well, I'm going asleep. 14:28:21 Bye! 14:28:27 gn 14:28:29 --- quit: ASau ("Toffee IRC client for DOS v1.0/b535") 14:37:03 --- join: thin (thin@bespin.org) joined #forth 14:37:20 can you believe the forth logs showed up when i did a google search on "message board sub-threading" ?? 14:37:23 jeezus! 14:38:00 i wonder why the hell the robots.txt file was removed 14:38:32 --- part: Nurf left #forth 14:44:35 --- part: madgarden left #forth 14:48:55 --- join: jamc (dne@as3-6-8.asp.s.bonet.se) joined #forth 15:29:26 --- quit: wossname ("good night") 15:46:48 lala 15:47:04 --- join: Sonarman (~matt@ppp-66-124-255-119.dsl.snfc21.pacbell.net) joined #forth 15:54:00 ave sonarman 15:54:01 --- join: PWizard (~pwizard@rdu163-111-190.nc.rr.com) joined #forth 15:54:07 allo 15:55:30 ave thin 15:55:36 hi PWizard 15:57:46 what's up 16:00:37 nothing 16:00:48 oops. typed /names in another window. :-/ 16:00:52 --- quit: thin ("Leaving") 16:22:53 --- quit: PWizard ("Leaving") 16:25:10 greetings 16:33:25 --- quit: jstahuman ("leaving") 16:34:10 hey arke 16:34:40 whats up, mister sound? 17:17:51 --- quit: jamc ("FEELINGS are cascading over me!!!") 17:20:46 http://cliki.tunes.org/Forth%20OSes 17:20:53 look under "other" 17:20:54 :) 17:26:45 arke: H3rL ? 17:28:22 no 17:28:23 isforth 17:28:24 lol 17:28:31 but i440r isnt here ... 17:28:38 ill mention it to him when he gets here 17:30:09 hrm 17:30:12 "A low-level functional-like programming language for a stack-based VM model," 17:30:17 its NOT low-level! 17:30:22 I just read about the language Whitespace 17:30:27 its low-level and high level at the same time 17:30:32 I'm quite amused :) 17:30:36 (which is what makes it so great :) ) 17:54:53 --- join: kc5tja (~kc5tja@66-91-231-74.san.rr.com) joined #forth 17:54:53 --- mode: ChanServ set +o kc5tja 18:21:55 --- quit: kc5tja (Remote closed the connection) 18:22:27 --- join: kc5tja (~kc5tja@66.91.231.74) joined #forth 18:22:28 --- mode: ChanServ set +o kc5tja 18:24:36 --- join: melinda (name@melinda.usercloak.freenode) joined #forth 18:35:50 time for some peanut butter and helly sandwiches... 18:35:55 jelly even... 18:36:28 nothing like peanut butter and hell 18:38:26 No. Not Hell. Helly! :) 18:39:37 i'll take one, openface 18:40:10 Is helly like silly hell? 18:40:14 Hey, watch who you call openface, mister... :) 18:40:23 lol :) 18:40:39 make me one quick, or I'll close your face! 18:40:57 HAH. You can try. 18:41:41 forceps! 18:42:12 scalpel! 18:42:28 Hmm...not working. :) 18:42:53 dagnabbit! 18:43:22 * Herkamire goes downstairs to make his own damn sanggwich 18:43:28 :) 18:50:54 ahhh 18:50:58 good stuff 18:51:22 Herkamire: Get me something to drink while you're down there 18:51:32 too late 18:51:42 Damn 18:51:58 all I got up here is a yummy feeling in my tummy and an empty nalgene bottle 18:52:28 melinda: Tell that lazy boyfriend o' yours to get off his doggone computer, stop wasting time, and do something useful, like get you a drink. >:) 18:52:35 Herkamire: that was oven cleaner in that bottle 18:53:12 kc5tja: He's not my boyfriend :P 18:53:21 kc5tja: and he was gone to taco bell hehehe 18:54:04 * kc5tja wanted to get something at Carl's today (where you live, it'd be called Hardee's), but then I remembered I had el-cheapo poor-man's food, so that's what I had instead. :) 18:54:42 Oh well, back to software design. 18:55:17 hehehe 18:59:41 hey kc5tja 18:59:44 how are ya? 19:17:15 --- quit: arke ("parents being stupid .... be back as soon as stupidity ceases") 19:18:58 --- join: arke (~chris@ca-cmrilo-cuda1-c3b-66.vnnyca.adelphia.net) joined #forth 19:27:47 arke: I'm doing well enough. I just don't have much time to do much tonight though. :/ 19:28:30 :( 19:28:34 soooooo 19:28:37 im learning ogl 19:28:37 :) 19:44:12 OpenGL? 19:44:21 * kc5tja is still designing the architecture for the qm editor. 19:54:19 --- join: madgarden (~madgarden@Kitchener-HSE-ppp3576567.sympatico.ca) joined #forth 19:55:59 --- join: thin (thin@bespin.org) joined #forth 19:56:20 arke: screw ogl, postscript is funner (except it doesn't support 3d stuff i guess??) 19:56:47 there could be something similar to postscript that supported 3d with no prob 19:58:58 Why would it have to be like postscript? 19:59:05 prompt `R%h `G%v `W%o `Y%t> 19:59:08 oops 19:59:15 stupid mouse 20:01:20 postscript is a very simple & nice 2d graphics specification format.. the graphics words could be coded in forth in 3 or 4 pages 20:01:45 it doesn't support 3d, but there's probably a "3D postscript" version 20:02:03 Ahh, right. 20:02:17 quite elegant, a 3d graphics specification could be quite small in forth compared to ogl 20:03:18 There is no 3D Postscript implementation. 20:03:30 kc5tja: yeah i figured i could count on you to let us know :) 20:03:34 :) 20:03:47 nothing 3d-like? 20:03:48 * kc5tja is still doing paper design of his qm editor's internal architecture. 20:03:52 postscript has been around so long you know.. 20:03:52 Nope. Nothing at all. 20:04:07 OpenGL is the de facto standard for all 3D stuff. 20:04:09 there's all that fancy postscripGUI stuff (i forget what they're called) 20:04:17 DisplayPostscript. 20:04:25 yeah 20:04:26 s/ayPo/ay Po/ 20:04:31 Surely it be pretty simple to make a 3D postscript spinoff. 20:04:39 yeah 20:04:44 madgarden: Maybe, I don't know. 20:04:44 :) 20:04:45 im happy 20:04:47 and gay 20:04:50 erm 20:04:55 the jolly kind 20:05:04 gay 20:05:10 GAY! 20:05:16 * thin goes prancing in the meadow 20:05:22 yeah we should bring back the old meaning :P 20:05:26 thin: you too? 20:05:31 :) 20:05:32 and be bold enough to wear pink! 20:05:37 * arke puts on his knee pads 20:05:41 madgarden: Well, I think I'm not going to use aggregate-based object model just yet. I just don't have an immediate need for it. 20:05:48 :O 20:05:55 arke: knee pads? 20:06:28 madgarden: It turns out that most of my object requirements can be satisfied with normal, statically bound C functions. 20:06:59 Hmm. Just going to pass a struct pointer around to various modules? 20:07:10 madgarden: Basically. 20:07:33 Yep, that's what I usually do. 20:07:34 madgarden: It's still object oriented; it's just not mad polymorphic. 20:08:02 (It's object oriented in the GTK sense of the word, where your functions are module_type_method() format) 20:08:19 * kc5tja really likes GTK's object model, actually. It's very easy to use, and very easy to extend. 20:08:20 Yea. And if you need "polymorphism" you can always slap together an interface or three and call through that. 20:08:43 arke: i'm not actually gay, but i certainly can be jolly gay 20:08:44 And while it supports single inheritance, I do not see it as being mutually exclusive with aggregation if it's required. 20:08:57 I prefer to be in a state of "glee". 20:09:11 sometimes glee is negative 20:09:16 Function pointers are our friends. 20:09:16 like perverts in a state of glee 20:09:17 :P 20:09:22 How can glee be negative!? 20:09:30 Hmmm...'gay sleighbells ring.' Makes you wonder just what those sleighbells are doing when Santa's not watching... 20:09:39 as long as you don't rub your hands together while in a state of glee 20:09:52 don we now our gay apparal! 20:09:54 How's that different than perverts in a state of gaiety? 20:09:58 apparel* 20:10:06 ack 20:10:07 ack 20:10:08 ack 20:10:08 ack 20:10:09 :) 20:10:11 nak 20:10:12 gaiety is by definition full of innocence :P 20:10:23 im not gay, i just do not mind gay sex for pleasure :P 20:10:29 it's actually "gay sleighbell's ring". they're buying wedding rings now that it's legal in Masachusetts 20:10:30 lol 20:10:35 Joyous gleeful glee! 20:10:40 s/bell's/bells'/ 20:11:10 Well, I'm going to head back to the drawing board -- I've got some code architecture to finish up. :) 20:12:14 OK, normally in a Forth dictionary, memory that's alloted is in the same area as word headers, right? 20:12:41 kc5tja: : 20:12:51 cheeese 20:15:49 : gay r> 2* emit here >r ; 20:16:50 nah, made up code 20:16:56 I'd say: 20:16:56 : gay r> 2* emit here >r ; 20:16:56 ok> gay 20:16:56 XError: exception 20:17:01 the joke is supposed to be it's bad code 20:17:06 hence its gay 20:17:43 heee 20:17:46 what does it do? 20:17:48 but i'm using gay as a swear word in this context, sorry for insulting all the gay forthers of the world :P 20:17:48 erm 20:17:51 nothing 20:18:04 it emits twice the return value, then sets the return value to HERE 20:18:08 uuh 20:18:10 lol 20:18:20 yeah, it's gay isn't it? :P 20:18:23 Quick! Shadow of the Beast title is playing on Kohina: http://130.240.194.204:8000 20:18:40 Gleeful! 20:19:01 madgarden: uuuuh 20:19:11 madgarden: sounds like a tune from some old gameboy game 20:19:17 Heh, it's an old Amiga game. 20:19:37 And what... don't you like the retro game tunes? :P 20:20:09 hee 20:20:20 i think id rather listen to di.fm 20:20:32 Wossat? 20:20:53 http://google.com/search?di+fm 20:20:57 http://di.fm 20:21:37 I'll check that out. 20:22:09 Cliqhop is also cool: http://63.208.2.26:8062 20:24:16 :) 20:25:18 Hey, I actually listen to some DI stuff already. 20:25:26 i think the word "gay" should be as meaningless as the word "fuck" 20:25:32 so that it can be used in swearing with no meaning 20:25:46 swearing isn't supposed to have meaning, its just supposed to be expressive :P 20:25:46 Fucking gay gay gays... ;D 20:25:56 lol 20:25:59 A voiced exclamation point. 20:26:23 that's got so many meanings 20:26:28 arke: tune into http://205.188.234.37:8008 20:29:06 Kalmah - Heroes To Us 20:30:53 home of teh metal nation :) 20:30:54 :) 20:30:55 :) 20:31:06 i should collect a bunch of mp3s and make my own shoutcast 20:31:17 notably red hot chili peppers 20:31:17 :) 20:33:36 Da peppers. 20:34:35 kc5tja: tell me, which do you prefer : DTC, ITC, STC, NTC 20:34:43 (make a choice, and ill ask you another question) 20:34:59 STC 20:35:01 depends on the chip :P 20:35:06 STC on forthchip :D 20:35:28 True, it does depend on the chip. But overall, I like the elegance of subroutine threading. 20:35:38 STC is similar to ITC 20:35:39 what's NTC? 20:35:58 the difference between ITC and STC is that STC uses "call" right? 20:36:05 unless i'm confusing ITC and DTC 20:36:51 STC uses calls, yes. 20:37:13 ITC and DTC are almost alike in that they use pointers to raw word headers/bodies (respectively). 20:37:15 yeah but you can do the same thing that STC does with push/jmp instead of calls.. 20:37:30 That's still subroutine threaded. 20:37:41 ok 20:37:57 Subroutine threaded uses the CPU's internal IP as the Forth instruction pointer, and the CPU's (perhaps emulated) return stack. 20:38:05 How you invoke the call is immaterial. 20:38:34 thin: yeah 20:38:37 uuh 20:38:37 wait 20:38:38 lagging 20:38:57 lol 20:39:04 yeah, STC is pretty good 20:39:17 Sonarman: NTC is STC with some words inlined 20:39:30 thin: there's a good article which explains STC,5C DTC, and so forth, which I am reading to learn more: http://www.zetetics.com/bj/papers/moving1.htm 20:39:39 arke: NTC = Native Threaded Code? 20:39:41 Sonarman: mostly used for optimization, because you can have a blazing STC with the right register assignemtns 20:39:50 Sonarman: yup 20:39:50 Sonarman: Oh, well in that case, NTC if it's used properly. 20:39:58 But to me, NTC is STC. :) 20:39:59 Sonarman: moving forth is great :) 20:40:05 I do not distinguish between the two, realistically speaking. 20:40:11 kc5tja: well, the way ive got my regs, i dont need NTC 20:40:34 the way i have it, i could probably outperform gcc 20:40:39 on -O3 maybe even 20:40:45 sonarman: nah, ignorance is bliss 20:41:11 i'm not too concerned about knowing the differences of threading methods :P 20:41:18 arke: Umm...no. :) 20:41:36 You can probably *compete* with GCC with -O0, but you won't be able to outperform it. 20:41:45 isforth outperforms gcc already :P 20:41:52 thin: Bull. 20:42:14 I want to see proof of this, including actual source code, AND the command-line options used to compile the C code. 20:42:16 thin: dont think it does 20:42:18 *gasp*! 20:42:24 ok 20:42:25 lol 20:42:30 lemme make a comparison here 20:42:33 : adder + ; 20:42:34 kc5tja: nah i don't think it does, i440r hasn't said it does 20:42:44 int adder( int a, int b) { return(a+b); } 20:42:53 first compiles to: 20:43:04 --- join: networm (~root@L0652P12.dipool.highway.telekom.at) joined #forth 20:43:18 adder: add eax, [ebp] 20:43:23 add ebp, 4 20:43:24 ret 20:43:37 gcc with -03 compiles the adder source to: 20:43:46 adder: 20:43:46 pushl %ebp 20:43:46 movl %esp, %ebp 20:43:46 movl 12(%ebp), %eax 20:43:46 addl 8(%ebp), %eax 20:43:48 popl %ebp 20:43:50 ret 20:43:53 which is faster? :) 20:44:29 How about the code *my* gcc produces: 20:44:34 mov eax,[esp+8] 20:44:38 add eax,[esp+4] 20:44:39 ret 20:44:41 :) 20:44:53 Which will *match* your code's speed. :) 20:45:12 kc5tja: i want to see the gcc's output 20:45:18 kc5tja: --save-temps ... filename.s 20:45:27 gcc -O3 -fomit-frame-pointer -c -o addertest.o addertest.c ; objdump --disassemble addertest.o 20:45:34 chris@chris:~> gcc --save-temps -O3 -c test.c 20:45:45 omit-frame-pointer? 20:45:50 oh 20:45:54 the whole ebp shit 20:45:56 neat 20:46:02 :) 20:46:05 ok, lets try a slightly more complicated example 20:47:04 (remember too that on modern processors, and with Forth's limited number of virtual registers, you'll often find yourself smack in the middle of pipeline interlocks too, so while code initially may look like it'll be faster, it probably won't be.) 20:47:56 : map ( xt array size -- ) 0 do dup rot execute while drop drop ; 20:48:00 (is that right?) 20:48:25 kc5tja: gcc will have interlocks, too 20:50:03 wouldn't it be fun to pass asm code to gcc and have gcc optimize it? :P 20:50:35 er, its not lol 20:50:37 arke: Not nearly as many as Forth. 20:50:40 thin: maybe :) 20:50:45 kc5tja: . 20:52:27 arke: Is your implementation of map changing the contents of the array at all? 20:52:31 Or just reacting to each element? 20:52:36 : map ( xt array size ) 20:52:36 0 do 1 + dup 4 pick execute while drop drop ; 20:53:17 Ok, so it's not modifying the array itself then. 20:53:55 --- quit: melinda ("Leaving") 20:53:58 OK, the code your compiler will produce is shorter, but not faster. :) 20:54:26 I'm looking at the code gcc produced, and there's all sorts of instruction reorderings and pipeline tricks going on. 20:54:43 paste! 20:55:05 I hope this doesn't flood. :( 20:55:08 Disassembly of section .text: 20:55:08 00000000 : 20:55:09 0: 55 push %ebp 20:55:09 1: 57 push %edi 20:55:11 2: 56 push %esi 20:55:13 3: 53 push %ebx 20:55:15 4: 83 ec 0c sub $0xc,%esp 20:55:17 7: 8b 74 24 28 mov 0x28(%esp,1),%esi 20:55:19 b: 31 db xor %ebx,%ebx 20:55:21 d: 39 f3 cmp %esi,%ebx 20:55:23 f: 8b 6c 24 20 mov 0x20(%esp,1),%ebp 20:55:25 13: 8b 7c 24 24 mov 0x24(%esp,1),%edi 20:55:27 17: 7c 0b jl 24 20:55:29 19: 83 c4 0c add $0xc,%esp 20:55:31 1c: 5b pop %ebx 20:55:33 1d: 5e pop %esi 20:55:35 1e: 5f pop %edi 20:55:37 1f: 5d pop %ebp 20:55:39 20: c3 ret 20:55:43 21: 8d 76 00 lea 0x0(%esi),%esi 20:55:45 24: 83 ec 0c sub $0xc,%esp 20:55:47 27: ff 34 9f pushl (%edi,%ebx,4) 20:55:49 2a: 43 inc %ebx 20:55:51 2b: ff d5 call *%ebp 20:55:53 2d: 83 c4 10 add $0x10,%esp 20:55:55 30: 39 f3 cmp %esi,%ebx 20:55:57 32: 7c f0 jl 24 20:55:59 34: eb e3 jmp 19 20:56:29 i have a feeling that the lea after ret never gets executed. 20:57:12 Right. It's a 3-operand "no op" that the compiler uses to align code to a 32-bit boundary, which makes instruction fetching and dispatching faster for the CPU. 20:57:37 . 20:58:15 stupid pipeline 20:58:24 stack machines are better :P 20:58:52 Pipelines are useful things for register machines. 21:02:43 gtg 21:02:44 --- quit: thin ("lala") 21:06:06 kc5tja: you know what i thought about tho? 21:06:53 Nope. Not in the slightest. :) 21:07:09 my code is pretty close to what gcc -O3 -fomit-frame-pointers (one of, if not the, highest optimization settings) 21:07:12 and its not optimized 21:07:46 imagine if i had an asm optimizer, which would go over the code after its compiled 21:07:51 i DEFINETELY would beat gcc then 21:09:26 do you agree? 21:14:46 Probably not. 21:14:56 GCC's code output for x86 is virtually ideal. 21:15:07 Just remember to set the architecture setting properly. 21:15:17 Oh, I forgot to mention that I'm using GCC 3.2.3. 21:15:51 im using 3.2 21:15:57 Remember that later generation x86s and RISC processors are specifically tuned to run C, so it follows that most C compilers will take advantage of this tuning. :) 21:16:22 hrm 21:16:51 the ideal C machine would probably be a forth machine with more registers and allows to do mov xxxx, [xxx+imm] 21:17:34 Well, that pretty much describes a RISC processor. :) 21:18:12 load/store architecture with limited addressing modes ((rA,rB) and (rA,offset) are usually all that is offered), and 32 (or more) integer AND floating point registers, with all other operations being done on registers. 21:21:34 we need to think of a forth/C comparison where the C version makes heavy use of locals 21:21:41 thats where forth will shine :) 21:22:07 The more locals, the faster the C code will be. 21:22:12 Better use of registers. 21:22:32 What you want, instead, is pointer dereferences. 21:22:38 And LOTS of them, to thrash the cache. 21:23:02 Then Forth will be faster than C, because Forth's reduced amount of subroutine call overhead. 21:26:01 ~/w 2 21:27:16 Sonarman: GET YOURSELF A BETTER TERMINAL OR USE XCHAT DAMMIT 21:27:21 kc5tja: . 21:27:24 Dude.... 21:27:28 Settle down, Beavis. 21:27:34 . 21:27:36 hrm 21:27:52 you said gcc produced ideal x86 code 21:27:55 right? 21:28:04 you mind if i add something to that statement? 21:28:25 gcc produces ideal x86 code for the register assignments it uses 21:29:13 --- join: warp0x00 (~warpzero@dsl.142.mt.onewest.net) joined #forth 21:31:03 warp0x00: greetings. please agree with me that a good forth will be able to outperform gcc -O3 -fomit-frame-pointer 21:31:06 lol 21:35:05 arke: It chooses its registers because they produce the minimum number of pipeline interlocks. 21:35:35 In 32-bit code, registers are registers are registers (with very, very few exceptions). This is quite unlike 16-bit code, where registers are more special purpose. 21:37:27 Anyway, I'm going to go back and resume designing. 21:37:35 * kc5tja is really liking the overall architecture I'm coming up with. 21:37:43 o.O 21:37:55 forth is never going to have any call overhead tho. 21:37:59 never 21:37:59 ever 21:38:02 ever 21:38:05 no matter what you do 21:38:06 none 21:38:07 at all 21:38:09 not even close 21:38:17 Fine. 21:38:30 Now what about all those SWAPs, DROPs, DUPs, PICKs (which are evil, BTW), and whatnot? 21:38:49 swap is very common and quite quick 21:38:54 xchg eax, [ebp] 21:38:58 done 21:39:03 It may not have call overhead, but it still does have stack overhead, and moreover, optimize all you want, the fact that you have precisely one top of stack register will result in a ton of pipeline interlocks. 21:39:05 That's just the way it is. 21:39:10 Doesn't matter!! 21:39:17 er 21:39:17 why? 21:39:20 C doesn't *HAVE* to "swap" if everything is kept in registers. 21:39:48 Because read-after-write interlocks stall the pipeline (the value of the written register isn't ready for the next instruction yet), as are write-after-write interlocks. 21:40:13 Then there's all that mish-mash with updating stack pointers and whatnot. 21:40:35 I'm not saying you can't write fast code in Forth; but the x86 just isn't optimized to run stack software. 21:41:34 i am sooo hating x86 21:41:56 arke: Join the club. 21:42:03 i need a mips emulator and learn how to code assembly in it and make something 21:42:15 i would probably have an orgasm, and then refuse to ever code x86 asm again 21:42:32 hehe -- that's the processor that started this whole "specifically optimized for C" campaign. :D 21:43:05 Microprocessor without Interlocked Pipeline Stages (MIPS) :-) 21:43:47 aaarrrrgggghhhh 21:43:48 ok 21:43:55 what would make a really good forth thingy? 21:43:57 ppc? 21:44:00 ppc should be good 21:44:22 ive gots more registers than i can shake a stick at 21:44:48 PowerPC is RISC; it's also optimized for C. 21:44:55 Yes, you do have more regs. 21:45:00 But Forth only uses *one*. 21:45:03 So what's the point? 21:45:12 That's why you need a true stack architecture. 21:45:48 Right now, the best way to get top-notch performance is to build your own stack architecture. Either in FPGAs (limited clock speed) or full-blown custom chips (mega-hyper-expensive). 21:47:00 BTW, NTC/STC Forth code on x86 isn't a slouch. 21:47:23 --- join: haroldo_ (~haroldo@r200-40-167-23.adsl.anteldata.net.uy) joined #forth 21:47:40 The best optimizations you can make on x86 to program code will result in 2x to 2.5x speed up over even unoptimized STC Forth code. 21:47:47 (in most cases; there are, of course, always exceptions) 21:47:55 Frankly, I *really* wouldn't worry about it. 21:49:46 *sigh* 21:49:52 but 21:50:00 But, with a 32-register machine, why not put the stack in the registers? 21:50:01 i _do_ come quite close to gcc's -O3 21:50:10 lol 21:50:17 madgarden: waaaay too much overhead 21:52:50 Well if memory was as fast as the registers, it wouldn't be an issue. 21:53:22 Just need a chip with 1G of registers. :) 21:54:48 lol 21:54:55 you know how sweet that would be? 21:54:55 Well, that's what cache is for. :) 21:54:59 oh 21:55:01 ack' 21:55:05 cache sucks. 21:55:09 its all about huge buses 21:55:11 :) 21:55:12 It takes precisely 1 clock to grab data from cache 21:55:24 Ideally, you just want unlimited memory with 1 clock access. Done. 21:55:30 And that clock cycle is often consumed in the pipeline stages, so you rarely ever see it. 21:55:48 Well, you don't need an unlimited amount of RAM with 1 cycle access. 21:55:53 If you want that, use a 65816 CPU. 21:56:29 But a cache is good enough for most things because (a) if you're not dealing with arrays, you're probably going to deal with (b) the data stack, or (c) the return stack. All of which have *outstanding* properties of locality. 21:57:50 whats the end word for DO? 21:57:52 DO ? 21:58:39 LOOP 21:59:04 10 0 DO I . LOOP 21:59:06 ok 21:59:07 duh 21:59:09 lol 21:59:09 That what you're talking about? 21:59:12 yup 21:59:13 :) 21:59:20 Heh. My Forth doesn't have DO/LOOP. 21:59:40 Holy mother Mary of Nazereth. I do believe I have the overall system architecture for my text editor completed. 21:59:49 Already? 21:59:54 Well, OK, the model side of things. 21:59:54 --- quit: haroldo (Read error: 110 (Connection timed out)) 22:00:03 I still need to work on the view and controller architecture(s). 22:00:12 But then again, you seem to be some sort of mutant brain. ;) 22:00:13 Oh, and the object prevalence system. 22:00:39 Well, the key to this whole thing is the object system, of course, and its object persistence mechanism, which I'm using object prevalence for. 22:01:01 kc5tja: do me a favor 22:01:08 What's up? 22:01:18 kc5tja: i wrote this horrible word, and i need to make sure this wont blow anything up 22:01:27 : bf-execute ( c -- ) 22:01:27 6 0 do 22:01:27 bf-table I cell * + @ 22:01:27 over = if 22:01:27 bf-table-f I cell * + @ 22:01:30 execute 22:01:32 loop 22:01:34 ; ] 22:01:37 endif 22:01:40 loop 22:01:42 \ Ignore --- comment :) 22:01:45 ; 22:02:06 I would use cells instead of cell *, but that's just me. 22:02:38 Also, what does 'c' represent? 22:02:47 the character to execute 22:03:12 would my whole ; ] kludge work at all? 22:03:14 It will explode. 22:03:23 No. :) 22:03:24 heehee 22:03:29 ok 22:03:33 alternative? 22:03:35 I think what you want is to say "unloop" instead of "loop ; ]" 22:03:41 because i couldnt think of much better 22:03:42 unloop? 22:03:47 Yea, I don't get that ; ] bit. 22:03:52 It breaks out of a do/loop cleanly. 22:04:05 If not, then unloop exit should work. 22:04:09 ; = end of work, but go back into compile mode with the ] 22:04:22 exit = exit proggie or exit word? 22:04:25 kc5tja: What's "kc5tja" supposed to mean? Other than something awkward to type and verbalize... 22:04:31 arke: Exits the word. 22:04:39 madgarden: ham radio nick :) 22:04:41 madgarden: Sorry. It's my ham radio callsign. 22:04:54 why is it ham radio? 22:04:55 Aha... 22:05:00 why not beef or pork or turkey? 22:05:11 Har har. 22:05:57 HAM is an acronym of some kind; that much we know. But the history of the term has been lost; it was never recorded. 22:06:12 It's believed that HAM is actually the three initials of the earliest licensed amateur radio operators. 22:06:17 heehee l0lz0r 22:06:26 Interesting. 22:06:31 One of them was named Hiram Peircy Maxim, which is the M part of HAM. 22:07:19 Another theory is that it's short for household amateur operator. 22:07:23 pretty cool magazine... 22:08:09 : ', ' , ; would work right? 22:08:13 in gforth, i mean? 22:08:41 Can you give me an example of use? 22:08:49 * kc5tja notes that context is very important with Forth. :) 22:09:01 Just compiling an XT right? 22:09:10 yeah 22:09:17 Oh.. 22:09:19 ' some-word , 22:09:21 Yeah, that should work. 22:09:25 -> ', some-word 22:09:26 ok :) 22:09:31 no immediate declaration or such? 22:09:37 Isn't that what ['] is for? 22:09:46 ['] foo , 22:09:53 You're already in the interpreter when running ', so there's no need for immediacy. 22:10:11 At least, I am ASSUMING you are. 22:10:13 CREATE FOO 22:10:20 ', george ', larry ...etc... 22:12:57 OK... in a word, the code is seperate from the parameters, correct? 22:13:24 ? 22:13:33 s" bf.fs" included redefined array redefined bf-buffer redefined bf-offset redefined bf-addr redefined bf-get ok 22:13:36 '+ bf-execute 22:13:39 *the terminal*:1: Invalid memory address 22:13:40 whats up there? 22:13:43 '+ bf-execute 22:13:45 ^^^^^^^^^^ 22:14:14 : test create foo 1 , 2 , does> dup @ 1 cells + @ ; 22:14:26 Err, remove that "foo" 22:14:48 arke: What is '+? 22:15:26 kc5tja: push the character + on the stack lol 22:15:38 Ahh, oops. :) 22:15:46 :) 22:15:47 It's getting late. 22:15:52 I should be heading to bed soon. 22:15:53 heehee 22:16:39 This, rather: 22:16:40 : test create 1 , 2 , does> dup @ swap 1 cells + @ ; 22:17:18 madgarden: The second version. 22:17:30 Yea, the first version would crash. :) 22:17:33 CREATE always gets its input from the input stream, but it's not an immediate word. It runs when test runs. 22:17:52 arke: That error message usually means a bad pointer somewhere. 22:17:55 Right... but what I am asking is, where does the code actually get compiled TO? 22:18:04 madgarden: Code for what? 22:18:19 The stuff after does> 22:18:37 kc5tja: so....? 22:18:51 madgarden: technically it goes in the same definition as the part before does>. 22:18:52 Or, for a regular word: 22:18:52 : foo swap drop dup ; 22:19:05 It's just never reached directly by the test code. Only the words created by test will execute that. 22:19:14 I mean literally, where does the code LIVE. 22:19:28 --- quit: Sonarman (Read error: 104 (Connection reset by peer)) 22:19:42 In OO terms, : test create foo 1 , 2 ,  is the constructor for an object, and does> dup @ 1 cells + @ is the sole method that object supports. 22:19:47 Yea, I understand DOES>... but in my Forth, I malloc seperate parameter and code areas when compiling the word. 22:19:54 madgarden: I just answered that question. 22:20:22 I suppose I'm not really being clear. 22:20:30 It exists in the same hunk of memory that the test definition exists in. It is physically part of the test definition. Note that ';' ends the definition, not does>. 22:20:39 Right. 22:21:39 So let's just look at this example then... 22:21:49 : bar 1 , 2 , swap drop dup ; 22:21:59 I've compiled parameters, as well as code. 22:22:10 That would crash if you tried to execute bar. 22:22:15 They have to live together nicely. I can't exactly execute "1" and "2" 22:22:16 Oh, wait. 22:22:17 I see. 22:22:27 Right. 22:22:35 I'm basically wanting to see a memory map of that word. 22:22:37 And you don't execute 1 or 2. 22:22:42 Right. 22:22:52 They just exist in the parameter fields for the word. 22:22:59 [header for foo] $00000001 $00000002 ...etc.... 22:23:25 And the swap drop dup? 22:23:25 E.g., the header and its body need not be adjacent, but there must be a linear relationship between the headers and the body. 22:23:39 madgarden: Those exist in the definition of bar. 22:23:45 hrm 22:23:46 In fact, this is what bar looks like: 22:23:48 heehee 22:23:55 i just thought of a funny forth prank 22:24:02 : 1 2 ; 22:24:04 lol 22:24:06 [header for bar] LIT $00000001 COMMA LIT $00000002 COMMA SWAP DROP DUP EXIT 22:24:13 thatll take _hours_ to figure out, if at all :) 22:24:57 Hmm... 22:25:22 So, you can't really have a created word that has compiled words in it. 22:25:25 CREATEd 22:25:44 Sure you can. You just need to be intimately familiar with your Forth environment's memory layout to do it. 22:25:56 It's generally not recommended anyway, for portability reasons. 22:25:59 I'm familiar with mine. ;) But I sort of cheated. 22:26:05 The closest is: CREATE DOES> ...etc... 22:26:29 --- join: Sonarman (~matt@adsl-66-124-255-90.dsl.snfc21.pacbell.net) joined #forth 22:26:44 Right. And CREATE's code field contains a DOVAR basically. 22:26:44 Another approach, and this is used a lot to implement text macros in Forth, si to do this: S" : foo blah blah ;" EVALUATE from within a definition. :) 22:26:59 only instead of a static string, the actual contents of the string is usually computed from some other set of inputs. 22:27:46 Heh. I've still never really understood where I'd use that. 22:28:03 It's one of those situations where it's rare, but when you need it, you REALLY need it. :0 22:28:04 :) 22:28:07 wow. it's amazing how up-to-date clog's logs are. i was going to take a log of this channel but the client crashed so i immediately went to tunes.org/~nef and lo-and-behold, the log there goes past when i quit! 22:28:25 In the 8 or so years i've been hacking Forth, I've used that trick precisely twice. :D 22:28:37 :) 22:28:38 Hehe. OK, so I won't worry about it too much at the moment. ;) 22:28:45 Sonarman: Yeah, that's a GOOD logging bot. 22:28:53 madgarden: :) 22:29:00 Well, I gotta jet. I ahve to work tomorrow. 22:29:02 *blech* 22:29:09 :-/ 22:29:17 Well, nighty night! 22:29:25 --- quit: kc5tja ("THX QSO ES 73 DE KC5TJA/6 CL ES QRT AR SK") 22:29:43 :) 22:30:42 --- quit: Sonarman (Client Quit) 22:31:47 OK so really, it's the difference between a word with ENTER in its code field and one with DOVAR that defines how the word's body is to be used. 22:58:37 --- quit: Herkamire ("I'm beat. See you all tomorrow") 23:14:02 --- join: I440r_ (~mark4@12-58.lctv-a5.cablelynx.com) joined #forth 23:21:02 Can someone explain this? 23:21:22 : bar 1 2 3 swap drop dup ; ok 23:21:22 ' bar 32 cells dump 23:21:22 A054B70: 72 13 40 00 00 00 00 00 - 18 4B 05 0A 68 10 41 00 .@......K..h.A. 23:21:22 A054B80: 02 00 00 00 68 10 41 00 - 03 00 00 00 60 12 41 00 ...h.A.....`.A. 23:21:22 A054B90: 5C 12 41 00 64 12 41 00 - 38 12 41 00 00 00 00 00 \.A.d.A.8.A..... 23:21:46 Where's the first literal (1)? 23:29:12 --- part: madgarden left #forth 23:30:15 --- quit: skylan (Read error: 54 (Connection reset by peer)) 23:44:12 which forth 23:54:57 --- join: skylan (sjh@vickesh01-4827.tbaytel.net) joined #forth 23:57:42 --- quit: warp0x00 ("#") 23:59:59 --- log: ended forth/03.11.21