00:00:00 --- log: started forth/01.06.20 01:24:57 --- join: dired (aaronl@vitelus.com) joined #forth 01:25:01 --- quit: Trey (Ping timeout for Trey[ns.TreySoft.com]) 01:25:01 --- quit: dired1 (Ping timeout for dired1[vitelus.com]) 01:40:33 --- join: aaronl_ (aaronl@vitelus.com) joined #forth 01:43:14 --- quit: aaronl (farmer.openprojects.net forward.openprojects.net) 04:08:15 --- part: I440r left #forth 04:08:19 --- join: I440r (mark4@purplecoder.com) joined #forth 05:47:15 --- join: leo037 (leo037@212.83.188.84) joined #forth 05:47:21 salut ! 05:47:46 quel interpréteur me conseillez vous sous linux ? 05:48:00 j'ai bigforth, et on m'a dit qu'il était pas standard..... 05:48:36 leo037, my french is poor but i think my answer to your question is "gforth". 05:48:55 gforth is gnu forth, i believe it does all of ANS forth. 05:49:30 http://www.complang.tuwien.ac.at/forth/gforth/ 05:52:16 :) 05:52:25 wow... lotsa ppl :) 05:52:33 hi leo 05:52:51 ur second name wouldnt be brodie now would it ?? :) 06:00:30 excuse me 06:01:30 is bigforth good ? 06:01:37 is it standard ? 06:02:12 hmmm... 06:02:18 i never used it 06:02:44 leo brodie wrote "starting forth" 06:03:04 hmm i think its ans 06:03:08 i dont like ans 06:03:18 ans sux 06:03:21 nuff sed 06:03:46 :) 06:04:38 so noone can give a piece of advice on bigforth 06:04:48 when i do: 06:04:50 sorry... 06:05:21 " a" .s 716906518 ok 06:05:27 is it normal ? 06:05:37 ? 06:05:42 oh 06:05:53 " a" compiled a string 06:06:04 compiled ? 06:06:06 the number is the address of the string 06:06:09 yes 06:06:18 how can i put a string on the stack ? 06:06:30 well 06:06:42 you want each character of the string on the stack ? 06:06:49 you would have to do... 06:06:49 in the beginning, it was to make a "hello world" program 06:06:51 ascii x 06:06:53 ascii y 06:06:56 ascii z 06:07:01 puts x y and z on teh stack 06:07:06 ascii h 06:07:07 ascii e 06:07:11 ascii l 06:07:13 ascii l 06:07:22 32 ( a space) 06:07:24 etc etc 06:07:31 but thats not very efficient 06:07:34 ascii a .s 97 ok 06:07:48 97 decimal, 61 hex 06:08:08 ok, how can i get a from 97 ? 06:08:10 instead of putting the while string on the stack you could compile the string 06:08:29 : test ." hello world" ; 06:08:31 test 06:08:35 hello world 06:08:42 actually it would be 06:08:49 test [enter] hello world 06:08:52 heh 06:09:05 the letter 'a' is just a character 06:09:08 like any other 06:09:15 there are 256 possible characters 06:09:19 ok 06:09:30 the ascii code for an a is 97 in decimal 06:09:34 and 61 in hex 06:09:39 'A' is hex 41 06:09:45 'a' is hex 61 06:09:56 hex 06:10:01 61 . 61 06:10:06 61 emit a 06:10:14 . shows the number 06:10:21 emit shows the character 06:11:36 yes ! 06:11:40 it works ! 06:11:43 :) 06:11:44 thanx a lot ! 06:11:47 :) 06:11:55 when you did " a" you compiled a string 06:12:05 and so ? 06:12:05 a string of one character but still a string 06:12:17 the nubmer you got was the address that forth compiled the string to 06:12:23 what happens when i compile a string ? 06:12:37 a is put in memory ? 06:12:40 yes 06:12:42 "a" is put in memory ? 06:12:46 yes 06:12:56 " test" count type 06:12:58 try doing that 06:13:13 imnot sure if that is right, if it doesnt work do it again but dont use count 06:13:17 im sure thats correct tho 06:13:18 so how can i get the content of a memory ? 06:13:29 @ <-- pronounced fetch 06:13:36 " test" ok 06:13:36 .s 716906519 ok 06:13:46 say count type 06:13:47 how can i get "test" now ? 06:13:54 say count type 06:14:02 " test" 06:14:05 count type 06:14:13 it should write 06:14:14 test 06:14:17 ok ! 06:14:26 try this instead 06:14:29 what do "count" ? 06:14:30 create test 06:14:33 " test" 06:14:41 & what do "type" ? 06:14:42 test count type 06:14:48 ? 06:15:04 type writes a string from the address specified 06:15:14 erm do this 06:15:14 it's 2 word, so i want to know what they do individually 06:15:29 im getting to that :) 06:15:42 you have to understand how strings are compiled in forth 06:15:42 ok for type 06:15:46 when you do... 06:15:49 " test " 06:15:59 forth compiles it like this.... 06:16:12 4 t e s t 06:16:19 the first character of the string is the number 4 06:16:26 the number of characters in teh string 06:16:31 ok 06:16:34 then comes the t character 06:16:36 e character 06:16:38 etc etc 06:16:50 it's clear 06:16:50 this is called a counted string 06:17:11 ok 06:17:23 lets say you have a counted string at an address 1234 06:17:28 if you say 06:17:32 1234 count type 06:17:51 it prints the string ! 06:17:54 well 06:17:59 the word count doesnt 06:18:02 type does but 06:18:12 type doesnt want a counted string 06:18:27 it wants a count byte on the stack and the address of the string on the stack 06:18:28 so 06:18:38 count takes the counted string and fetches the count 06:18:52 and returns the count and the address plus 1 06:19:58 ok 06:20:44 :) 06:20:49 where are you from ? 06:20:59 france, annecy, 06:21:03 cool :) 06:21:05 im in usa... 06:21:07 how old ? 06:21:11 20 06:21:21 n you ? 06:21:21 im 37 :) 06:21:28 I440r, could you perhaps point me in the right direction? 06:21:29 :^) 06:21:35 you know i'm a forth beginner. 06:21:39 this way --> 06:21:49 thanks ;) 06:21:53 see if your library has a book called "starting forth" 06:21:54 hehe 06:21:55 mouhahahahahaha !!! 06:22:03 thats the best damned beginners book evber 06:22:08 yes, i'm trying to get my paws on that. 06:22:08 also try get "thinking forth" 06:22:14 both are by leo brodie 06:22:17 * klooie nods. 06:22:19 and both are out of print :( 06:22:23 * klooie nods again, sadly. 06:22:27 --- quit: leo037 (thanx for all, see you ) 06:22:58 i was wondering if you might know some documentation or code that would elucidate dictionary and heap space for me. 06:23:11 dictionary 06:23:19 the gforth info tells me what the relevant words do, but not when or how to use which. 06:23:29 i dont use gforth... 06:23:37 i wont use any linux forth that currently exists 06:23:43 thats why im writing isforth 06:23:56 any forth written in c is a pile of shit imho 06:24:10 so i read on the isforth web page. :) 06:24:24 if the forth compiler cant take its own sources and compile itself its not a real forth :P 06:24:30 isforth is sort of on hold tho, 06:24:31 dictionary versus heap space aren't gforth concepts though are they? 06:24:40 hmm 06:24:46 i dont know about heap space 06:25:04 the dictionary in a normal forth isnt too difficult to understand tho 06:25:09 do you code asm ? 06:25:10 c ? 06:25:13 * klooie nods. 06:25:13 both. 06:25:16 ok 06:25:16 well 06:25:19 i was reminded of alloca(). 06:25:35 alloca() is cool in c... 06:25:40 :) 06:25:41 cool and deprecated. :) 06:25:47 every word has 2 parts 06:25:48 a header 06:25:51 and code 06:25:51 * klooie likes it, and strdup() too. 06:25:53 * klooie is sinful. 06:26:05 i dont like c generally :) 06:26:12 each header has certain info in it 06:26:22 1 a pointer to the previous header in teh dictionary 06:26:35 2 the name of the word this header belongs to 06:26:44 3 a pointer to the code associated with this word 06:27:15 thats basically what teh dictionary is... 06:27:19 BUT 06:27:20 aye. 06:27:32 that's readily understood. 06:27:40 when forth talks about dictionary space it doesnt just mean headers 06:27:48 it means header space AND code space 06:27:52 right, i'm reading about "here", "allot" etc. 06:27:53 they are usually the same 06:27:55 interleaved 06:28:00 header1 06:28:02 code1 06:28:04 header2 06:28:06 code2 06:28:08 etc etc 06:28:28 here is the address that the next byte gets allocated to 06:28:43 here is not avariable tho, its a word that fetches dp 06:28:54 : here dp @ ; 06:29:03 okay. 06:29:09 except its usually done in assember because dp is usually headerless 06:29:20 i.e. YOU dont usually have access to it heh 06:29:33 i played with "allot" "," "align" and some others yesterday. 06:29:52 , and c, ar good 06:29:55 the gforth documentation tells me what the words do. 06:30:13 perhaps i just need to see some code to illustrate their umm, idiomatic uses. 06:30:18 : , ( n1 --- ) here ! 2 allot ; 06:30:32 : c, ( c1 --- ) here c! 1 allot ; 06:30:39 ok 06:30:54 lets do a program to do a 2 * table 06:30:54 2 being "cell"? 06:31:02 without using 2* 06:31:14 argh i hate the word cell 06:31:26 create table 06:31:27 heh. 06:31:35 please don't hold it against me, i don't know enough forth to have opinions. 06:31:44 0 , 2 , 4 , 6 , 8 , 10 06:32:05 oopts 06:32:13 change those to c, 06:32:15 hehe 06:32:19 "create table" reserved space and makes table a word that returns the address right? 06:32:26 s/reserved/reserves/ 06:32:34 the word create makes a new header 06:32:49 it CREATES a dictionary entry 06:32:52 right. 06:32:57 if i say.... 06:33:03 create foo 06:33:12 i can now say "foo" 06:33:22 and it will return an address 06:33:49 and it updates here to point to the start of the new block, so you "," to put stuff there. 06:33:53 the address being the address of "here" 06:33:59 yes 06:34:06 u used variable ? 06:34:13 variable x 06:34:14 there's no need to specify the size you want the block to be? 06:34:15 x @ 06:34:17 5 x ! 06:34:26 yes. 06:34:30 there is and there isnt 06:34:31 ok 06:34:40 i can say... 06:34:46 variable x 06:34:47 or 06:34:47 "do not go to the elves for counsel .." :) 06:34:52 i can say 06:35:01 create x 2 allot 06:35:21 oh, and "," does the allot. 06:35:34 one character or cell (sorry) at a time. 06:35:36 when i execyte x it returns the address allocated to the variable 06:35:37 yes 06:35:46 c, and , allot :) 06:36:20 create table 20 allot 06:36:25 then if you create again, it ends (limits) the block you were extending? 06:36:26 reserves 20 bytes 06:36:39 yes 06:37:09 you cant add to the size of a table if you define any new words after it 06:37:14 but you can.... 06:37:21 how does forth tell you you've run out of memory? 06:37:30 create table 10 allot 20 allot 30 allot 06:37:38 * klooie nods. 06:37:41 some do :P 06:37:46 most do 06:37:50 heh, okay, i'll worry about that later. 06:38:00 good plan :) 06:38:03 how do you free()? 06:38:12 -n allot? 06:38:20 its not important unless ur gona code big progs :) 06:38:24 no 06:38:29 ok watch 06:38:40 : word1 ........ ; 06:38:46 : word2 ........ ; 06:39:05 replace ........ with whatever 06:39:12 * klooie nods. 06:39:20 create table ......... allot 06:39:25 : foo ..... ; 06:39:30 forget word1 06:39:58 the dictionary gets but back to where it was before word1 was defined 06:40:09 gforth doesn't know "forget". 06:40:12 *pout* 06:40:15 word1 and everything after it is forgotten 06:40:21 ugh 06:40:44 already gforth sucks :) 06:41:04 do u have a dos or doze machine ? 06:41:10 or just linux 06:41:12 "You can deallocate memory by using `allot' with a negative argument". 06:41:18 no 06:41:22 openbsd actually. :) 06:41:29 ugh! 06:41:31 ]hehe 06:41:43 do u have dos/doze ? 06:41:52 or just fbsd ? 06:41:53 not installed. 06:41:57 ok 06:41:59 hmmm 06:42:01 not fbsd, openbsd. 06:42:11 well i would have said get fpc 06:42:16 same diff :P 06:42:42 having to free with negative allot is more work. 06:43:11 i guess you can stick addresses in variables and do arithmetic. 06:43:13 .. or something. 06:43:52 doesn't the stack nature of the dictionary make memory management complex? 06:44:01 erm i dont thnink -n allot will work 06:44:08 no 06:44:10 it does with gforth. :) 06:44:11 easy :) 06:44:17 it specifically tells me to do that. 06:44:17 duh 06:44:25 d u m b 06:44:32 well 06:44:45 you cant fragment memory :) 06:44:58 yes, that's a plus. 06:45:17 the gforth wasy is dangerous 06:45:29 : test ................... ; -6 allot 06:45:30 i could redefine create to keep information so that i can define my own free.. 06:45:36 you just freed up part of the word test 06:45:53 perhaps not even necessary to mess with create if you can walk the dictionary from forth. 06:46:00 : forget ' dp ! ; 06:46:01 or something 06:46:21 but thats not a complete definition 06:46:27 maybe ... 06:46:32 what does ' do? 06:46:36 : forget ' dup off dp ! ; 06:46:40 if i say... 06:46:42 variable x 06:46:47 ' x >body @ 06:46:55 gets teh contents of the variable 06:47:03 ' returns the address of the next word 06:47:09 10 constant ten 06:47:15 ' ten 5 ! 06:47:18 erm 06:47:24 ' ten >body 5 ! 06:47:25 ten . 06:47:26 5 06:47:29 that's different in gforth too. 06:47:35 ' wants to consume something off the stack. 06:47:39 i modified the body of a constant 06:47:45 thus changing its value hehe 06:47:58 ugh 06:48:03 gforth is crippled 06:48:07 and fscked up 06:48:14 is there a better one for unix-alikes? 06:48:19 ' is pronounced tick 06:48:25 not yet hehe 06:48:30 check. :) 06:48:36 i relay need to finish isforth 06:49:01 does openbsd have dosemu ? 06:49:03 your illustration of the dictionary was enlightening. 06:49:16 no, that's linux. 06:49:19 not all forths are exactly like that tho 06:49:22 plex86 will run on openbsd eventually. 06:49:43 that's no problem, i get along with 10 different unix-alikes too. 06:49:52 in my experience it's best to learn one well, then contrast with others. 06:50:02 i tried freebsd 06:50:07 had it installed for all of 2 hours 06:50:10 then got rid 06:50:13 i didnt like it 06:50:19 you don't like unix? 06:50:22 i like to be able to manually edit files 06:50:27 i use linux 06:50:36 joe /etc/fstab 06:50:36 you manually edit files with freebsd too. 06:50:37 or 06:50:43 joe /etc/passwd 06:50:50 flat configuration files are an essential part of unix philosophy. 06:51:03 if you edit passwd and change from teh default fscked up csh to the SANER bash 06:51:06 and so is vi. :) 06:51:06 you dont change shell 06:51:21 you have to run chsh 06:51:24 no you don't. 06:51:31 you can edit and run pwd_mkdb, which chsh does for you. 06:51:47 because fbsd talkes these files and compils them into a NON FLAT data base file 06:51:53 which i say is fscked up 06:52:04 just editing /etc/passwd should be enough 06:52:05 this incidentally is what vipw(8) is for, which you should use on linux also because it provides locking. 06:52:15 i shouldnt have to RUN something to convert this flat file for the system 06:52:44 surely you see the algorithmical side of this when you have thousands of users. 06:53:01 i have about 30 here 06:53:11 * klooie nods. 06:53:21 i'm just saying they made a sane choice. 06:53:30 most of them kiddies running bots on undernet hehe 06:53:36 please, never try AIX. 06:53:39 i understood why 06:53:41 i just dont like it :) 06:53:48 im a purist hehe 06:54:09 they stuck all configuration in an object database, keeping generated versions of the flat text files around for compatibility. 06:54:13 im stuck on debian linux im afrade :P 06:54:24 ugh 06:54:31 bsd is more pure than linux though. 06:54:48 the only thing i dont like about linux is teh syscall syntax 06:54:54 there are very many linuxisms. 06:55:00 putting teh parameters in registers instead of on teh stack is fucked up 06:55:15 it limits the number of parameters... 06:55:20 and it's speedy. 06:55:26 but i am in favor of cleanliness too. 06:55:42 bsd puts them on the stack.. 06:55:48 doing a syscal is already slow 06:55:56 yep. 06:56:02 who cares about teh extra 100th of a micro second needed to fetch teh parameters 06:56:22 isforth uses syscalls for everything.. 06:56:31 it wont link any std libraries... 06:56:36 oh, i remember the cheer when someone found there was a superfluous "cli" instruction in the context switch, a one cycle optimization. :) 06:56:41 it wont link ANYTHING in fact :) 06:56:49 hehehehe 06:57:24 i like doing optimizations at the instruction level... 06:57:37 but its not realy that helpful//// 06:57:55 optimize your instructions get a 1% improvement 06:57:59 yep, instruction sets and architecture are too complex for it these days. 06:58:20 optimize your algorithms get a 99% improvement 06:58:21 on PCs, i mean. 06:58:42 who cares about agi realy :P 06:58:50 i have to get going. 06:58:54 ok :) 06:59:05 im hona go back zzz neway :) 06:59:05 thank you for your explanation. 06:59:11 any time 06:59:11 and see you later. :) 06:59:14 :) 07:13:12 --- join: grurp (grurp@pc19954.batc.tec.ut.us) joined #forth 07:44:35 --- quit: I440r (Read error to I440r[purplecoder.com]: Connection reset by peer) 08:51:27 --- quit: grurp (Bye all) 09:14:58 --- join: Trey (Baxter@ns.TreySoft.com) joined #forth 09:17:32 --- join: edrx (edrx@copacabana-ttyS25.inx.com.br) joined #forth 09:18:33 --- join: nopcode (yap@p3EE02ADC.dip.t-dialin.net) joined #forth 09:18:35 hey :) 09:18:50 how can i dynamically build c to forth callgates in forth/ficl ? 09:19:15 that is, i want to make a forth function availiable for calling with c / native code 09:19:38 In ficl, just pass it a string to evaluate. 09:20:24 well ok, keep a forth wordtable in c 09:20:33 ? 09:20:34 but still i need to build c functions so they can be called from outside 09:21:04 You want to call C functions from ficl? 09:21:08 no 09:21:14 * Trey doesn't get it. 09:21:17 i want c code to be able to call ficl functions 09:21:33 i'll tell you the whole story - do you know x86 asm ? 09:21:45 Only enough to get in trouble. 09:21:54 k :) 09:22:00 well imagine you have a CALL 09:22:08 as in CALL 0x12345678 09:22:11 Right. 09:22:20 i want to patch it, from forth code, to be redirected to another forth function 09:22:44 Hmmm. 09:23:04 That depends quite a bit on the ABI of the Forth and C in question. 09:23:21 well the C abi is standard 09:23:36 Not. 09:23:41 pretty much standard 09:23:46 otherwise my whole system wouldnt work 09:23:52 Warmer. 09:24:02 Linux? 09:24:14 win32 09:24:17 Ah. 09:24:41 Does the forth you want to use generate native code? 09:24:47 nah 09:24:53 Hmmm. 09:25:00 well i could make "call gates" 09:25:03 " 09:25:05 PUSH n 09:25:10 CALL dispatcher 09:25:11 " 09:25:20 every gate gets a higher n 09:25:24 Yeah. 09:25:31 and the dispatcher could look up the "n" in a word table 09:26:01 and call the right forth word 09:26:29 You need some way to get parameters to and from the Forth VM. 09:26:45 yeah 09:26:48 and not only that 09:26:55 the forth VM needs to know the original function as well 09:26:58 to call it 09:27:17 so i can pre-chain, post-chain and anything inbetween 09:27:28 but that could be stored in a forth variable when patching the call 09:28:11 so the dispatcher would call the forth word with just the c-parameters of that function on the stack... 09:28:15 I take it you don't want to code all of the relevant C functions as Forth primatives? 09:28:29 no, not the ones for generic hooking 09:28:31 can all be c 09:28:50 i just dont want to be specific on the c side for the actual function i want to hook 09:29:28 You can always pass a pointer to the desired C function around, then go through a generic Forth->C thunk. 09:29:49 (as long as all of the C functions for that thunk take the same parameters. 09:29:53 ) 09:30:22 hm ok 09:31:14 I seem to recall ficl (or perhaps gforth) having such generic thunks for C functions taking CELL-width parameters. 09:36:50 I didn't find it in ficl 2.0.4. 09:52:50 --- quit: nopcode (Leaving) 11:36:19 --- join: grurp (grurp@pc19954.batc.tec.ut.us) joined #forth 11:42:57 --- join: Carbonyl (root@du-225-89.nat.dialup.freesurf.fr) joined #forth 11:49:18 --- quit: grurp (Bye all) 11:55:31 --- join: Fare (fare@ppp96-net1-idf2-bas1.isdnet.net) joined #forth 11:57:14 anyone knows of a standalone forth (colorforth if possible) bootable by grub? 11:57:41 I suppose retro could do it 11:58:00 you mean... with a little work? 11:59:13 have to go, sorry 11:59:15 bye 11:59:28 --- part: edrx left #forth 12:19:24 --- quit: Fare (Connection reset by pear) 12:19:36 --- join: Fare (fare@ppp96-net1-idf2-bas1.isdnet.net) joined #forth 12:37:38 --- quit: Carbonyl ([x]chat) 15:56:06 * Trey is away: life, etc. [17:55] 17:35:42 --- join: aaronl__ (aaronl@vitelus.com) joined #forth 17:36:13 --- quit: klooie (Ping timeout for klooie[213-84-79-23.adsl.xs4all.nl]) 17:37:05 --- quit: dired (Ping timeout for dired[vitelus.com]) 17:37:05 --- quit: Trey (Ping timeout for Trey[ns.TreySoft.com]) 17:37:05 --- quit: aaronl_ (Ping timeout for aaronl_[vitelus.com]) 17:37:34 --- join: dired (aaronl@vitelus.com) joined #forth 17:38:52 --- join: klooie (kloo@213-84-79-23.adsl.xs4all.nl) joined #forth 17:39:07 --- nick: aaronl__ -> aaronl 17:50:11 --- quit: Fare (Connection reset by pear) 18:24:09 --- join: edrx (edrx@200.240.18.60) joined #forth 18:32:39 --- quit: edrx ([x]chat) 19:26:28 * aaronl is away: I'm busy 20:21:13 --- quit: klooie (Ping timeout for klooie[213-84-79-23.adsl.xs4all.nl]) 20:22:48 --- join: klooie (kloo@213-84-79-23.adsl.xs4all.nl) joined #forth 21:27:18 * aaronl is back (gone 02:00:50) 22:01:02 --- join: Trey (Baxter@ns.TreySoft.com) joined #forth 22:42:22 * Trey is away: sleeping. [0:42] 23:59:59 --- log: ended forth/01.06.20