00:00:00 --- log: started forth/04.06.07 00:29:03 yeah 00:29:04 in halo too 00:37:13 --- quit: arke (Read error: 104 (Connection reset by peer)) 00:37:31 --- join: arke (~Chris@wbar8.lax1-4-11-100-108.dsl-verizon.net) joined #forth 00:38:07 --- part: arke left #forth 00:38:31 --- join: arke (~Chris@wbar8.lax1-4-11-100-108.dsl-verizon.net) joined #forth 00:38:56 --- topic: set to ':NOTICE: Kestrel project update! See http://www.falvotech.com/weblog for more details.' by arke 01:29:50 --- join: cedricshock (~cedricsho@209-181-58-5.eugn.qwest.net) joined #forth 01:36:50 hrm. 01:36:57 does gforth provide any curses stuffs? 01:37:23 Hm, rtfm. :) I have no idea 01:38:08 ^_^ 01:40:08 guess i could use isforth 01:40:20 but that would mean firing up vmware again 01:40:22 and i don't wanna 01:41:24 Or, worse, install a real system! 01:41:42 i have a real system 01:41:50 networking doesn't work right now on it though 01:42:03 Oh, why? 01:42:04 (VMWare is actually booting my SuSE partition :)) 01:48:13 Just a question. 01:48:30 arke. Why not hack curses into gforth yourself? 01:49:20 Robert: my current means of accessing the net doens't work on linux (WUSB11) 01:49:26 ASau: because I don't want to :) 01:49:36 ASau: and also, I need TCP/IP 01:49:46 AFAIK, Gforth provides libc/solibc API. 01:50:05 arke, take a look at http server written in Gforth. 01:50:15 There exists one. 01:50:32 Maybe even not single one. 01:51:07 ok, cool 01:51:11 any idea what its called? 01:52:40 cool, there was one written in bigFORTH as well 02:01:41 --- join: qFox (C00K13S@cp12172-a.roose1.nb.home.nl) joined #forth 02:02:35 Hi fox 02:04:01 arke. Look at Paysan's pages. 02:04:07 IIRC, he wrote it. 02:04:21 yeah, I am. 02:04:23 In german too :) 02:05:50 mornin 02:08:20 --- join: crc (crc@0-1pool176-8.nas6.philadelphia1.pa.us.da.qwest.net) joined #forth 02:09:50 --- join: doublec (~doublec@coretech.co.nz) joined #forth 02:11:03 * arke is away: sleep --- night! 02:27:48 --- quit: Herkamire ("goodnight") 02:40:56 is it possible to rotate a byte? 02:41:31 i mean, shift it so that the bits shifted off on the left, shift back in on the right (or the other way around) 02:41:44 but then not for a 32bit number, but for 8bit 02:49:25 : ROL DUP 2* SWAP [ HEX ] 80 AND 0<> OR ; 02:49:39 : ROL DUP 2* SWAP [ HEX ] 80 AND 0<> OR 0FF AND ; 02:49:54 --- quit: ASau () 02:55:18 --- quit: crc (Nick collision from services.) 02:55:39 --- join: crc (crc@0-1pool176-8.nas6.philadelphia1.pa.us.da.qwest.net) joined #forth 03:41:18 --- quit: doublec ("Leaving") 03:42:11 arke: You could almost certainly call curses from gforth using fflib.fs. See http://www.shockfamily.net/cedric/fflib.html 04:22:03 --- quit: cedricshock ("Leaving") 04:26:12 --- quit: crc ("Hacking...") 06:06:13 --- join: imaginator (~George@georgeps.dsl.xmission.com) joined #forth 07:12:11 * arke is away: schoool!!! aaaarghrgurgkubjkjbtklk43126@#G>:%@L:K$LKrelkngK3GG:%KI@:%VLREN 07:16:16 man 07:16:20 i feel arke there 07:18:31 --- quit: I440r_ (Read error: 60 (Operation timed out)) 08:03:23 --- quit: Serg () 08:08:34 --- join: tathi (~josh@pcp02123722pcs.milfrd01.pa.comcast.net) joined #forth 08:59:56 --- quit: tathi ("leaving") 09:08:53 --- quit: imaginator ("rest") 09:15:36 --- join: Topaz (~top@exten-halls-131.soton.ac.uk) joined #forth 09:21:00 --- join: Serg[GPRS] (~z@193.201.231.126) joined #forth 09:21:38 re from home 09:23:49 just installed Mirc but still hope to code something oldsch00l-intro-sized ;) 09:26:09 i want city nets to be wireless 09:26:36 to roam from one rented room/provider zone to another, w/o expence related to cabling 09:27:09 and cheaper than cellphone ,) 09:35:50 whee 09:36:50 yeah ! 09:37:21 or i want cheaper data-only cell stations for local providers ;)) 09:37:43 plug 2 tails, add users and have fun 09:39:55 --- join: ASau (~asau@158.250.48.204) joined #forth 09:40:04 Dobryjj vecher! 09:40:16 re 09:42:13 mobile provider raised price up to 1.2$ per megabyte ;(( 09:42:38 * Serg[GPRS] looks at counter 09:54:33 what was it before? 09:55:09 i'm uncertain, but kinda like _10_times less 09:55:52 hmm 10:07:40 I would just wait until I found a cheaper method =) 10:08:44 i spent 35k this session ;) 10:09:03 Kbytes, not K$ ;)))) 10:10:43 at Saturday i gone to free state lawer ,) 10:11:02 helped them a little w/ faulty Win98 10:12:03 traded a CD of two magz/few years for a recovery stuff 10:12:29 nice guys ,) crackers 10:23:35 1,3359375 RUbles spent ;) 10:35:14 so. lets compare. what filetype explanation would i prefer to read. http://astronomy.swin.edu.au/~pbourke/dataformats/bmp/ oooooorr... http://www.w3.org/TR/1996/REC-png-19961001.html 10:39:07 flip a coin 10:40:23 sup forthers 10:43:32 --- quit: Serg[GPRS] ("maybe BRB in half/hour") 10:50:09 heh, use libpng if you want to open png files 10:56:10 --- join: cedricshock (~cedricsho@209-181-58-5.eugn.qwest.net) joined #forth 10:59:12 --- quit: ianp ("Hey! Where'd my controlling terminal go?") 11:04:06 is there a word that converts a little endian number to big endian? 11:06:10 : flip split swap join ; 11:06:11 hehe 11:07:04 split? 11:07:16 it was in fpc, its in isforth :P 11:07:23 oh 11:07:41 well appearantly the size field can be skipped so i wont have to bother :p 11:08:41 i do have a question though 11:09:06 if i create a variable of 2 bytes (in a 32bit implementation, where one cell = 4bytes) 11:09:18 and i store something to this variable, 15 data ! 11:09:25 does it store 2 bytes or 4 bytes? 11:09:29 yes 11:09:38 because it seems, that when fetching from it, it fetches the 2 bytes, instead of the 4 bytes 11:09:46 create foo 2 allot 11:09:54 theres a 2 byte variable 11:10:08 but you need to have a 16 bit fetch word (usually w@) 11:10:08 aye but when you do: 0 foo ! 11:10:10 foo w@ 11:10:17 nope - that will NOT work 11:10:20 it would be w! 11:10:21 hmmm is that implementation dependent then? 11:10:24 yes 11:10:28 ah pity 11:10:29 okay 11:10:39 then i'll go by it the hard way, just to make certain :p 11:10:48 i noticed win32forth does this 11:11:39 neither fetch or store are size smart, they only know address and data, they dont know that the variable was cretaed as 16 bits 11:11:41 or perhaps just for 1 byte vars... 11:11:52 1 byte vars would be c@ and c! 11:11:57 yeah but... hold on 11:12:18 hm 11:12:34 ignore this part. i dont know what...how...who :\ 11:12:52 lalalalala nice weather aint it? 11:12:53 :) 11:37:16 needs more isforth 11:38:06 can isforth do asynchronous I/O? 11:42:59 --- join: networm (~networm@L0664P22.dipool.highway.telekom.at) joined #forth 11:51:13 --- join: Sonarman (~matt@adsl-64-169-93-183.dsl.snfc21.pacbell.net) joined #forth 12:39:51 hmmm 12:39:59 dunno :) 13:01:41 --- join: Herkamire (stjohns@h000094d30ba2.ne.client2.attbi.com) joined #forth 13:01:53 --- join: wossname (wossname@Toronto-HSE-ppp3698988.sympatico.ca) joined #forth 13:14:16 --- part: gl left #forth 13:17:08 ok. i'm working on some code to create an image. now i need to create a buffer before actually writing the image. this buffer of course varies according to dimensions of the image. 13:17:33 am i forced to create a static buffer for this purpose? 13:17:53 or can i specify dimensions and create a buffer when the word is invoked? 13:21:08 yup 13:21:13 :| 13:21:17 just create the buffer when you need it 13:21:21 oh 13:21:23 how? 13:21:45 well just make a word that takes in the size and creates a variable 13:21:52 treat hte variable as the buffer 13:22:01 but how will i name it? 13:22:06 i mean, give it a name 13:22:12 name what? 13:22:16 the picture or the buffer? 13:22:26 the buffer 13:22:33 : createbuffer variable buffer ; 13:22:49 cant you name the variable to be "buffer" ? 13:22:54 or do you need to have more than one buffer? 13:23:00 wont that merely create a buffer of 4 bytes? 13:23:06 (or 1 cell, anyhow) 13:23:25 just a sec 13:23:54 and one buffer is enough 13:26:34 you can use ALLOCATE and FREE and RESIZE like malloc() and free() and realloc() 13:26:43 inside a word? 13:27:00 hmmm and i'd have to save the location manually? 13:27:00 yup 13:27:20 ALLOCATE'll return the address of the buffer 13:27:31 so allocate and not alloc? 13:27:52 in ANS it's called ALLOCATE 13:27:55 VARIABLE BUFFER ALLOT 13:28:03 use ALLOT 13:28:05 is there a common name for ROT ROT? 13:28:06 ALLOCATE is for weenies 13:28:07 oh sorry i did mean, allot not allocate. 13:28:07 :P 13:28:11 futhin: stfu :) 13:28:21 Sonarman: heh :P 13:28:32 i.e., rotate into the other dir 13:28:39 networm: -ROT 13:28:49 he doesn't know the buffer size at edit-time, so he can't use aLLOT 13:28:50 ah, thanks 13:29:03 Sonarman: which one is prefered by chuck moore ALLOT or ALLOCATE? :P 13:29:08 * qFox chuckles... 13:29:08 he can get the buffer size 13:29:21 he doesn't need the buffer size at edit time 13:29:27 oh, RIGHT 13:29:28 heh 13:29:43 : CREATEBUFFER VARIABLE BUFFER ALLOT ; (pass size of buffer to it) 13:30:02 okokok, say i have this word; : createbuf ( width height -- ) * (allot?) ; or what 13:30:20 and variable wont allocate 4 bytes to it? 13:30:22 qfox: the word i just typed is valid code 13:30:30 ok 13:30:44 you pass the number of bytes you need 13:30:48 to CREATEBUFFEr 13:30:49 variable will just be the name you use for the buffer 13:30:52 and how will i use this buffer in a word before i create it? 13:31:09 because its xt needs to be known at compile time 13:31:11 you also need a word to store all the info to the buffer 13:31:14 futhin: I think you mean CREATE not VARIABLE 13:31:18 using a do loop or something 13:31:25 but if i create a new buffer at runtime, there will be a new xt, wont there? 13:31:56 Herkamire: sure CREATE can be used.. (i'm a bit rusty) 13:32:13 : variable create 0 , ; 13:32:22 VARIABLE buffer 13:32:24 --- quit: networm ("Client exiting") 13:32:25 : init-buffer ( w h -- ) HERE buffer ! * ALLOT ; 13:32:35 qFox: the buffer will be created when the CREATBUFFER is run. the name "buffer" will give the xt 13:32:37 --- join: lalalim_ (~lalalim@p508AA79D.dip.t-dialin.net) joined #forth 13:32:52 hmmmmm 13:32:54 <--- hella rusty w/ forth coding :P 13:33:03 i love all this confusing stuff btw :\ 13:33:08 >:D 13:33:24 hmm, but then with my init-buffer word above, there's no way to free the memory 13:33:46 unless your Forth provides a factor of FORGET that lets you specify the new end of the dictionary 13:33:57 qFox: you don't normally add new words to the dictionary at runtime 13:34:07 for now, lets pretend i dont really care about what happens to the buffer. if i need new memory, i'll close and open a new win32forth window. the vm can clean up for me 13:34:22 qFox: you'd more likely use ALLOCATE which will return an address to the memory 13:34:28 Herkamire> i understand that, but i think its obvious that it is desired in a cirumstance like this. 13:34:46 what circumstances? 13:34:52 I highly doubt it 13:34:55 well if you run the program once then you don't need to worry about freeing the memory 13:35:13 Herkamire> creating a program that creates a new image with variating dimensions... 13:35:39 just FORGET the first word of the program after you're done and that'll clear the buffer 13:36:10 s/clear/free 13:36:41 qFox: I don't see why the program would add words to the dictionary at runtime 13:36:55 its not adding words as such, its adding a variable.. 13:37:02 you'd just have three variables: buffer width height 13:37:16 actually the width and height would be a parameter, but w/e 13:37:28 parameter to what? 13:37:30 --- quit: cedricshock ("Leaving") 13:37:33 yeah, and buffer isn't THE buffer, it's a pointer to the buffer which you allocate at runtime without needing to define a word at that time 13:37:34 to the word creating the image... 13:37:39 Herkamire: it would be values passed on the stack 13:38:01 right 13:38:04 but... wouldn't you want to know the dimentions afterwards too? 13:38:21 that can be put in variables, but thats not an issue really 13:38:23 just dup them on the stack if you want them afterwards 13:38:30 width @ height @ new-image buffer ! 13:38:32 either will work 13:38:33 variables = lame :P 13:38:49 variables are not lame 13:38:59 * qFox chuckles... will try 13:39:12 proper factoring destroys the need for most variables 13:39:35 : new-image ( width height -- addr ) * pixel-depth * allocate ; 13:39:50 futhin: no it doesn't 13:40:04 chuck uses lots of variables 13:40:11 i would have to agree with Herkamire. 13:41:09 he doesn't use as much variables as a bad forth coder does 13:42:00 right 13:42:13 sometimes it's better to use the stack 13:42:34 with a forth cpu that's certainly the case 13:43:01 using the stack makes the code reentrant too 13:43:14 but there are a great many cases where a variable is the best way 13:43:16 --- join: arke_ (~Chris@wbar8.lax1-4-11-100-108.dsl-verizon.net) joined #forth 13:43:19 --- quit: arke (Read error: 104 (Connection reset by peer)) 13:43:21 often it's a choice between that and stack juggling 13:44:05 reentrant makes my ass twitch 13:44:14 heh 13:44:17 technically the stack is faster, but with most forth implementations this makes hardly no difference... 13:44:19 --- quit: lalalim (Read error: 110 (Connection timed out)) 13:44:21 j/k 13:44:24 if any at all 13:44:26 i need to make some sort of multi tasker for isforth 13:44:42 And you need to code the resolver! 13:44:44 * Robert runs away 13:44:44 : create.buffer ( width height -- ) here buffer ! * 3 * 54 + allot ; 13:44:49 qFox: what do you mean technically? 13:44:51 proper factoring of code leads to minimal stack juggling therefore less need for variables 13:45:16 futhin - not always 13:45:24 Herkamire> because in a vm, like win32forth, its all memory, so its basically not faster then a hardware stack would be on a cpu 13:45:45 sometimes you just need to totally rethink your code to get rid of variables or excessive stack juggling 13:45:54 then = opposed to what 13:46:03 futhin: right. that works great, but sometimes you need to access 6 items in a random order. 13:46:35 i440r: yup. thats implicit in even attempting to code in Forth PERIOD 13:46:44 I totally agree that you should try to factor and refactor to minimize stack juggling and variables 13:47:00 but you can't get away without either 13:47:12 its implicit in attempting to code 13:47:41 Herkamire: a bad forther will end up trying to jugglie 6 items, a good forther will limit it to 3 items without going overboard with variables 13:47:42 I would asume in most forths (hardware or otherwise) a variable would be faster than accessing the 3rd stack item 13:48:14 futhin: agreed :) 13:49:21 herk no 13:49:49 i think accessing any stack item in isforht is faster than a variable 13:50:01 I440r: why? 13:50:08 some_variable: 13:50:11 call dovariable 13:50:14 dd xyzzy 13:50:25 dovariable pops the return address off the stack 13:50:36 erm no 13:50:42 oh I see 13:50:44 lol 13:50:52 pop top of stack to eax 13:50:54 push ebx 13:51:01 mov data pointed to by ebx into ebx 13:51:21 mine just compiles a LIT 13:51:22 erm i mean data pointed to by eax eve 13:51:31 a variable compiles a lit ? 13:51:35 my const does taht 13:51:51 my compiler doesn't know the diffirence between variables and constants 13:51:58 the goal isn't strictly speed, the goal isn't strictly smallest footprint, the goal is striving for the simplest program which automatically leads us to better solutions and ultimately the program will be fast and small and bloat free and beautiful 13:52:01 neither does my 8051 forth 13:52:10 a variable is a constant address 13:52:18 futhin: here here! 13:52:26 right. 13:52:32 the goal isnt negative bloat 13:52:37 its negative obfuscation 13:52:52 bloated slow software is prefereable to the crap most people puke out 13:52:56 my compiler treats (green) numbers, hex numbers, variables, and constants exactly the same. it just calles LIT 13:53:01 as long as its readable 13:53:27 i think colorizing forth is a backwards step 13:53:30 i440r: simplest program = zero obfuscation 13:53:34 THAT obfuscates it 13:54:02 because in forth the developer of the compiler can chose ANY set of colors he wants for whatever he wants 13:54:12 dudes... obfuscation is a word that only makes things harder to understand you know... 13:54:14 :\ 13:54:17 colorforth is instant gobbldegook 13:54:32 from latin obfuscare - ob meaning intense 13:54:37 fuscare meaning darkness 13:54:42 I440r: in a few keys, you can have my forth display the sources without color 13:54:47 then just say darkness 13:54:48 :p 13:55:03 were coders, we like the word obfuscated 13:55:07 it makes us sound smart 13:55:08 qFox: but obfuscation is such a cool word 13:55:16 what he said! 13:55:25 qfox: obfuscation means something different than darkness 13:55:32 but but but 13:55:37 that's like trying to get me to say "chick peas" instead of "garbanzo beans" 13:55:38 [22:54:34] fuscare meaning darkness !!! 13:55:52 if its obfuscated its wrapped in intense darkness. its hidden. its not easilly descernable 13:56:10 or however thats spelt :P 13:56:27 desce... you did that one on purpose ;p 13:56:32 the word obfuscation is derived from doesn't necessarly mean the same thing 13:56:47 discernable 13:56:49 i believe that sentence misses a few words 13:56:50 hehe 13:57:09 doesn't necessarily mean the same thing as obfuscation 13:57:45 futhin i think the people who invented the word "obfuscated" meant exactly what we use it for 13:58:26 if i wasnt quite sure they were already dead, i'd say they ought to be shot 13:58:28 ;) 13:58:59 (oh and i am just joking about this whole thing eh..) 14:00:52 I haven't even thought about writing reentrant code 14:03:26 *gasp* 14:03:30 blasphemy :P 14:03:47 i thought well factored code was automatically reentrant for the most part 14:03:59 especially if you avoid variables and stuff 14:04:02 no it's not 14:04:18 not if you change data along the way 14:04:34 not if you use variables 14:04:37 or arrays etc 14:07:59 if i use 14:07:59 value buffer 14:07:59 : create.buffer ( width height -- ) here to buffer * 3 * 54 + allot ; 14:08:12 will i successfully free hte buffer using FREE buffer ? 14:08:40 no 14:08:48 you can't free allot 14:08:54 ok 14:09:04 use allocate for dynamic memory allocation 14:09:12 i'll just close and reopen when i get Error: cb Out of System memory! 14:09:14 :p 14:09:24 or just allot enough memory for your biggest image, and never change buffer 14:09:38 nah thats ok. this is my preferred method 14:09:51 whateve 14:09:52 r 14:09:54 :) 14:10:12 hm 14:10:18 well this sux... 14:10:45 either use dynamic memory allocation, or allot enough for your bigest requirement. 14:10:49 that goes for any programming 14:10:52 it appears i cannot create a variable of.. 375k 14:11:01 what? 14:11:07 (to create a 500x250 px img) 14:11:19 a variable is one cell 14:11:20 what forth are you using? 14:11:23 win32forth 14:11:34 Herkamire> it should allot bytes, not cells 14:11:36 Herkamire: you can ALLOT to the variable 14:11:50 futhin: yes, but that's stupid 14:11:51 qFox: just use CREATE 14:11:53 just use create 14:12:12 CREATE BUFFER 30535105150110 ALLOT 14:12:16 or something like that 14:12:32 ok, and how do i get around this 14:12:33 Error: Need a NAME to create! 14:12:36 at runtime 14:12:40 I would hope there is some way to get win32forth to give you more memory 14:12:57 (this is caused by CREATE btw) 14:12:57 qFox: give it a name 14:13:00 i am. 14:13:06 : create.buffer ( width height -- ) create buffer * 3 * 54 + allot ; 14:13:12 qFox: no you're not 14:13:26 CREATE is not an immediate 14:13:55 : create.buffer create * 3* 54 + allot ; create.buffer buffer 14:14:25 s/3\*/3 */ 14:14:27 but this still means that the buffer is created at compile time, not runtime 14:14:39 or it would mean i'd have to manually create the buffer before using the word 14:14:46 qFox: if you want to create buffers at run time _________USE ALLOCATE!!!!!!!!!!!!!!!!!!!!!!! 14:14:47 either way was what i was trying to avoid 14:14:56 ALLOCATE ALLOCATE ALLOCATE 14:14:59 THEN DONT FUCKING TELL ME TO USE ALLOT OR CREATE 14:14:59 ffs 14:15:25 I sait 3 times, either create a big buffer ahead of time with ALLOT or do it at runtime with ALLOCATE 14:16:13 I bet ALLOCATE won't give you the out of memory errors either 14:16:53 not all forths have allocate 14:16:58 whats the stack decription for allocate? ( size -- adr ) ? 14:17:04 win32forth does, i checked 14:17:10 so does isforth 14:17:12 --- quit: wossname ("oleh") 14:17:37 : create.buffer ( width height -- ) * 3 * 54 + allocate to buffer ; 14:17:39 will that do? 14:17:40 yeah, not all forths have it, but if you want dynamic memory allocation, use it 14:17:48 qFox: yes 14:17:50 ok 14:18:10 i hate that fucking word "to" 14:18:15 its fucking incomplete 14:18:18 me to 14:18:19 its a fucking STORE operation 14:18:23 !> <-- thats the fucking word 14:18:45 ans is so fucking limp wristed sometimes 14:18:59 ans the GHEY forth 14:19:04 it doesnt bother me and it will allow me to use buffer as a normale variable (eg. returning its adr) 14:19:40 ???? I don't think so 14:20:38 I never use TO, so maybe I'm wrong about how it works 14:20:51 0 value buffer 14:20:51 : create.buffer ( width height -- ) * 3 * 54 + allocate to buffer ; 14:21:02 buffer acts as a constant does 14:21:07 value is another fyucking dumbass name 14:21:09 to is the way to store data to the variable 14:21:21 well, or whatever alternative I440r thinks of ;) 14:21:30 to will work on variables, constants, values and deferred words 14:21:37 right. and BUFFER will give you it's value, not the address you can use to change it 14:21:57 so now when i use buffer, it will behave like a constant. once it has the address of the newly allocated space, it'll behave like a regular variable, as far as the user is concerned 14:22:16 your restricting your create.buffer to creating only ONE buffer 14:22:25 thats ok, i only need one 14:22:27 you shouldnt do the store operation inside it 14:22:44 my problem with VALUE/TO is that it hides the fact that there is a level of abstraction. it makes it look like it's a constant. 14:22:58 this makes your code less readable, and bugs harder to find 14:23:46 I440r: it's good factoring if (and only if) he only uses it for that one variable anyway 14:24:08 he even has "buffer" in the name. I think it's pretty clear 14:24:23 Herkamire> how do i free ALLOCATEd space? unalloc? 14:24:41 although... if he only cals creat.buffer in one place in the code, I too would take the "to buffer" out 14:24:50 FREE I think 14:25:10 I've never used it, but that's my recolection 14:26:13 hm anyone know another page with the ansi specs? http://www.taygeta.com/forth/dpansf.htm doesnt work for me atm 14:31:13 whats happening withi skip carter btw ? 14:33:22 (got one) 14:33:25 qFox: http://ficl.sf.net/ go to the links section; they have the document and a really useful alphabetical index (it's really nice) 14:35:03 tnx. added to favs 15:00:01 --- join: blockhead (default@dialin-864-tnt.nyc.bestweb.net) joined #forth 15:02:15 that fics looks rather good 15:02:29 unfortunately writing a FORTH for a device with no RAM is proving interesting ;) 15:05:34 Topaz: how are you doing the stack? 15:06:09 Topaz> no ram? are you using the hd instead? 15:06:28 well, it does have limited RAM, to be fair 15:06:33 128 bytes of it 15:06:34 ah :) 15:06:36 oh 15:06:39 heh 15:15:57 though my current design is a bit of a kludge 15:16:25 well i'm impressed if you got it to work on 128 byte ram 15:16:50 since the target is harvard, so can't run code out of RAM, and I also for some reason decided that i wanted a STC FORTH (subroutine-threaded), the FORTH runs inside a self-written emulator 15:17:00 such that you design the whole thing in the emulator 15:17:13 and then you just burn the dictionary (which is all STC) onto the chip itself 15:17:20 this is coooool :) my wiki is catching on 15:18:15 http://herkamire.com/jason/ 15:18:22 however, because i didn't feel like writing various procedures in assembly (i guess I should do, just haven't got around to it yet), i've written them in python, the same language as the emulator 15:18:45 so the emulator catches various assembly 'call's, and invokes the python ;) 15:19:10 I look at a recursive diff every time I backup, and this time I got a question in the wiki FAQ, a new person, a new forth system, and at least one new page I didn't write. 15:19:35 and it looks like about 3 people experimenting with editing 15:22:58 in 8 days :) 15:24:50 Topaz: sounds like a cool project :) 15:24:58 tis quite entertaining 15:25:15 though i'm not entirely sure about my writing the : word in 'native code' ;) 15:25:33 Topaz: you shouldn't have to 15:25:50 i know, i just like python better than assembly :P 15:25:53 use an emulator or cross compiler to make an image that doesn't have the ability to compile stuff 15:26:05 how much rom on your chip? 15:26:21 between 2 and 8k, i think 15:27:01 8bit chip? 15:28:15 yeah 15:28:57 i could potentially write colon in STC which declared DTC words in the little-available RAM actually, for the novelty of actually being able to program it in-situ 15:29:05 though that's a side issue 15:30:13 were you thinking of hooking a keyboard up to the chip and programming on it? 15:30:53 Herkamire, who has forbidden negative argument of ALLOT? 15:31:09 ASau: oh, I forgot all about that 15:31:29 but I still don't see any point in doing it that way. 15:31:37 might as well allot all the space you'll ever need in one shet 15:31:39 I don't know how your Forth does. 15:31:44 s/shet/shot/ 15:31:51 Mine is this: : ALLOT DP +! ; 15:32:15 mine is something like that 15:32:17 should work 15:32:34 except it might get the cache-flushing code all confused if you compiled code back there 15:32:39 You have three stacks actually: data one, return one and dictionary one. 15:33:33 my dictionary is a big array 15:34:07 wait, what's your definition of "dictionary"? 15:34:28 you mean the word/CFA lookup table? or the place where compiled code lives? 15:34:29 Storage for words etc. 15:34:30 (if nobody minds any more basic questions): how are literal numbers compiled into definitions? 15:35:01 : LITERAL STATE @ IF COMPILE LIT , THEN ; IMMEDIATE 15:35:09 Topaz: depends how compiled code is stored 15:35:32 Topaz: if you compile native machine code, then you can compile instructions to push that value onto the stack 15:35:39 ah, ok 15:36:23 would a non-native definition have to push the next value along onto the stack and advance the IP, or something? 15:36:32 or you can branch to a function like so: : do-lit r> 4 + dup @ swap >r ; 15:36:34 Yes. 15:36:44 and put your literal in the code right after that call 15:36:53 Herkamire, it's called LIT 15:36:57 Topaz: exactly 15:37:11 ASau: no it's most definitely not called LIT 15:37:14 forth is fun! FUN to code! Lal alalalalala la!!!! 15:37:16 L 15:37:16 T 15:37:17 IT 15:37:19 S ARE 15:37:25 lol 15:37:27 LIT comples a call to do-lit and put's the literal in the code 15:37:28 OK! AND MY SPACE BAR WASfucked up 15:37:45 holy shit my keyboard went all wack 15:37:51 and how my caps lock is on 15:37:52 and i" 15:37:54 m typing lowe 15:37:55 r case 15:37:58 w 15:38:00 e 15:38:03 erid 15:38:11 get a new return key? ;) 15:38:11 * Herkamire thinks futhin went all wack ;) 15:38:13 i seem to have screwed up my program :'( 15:38:49 Herkamire, LIT is run time literal handler. 15:39:14 ASau: that would be a very confusing name for it. 15:39:23 LIT is an immediate 15:39:31 It is to read inlined number and push in on the stack. 15:39:41 : bla [ my-const 5 * ] lit ... ; 15:39:56 Herkamire, this is called LITERAL 15:40:02 traditionally. 15:40:09 oh 15:40:10 I'm sorry 15:40:20 you sure? 15:40:21 See definition above. 15:40:30 chuck now calls it lit 15:40:34 : LITERAL STATE @ IF COMPILE LIT , THEN ; IMMEDIATE 15:40:48 : LIT R> DUP CELL+ >R @ ; 15:40:58 For threaded code. 15:41:08 you're right 15:41:13 sorry about that 15:41:24 No matter. 15:41:50 It's interesting idea, actually. 15:42:19 oh, that's a much better definition of LIT than I just made up above 15:42:23 If I rename LIT to (LIT) and LITERAL to LIT 15:42:37 s/@ swap >r/>r @/ 15:42:38 I'll get rid of two bytes. 15:42:57 heh 15:43:44 I compile machine code to push the stack, so I only have one word 15:43:56 And if I rename LIT to -LIT or like, I'll free three bytes! 15:44:00 (and I call it ,lit) 16:03:02 grrrrrr. why is paint accepting my bmp and cant that stupid default xp viewer build up an image :s 16:03:17 i looked at the header, it should all be correct 16:03:56 explorer and acdc think its fine as well... 16:04:11 the viewer has no problem displaying when i create a 1 px image 16:04:25 but i see nothing wrong with the size fields with bigger images :\ 16:05:21 open in paint, tehn resave as a new file, the compare the two headers 16:05:32 i have 16:05:36 oh 16:05:39 the problem is paint adds something at the end 16:05:58 a 100 bytes i cant account for (unless its this pallet thingie, for which i see no reason) 16:05:59 so you;ll have to add something at the end also? 16:06:08 well 16:06:26 aside from the affected counters, all other fields are exactly the same, so it must be related to it 16:06:30 i just dont see what it is 16:06:56 also i noticed paint looses information 16:06:58 you look at it ina hex editor? 16:07:05 exactly what i'm doing 16:07:12 :D 16:07:13 i opened my image in paint and saved it 16:07:32 and instead of a continously byte 50, it suddenly had 2 0 bytes every now and then 16:07:48 makes me wonder why he'd do that on bmp :\ 16:09:38 wth... 16:09:49 he'll show a 200x200 image, but he wont show a 50x50 image 16:10:01 when the only things changed are those two parameters... 16:10:36 200 i s diviable by 8 and 50 isn't. COudl that have something to do with it? 16:11:00 some file formats get pissy about thing sbieng divable by 8 16:11:08 hm 16:11:39 how do you devide 1 by 8? ;) but that would mean none of the viewers would show it 16:11:49 * blockhead dunnos. :( 16:11:52 and i only see this problem with that viewer 16:12:37 and only with 1 < x < 100 16:13:12 hrm, whatever. 16:13:13 use a different viewer? :) 16:13:27 yeah i dont even know why acdc doesnt takeover bmp's anyhow 16:13:41 irfanview is kinda good 16:13:42 i hate that xp viewer. its just that it indicates something might be wrong. 16:13:58 but perhaps its just that viewer 16:14:23 go intot he options tab fo rthe view and uncheck the "suck" box :D 16:14:36 its windows, its hidden. 16:14:49 * arke_ is away: brother's birthday -- movie (harry potter) + sushi, see you in 4-5 hours 16:14:50 * blockhead as attempting a joke 16:14:52 ahwell. 16:15:04 acdc takes over now so no more hassle :p 16:15:12 yeah, they rock! 16:15:16 :) 16:15:24 now lets create some image stuff so i can create a graph from my statistics 16:15:26 yay 16:15:38 * blockhead plays air guitar "dirty deeds, done dirt cheap" 16:34:00 is there a -rot for roll? 16:34:08 i need ( r g b n -- n r g b ) 16:34:11 --- join: cedricshock (~flop@209-181-58-5.eugn.qwest.net) joined #forth 16:35:22 else i'll use swap >r swap >r swap r> r> 16:38:35 --- join: slasherx (chuck@ip68-225-243-23.oc.oc.cox.net) joined #forth 16:38:49 --- nick: slasherx -> Klaw` 16:39:16 --- quit: ChanServ (calvino.freenode.net irc.freenode.net) 16:39:16 --- quit: ASau (calvino.freenode.net irc.freenode.net) 16:39:16 --- quit: Klaw (calvino.freenode.net irc.freenode.net) 16:40:09 --- nick: Klaw` -> Klaw 16:47:31 --- join: ChanServ (ChanServ@services.) joined #forth 16:47:31 --- join: ASau (~asau@158.250.48.204) joined #forth 16:47:31 --- mode: irc.freenode.net set +o ChanServ 16:50:03 --- quit: I440r (Read error: 54 (Connection reset by peer)) 16:55:10 hmm, how is IMMEDIATE checked for? 16:55:42 (does colon just keep going until it reaches the end of the input buffer?_ 16:55:43 ) 16:56:31 I've wondered the same thing. immediate shows up after ; 16:56:41 It must work with similar magic as DOES> 16:57:04 well, does colon actually stop when it gets to the ;, or does it just stop at the end of the line? 16:57:16 the way i implemented mine once was to just switch the header of the last defined word to immidiate 16:57:18 There is some information passing about the last added word that is hidden. 16:57:37 : stops when it gets to ; i think 16:57:44 ok 16:57:58 so with my way you could do immidiate anywhere, and it would simply lookup the last word and change that to an immidiate, but i'm not sure if this is how it "should" work. 16:58:11 well, i guess that'd be fine 16:58:14 * Topaz does so 17:12:29 qFox: how about swap >r -rot r> ?? 17:17:55 hmm 17:18:13 yep same 17:19:30 ( a b c d ) ( a b d c ) ( a b d , c ) ( d a b , c ) ( d a b c ) I see. You're trying to push the top of the stack down 3 spots. 17:19:50 yeah. you should look at it like ( rgb n ) 17:20:04 rgb being a color, so i'm actually just swapping the color for the number 17:20:47 also, bmp's offset is left-bottom, not left-top. kinda sux when you think the latter while trying to fix your putpix word :\ 17:21:41 hm hm hm shall i keep it like this and have the 1,1 in the left-bottom corner, or should i do it the hard way so 1,1 is top-left (for the word) 17:21:49 ah screw it 17:22:14 :) 17:23:17 like ten years ago I was writing software to read and write BMPs and it got really screwy so I gave it up 17:23:29 well its not very hard 17:23:36 zero compression aint anyhow 17:23:50 you;de think so :/ 17:23:54 its an easy fixed header 17:23:59 i've done it :) 17:24:19 or well, doing the lib functions now 17:24:35 * blockhead bows to qFox's supieruo l33tness D: 17:24:39 :D 17:24:47 no really, its not hard 17:24:48 :) 17:25:23 * blockhead read snad writes to TGA files now. End of problem. :D 17:25:24 i glanced at the png specs, for which i was going first, and immidiatly decided i wasnt able to do that :p 17:25:38 png has built in compression. very complicated 17:25:44 i noticed 17:25:52 not a simpel run-length either, but COMPLICATED 17:26:13 Tiff is pretty bad too - mostly the result of abused headers. 17:26:24 cedricshock: agreed 17:26:25 so then i figured i might as well do bmp since that (afaik) is one of the simplist lossless type, not very efficient in data but no point 17:26:34 no problem i mean 17:26:43 and just about anythign can read/write BMPs 17:26:46 yep 17:26:55 It's hard enough to open a stupid file when you know what it is using libtiff. 17:27:05 well i want to make frequency tables from the statistics i gather with another code 17:27:27 to be able to see the differential quickly in the frequency of bytes in a file 17:27:35 I use ppm for outputting simple image data 17:28:26 * blockhead seems to reacall that you can actually look at the ppm header and read it as a ascii text 17:28:49 the bmp data isnt very hard. for 24bit pallet, there's simply 3 bytes per pixel 17:28:54 rgb 17:29:08 qFox: well, yeah, it's that pesky header that get you :D 17:29:16 not really 17:29:21 most of it is static 17:29:29 there's file size, which appearantly is ignored 17:29:36 there's image size 17:29:37 :o 17:29:41 and the rest is static 17:29:44 well 17:29:55 for me anyhow. 0 compression, 1 planes (whatever the hell..) 17:30:10 oh yeah, and there's width and height ofcourse 17:30:29 you can specify bitsize, 1 4 8 24 17:30:38 yeah, ppm header is ascii 17:30:52 and there are some other fields of which i'm not even sure wtf they are for (but they are all 0 so who cares) 17:31:02 that's the part I don't like, but at least it's not endian dependant 17:31:10 heh 17:31:10 So I'm guessing you reverse-engineered the format? 17:31:25 no i found a simple spec with google 17:31:31 http://astronomy.swin.edu.au/~pbourke/dataformats/bmp/ 17:31:33 coolness 17:31:34 :D 17:31:42 if all formats were this simple 17:32:17 qFox: you actually have it easier because you are writing BMPS, so youc an handle a reduced subset of all the possibiltiies of that format. reading is harder 17:32:29 writing is easier than reading 17:32:30 true 17:33:00 but if i was able to display bmp's, i wouldnt even bother at all because i'd just output my diagram myself alltogether :) 17:33:30 this is just a workaround (well and a little challange as i've never messed with img formats before) 17:34:33 say, bmp's are left-right bottom-top, right? 17:34:39 not bottom-top left-right... 17:35:10 * blockhead dunnos but left-right is a safe assumption 17:35:18 well 17:35:28 for 1,1 my pixel appears nice in the leftbottom corner 17:35:34 for 1,2 the pixel appears where it should be 17:35:39 for 2,1 .... its gone 17:36:44 sounds like a problem 17:36:54 better find another page explaining the format 17:37:06 thank you cap' obvious :p 17:37:20 :D 17:38:10 * blockhead often has to state the obvious, in case people skip it 17:38:20 "did you turn your comptuer on"? 17:38:23 etc. 17:38:41 hmmmmm for 2,2 it shows 1,2 17:38:42 :\ 17:39:00 qFox: what width is the image? 17:39:04 50 17:39:18 i'm having problems with the 3byteperpx thing, obviously 17:39:25 1- get.width * 3 * swap 1- 3 * + 17:39:33 (stack: x y ) 17:39:46 must the width be 50? try 56 17:39:54 no but it should work on any width 17:40:05 *should* - humour me and try it anyway 17:40:10 fine :p 17:40:57 partially 17:41:00 ? 17:41:03 well 17:41:10 there is a change in 1,2 17:41:13 buuuuut 17:41:19 the color is red, not blue 17:41:29 (this means the 00 is put in the wrong byte ;) 17:41:31 hmmmm 17:41:40 uhhh, you writing 24-bit, right? 17:41:41 perhaps i should deduct 1 from the total 17:41:43 yes 17:42:00 and BMP is RGB (not BGR), right? 17:42:05 the color used is blue, which is : blue ( -- r g b ) 0 0 255 ; 17:42:15 aye 17:42:27 i think i need to deduct 1 from the grand total 17:42:29 * blockhead is stumped 17:42:39 but then it wouldnt make sense why 1,1 is correct. 17:44:34 qFox: I may have an idea. But first a question 17:44:36 adding 3 to the grand total shows 1,2 correct (just the next px really), now for 1,1 17:44:51 these BMPs that you are writing. ARe they always going to be the same dimensions? 17:44:58 no 17:45:02 ok, never mind 17:45:11 you missed the earlier discussion about that ;) 17:45:24 * blockhead sorries 17:46:09 well it's gotta be something with the y 17:46:28 with a width of 50px 17:46:38 every "line" should be 150 bytes, right? 17:46:59 one would think so 17:47:12 so to get to the right height, it should be (y-1)*150 17:47:27 then add (x-1)*3 17:47:27 why -1? 17:47:37 for alignment 17:47:55 1,1, is your origin? 17:47:57 we're counting from 0 to width-1 17:47:58 yes 17:48:01 'k 17:48:13 but y=1 means its just x 17:48:37 1- get.width * 3 * swap 1- 3 * + 3 + 17:48:43 grrr whats wrong with this picture 17:49:03 huh i'm multiplying x with 3... 17:49:25 oh wait. gah confused 17:49:56 qhat's on the stack before that line of code is execute? 17:50:02 x y 17:50:05 (y = tos) 17:50:07 ohhh 17:51:03 near as I can tell, you've only got one item on the stack when you hit that swap 17:51:22 You mulitplied by three twice. 50*3 to get 150, then x*3 17:51:30 get.width puts the width on the stack (reads it from the imageheader in the buffer) 17:51:46 ok. sorry 17:51:52 never mind 17:51:58 * blockhead is a blockhead 17:51:59 Topaz, look for LATEST 17:52:01 hehe 17:52:23 IMMEDIATE toggles flag for LATEST word. 17:53:42 uhoh... maybe 17:53:44 qFox. Try to write your word without roll/-roll. 17:54:02 mine's without 17:54:20 well at least that one 17:54:33 (i asume you're referring to the rgb swap?) 17:54:51 I mean if you had "rgbn", then don't ever make it "nrgb". 17:55:04 why not 17:55:15 i need it that way. rgb is one color 17:55:32 What is n? 17:55:34 i have a word !rgb, that stores one color (3 bytes) to the buffer 17:55:39 any number 17:55:48 not related 17:56:00 see it as a swap 17:56:05 rgb with n 17:56:08 Why you need it? 17:56:19 because i do... 17:56:19 :) 17:56:45 Do not do it! 17:57:08 hmmm i appear to have lost or deleted the word that used it, but i'm sure i needed it at some point 17:57:21 ! :o ! 18:00:06 --- join: qF0x (C00K13S@cp12172-a.roose1.nb.home.nl) joined #forth 18:00:08 --- join: harm^kuvo (C00K13S@cp12172-a.roose1.nb.home.nl) joined #forth 18:00:20 ehr ok... whatever 18:00:29 --- quit: qFox (Read error: 54 (Connection reset by peer)) 18:00:34 --- nick: qF0x -> qFox 18:00:41 appearantly that was my isp 18:04:18 ok well it appears i had my colors wrong in the first place 18:04:19 : red ( -- r g b ) 0 0 255 ; 18:04:19 : green ( -- r g b ) 0 255 0 ; 18:04:19 : blue ( -- r g b ) 255 0 0 ; 18:04:38 --- quit: Topaz ("Leaving") 18:04:42 it appears rgb is not rgb but bgr. i believe someone mentioned that just now 18:04:48 and that was you blockhead 18:04:50 hehe 18:05:04 :) 18:05:06 --- nick: harm^kuvo -> kuvos 18:05:12 TARGA is like that also 18:05:33 but it doesnt solve the problem 18:05:49 1,1 shows proper, 2,2 shows as 1,2 and 1,2 doesnt show 18:06:23 the odd part however, is that i do see the double 0 0 in the file when looking at it in hex... 18:06:41 is there some kind of hidden bar in bmp? 18:06:52 why the 3 + at the end of that line of code you posted a screen or so ago? 18:07:21 i thought it was needed for allignment, but i removed it already 18:07:34 'k 18:08:12 i'm beginning to suspect some odd behaviour 18:08:18 from the acdc viewer... 18:08:47 try the Metallica viewer instead? :D 18:09:04 exactly how many viewers do you suppose i have here :p 18:09:18 or the iron maiden viewer? :D 18:09:28 jeez, you remove the psp directory from your my documents and suddenly the whole program borks up 18:09:29 gah 18:09:31 never mind. stupid attempt at heavy metal joke 18:10:06 now wth.... 18:10:20 this shit's getting funkier every time 18:10:36 maybe you oughta reboot 18:10:51 nono not that 18:10:55 ok 18:11:15 my bmp is 354 bytes (10x10) 18:11:20 thats 54 for the headers 18:11:30 and 300 for the imagedata, 10x10x3 18:11:44 this is properly done when i look at it in hex 18:12:10 every byte is FF (white) except two, which should make that one pixel red. 18:12:35 but the only odd thing i see, is that the top bar is funky, when i look at it in editors 18:12:43 paint shows it (limited zoom), and psp as well 18:13:23 top bar? you mean the top row of the image? 18:13:26 yes 18:13:40 have you tried making that same image 18:13:42 and saving it 18:13:47 and comparing the output 18:14:07 well thats the thing, when i save it in paint, paint adds a whole line of additional data 18:14:21 hmmmmm come to think about it, i did notice it added several double 0's 18:14:27 for no appearant reason 18:14:29 hm 18:14:49 is that perhaps the row terminator for bmp? nahhhh they wouldnt... 18:15:05 come on that can be computed from the width in the header.... :\ 18:15:08 there is no row terminator. that much I do remember 18:15:34 I suspect aht paint wants to pad the lines to be even multiples of 8 ... or possibly 16 ... pixels 18:16:44 becasue I ran into that problem ... forget itf it was BMP or one of the other file formats I was messing with 18:17:19 * blockhead fires up paint and goes to look 18:17:33 well SOMETHING's up.. 18:18:27 paint really just seems to add some padding. 18:19:22 perhaps the rows need to be even, whatever the width is 18:19:29 taht might be it. 18:19:45 hm, i have a 5x5 now, and it pads one 0 18:19:46 I just made an 11x11 BMP, filled with gray (7f), then saved it and looked in the hex editor 18:19:50 that makes 16 bytes for a row 18:20:23 it padded the 11x11 file 18:20:32 weird 18:20:57 perhaps a power of 16? 18:21:07 (bytes, not px) 18:21:15 scroll up a bit. someone was telling you that :D 18:21:20 oh bytes. 18:21:25 that's a differetn thought 18:21:59 yes 18:22:02 lessee, 11 x 3 is 33. add three more and it is 36. That's certainly even 18:22:05 remember that every px is 3 bytes 18:22:10 but not / by 16 18:22:16 not /2 either 18:22:26 with the padding it is even 18:22:45 paint padded the 11x11 file so that each line is 12 pixels 18:22:58 word alignment 18:23:04 that's what ot's doing! 18:23:09 its 18:23:31 word == two bytes, natch :D 18:23:41 hmmm ok so regardless of what the width is, the number of bytes per row must be devideble by 2? 18:23:49 looks like it 18:24:07 whoever thought of that ought to have his programminglicence revoked. twice. 18:24:27 well duh: this is the creator of windows we're tallking about :D 18:24:46 how the hell am i supposed to implement that 18:24:48 mystery is solved. happy happy joy joy! 18:24:49 ffs :\ 18:24:58 no now i have to work around that 18:25:12 but now you *know* 18:25:18 uh-huh 18:27:56 dup mod 2 if 1+ then 18:28:22 2 / 2 * 18:28:32 no, wait, that's not right 18:28:39 * blockhead never minds 18:28:58 1+ 2/ 2* 18:29:04 * blockhead tries to avoid conditionals, silly habit I knwo 18:29:09 ASau: much better! yes! 18:29:16 * blockhead thanks ASau 18:30:45 It's general. 18:31:05 When you want to align at X you do: 18:31:12 X+ 1- X/ X* 18:39:58 --- quit: cedricshock (Read error: 104 (Connection reset by peer)) 18:40:52 ah woot 18:40:54 it works 18:40:59 cool 18:41:00 stupid padding 18:41:35 but i guess that if my 1,2 px works on a 99x99 img, i'm cool 18:41:51 plus, it shows in all editors and viewers i have properly :) 18:42:00 score! :D 18:42:15 now to create lines 18:42:17 * qFox chuckles 18:42:38 : draw.line ( rgb x1 y1 x2 y2 width -- ) ; 18:43:10 8 stack items, heh 18:43:27 I preffer set-color move-to line-to 18:43:37 hmm 18:43:53 Herkamire: sounds like you used to use plotters 18:44:03 you can always: : draw-line set-color move-to line-to 18:44:11 ; 18:45:08 what's a plotter? 18:45:33 oh! 18:45:59 Old style output device. Used phsyical pens. to change a color it would have to park the pen on the side and grab anotehr pen 18:46:03 really annoying 18:46:05 I just like having those smaller words available 18:46:13 hehe :) 18:46:22 no, I haven't used those 18:46:24 Herkamire: my mistake. your syntax made be flash back to plotters 18:46:32 lots of APIs have that interface though 18:46:41 * blockhead shudders. plotters 18:46:56 * blockhead didn't know that 18:46:59 with forth you can easily provide the lower level functions and the higher 18:47:25 I got my big forth bug fixed! life is good! yay! 18:47:30 and people can factor nicely 18:47:38 yay :) 18:47:59 if people want to draw lots of stuff in red, they don't have to keep specifying red. 18:48:00 I knew that walking away for a month and then rewriting part of the code from scarth woudl do it :D 18:48:09 scratch 18:48:22 dang: I am impressed with the amount of typos I've done tonight 18:48:40 if people want a lines connected end to end they won't have to specify the middle points twice 18:48:56 Herkamire: smaller code. nice. 18:49:11 that is a good point actually 18:49:33 and if people just want to draw one line in a certain place, of a certain color, they can call draw.line 18:50:27 well. i'll break my head over pixelmath tomorrow 18:50:29 as an added bonus, it can be implemented quicker 18:50:43 nite 18:50:54 because you should have the pixel address of the end of the last line when there has not been a moveto 18:51:02 'nn qFox 18:51:09 goodnight qFox 18:51:21 --- quit: qFox ("this is mirc's last attempt of communication...") 18:51:31 I've implemented line-drawing routines at least twice 18:51:46 once in C and once in gforth 19:39:39 oh wow. my forth reads tokens from the input buffer! we've got progress! :D 19:39:49 * blockhead dances for joy 19:41:55 better quite while I'm ahead. 'night all 19:42:05 --- quit: blockhead ("laugha while you can, monkey boy") 19:52:02 --- join: kc5tja (~kc5tja@66-74-218-202.san.rr.com) joined #forth 19:52:09 --- mode: ChanServ set +o kc5tja 20:05:33 Bad morning, kc5tja! 20:06:25 Are you attempting to place me under a curse or something? 20:08:53 No. 20:09:29 It's only a bad morning here. 20:25:11 hi 20:42:53 Bye. 20:43:02 I've to go. 20:43:05 --- quit: ASau () 20:51:26 --- join: yeoh (~yeoh@219.95.27.6) joined #forth 21:08:46 : exp >rect swap real-exp swap polar> ; 21:08:46 : log >polar swap real-log swap rect> ; 21:10:58 --- quit: yeoh ("Client exited") 21:17:13 is anyone here familiar with intel branch prediction? 21:18:51 * arke_ is back (gone 05:04:01) 21:21:47 i'm not, but i'm sure somebody here is :) 21:23:29 well, my question is, according to the intel manuals you shouldn't mix code and data because it will get prefetched if it's too close to the code 21:23:37 so does that apply to a ret as well? 21:25:48 you're asking whether it's ok to place data after the target of a ret that hasn't executed yet because maybe the CPU prefetches from there? 21:26:27 i.e., the CPU prefetches from the place you're about to return to before you've returned there yet? 21:27:27 hi all 21:27:32 --- nick: arke_ -> arke 21:27:36 hi Sonarman :) 21:27:41 if you have an execution stream that terminates with a ret and you place data below this ret, will that get prefetched or is the bpu smart enough to figure out that it needs to start fetching from the return address instead? 21:27:49 Sonarman: what's your favorite forth? 21:27:53 code/ret/data 21:29:03 arke: i don't have one :) 21:29:11 arke: what's yours? pyg? 21:29:54 htp123: oh, ok 21:30:15 Sonarman: yeah, although it ain't offering what I need ^_^ 21:30:21 yah sorry if that wasn't clear 21:30:41 any idea? my best guess would be that it's ok to do, but i do that a lot so it's best to be sure 21:32:20 i have a question: if the bpu were not smart enough to start prefetching from the ret target address, then would there be a pipeline stall upon executing the ret instruction? i want to make sure my understanding of the way they work isn't TOO flawed :) 21:32:39 htp123: The data will get prefetched, because the CPU fetches whole cache lines. 21:32:45 "they" meaning pipeline processors 21:32:56 But the BPU will also predict the return too. 21:33:34 whats a BPU? 21:33:41 Sonarman: Yes, a failed prediction can cost several tens of clock cycles. 21:33:50 branch prediction unit 21:33:53 Sonarman: That's *assuming* the code exists in the code cache. 21:33:59 hmm. well, the manuals said that unconditional jumps are predicted to fall through if they're not in the btb 21:34:05 that seemed odd to me 21:34:22 what's a btb? 21:34:30 Sonarman: Branch Target Buffer. 21:34:50 Sonarman: It's a cache containing a mapping of instruction addresses and the target addresses they refer to. 21:35:03 Obviously, only branch instructions are considered for inclusion here. 21:35:13 ok, thanks 21:35:30 so final word here is jmp = ret as far as branch misprediction goes? 21:35:41 or will it just fill enough to start filling from the return address? 21:35:44 htp123: It makes sense in a way; it cuts back on the hardware used to implement the branch predictor, by treating all branch instructions uniformly. 21:35:54 oh, yah that's true 21:36:08 so why is jecxz not predicted? 21:36:26 Like I said above, whole cache lines are prefetched. 21:37:07 This means that anything beyond a correctly predicted branch is also fetched (though discarded later). Remember, the instruction fetch unit is not the branch unit -- they don't communicate with each other, and indeed, even if they did, it'd have little effect. 21:37:37 htp123: Because jecxz is a highly complex instruction, and should never be used in high performance code anyway. It will still at least one pipeline, if not both. 21:38:00 s/still/stall/ 21:38:26 so it's OK to put data in the memroyr after a ret instruction, because the prefetched data will be discarded? 21:38:49 It'll thrash the code and data caches, but yeah. Why not? 21:39:28 so would it be prefered to put other code there instead? 21:39:42 In general yes. 21:39:56 Intel CPUs do not treat mixed code/data nicely. 21:40:00 Now... 21:40:11 unless you're making performance code, it probably won't matter. 21:40:24 99.999% of the time, code is WAY over optimized for what they do. 21:40:40 I have no problems waiting half a second while my e-mail client accesses a network to check my mail. 21:40:50 well, i'd like to optimize when i can 21:40:59 http://compsoc.dur.ac.uk/whitespace/tutorial.php 21:41:03 if data after ret results in a slowdown and i have another place to put it, why not? 21:41:16 but yah, i know what you mean 21:41:47 htp123: Well, sure. But don't go overboard. And most Forth environments I'm familiar with completely violate this rule (including mine, so far, though I have intentions to address this issue later in time). 21:42:29 so does this also mean that there is no difference wether or not i have data or code after the ret assuming the code will not be called soon after? 21:42:31 arke: ?=) 21:42:44 say two entirely different routines 21:43:01 Sonarman: do you have bigforth on supermac? 21:43:10 er, nevermind 21:43:19 arke: i have the Atari ST version, which runs in STonX :) 21:43:23 htp123: Correct. The slow-down only occurs when a cache line changes from "memory as instructions" to "memory as data" and vice versa. Once it's in either state, it'll want to stay in that state. 21:43:26 ^_^ 21:43:33 Something I more or less call "cache inertia." :) 21:43:42 heh 21:43:43 Sonarman: well, would you hook me up with VNC? :) 21:43:48 but i have bigforth on the PC (the i386 version, no less!) 21:43:51 Sonarman: just kidding... 21:44:02 well, thank you very much. that helped a lot 21:44:03 arke: whew :) 21:44:19 htp123: No problem. 21:44:36 I've been doing assembly language coding for a variety of CPUs since before I turned 13. :) 21:44:50 And I don't care what anyone says, assembly language is the only true programming language. 21:45:37 yah i'd like to agree with that, even though my experience is far less 21:45:39 Sonarman: if I were serious, would you have? 21:45:47 kc5tja: :) 21:45:51 i would have tried 21:45:55 kc5tja: and forth...? 21:45:57 kc5tja: :) 21:46:28 arke: Forth is a close second, but also consider: Forth is an assembly language for a (sometimes mythical) stack CPU. 21:46:38 arke: This is why it is so flexible. 21:46:56 i sort of think of forth as an assembly runtime 21:47:10 write assembly words and make use of a nice library 21:47:12 htp123: Yeah, my later generation of Forths take this philosophy as well. 21:47:33 do you have any published sources i could look at? 21:47:39 Actually, my Forth is subroutine threaded, so I see it as a very sophisticated macro assembler. :) 21:48:44 htp123: There is an implementation of FTS/Forth's cross compiler on my website in the FTS/Forth project page. It's actually more complex than necessary, and it's software will eventually be replaced by code borrowed from my Kestrel project's assembler (aka MachineForth compiler). http://www.falvotech.com, click on Projects, and then your choice of Kestrel or FTS/Forth. 21:49:55 great, thanks 21:50:13 i looked at that FTS10001 chip a few days ago actually and was wondering what the status is on that 21:50:27 1001 rather 21:50:40 I just recently finished the assembler for it, so I'm kind of taking an intellectual break from it for the time being. 21:50:48 --- join: teehee (~arke@melrose-251-251.flexabit.net) joined #forth 21:50:59 My next step in its development is to actually produce Verilog code that can execute the instructions the assembler produces. 21:51:00 so do you actually plan on having a hardware implementation? 21:51:13 * teehee loves GNU screen 21:51:20 htp123: Since I'm going to sell the Kestrel as a kit, yes. 21:51:47 that sounds pretty awesome 21:52:27 Anybody who has ever enjoyed a Commodore 64 or 128, that is the atmosphere I'm striving for with the machine. 21:52:50 Instant on, instant off, integrated OS/programming language, virtually infinitely expandable, yet no expansion slots, etc. 21:52:56 excuse the cliche, but sign me up 21:53:16 :) 21:53:32 Development isn't going to happen very fast, as I'm working a full-time job. 21:54:05 yah i figured, but it's worth the wait. i just hope you don't get bored/sidetracked 21:54:05 The less loaded I am at work, the more likely I am to work on Kestrel. 21:54:14 I'm hoping I don't either. 21:54:35 But, there is less a chance of that happening with this project, because I intend on using it directly, myself. 21:55:17 I'm sick of the IBM PC, I miss the grace of my Amiga, and the openness and extensive documentation of the Commodore 64c that I had previous to that. 21:56:12 unfortunately that was before my time, but i share the feeling. i'm sick of huge, bloated picture viewers 21:56:12 Although clocked at 25.175MHz, I expect the Kestrel to have a run-time performance roughly equivalent to a 50MHz clocked Atari ST with blitter emulation turned off. 21:56:20 err, blitter support turned off, rather. 21:56:29 blitter? 21:57:04 A vector coprocessor optimized for moving arbitrary blocks of bits around memory, and combining multiple vectors in various ways (usually via boolean logic operators). 21:57:20 Used to implement very rapid 2-D graphics acceleration. 21:57:25 interesting 21:57:53 For example, although the Amiga originally ran at 7.15909MHz, it nonetheless supported real, honest to goodness, full-screen 60fps animation with 4096 colors on the screen at once (its entire color palette), back in 1985. 21:57:56 * teehee just absolutely loves GNU screen 21:57:57 :) 21:58:07 heh, not bad 21:58:24 teehee: You already said that. :) 21:58:44 wel, i love it so much its worth saying agian 21:59:13 :) 21:59:34 * teehee is now in bed 21:59:40 htp123: Quite seriously, the Amiga is the very reason IBM came out with the VGA card. 21:59:55 in an attempt to keep up? 22:00:03 Previous to the VGA, the EGA represented the best in computer graphics for under $1000, and that was limited to 16 colors out of a palette of 64. 22:00:07 htp123: Yep. 22:00:07 thanks to wireless keyboard, full screen putty, and GNU screen I'm all set 22:00:21 And it STILL took another 10 years before performace of the PC matched a bone-stock Amiga 1000. 22:00:46 kc5tja, those are basically the same reasons i've been working on a forthish system as well. i wasn't around for the amiga days, but i'm sick of hugely bloated cpus with 20 stage pipelines and operating systems with layer upon layer of stupid abstraction 22:01:04 :) 22:01:11 In fact, window management and GUI manipulation on my current desktop PC, an AMD Athlon box running 800MHz, is still slower than my 7.15MHz Amiga. (However, obviously, programs run faster.) 22:01:22 we should be colonizing the moon not try to figure out how to make the movement of a ball reflect an image bigger than an entire operating system 22:01:28 :) 22:01:45 teehee: Heh 22:02:30 htp123: My Amiga still has only a 120MB harddrive. :D 22:02:48 hehe 22:02:51 still use it actively? 22:02:57 Not anymore. 22:03:15 I would like to put it back in service somehow, but I've got it mothballed for the time being. 22:03:34 i had an amiga when i was around 10, but that was before i really got into computers. just had it because there were so many games available for it 22:03:46 The monitor it requires has a bad power switch though, and the expansion slot I have for it is flaky; touch the computer the wrong way, and it crashes. 22:04:08 too bad 22:04:17 Well, the computer is going on 20 years old now. :) 22:04:25 I'm surprised it works at all. 22:04:33 Most ROM chips don't last that long. :D 22:05:14 no? i didn't think they had a lifespan that short 22:05:46 Most semiconductors last longer. But chip vendors only guarantee their parts for 10 years now-a-days, and 20 years back when my Amiga was made. 22:06:31 i need a glow=im=the=dark keynpard 22:06:45 teehee: We noticed. :) 22:06:53 oh weird. i have collected a few old systems and they all work fine 22:06:54 :) 22:06:56 Or, you can just learn to touch type. :) 22:07:07 jarder tjam ot see,s 22:07:12 :) 22:07:16 well, not that old i guess. mid 80's 22:07:34 Well, my previous car was warrented only for 100,000 miles, but I got 262,156 miles out of it before it blew one of its apex seals. 22:07:47 yah that's true 22:08:12 still. i wasn't aware they had a specified lifespan 22:08:32 Yeah, it's usually such a rare issue to deal with, most don't mention it. 22:08:47 true 22:09:16 * teehee 's car is at 113xxx miles 22:10:01 Hey, I gotta go. Food. :) 22:10:05 And then bed. 22:10:29 --- quit: kc5tja ("THX QSO ES 73 DE KC5TJA/6 CL ES QRT AR SK") 22:10:30 night, and thanks again. nice talking to someone that knows his stuff 22:10:47 :) 22:10:49 he's already gone :) 22:10:52 ah well 22:12:01 laaa deeee dooooo 22:12:02 :) 22:12:05 * teehee is bored 22:12:08 hehe, you're a happy one 22:12:12 * teehee loves GNU screem 22:12:15 yep 22:12:19 who doesn't? 22:12:29 there are some ... 22:16:16 so you're a forth person too i'm guessing? 22:17:09 yeah 22:17:21 kc5tja taught me most of what I know :) 22:17:33 cool 22:18:02 i still don't know much about it really. just enough to get my OS going 22:18:19 infact, all the forth programming i've done was quick tests to make sure my words work as expected :) 22:23:08 --- quit: Sonarman ("leaving") 22:25:48 --- join: Serg (~z@212.34.52.140) joined #forth 22:26:26 * arke = teehee 22:30:56 --- quit: teehee ("leaving") 22:45:56 ugh, I wish Mark was here. 23:50:03 --- quit: Serg () 23:59:59 --- log: ended forth/04.06.07