00:00:00 --- log: started retro/11.02.27 00:45:12 --- join: Pline (~Aashim@61.153.16.162) joined #retro 00:45:12 --- part: Pline left #retro 00:58:04 --- join: Mat2 (5b4085ac@gateway/web/freenode/ip.91.64.133.172) joined #retro 00:58:09 hi 01:00:04 oPless: The CTO of XMOS was the chief architect for INMOS transputer, the XMOS is not a 0 operand stack-cpu but its instruction set allowing stack processing without extra effort 01:02:11 and the four "links" of each core share some ideas from INMOS "interconnect channels". New is the build in sheduler for each core, supporting asynchronous threads 01:02:47 I think it's a nice architecture 01:06:55 ciao 01:06:59 --- quit: Mat2 (Quit: Page closed) 03:26:29 --- log: started retro/11.02.27 03:26:29 --- join: clog (nef@bespin.org) joined #retro 03:26:29 --- topic: 'Retro Language | http://retroforth.org | Logs @ http://bit.ly/ayTmLI | Release 10.7.6 @ http://bit.ly/gSLQdD | Fossil Repo @ http://rx-core.org | Corpse Blog @ http://rx-core.org/dev/corpse | Forums @ http://forthcommunity.com | Donations @ https://www.wepay.com/donate/179527' 03:26:29 --- topic: set by crc!~quassel@li125-93.members.linode.com on [Sat Jan 29 13:39:05 2011] 03:26:29 --- names: list (clog SimonRC +foucist yiyus oPless scj @ChanServ @crc docl cfa) 07:39:43 docl: that (+) symbol is XOR so shouldn't your ch and maj word be using 'xor's ? 07:47:29 I updated the various retroforth mirrors, and made the old wiki editable again 07:47:41 crc: what does the stack comment here mean? t: << ( xy-n ) <<, ; t: >> ( xy-n ) >>, ; 07:47:55 crc: shouldnt >> be taking in 2 values, 1 being n ? 07:47:59 takes two elements, returns 1 07:48:16 yeah but wouldn't the stack comment be xn-n ? 07:48:18 er 07:48:26 xn-x 07:48:38 takes in a value & integer, returns the modified value.. 07:48:40 xn-y ? 07:49:03 xy-n implies two separate values taken in, and some integer returned 07:49:05 foucist: yeah I was reading the specs and it said that OR and XOR give the same result. heh, I should do the empirical test. 07:49:19 foucist: would be correct 07:49:32 takes a two values in and returns a new value 07:49:37 crc: but that's not what >> does, it doesn't return an integer, it returns a modified variable 07:49:46 n = (x >> y) 07:49:49 X Y etc represent variables 07:49:59 N represents a count 07:50:13 +------------+------------------------------------+ 07:50:14 | x, y, z, n | Generic numbers | 07:50:14 +------------+------------------------------------+ 07:50:14 | q, r | Quotient, Remainder (for division) | 07:50:14 +------------+------------------------------------+ 07:50:15 | ``"`` | Function parses for a string | 07:50:17 +------------+------------------------------------+ 07:50:19 | q | Quote | 07:50:21 +------------+------------------------------------+ 07:50:23 | a | Address | 07:50:26 +------------+------------------------------------+ 07:50:28 | ``$`` | Zero-terminated string | 07:50:30 +------------+------------------------------------+ 07:50:32 | c | ASCII character | 07:50:35 +------------+------------------------------------+ 07:50:37 | f | Flag | 07:50:39 +------------+------------------------------------+ 07:50:41 | t | Type constant | 07:50:43 +------------+------------------------------------+ 07:50:45 | ... | Variable number of values on stack | 07:50:48 +------------+------------------------------------+ 07:50:54 I'd have used 'a' if it expected a variable 07:52:44 looks like ansi forth uses # for count 07:52:48 i guess i was wrong http://www.forth.org/forth_style.html 07:53:01 and the other forths use n1 n2 n3 i guess 07:53:04 WEIRD though 07:53:09 because when i see shit like 07:53:41 nevermind 07:55:22 crc: in science papers it's often n that is a count, and x/y etc that are varibles heh 07:55:35 like in that page you linked before @ http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf 07:55:40 SHR 07:55:40 n 07:55:41 (x) = x >> n 07:57:00 My stack comments and code styling guidelines are documented (see The_Retro_Language.rst, or http://retroforth.org/pages/?CodeStyle for the wiki version of this section) 07:59:03 : shr ( xn-y ) repeat >> again ; 07:59:22 does that work ? it'll repeat >> n times on x ? 07:59:24 no 07:59:36 that'll crash, since repeat/again is an endless loop 07:59:59 what takes a count and repeats for that amount? 08:00:21 the times, iter, and iterd combinators 08:00:56 cool 08:01:25 : shr ( xn-y ) iter >> ; ? 08:01:28 er 08:01:32 iterd >> ; 08:01:36 : shr ( xn-y ) tuck [ over >> ] times nip ; 08:02:05 assuming you want to repeat "x >> n", n times 08:02:08 what's wrong with : shr iterd >> ; ? 08:02:11 times ( nq- ) Run quote (n) times 08:02:12 iterd ( nq- ) Run quote (n) times and push counter to stack 08:02:12 each time. Counts down. 08:02:12 iter ( nq- ) Run quote (n) times and push counter to stack 08:02:12 each time. Counts up. 08:02:26 1) iter and iterd push a counter to the stack 08:02:33 2) they take a quote off the stack 08:02:45 crc: your http://sprunge.us/MgMG doesn't say iterd pushes counter to stack each time 08:02:52 what's the diff between iterd & iter? 08:02:57 up vs down 08:03:03 oh 08:03:19 3 elements x y z 08:03:19 : !each [ getc dup putc !tib 0 tib 1+ ! tib find drop @d->xt ! ] times ; 08:03:20 1 2 3 3 !each zyx 08:03:39 foucist: 08:03:39 : iterd ( nq- ) 08:03:40 over 1 >= [ swap for tors swap dup dip next drop ] [ 2drop ] if ; 08:03:40 Run quote (n) times and push counter to stack each time. Counts down. 08:03:59 that's from the link you just pasted; it does say that the counter is pushed :) 08:04:12 crc: oh i was assuming the sentence above was applying to iterd 08:04:21 woopsie 08:04:24 ahh, sorry 08:04:31 * crc makes a note to clarify this 08:04:58 crc: ti 08:05:22 crc: i rpobably would've noticed if i was reading through the whole thing properly 08:05:46 but since i looked directly at iterd.. 08:06:32 crc: a clarification might be "times runs quote (n) .." 08:06:58 i.e. throw the name of the word into the beginning of each sentence maybe? not sure if it works 08:07:26 done: http://sprunge.us/geDW (and in the Commentary.txt in the repo as well) 08:10:19 better approach than above 08:10:19 3 elements x y z 08:10:20 1 2 3 x !+ !+ ! 08:19:01 docl: if you have a larger array to initialize, each@ might work better: 08:19:01 1 2 3 x 3 [ ! ] ^types'BUFFER each@ 08:20:33 docl: : shr >> ; :P (ignore the one above lol) 08:20:49 heh 08:21:41 crc: neat 08:22:46 crc: as far as arity goes, should I do ( x y z ) or ( z y x ) for my functions? 08:23:20 well I guess it's ( zyx- ) vs ( xyz- ) 08:23:38 or rather ( zyx-n ) vs ( xyz-n ) 08:24:05 docl: i generally go with whatever leads to the least stack noise 08:25:22 hmm. I wonder if I should just juggle since there are only three values. makes it harder to read that way. 08:25:46 what is the current code? 08:26:03 3 elements z y x 08:26:04 : ch ( xyz- ) z !+ !+ ! @x @y and @x not @z and or ; 08:26:04 : maj ( xyz- ) z !+ !+ ! @x @y and @x @z and or @y @z and or ; 08:27:06 : rotr ( xn-y) 2dup >> push 32 - << pop or ; 08:27:24 docl: have you done rotr yet? 08:27:29 not yet 08:30:24 32 being word size. could replace that with a constant named w in case you want to port to SHA-512 later. 08:32:21 well in retro do we have cell sizes or what? 08:32:24 32 constant w 08:32:25 : rotr ( xn-y) 2dup >> push w - << pop or ; 08:32:25 : rotl ( xn-y) 2dup << push w - >> pop or ; 08:32:54 foucist: one cell size, 32-bits. Unless you are using an experimental VM with 16-bit or 64-bit cells. 08:33:32 crc: do you have a variable that provides the # ? i know some forths do that 08:33:55 a constant called 'cell' or something like that? 08:34:01 no 08:34:13 yeah prob not needed 08:35:28 heh, I guess rotl is not needed for sha256 anyway 08:35:44 generally not. You have to use an image that matches your VM's cell size, so you shouldn't need to query the cell size normally 08:36:45 docl: for 'ch', you could get by with one variable: 08:36:45 : ch ( xyz- ) -rot over !x and @x not rot and or ; 08:36:58 crc: have you talked to chuck moore in the last 5 years btw? 08:37:04 foucist: no 08:37:09 you meanie 08:37:11 he's a nice guy 08:37:14 what do you got against him? 08:37:15 jk 08:37:16 :P 08:37:31 crc: good point, x is the only one that gets duplicated in that function 08:38:25 his work and mine are in two different directions 08:38:45 nothing against him, except that he hasn't built a version of colorforth that can run on more systems... :) 08:40:05 * docl wonders how hard it would be to port it to ngaro 08:40:35 colorforth? it'd be a complete rewrite. The only c4th source I've seen is for 32-bit x86 assembly. 08:41:16 I've dabbled with limited colored forth varients for ngaro in the past, with raystm2 helping to test them. Nothing came of that though. 08:42:33 * docl wonders how much of an advantage color really presents 08:43:31 color isn't a big part of it 08:43:39 everythign else is radically different 08:43:47 even if you decolorized it 08:44:03 text-entry modes 08:44:17 no i'm not talking about the interface either 08:45:15 talkign about stuffl ike : foo jump ; ; ; 08:45:43 or one word running into the next 08:46:08 retro4-9 were mostly based on colorforth's internal model 08:47:12 docl: : ch ( xyz- ) -rot over [ and ] dip not rot and or ; 08:49:20 crc: you had open ended ; once right? 08:49:24 like 08:49:26 : abs -if 08:49:36 : negate - 1 . + then ; 08:49:47 so 'abs' also used negate 08:49:51 foucist: correct 08:49:57 do you still have that? 08:50:02 not currently 08:50:08 any reason ? 08:50:17 though your negate is wrong. badly :) 08:50:31 (at least, for retro) 08:51:08 yeah that's the colorforth version 08:52:07 foucist: with the current dictionary structure, it's not all that efficient since I'd have to jump over the header to get to the next function 08:52:11 crc: from ehre http://www.greenarraychips.com/home/documents/greg/cf-style.htm 08:52:15 at thte bottom heh 08:52:36 check out the 'jump into the loop in the middle' one too 08:52:40 begin -1 . + 08:52:40 delay n -until ; 08:52:53 begin -1 . + : delay -until ; 08:53:14 pretty weird 08:53:26 not even defining the world till the middle of it? 08:53:38 well i guess the first part would get defined in some other word 08:53:46 probably 08:54:04 it might be cool to do multiple word definitions in one line 08:54:17 things like that are interesting, but harder to test for consistancy 08:54:27 (the loop, not the fallthrough) 08:57:14 crc: finish the dl? :P 08:57:28 yes, a short time ago 08:57:30 & hacking teh logs? 08:57:33 now freeing up hard drive space 08:57:56 I haven't synced the logs to my server yet 08:59:10 I'll do that now 09:00:16 cleaned logs will be uploaded shortly :) 10:37:12 --- join: Mat2 (5b4085ac@gateway/web/freenode/ip.91.64.133.172) joined #retro 10:37:15 hello 10:56:21 hi Mat2 10:56:30 hi crc 11:21:38 --- quit: Mat2 (Ping timeout: 272 seconds) 11:36:36 --- join: Mat2 (5b4085ac@gateway/web/freenode/ip.91.64.133.172) joined #retro 11:51:34 * crc is back to editing books. I should probably check to see what's new with MoR (my last update was TSPE, Constrained Cognition, Part 8) 12:03:29 howdy Mat2 12:03:41 hi Foucist 12:04:07 crc: btw, speaking of colorforth on ngaro like docl brought up earlier.. i assume colorforth runs on the forthchip, which has 33 opcodes.. so there must be a version out there written in forth 12:04:12 perhaps that could be adapted to ngaro easily 12:04:30 (i asusme there's a version of colorforth for forthchips..) 12:05:08 I've never seen source for that released, and the dev boards coming out for the ga144 list an eforth port, not colorforth as being included 12:05:49 oh, yeah i read that eforth came out first for it 12:06:02 the implication is that colorforth will (or may have by now) be coming out for it 12:07:59 if there exist a colorforth version based upon machine-forth porting would probably an easy step ? 12:08:16 who knows 12:08:24 not necessarily, but it gives us more to study :) 12:08:38 yeah :) 12:10:25 colorforth makes a lot of sense, specially the compiler simplification, late binding, on demand compiling etc. 12:11:08 add closure support and tail-call optimisation and you get a nice functional forth dialect 12:11:33 yeah 12:12:28 *Mat2 is a colorforth fan 12:12:37 me too :P 13:53:33 --- quit: Mat2 (Ping timeout: 272 seconds) 14:27:43 --- quit: foucist (Remote host closed the connection) 14:38:09 --- join: foucist (~foucist@ps14150.dreamhost.com) joined #retro 14:38:09 --- mode: ChanServ set +v foucist 15:41:34 foucist: to allow nestable colon definitions in Retro: 15:41:34 : t: ahead : here swap ! ; immediate 15:41:34 &t: rename: : 15:45:25 heh 15:49:59 crc: ok dl'd the stable retro and ran make.. how do i load a retro file? ./retro doesn't do anything 15:50:07 or rather, how do i just run the file (not load).. 15:50:42 hmm, you don't have any documentation links on yoru main retroforth.org page ? 15:51:29 nevermind, found the do 15:51:30 doc* 15:53:43 crc: http://pastie.org/1614988.txt if i do ./retro --with it should work right? 16:03:46 yes 16:04:30 rename: may not be in the stable release; don't remember at the moment :) 16:06:48 yeah, stable lacks the rename: function 16:08:32 ah i see 16:09:22 so: 16:09:22 : : ahead create &.word reclass here swap ! ] ; immediate 16:09:43 that should work in 10.7.x 16:10:12 crc: how do i use retro to run scripts (don't wnat to go into the interpreter?) 16:10:21 also the interpreter is weird, it creates a new line for every time i hit space? 16:10:27 and has 'ok' on every line 16:10:40 the interpreter evaluates as you type. it's been like this since I started on 10.x 16:10:54 ok 16:11:03 how about just runing a script 16:11:19 how to use retro for shell scripting for example 16:14:00 crc: oh, 11.0 doesn't use puts or . anymore? 16:14:09 1) build the vm to look for the image in a known location (see the "GLOBAL" define) 16:14:09 2) copy the vm to a location in your path 16:14:09 3) load this into the image you'll use: 16:14:09 : #! 32 accept 32 accept ; 16:14:09 here ] ; is boot 16:14:11 here ] ; is ok 16:14:13 save 16:14:16 bye 16:14:18 4) copy the image to where the script expects to find it 16:14:20 5) start the script with: 16:14:22 #! /path/to/retro --with 16:14:25 6) end the script with bye 16:14:27 foucist: . is now putn in retro11 16:14:29 puts should work 16:14:50 ok 16:17:06 foucist: I really don't do much scripting with retro; I'd build a custom image, and then write a shell script or use a modified vm to load it (this is what I do with the couple of small web apps I've written) 16:18:38 crc: is that stuff you load into the image to turn off the interpreter's display of the code & 'ok' message? 16:18:52 that turns off the "Retro ...." banner and the "ok" 16:19:02 turning off code being evaluated is harder 16:22:52 crc: btw, doing 'here ]' causes 11.0 to crash so i guess that's for 10.7 :P 16:22:52 you'd need to selectively disable and re-enable 'putc' for that 16:23:03 in 11.0, you'd use here ]] 16:23:13 since [ ] are redefined for use in creating quotes 16:23:13 ah 16:23:21 how do you handle cgi anyways? 16:23:33 for web for example 16:23:45 that's basically identical to shell scripting 16:23:47 just need stdout 16:25:41 getEnv, and using casket: http://rx-core.org/dev/casket.fossil/artifact?name=7fd1e6f7fbf2fce281ce95f33cd7722cbdcf3918 16:26:49 This is all still barebones; just adding what I need as I go along 16:28:38 yeah 16:28:45 you have too much fun with the barebones :P 16:29:15 all the other projects built on top of retro get killed, the poor things :P 16:31:27 crc: it seems rather strange to not have gone the regular stdout/shellscripting way of cgi, that would've been the easiest thing to handle? 16:31:48 i vaguely recall doing a cgi script w/ retro or some forth ages ago.. 16:34:24 crc: huh, how does casket output the html? it looks like regualr stdout anyways? 16:34:32 but you don't override putc in there 16:35:07 casket writes to stdout, but it's a custom image 16:35:18 not in 10.7 ? 16:35:24 i have it in the examples/ dir 16:35:25 heh 16:35:42 it hooks itself to run when the image is loaded, and receives input from the cgi environment variables 16:37:37 retro-10.7.6/retro --with retro-10.7.6/examples/casket.rx not good enough? 16:37:39 http://sprunge.us/BieR is an example of a small thing using casket 16:38:00 it's running on my server as http://rx-core.org/dev/showPageViews 16:38:51 casket provides a framework. the app using it sets up a few paths/url variables, defines page handlers, and then hooks the casket "dispatch" as the "boot" function of the image 16:39:32 is that code for 11 or 10.7? 16:39:38 11 16:41:21 the 10.7.x implementation of casket has a couple of small differences (e.g., no Content-type: macro, requires s" for strings (no s" in retro11), and probably has a few other bits different 16:41:54 crc: ok i'm trying that code you pasted plus the new casket.rx 16:42:05 so i did ./retro --with yourpastie.rx 16:42:10 it saves and goes bye 16:42:21 and then i run ./retro again and no workie 16:42:26 it doesn't run 16:42:27 any errors during the load? 16:42:37 ./retro --with .... | grep -v ok 16:43:16 nope 16:43:24 no errors 16:43:32 well 16:43:37 i didn't fix the paths 16:44:01 that wouldn't be too relevant if you're not worried about saving the image 16:44:12 well the pastie includes the save 16:44:19 so the image got saved (i used a copy ) 16:45:02 and then i run the image and it just quits w/o any display 16:46:35 PATH_INFO=/index ./retro 16:46:51 ooh 16:47:06 set that CGI variable ;) 16:47:08 :P 16:48:59 crc: ok so why does casket successfully output text without showing it's code, can't i do the same thing using it in another retro script as a shell script? 16:49:09 casket doesn't hack putc 16:49:18 oh wait 16:49:19 it does 16:49:22 nothing reaches the listener 16:49:24 the 10.7 one didn't 16:49:55 the casket dispatch is called on boot, then exits 16:50:01 ah i see 16:50:46 so just need a script dispatch 17:10:02 this is easy enough to do in retro 11: 17:10:02 : #! ( ""- ) getToken getToken 2drop ; 17:10:02 : disp ( q- ) &putc :devector do &drop &putc :is ; 17:10:02 [ [] &boot :is ] disp 17:10:02 [ [] &ok :is ] disp 17:10:03 save bye 17:10:10 that'll give you an image with no output 17:10:25 anything that you want to show output gets put in a quote and passed to "disp": 17:10:42 words ( won't display ) 17:10:42 [ words ] disp ( will display the output only ) 17:14:46 ok 17:15:21 I'll throw this into the repo for 11.0 users (as library/script.rx) 17:15:36 crc: is there something to produce a newline? 17:15:40 since putn/puts etc don't have that 17:15:48 and that code above doesn't produce any 17:15:56 i guess you ahve a newline sequence in the ok definition 17:15:56 "\n" puts or cr 17:16:01 cr ok 17:16:41 coolio 17:16:50 crc: anyways, have you loaded ga144 simulator yet ? ;) 17:17:06 no; vmware crashed twice so far trying to install windows 17:17:13 :( 17:17:15 damn 17:17:37 maybe try virtualbox then :P 17:17:39 oh well.. 17:19:53 I'll try that tomorrow 17:20:48 cool 17:21:37 scripting language library module is at http://rx-core.org/rx.fossil/artifact?name=cdd14bb81ec3676cc99aff566ec761b87968a199 17:22:31 crc: how's your mac mini holding out these days? 17:23:15 i recently maximized the ram on this 3 year old macbook to 4 gigabytes (it can only actually handle 3.3 gb, but i figure dual channel and the slight extra would've been worth it.. cheap enough to get ram these days) 17:23:23 and i also put in an SSD hdd, ocz vertex 17:23:29 big difference 17:23:37 s/big/huge 17:25:52 the ram was like $40 17:26:00 the hdd was 128gb, so like $220 17:26:13 maybe ram was $80? i forget.. 17:26:47 i only went 128gb cuz my local store didn't have an ocz vertex 2 at 80gb 17:28:35 I'll eventually up the ram in this mac mini 17:28:40 1gb is no longer sufficient 17:29:35 no sir.. 17:29:38 crc: how old is it 17:29:54 2-3 years IIRC 17:30:29 how big is the hdd? 17:30:35 how much disk space do you need 17:30:36 80gb 17:30:52 you probably have external drives and such right? 17:31:07 I'm planning to setup 2tb external; I've got 320gb external currently 17:32:35 could get a 60gb ssd for $130 http://www.newegg.com/Product/Product.aspx?Item=N82E16820227550&cm_re=vertex-_-20-227-550-_-Product 17:32:44 80GB for $170 17:32:44 http://www.newegg.com/Product/Product.aspx?Item=N82E16820227685&cm_re=vertex-_-20-227-685-_-Product 17:33:02 hmm, 90 for $180 http://www.newegg.com/Product/Product.aspx?Item=N82E16820227601&cm_re=vertex-_-20-227-601-_-Product 17:34:25 so something like 60gb sdd for $130 + say $40 for ram or so ? 17:34:31 for less than $200 bam, super fast computer 17:34:36 and you're getting an external hdd anyways 17:34:42 so you probably don't need more htna 60gb ssd.. 17:34:57 SSDs are fast 17:35:12 half the bootup time, programs load nearly instant now 17:35:41 and beachballing times are negligable.. swap disk is fast 17:41:03 crc: vertex 2 was the gold standard based on my research (i upgraded in december) so probably hasn't changed much since intel's ssd came second 18:04:10 foucist: I'll add this to my wish-list for the upgrades later this year 18:10:05 s/since intel's/since. intel's/ 20:35:41 https://github.com/libtom/libtomcrypt/blob/master/src/hashes/sha2/sha256.c 23:59:59 --- log: ended retro/11.02.27