00:00:00 --- log: started retro/10.02.07 05:14:20 --- quit: virl (Ping timeout: 272 seconds) 05:53:00 docl: where would the check take place? 05:53:46 docl: call/jump instruction can't check for non-zero, because if it's not a nop it could be an address or a more instructions 07:28:11 --- join: sixforty (~sixforty@pdpc/supporter/active/sixforty) joined #retro 08:29:34 crc: why would there be instructions at the beginning of a word? 08:41:49 --- join: erider (~chatzilla@pool-173-69-160-231.bltmmd.fios.verizon.net) joined #retro 08:42:19 --- quit: erider (Changing host) 08:42:19 --- join: erider (~chatzilla@unaffiliated/erider) joined #retro 09:06:44 crc does retro have closure 09:13:54 erider: closure is when variables are hidden, right? 09:14:58 no closure is when you can define a function inside of a function and you can access the outer function local variables 09:17:14 and you can return the inter function 09:18:49 http://en.wikipedia.org/wiki/Closure_%28computer_science%29 09:20:10 first define "local variable" 09:22:45 also define "function"... 09:23:53 docl: can we did it in forth 09:24:20 of course, you can do anything in forth 09:24:41 the question boils down to when, how, and whether you want to 09:25:40 vocabs could be seen as objects. you could have every vocab have a "main" word. then any variables within the vocab would be local in a sense 09:27:37 it really just has a lot to do with your preferred syntax rather than what is and isn't possible 09:28:18 crc has a pretty good system for local scopes that he used before my vocab code was developed... 09:28:29 {{ ... ---reveal--- ... }} 09:30:27 also { ... } creates words that are erased from the dictionary later. by vectoring stubs created beforehand or passing the xts on the stack you can selectively make things visible 09:31:41 docl: retro is a special case and it has a lot of built-in side-effects that you can gain power from the language but what about ANS forth or reva can I get the same out of it 09:32:30 it's entirely possible. however the dictionary implementation may differ from one ans forth to another 09:32:36 but it's certainly possible in reva 09:34:39 * docl will get a copy of reva and see if I can figure it out 09:35:24 reva is like a blast from the past for me, as it split from retro back around the time I started using it 09:35:44 I am only using a small set of words to keep things portable 09:36:31 the word set that I am using I should be able to build on top on them to get the functionality that I want 09:37:33 to hide the most recent word in reva is the same as in forth: 09:37:37 last @ @ last ! 09:37:51 er, I meant to say retro there 09:37:59 same as in retro 09:38:31 you can hide any word in the dictionary in a similar way though. they are a linked list, with the link stored at the zero offset. 09:38:54 last @ @ @ @ @ dup @ @ @ @ @ @ @ swap ! 09:39:02 that takes a chunk out of the main dictionary 09:39:21 * docl could probably implement vocab in reva pretty easily 09:41:13 it's pretty convenient how the links are all stored at the zero offset. that means you can just do @ @ @ @ ... as many times as necessary 09:42:37 but the deeper words in the list need to be stored to the ones higher in the list, not vice versa. a backwards link would create a circular chain, which in turn causes an endless loop when you try to look something up 09:43:51 docl: you should be able to scale the dictionary with here 09:44:08 what do you mean? 09:44:35 last is a pointer to the end of the linked list or NULL pointer 09:45:25 * docl is unaware of it ever being a null pointer 09:45:53 I have used here 4 - or here cells - to back in to a nameless data section created with comma 09:47:01 yes that is possible 09:47:03 there has to be a null pointer somewhere to define the end of the linked list 09:47:17 yes there is, at the end of the list 09:47:25 that is how it knows when to stop 09:47:44 so it the null pointer the head or the tail of the list 09:47:44 if you to last @ @ @ ... @ enough times you eventually hit 0 09:48:21 last itself isn't ever null unless your dictionary is completely empty 09:48:29 so last is the pointer to the last word in the list 09:48:35 right 09:48:43 ok got it 09:48:45 the most recently created one 09:52:12 docl: my word set is: create ' , : ; @ ! c@ c! . emit key and or xor - + / * dup drop swap over rot >r r> do loop = > < <> if 09:52:42 does> 09:52:50 here 09:53:03 that should cover it 09:53:06 is there any good modern books on forth for learning? 09:53:24 Starting Forth 09:55:21 ok i found a web version 09:55:41 does retro have floating point and trigonometric functions? 09:55:47 what's the tutorial by beez? The 4th version is still available, but it's been edited for (gad) gforth/ANSI now. 09:57:06 zachk http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm#contents 09:58:10 zachk: I think there may be a math library, let me check what it contains 09:59:42 ah, not very much apparently 10:04:33 zachk: did that link help 10:04:56 docl so what do you think about closures and forth 10:06:50 hmm 10:07:06 I think it could be done, if you have a good use for it 10:10:36 heres a link to starting forth by leo brodie http://home.iae.nl/users/mhx/sf1/sf1.html 10:12:03 * crc returns 10:12:21 erider: I'd add [ ] to the word set as well, so you can interpret during your definitions 10:12:47 crc: retro doesn't specifically support closures does it? 10:12:49 docl: the words are machine code for ngaro, call/jump can skip nop's, but otherwise has no idea 10:12:51 docl: no 10:13:08 hmm 10:13:48 call is always used to jump to an xt value, isn't it? 10:13:57 zachk: http://www.forth.org/tutorials.html many links, info are out of date 10:14:02 [ ] added :) 10:14:15 zachk: no fp or trig functions at this time 10:14:23 docl: yes 10:14:54 docl I am missing anything else? 10:15:15 zachk: crc's return reminds me -- http://forthfreak.net/index.cgi?ForthTutorials 10:15:24 so mathematically speaking how would i rotate an object on the canvas ? 10:15:26 well I forgot the family of cells 10:15:27 erider: add immediate to your list 10:15:35 crc: couldn't it automatically use "jump" if the value isn't zero? 10:15:37 zachk: currently there's nothing defined for that 10:15:53 crc can I get that effect with [ ] 10:16:08 zachk: I've only recently added the canvas words; it's basically a bitmap display with primitives for simple shapes 10:16:15 yea ive seen that 10:16:21 it looks concise 10:16:24 erider: sometimes 10:16:49 erider: some words in retro can *only* be run inside a definition (marked as compile-only with .compiler class) 10:17:00 zachk: would you be able to use bigger numbers during the calculation then divide by a constant? 10:17:18 you mean like fixed point? 10:17:37 I suppose that would be the term 10:17:54 i could, but still not sure how to polar coordinates to cartesian without fp and trig 10:18:16 * docl just now realized what the "floating" referred to in floating point 10:18:46 crc what do you think about the closure question 10:19:07 erider: I've not worked on any sort of closure support at this point 10:20:11 * docl looks up floating point in wikipedia. 10:22:05 crc so closure is something that needs to be implemented? its not a side-effect of something that is built-in to the language currently 10:23:24 closures would add to words hidden variables only accesible through that word 10:23:39 with closures you can roll your own objects quite easily 10:24:07 create/does> is sort of like a closure 10:24:34 but there's no formal closure support 10:25:01 * docl will play with floating point code and see what he can come up with 10:25:04 but I guess we would have to pass xt from the word on the stack manually 10:25:50 crc: vocabs are sort of like closures in their own way. you could actually have them behave like words, by having them execute a main word. 10:26:07 the term "function" connotates more than "word" 10:26:25 even though we have "word classes" 10:27:47 object foo (( .... : bar baz ; )) 10:27:50 foo bar 10:28:22 how would i print the numbers 1 through 10 in retro 10:28:28 in that case foo would open the vocab briefly enough to look up bar, but not leave it open 10:28:56 or 10 through 1 10:29:02 or n through 1 would be fine 10:29:27 : foo 10 fori . nexti ; would be one simple way 10:30:44 fori counts up from 0 though 10:30:53 : foo 10 fori 1+ . nexti ; 10:30:53 : foo 10 for 10 r - . next ; would be another way 10:30:58 true 10:31:05 : foo 10 for 10 r - 1+ . next ; 10:31:50 docl your definition yesterday was like is: : 1; dup if rdrop drop then ; 10:32:24 whats r? the loop variable for the for loop? 10:32:42 erider: true. but note that 1; isn't as useful in as many situations as 0; -- it is a logical correlary to it though. 10:32:45 r = tors, used for the loop index in for loops 10:33:42 zachk: for uses the return stack to store the number that it is decrementing each time the loop is run. as soon as it reaches 0 it ends. 10:34:28 r = pop dup push 10:34:57 or r> dup >r in reva 10:35:20 basically just gets a copy of the tors 10:35:33 tors==top of the return stack im guessing 10:35:48 : foo 10 for 11 r - . next ; 10:35:53 does 1 through 10 10:35:57 zachk: yes 10:37:02 I'd use fori though. : foo 10 fori 1+ . nexti ; 10:37:27 (fori counts upwards, from 0 to index-1, and gives the index on the stack with each cycle) 10:38:04 ok to print a space : space 32 emit ; in retro right? 10:38:14 space is already defined, but yes 10:38:34 it doesnt seem to do anything 10:39:26 the spaces may not be visible 10:39:31 : foo char: a emit space char: b emit ; 10:39:32 foo 10:39:47 is there a way to flush stdout? 10:40:18 the vm should handle that 10:40:36 ok im guessing my spaces are just getting printed at the end of line 10:41:04 zachk: try selecting the text area and see if you can detect a space that way 10:41:23 im on windows vista so thats a negatory 10:41:28 :| 10:41:41 i like to play first person shooters 10:42:02 btw, I started a forum recently if you have questions or ideas to post: forthcommunity.com 10:42:08 so if you wanna game on pc you have to run windows pretty much 10:42:15 it's new, so I'm trying to drum up some activity 10:42:42 have you tried andlinux? it's pretty seamless to install 10:42:51 installs under windows 10:43:14 it's based on colinux 10:43:55 then there's mingw and cygwin, which are still windows but include a more unix like environment 10:45:01 the only thing I didn't like in andlinux was how complicated its networking bridge seemed to be. but then, networking stuff always seems to be that way. :| 10:45:27 there may be a third-party terminal program for Vista, etc., which this could be run under 10:45:44 that's a thought 10:46:10 if you like the command line, you'd want one anyway 10:48:00 docl: do you have an example of tail-recursion 10:48:47 : blarg dup . 1+ pop drop blarg ; 10:48:48 : foo ( n- ) 1- dup . 0; foo ; 10:49:35 docl wont that blow the rstack? 10:49:43 yeah if it gets too high 10:49:53 : foo ( n- ) 1- dup . 0; rdrop foo ; should work 10:51:12 docl how would you define 0; 10:51:14 hmm. both of those seem to have issues. 10:51:58 erider: : 0; dup 0 =if drop rdrop ;then ; 10:52:00 : 0; ( n -- ) dup 0 = if rdrop drop then ; 10:52:30 erider: though 0; is actually an ngaro machine instruction, so it's more efficient to use use it :) 10:53:11 crc I need something defined for more general uses 10:53:13 zachk: the one with rdrop exits regardless of length. the one without exits if you use a high number like 2000. 10:53:35 docl: does it matter the order of the words rdrop and drop 10:54:43 erider: it shouldn't, since there is no return until after they are both executed 10:55:09 hmm 10:58:21 dup and if are idiom they are together most of the time 11:00:12 : ? ` over ` =if ; compile-only 11:01:04 : foo ( n-n ) 0 ? ." zero" else ." nonzero" then ; 11:02:18 that would be the same as using "dup 0 =if" or "0 over =if" 11:02:46 you can create all kinds of custom syntax structures using backtick and compile-only 11:04:35 docl: could you have used [ ] in that definition without have to use compile-only 11:04:56 no 11:05:06 not cleanly anyway 11:05:38 : foo 0 ? [ ' over .word ' =if execute ] ..... ; 11:06:05 so there is no way to accomplish that with my small set of words 11:06:27 he could have used immediate as well as compile-only 11:06:55 erider: if you have the dot-class words and ['] you can use reclass instead of compile-only 11:07:50 actually ['] foo is [ ' foo literal, ] I believe 11:08:00 docl: yes 11:08:13 * erider needs to dig more into immediate or macro forth in reva 11:09:17 crc I haven't found any good docs on the usage for immediate 11:09:27 --- join: Mat2 (~4d177cd9@gateway/web/freenode/x-yhnvmxxqbgisoera) joined #retro 11:09:33 god evening 11:09:36 erider: use immediate when you have a word that needs to be executed at compile-time 11:10:07 words are executed as soon as they are interpreted 11:10:34 immediate uses .macro class to always execute the word, and not compile it if compiler is on 11:11:04 erider: have you readin your book ? 11:11:18 quick example please 11:11:29 erider: docl's ? word 11:11:51 there's a book? 11:12:13 this will only behave properly if called when the compiler is on; calling it during interpret time is a bit pointless as conditionals must be compiled into a target definition 11:12:20 ` over ` =if 11:12:22 expands to: 11:12:26 hi Mat2 11:12:30 Mat2: I get words are executed as soon as they are interpreted but I haven't figured out a practical use or an apply use yet 11:12:33 ['] over .word ['] =if .compiler 11:12:52 hello all together 11:13:08 the classes react to the use of compiler, over gets compiled into target definition, and =if will inline code into target definition 11:13:34 if you invoked docl's ? at the interpreter, it'd act as "over" only 11:13:54 since compile-only words (like =if) are *only* called when the compiler is active 11:15:11 erider: some forths define conditionals as immediate for example, look at crc explanation ^^ 11:17:33 : RECURSE IMMEDIATE 11:17:40 LATEST @ 11:17:55 >CFA , ; 11:18:11 (example from jonesforth) if that helps you 11:18:25 so if you have a definition with immediate tacked on to the end what is being executed? every word in the definition 11:18:30 : RECURSE LATEST @ >CFA , ; IMMEDIATE 11:18:45 would be closer to ANS, since IMMEDIATE isn't IMMEDIATE, except in jonesforth 11:19:23 jonesforth is a bit strange in it's interpretation of ANS 11:19:58 hi crc 11:20:05 hi mat2 11:20:21 * crc is slowly getting the development stuff for iphoneos together 11:20:34 it must be an huge download 11:21:22 3gb 11:21:26 so [ is an immediate word 11:21:29 erider: yes 11:21:49 Mat2: but there's some additional work involved in setting it up to be used without using xcode 11:22:16 it won't let you compile a console app by default, so I'm trying to get the command line parameters, etc worked out 11:22:37 so I can doing something like this : foo [ 3 4 + ] 3 * . ; 11:22:54 not portably 11:23:05 [ 3 4 + literal, ] 11:23:08 or 11:23:14 [ 3 4 + ] literal 11:23:23 if you want the value to be compiled into the definition 11:23:33 so literal pushes the value on the stack 11:23:47 literal compiles a value from the stack into a definition 11:24:11 ah it pulls the value from the stack and compiles the value into the definition 11:24:31 ok 11:24:35 does retro let you use [ ] ? 11:24:37 crc: Is the iPhone OS based upon Mac OS X ? 11:24:51 Mat2: yes 11:24:55 zachk: yes 11:24:57 it is? 11:25:01 yes 11:25:04 iphone OS is base of freebsd 11:25:07 no 11:25:28 sure? 11:25:33 some of the userland of osx is from freebsd, but the os + core libraries are different 11:25:38 * crc is quite sure 11:25:42 it's calles XNU 11:25:59 XNU being a hybrid of Mach and an older BSD-style kernel 11:26:33 so it combines the disadvantages of two worlds ... 11:26:39 sounds like Windows NT 11:26:39 lol 11:26:47 erider: literal compiles the value from the stack, but with a lit instruction so it is placed on the stack when it is executed 11:26:47 Mat2: it's worse in some ways 11:26:55 Mat2: but the userland is *really* nice :) 11:27:13 : foo 10 . ; = 10 : foo literal . ; 11:28:29 = : foo [ 10 ] literal . ; = : foo [ 10 literal, ] . ; 11:29:22 with so many different ways to do things, you really want to think a lot about which way is most readable. 11:30:07 but when you are just learning, it is good in my opinion to try the various different ways just for fun 11:30:54 asking, is there a way I could use this word to do this thing? 11:31:00 I have made the experience that one can wrote very readable code in forth (sadly some advocates have an APL like approach) 11:31:55 part of the fun is finding a new way to do an old thing. even if it doesn't make the cut, you may find the same approach ideal for something different you are doing later 11:32:18 Mat2: what do you think of the retro 10 sources? 11:32:49 there are readable 11:35:01 but can be better commented 11:35:50 you mean the stack comments? or the descriptions? 11:37:02 some stack comments would be nice 11:37:24 but that's my personal preference 11:37:43 there are stack diagrams. crc prefers the short form though 11:38:29 over here ! 1- 0; for here @ * next (pow) 11:39:00 stack comments would be useful for this code (but not necessary) 11:39:25 : pow ( bp-n ) over here ! 1- 0; for here @ * next ; 11:40:05 the ( bp-n ) tells us we are starting with a base and a power, and the result is a number 11:41:06 * docl is reading them from the assembla repo 11:41:17 yeah but one must iterate over the code to understand it, I found such code intuitive understandable with stack comments 11:41:35 for others quite the opposite is true 11:42:01 so it's really a personal preference 11:42:16 how would you prefer to see it commented? 11:42:45 : pow ( base power -- result ) ... ; 11:43:00 something like that? 11:43:03 : fac ( n -- n ) dup 0; dup 1; dup 1 - fac * ; 11:43:19 : pow (bp-n) 11:43:29 over (bpb-n) 11:43:31 ... 11:43:46 hmm that doesn't work the way I want 11:44:03 ups sorry 11:44:41 Mat2: you'd rather see stack diagrams every time the stack is changed? 11:44:48 yes 11:45:25 * crc personally dislikes that style 11:45:48 it can be helpful when you are working on complex code and having a hard time juggling it in your head 11:46:29 but usually I take the comments out and condense it afterwards 11:46:39 true. but it leads to a longer, more verbose source code if you leave them in 11:47:00 or factor into separate words so they are preserved 11:47:14 * crc thinks all exposed words have at least stack comments now 11:48:46 adding your own line-by-line stack comments is a good grokking strategy though, particularly if you are new to forth and the juggling isn't second nature yet 11:50:29 I know an old Fig Forth which decompiled code with automatic generated stack comments 11:51:06 I will try to port the code 11:52:52 * docl wonders if the retro decompiler could be rigged to show stack depth (relative to the starting depth) at various points 11:53:34 every literal would increment it by one... other things would decrement it. the tricky thing would be calls 11:53:35 The interpreter of this forth parses the stack comment for words for that 11:53:51 of words 11:53:57 ahh 11:54:11 this makes them mandatory just like in factor 11:54:13 you could store the stack comment in a doc string 11:54:43 *mat2 have only playes a bit with factor* 11:55:26 better you can use the stack comment for some optimization purpose 11:56:03 automatical convert types etc. 11:56:04 calls to anonymous functions would complicate things. I'm not seeing this happen without major overhauls to retro. 11:57:34 i'm not sure if closures are a good idea 11:57:49 Mat2: why do you say that 11:58:56 what if a closure isn't bount to a word (a function in fp lingo) ? 11:59:04 it#s quite useless 11:59:24 so closures are most bound to function concantentation 11:59:35 Mat2: you could use something like a vocab 12:00:20 yes 12:01:01 i see closures as generic block delimiter for structuration, eg: 12:01:23 [dup *] [0] 1 < if 12:01:58 it seems like an OO language could be made as a sub-language of retro, one which creates functions that are more than just words -- that have their own vocab, essentially. 12:02:56 hmm 12:04:15 --- quit: zachk (Quit: Leaving.) 12:04:43 * erider wonders how lambda was implemented in factor 12:06:05 I think there have written an lambda interpreter 12:06:12 for that 12:06:33 http://factor-language.blogspot.com/2006/08/lambda-calculus-interpreter-in-factor.html 12:07:11 I am not sure if an anonymous word define in a word would be useful 12:07:48 i'm neigher 12:08:42 I guess you could use vector execution to build that type of functionality 12:10:37 *Mat thinks that's a good idea* 12:10:38 what is the most widely use data structure in forth? arrays 12:12:18 and lists and hash tables and .. all higher level data structures 12:13:27 --- join: zachk (~geisthaus@pool-71-240-243-4.syr.east.verizon.net) joined #retro 12:16:22 list are good 12:16:27 what's a good first forth? 12:16:48 pfe 12:16:51 retroforth 12:17:05 first != retroforth 12:17:10 believe me. 12:17:27 sixforty: this comes with a forth http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm#factoring 12:18:08 linux here, erider 12:18:22 pfe is a good forth for beginners because it supports all standards (fig, f79, f83, ans) 12:18:25 then I would go with reva 12:18:34 retro's not intended for beginners 12:18:44 retro was my first forth 12:18:49 docl: true 12:18:54 and I'll help anyone 12:18:56 crc: I gathered :D 12:18:58 well, the first I used much 12:19:00 crc: my second forth system after fig forth for commodore 128 12:19:08 but it's really got a lot of interesting stuff 12:19:21 the first forth I used was thisforth 12:19:37 : .object dup open ' swap shut .word ; 12:19:37 : object create 3 allot ['] .object reclass ; 12:19:37 object foo (( : bar words dup . ; )) 12:19:38 foo bar 12:19:40 sixforty: I would say reva I am really started to like it myself 12:20:15 (interpret-only) 12:20:16 and it has a nice help word built-in 12:20:18 reva is good, but poorly documented 12:20:44 crc you have th source code :) 12:20:44 I've just deleted reva for that reason. 12:21:06 for some one which prefers IDE's, holon and 4th 12:21:06 * erider like reva 12:21:08 for an ANS-ish forth, pforth is pretty nice, and quite portable 12:21:09 retro has good source code documentation :) 12:21:15 quartus would recommend gforth 12:21:55 not a bad choice 12:22:08 I'm allergic to "g"'s 12:22:10 * erider hated gforth and that is why he ran away from forth for a little awhile 12:22:46 erider: what was wrong with gforth ? Its interface ? 12:23:50 http://holonforth.com/ 12:23:52 too many words and needed to know them to read some else code 12:24:05 someone* 12:24:39 sixforty: are you looking for bloated forth or thin forth 12:24:49 erider: that is what attracted me about retro -- you get a single page of words to learn and it's pretty much it 12:24:49 atlast wasn't bad 12:25:04 thin. concepts and just getting a foot in are the idea 12:25:19 there is freeforth 12:25:26 atlast has good docs IIRC 12:25:55 atlast is at last a good idea for beginners too 12:25:57 its pretty thin 12:26:06 freeforth is radically different 12:26:21 brb 12:26:22 beside its purpose as scripting replacement for AutoCAD 12:26:44 when did freeforth become public domain? 12:27:04 docl: reva got me back in the mood to play with forth again 12:27:29 :) 12:27:55 doesn't reva have a big wordset compared to retro though? 12:27:57 docl: plus reva is thin 12:28:13 sixforthy: since 2006 I think 12:28:37 yeah but not to big but I told you I have limited myself to a small set of words 12:29:11 reva has some standard librarys and that's not a bad thing 12:29:16 those words I can carry cross most forths I come across 12:30:19 hmm 12:30:20 * erider was playing with the context ~asm yesterday and wrote inline assembly in reva with asm{ } 12:31:21 * docl is so used to the space parsing aspect of retro that it seems weird when I hit space and nothing happens 12:31:29 (in reva) 12:31:44 docl: that is way I am interested with creating the same behavior with my set of words 12:31:56 cool 12:32:38 the behavior you have mentioned above with retro's built-in features 12:33:09 I want to reproduce that with the small set of words in my tool box 12:33:21 :) 12:33:41 docl: I like that nothing happens when I hit the spacebar ;) 12:34:09 it definitely takes getting used to... but once you do get used to it you feel weird about the opposite :) 12:34:29 I hav eno problems with that 12:34:29 back 12:34:32 wb 12:34:55 incidentally I keep expecting to be able to scroll back in reva because it reminds me of a command prompt 12:34:58 docl: the reason why I don't use retro to test things is because of what you like 12:35:01 *mat found the standard defination for recursive fib a bit strange* 12:36:05 Mat2: how so 12:36:13 erider: I might have been turned off from retro if the space executed things too. it does look a bit strange to see the "ok" sign every time you hit space. also seems weird not to be able to backspace past a space. 12:36:40 erider: two recursive calls where only one is really needed 12:36:42 (*when I first came to forth) 12:37:24 docl: I guess it is forcing you to use an editor ;) 12:37:26 http://en.literateprograms.org/Fibonacci_numbers_(Forth) 12:37:47 true. I use an editor for a lot of the stuff I do in forth these days 12:38:02 not the block editor though :| 12:38:57 reva has a block editor but I have not took it out for a test drive yet 12:39:30 why does retro die when underflow the datastack 12:39:40 when i 12:39:58 if it is something like emacs with elisp that would be neat. You can highlight the code you want to execute 12:40:05 under and overflow errors are fatal 12:40:13 ouch 12:40:14 the vm doesn't have a way to safely recover 12:40:27 erider: I have extended rem to be able to move lines around with x-keys 12:40:36 docl: :fib dup 0 =if 1 swap else 1- fib tuck + then ; 12:41:18 is that iterative or recursive? 12:41:37 recursive 12:41:58 does it use an accumulator? 12:42:36 yes (tos) 12:42:37 no accululator registr 12:42:43 for the link they have a iterative example : fib-iter ( n -- f ) 12:42:44 0 1 rot 0 ?do over + swap loop drop ; 12:42:58 from* 12:43:17 erider: I need a recursive version for benchmarking 12:43:27 oh 12:43:36 iterative versions are too fast 12:44:54 come back later 12:45:11 -> get some work 12:45:16 doesnt too fast to benchmark imply a good thing :-) 12:45:33 docl: rem is retro's block editor 12:45:38 --- quit: Mat2 (Quit: Page closed) 12:45:44 you could just repeat the test like 10000 times and benchmark that 12:46:34 erider: rem is an extended version of the block editor. the block editor itself is called red (retro editor) 12:46:54 erider: rem supports hotkeys and a cursor, is the main difference. 12:47:13 docl or crc what data structure do you use the most 12:47:23 docl: it is like driving vi 12:48:31 erider: yes but we use ijkl instead of hjkl because it is easier to reach the keys 12:48:46 ok : fori dup 1+ . nexti ; 12:48:54 * zachk wasd for the win 12:49:14 er call that thing foo 12:49:17 i just defined 12:49:22 10 foo works 12:49:26 21 foo works 12:49:33 100 foo dies 12:50:12 zachk: fori places a new value on the stack each time 12:50:18 take out the dup and it should work 12:52:49 is there a command like .s in retro to view the stack? 12:53:59 ./retro --with library/debugging/dots.retro 12:54:11 or the windows equivalent 12:54:51 that should work on windows 12:54:54 minus the ./ 12:55:56 would be nice if you could load library files from within retro 12:56:28 where does fori store its counter? 12:56:57 docl: that may come in the future 12:57:14 zachk: on the return stack, I believe 12:57:30 * crc had a brief scare. blood sugar dropped to 45 a short time ago 12:57:42 what did you do? 12:57:42 zachk: on the return stack 12:57:58 I didn't check my sugar level before going out to dig out the car 12:58:06 woah 12:58:31 a bit of physical exercise always brings it down, but this was the lowest I've ever been. Nearing the point at which risk of coma sets in :( 12:58:45 * zachk comforts crc 12:58:49 do you keep sugar on you at all times? 12:58:57 docl: normally 12:59:29 docl: this time I had to look for some though :( 12:59:50 darn, that's dangerous :( 13:00:04 one of the perils of being diabetic 13:00:09 yeah 13:00:47 do you mainline insulin to keep it under control? 13:01:06 I never mainline the insulin 13:01:13 that's extremely dangerous 13:01:31 you take pills? 13:01:39 i thought people with diabetes shot up insulin 13:01:44 or is that the old method? 13:01:46 subcutaneous injections 13:01:49 below the skin 13:01:55 not into the blood vessels directly 13:01:55 oh 13:02:02 I have pills and insulin 13:02:05 and not intramuscular as well 13:02:06 someone needs to come out with a cybernetic sugar and insulin release mechanism 13:02:12 they have one 13:02:21 they implant it in you and gives out insulin 13:02:31 has a port in it where you stick a needle in to refill it 13:02:38 or ive heard of it 13:02:39 I was reading about a study where they were trying out an insulin injector 13:02:45 you can go intramuscular, but the insulin starts acting faster, so it's normally done only when the sugars are really high 13:03:08 so with diabetes your sugar foes extremely low and extremely high? 13:03:14 yes 13:03:15 s/foes/goes/ 13:03:24 I try to keep a range of 80-120 13:03:26 http://www.nytimes.com/2010/02/05/business/05diabetes.html 13:03:30 they told me i was prediabetic a while ago 13:03:42 my sugars wothout meds are in the 400-500 range most of the time 13:04:13 if you keep the range good, the pancreas is less likely to burn out, or so I've heard 13:04:17 * crc can't afford an insulin pump :( 13:04:29 my pancreas doesn't produce anywhere near enough insulin 13:05:46 i was a heavy coffee++cig smoker 13:05:58 the other development would be stem/ips cells. 13:06:32 zachk: I drink tea on occasion and have never smoked or drank alcohol 13:06:39 used to drink about 2 pots of coffee a day at 5 cups a pot. 2 tablespoons of sugar in each cup. so i cut out the sugar and my vision doesnt wig out anymore 13:06:47 ouch 13:06:53 im also down to about half a pack of cigs a day 13:06:57 crc: are you type 1 or type 2? 13:06:58 * crc seldom drinks more than 1 cup of coffee a month 13:07:05 docl: type 2 13:07:22 * docl drinks around 1 pot of coffee... no smoking or alcohol though 13:07:23 docl: since my pancreas produces just enough insulin to prevent ketoacidosis 13:07:45 : factorial 1 swap fori 1+ * nexti ; :-D 13:07:52 just black coffee. I'd hate to see what that much sugar would to to me. 13:11:37 docl: just to the block editor for a test drive. its ok but it crashes a lot 13:11:58 erider: how do you get to the block editor in reva? 13:14:00 reva/reva/examples/block-editor.f 13:16:04 so am i correct in guessing that fori/nexti uses two slots on TORS? 13:16:11 zachk: yes 13:16:35 one for the value being counted down and one for the original 13:18:25 10 2 / . . -> 5 0 wth 13:18:58 only one value is on the stack after / 13:19:05 10 2 / 13:19:08 leaves 5 13:19:16 how do i do remainder or modulo 13:19:16 if you want remainder too, use /mod 13:19:24 or just mod for remainder 13:19:43 oh ok 13:36:23 any reason I shouldn't start with jonesforth? 13:37:41 no, just keep in mind that the descriptions of the implementation won't hold true for other forths :) 13:38:19 right. appreciate the reminder. 13:45:36 sixforty: did you decide on an implementation 13:45:54 docl: did you find the block-editor 13:46:09 LOOKing at jonesforth (obviously, note caps) 13:49:38 sixforty: have you looked at this one http://www.forthfreak.net/index.cgi?MinForth 13:52:46 thanks, erider, but I'm also interested in bootstrapping and internals, and grok asm but not C 13:54:26 --- join: Mat2 (~4d177cd9@gateway/web/freenode/x-upsuqpcqhmuzyajb) joined #retro 13:54:41 hi 14:06:44 sixforthy: do you know lina ? (x86 assembler, indirect threaded forth) 14:07:09 was an inspiration for jonesforth (but is ANS compatible) 14:08:03 good idea, Mat, but I'm not interested in ANS. thanks anyway 14:08:37 then take a look at the predessor: an fig forth 14:09:46 I'm writing all this down to look at if jonesforth doesn't work out, but it looks like it will. Thank you. 14:15:23 --- quit: Mat2 (Ping timeout: 248 seconds) 14:21:11 * crc could probably port red to reva pretty quickly 14:21:51 crc have you looked at the block-editor in reva 14:21:58 erider: only briefly 14:23:44 crc I haven't used red 14:23:54 * crc has used red for years 14:24:15 does it have an evaluator 14:24:33 yes, via "e" or "ea" 14:25:44 does it have a help 14:26:02 there are notes in the source 14:26:04 and a wiki page 14:26:17 http://retroforth.org/pages/?TheEditor 14:27:48 crc I guess I am going to give the block editor a try to get a feel how to use it 14:28:25 --- join: virl (~virl__@chello062178085149.1.12.vie.surfer.at) joined #retro 14:29:03 crc do you do any embedded systems? 14:30:15 not at this time 14:30:27 I've dabbled with PIC stuff a bit in the past 14:41:59 erider: http://gist.github.com/297738 14:42:05 red, quickly ported to reva 14:42:18 may have some bugs still, but I did a few tests 14:43:42 crc thanks got it 14:44:21 crc is the wiki complete? 14:44:28 or are you still working on ti 14:44:33 it* 14:46:13 a wiki is never complete 14:46:14 :) 14:46:50 theoretically, a wiki can be complete, but then there's no longer a point to its being a wiki 14:48:17 crc I mean the tutorial is like 3 lines :) 14:49:11 crc can you pick with line in the block gets evaluated 14:49:46 nevermind 14:49:49 I got it 14:50:00 the current version doesn't have el 14:50:07 since I stopped using it 14:50:27 I used e hello and that seemed to work 14:51:07 can you save to a file 14:51:43 I didn't write words for that 14:51:49 I just ported the editor itself 14:52:08 erider: in retro, the blocks live in the image file 14:52:16 that is cool I think I am going to use this 14:52:18 reva would need additional words 14:52:25 * crc will see what he can come up with 14:55:50 sixforty: so you are satisfied with joneforth 14:56:48 --- join: Mat2 (~4d177cd9@gateway/web/freenode/x-jivxgwvfexywcesv) joined #retro 14:57:46 erider: so far, yes; but I've been doing things other than computer since my last posting 14:58:34 I wouldn't want to actually *use* it, but it seems tailored to exactly what I want to learn. 15:00:13 after completing "the course" and playing a little, I should be ready to select a forth to use. 15:00:37 sixforty: what course are you talking about 15:01:51 erider: http://gist.github.com/297738 - now with "save-blocks" and "load-blocks" 15:01:59 erider: and uses the console library to clear the screen 15:02:04 the source code for jonesforth is mostly a tutorial on writing a forth. That's what I call, with tongue in cheek, "the course". 15:02:24 sixforty: do you plan to use forth for written device drivers or just trivial utilities 15:03:16 a device driver is a trivial utility, unless it's for VIA, then it requires a giant search and rescue team 15:03:30 but, yes, device drivers especially 15:03:50 also complex device emulations. 15:04:24 interesting 15:04:49 all of which is way above me, but not for long 15:05:09 crc the name of the file is reva.blocks 15:06:13 yes 15:07:19 what is the ? 15:07:28 is that an error 15:08:32 crc ok> e hi 15:08:34 ? 15:08:36 hello world 15:09:01 go sleep, ciao all together 15:09:42 --- quit: Mat2 (Quit: Page closed) 15:14:26 --- quit: SimonRC (Ping timeout: 246 seconds) 15:15:03 erider: I don't get a ? 15:16:12 hey crc I put this ">r offset @ #-blocks @ 512 * r@ " in a word 15:16:48 that sequence isn't balanced 15:16:49 well I defined it as it's own word 15:17:00 you need r> somewhere to pull the value off the return stack 15:17:30 I keep getting "ERROR: could not load color_set" 15:18:08 it happens when I load the block-editor.f file as well as when I paste in the copy of red 15:18:10 docl: disable the 'needs console' and remove 'cls' from (v) 15:18:20 there may be issues with reva's console library 15:19:01 works 15:19:27 brb 15:19:39 I don't like it much because it removes the up-arrow feature 15:19:46 I'm using the development version, 9.0.9 15:23:06 bbiab 15:23:12 --- quit: sixforty (Quit: Leaving.) 15:24:38 --- join: SimonRC (~sc@fof.durge.org) joined #retro 15:37:05 --- join: sixforty (~sixforty@pdpc/supporter/active/sixforty) joined #retro 15:48:31 sixforty: www.mpeltd.demon.co.uk/arena/ProgramForth.pdf 16:11:10 --- quit: zachk (Quit: Leaving.) 16:21:48 back 16:27:20 crc do you have to make some custom tweaks to run in MAT2 vim 16:46:00 docl: hey did you remove console for red in reva 16:48:29 erider: retro doesn't run on mat's vn 16:48:31 *vm 16:48:47 crc here is ] is a very interesting way to build a word 16:48:53 erider: his vm is a completely different design from ngaro, it'll take a lot of porting and rewriting 16:49:23 so the retro is going to have to be rewritten 16:49:34 a retro will likely run on it eventually 16:50:00 * crc has no plans to drop ngaro anytime soon 16:50:10 this is very cool here is (v) ] cls vb .block ; 16:51:12 crc I removed console and add os/shell and add the word : cls " cls" shell ; 16:51:20 erider: yeah it worked when I commented the console stuff out 16:52:37 crc you are just get cls for the console lib right 16:52:46 yes 16:53:15 then I will stay with os/shell 16:59:53 crc what is the case to spur you to use that form of "here" to define a word 17:00:10 avoids :noname 17:00:17 and binds the name early 17:01:06 I like it a lot if is very clean but not sure when I would need to do something like that 17:04:48 only useful when dealing with defer'd words or stubs 17:05:17 crc but when would you defer a word 17:06:11 when you need to use it before it's defined properly 17:06:35 e.g., I use "v" throughout the editor, but don't actually define it until after the other words are defined 17:06:44 mostly to organize the source, in this case 17:06:49 same with "ia" 17:06:59 top-down 17:07:26 (I have internal factors (v) and (ia) to allow v and ia to be replaced and restored later, if this is desired) 18:51:37 anyone running aim? 18:52:16 I need to see if I have it set up correctly. 18:53:55 I've not used aim in years... 18:54:20 do you use a common personal messenger? 18:54:27 will see if I can remember my account info... 18:54:29 * sixforty is way behind the times 18:54:47 don't knock yerself out, ain't that important 18:54:48 google talk 18:54:54 aim username: crc1wheel 18:55:01 I'm logged in 18:55:14 --- nick: sixforty -> roarde 18:57:06 ok, show you as logged in, just trying to figure out how to send a message using pidgin 18:57:57 --- nick: roarde -> sixforty 18:58:53 you figure google talk is the most common now? 18:59:07 I don't know 18:59:11 k 18:59:26 my coworkers all use it, so it's handy for inter-office discussion 19:01:41 --- nick: sixforty -> roarde 19:01:55 --- nick: roarde -> sixforty 19:03:56 sixforty: I hop that pdf helps out 19:04:58 erider: more info than I can use right now, but thanks 19:05:19 its pretty complete as a book 19:05:37 took a quick look, stored the url; probably get to it later 19:05:57 (now if I can remember where I put it . . .) 19:06:14 crc hey did Quartus` make a forth for win mobile 6 19:06:41 erider: last time I talked with him, he had no intention of doing a forth for windows mobile 19:07:41 and with wm7 coming this year, I'm not sure how much life is left in wm6 19:08:37 crc does he still maintain the palm OS version 19:09:03 what maintenance does it need? the classic palm os is dead. 19:12:54 brb 19:13:07 --- quit: sixforty (Quit: Leaving.) 19:15:10 --- join: sixforty (~sixforty@pdpc/supporter/active/sixforty) joined #retro 19:15:46 erider: no new forum posts about quartus since 2008; so I'd say it's pretty dead these days 19:19:27 ok crc 19:19:32 thanks 19:19:56 I guess I could get reva on my iphone 19:20:06 reva won't work on the iphone 19:20:17 no 19:20:17 iphone = arm cpu, which reva won't support 19:20:34 same issue then 19:20:37 retro can be run, if you have a jailbroken iphone or ipod touch 19:20:47 and a terminal app 19:22:21 I have a jb iphone 19:22:31 hey have you seen dsforth 19:27:40 only briefly 19:28:25 crc that one should work right 19:28:36 dsforth may work for wm 19:28:50 but it's shareware, with a $99 registration IIRC 19:29:17 really 19:29:26 I guess I need to keep looking 19:36:26 if your wm6 device supports J2ME/MIDP, Retro would run 19:39:45 maybe 19:56:25 crc there is a dsforth free 19:56:39 * crc no longer has a windows mobile device 20:14:10 * crc finally got the dev tools working :) 20:14:19 http://retroforth.org/retro-iphoneos and http://retroforth.org/retroImage 20:15:50 crc I should be able to wget that stuff right 20:15:54 yes 20:16:08 wget them, chmod +x the retro-iphoneos binary, and it should work 20:17:29 cool talk to you later 20:19:02 http://retroforth.org/pages/?BuildForiPhone for future reference 20:21:50 --- quit: erider (Ping timeout: 245 seconds) 20:47:31 for mat2: apple iphoneos 1st-gen ipod touch: 6m42s on the benchmark (avm, ttc) 20:50:28 running with fast-console retro (with -nop ignore patch) now 21:05:51 fast-console: 14m4.773s 21:07:02 --- quit: probonono (Ping timeout: 240 seconds) 23:07:18 --- quit: docl (Ping timeout: 265 seconds) 23:42:40 --- quit: sixforty (Quit: Leaving.) 23:59:59 --- log: ended retro/10.02.07