00:00:00 --- log: started retro/12.10.02 00:15:54 --- quit: kumul (Quit: WeeChat 0.3.8) 00:39:50 okay, well this is what i came up with: 00:39:51 http://bazaar.launchpad.net/~tangentstorm/retro-language/multiuser/revision/367#library/multiuser.rx 00:40:05 * tangentstorm is off to sleep. 06:54:01 tangentstorm: for a link to the log discussion, use http://rx-core.org/dev/rancid/log/12.10.01 07:30:25 I'm wondering if the implementation would be different if the dictionary gets replaced by a struct array like parable's. 07:57:35 the cost of switching might not be too big of a deal though. player dicts could be struct arrays or chains. 07:58:19 the find mechanism could take a link when it sees one, otherwise some field in the struct is usually zero 11:27:28 morning 11:54:48 hi tangentstorm 11:54:57 mid afternoon here (3pm) 13:20:21 hi all 13:22:47 howdy (late lunch, 1pm here) 13:23:08 hey docl 13:24:25 hi erider 13:26:33 docl: whats new 13:27:28 tangentstorm and me have been laying groundwork for a mud or other shared environment 13:27:59 * erider is not familiar with mud 13:28:26 multiuser dungeon (basically a text game with builtin chat) 13:28:39 cool 13:28:51 * erider is a fan of minecraft 13:30:37 docl: what is the server ip 13:31:35 haven't set one up yet. I think tangentstorm plans to host it. 13:31:47 ah ok 13:48:17 docl: do you know how to use the assembler.rx 13:52:38 ./retro --with examples/languages/assembler.rx 13:52:58 yeah I got that part lol 13:53:15 :) 13:53:39 I want to know how to use it to create programs that will run on top of ngaro 13:54:27 I'll have to play around with it after work. looks like fun. 13:57:56 does crc have some specs on the imagefile data? like header format etc... 13:58:46 I guess with that we could use some other language to create an image for ngaro 14:02:42 the imagefile is just a string of ngaro code I think. 14:03:13 doc/The_Ngaro_Virtual_Machine.rst describes how those work 14:03:31 as to what is contained you might read the kernel.rx and documentation on that 14:03:41 there is suppose to be an output file to this right ./retro --image retroImage --with bf_examples/hello.bf 14:04:09 ya I have been poking around 14:04:51 yeah it will alter retroImage if you type save or if that's part of the code that runs. 14:06:16 nop I have to kill the pid to get out of retro :( 14:07:41 that happens sometimes. did you lose the dictionary? 14:07:55 maybe 14:08:01 sometimes you can use the safety function %% to get back the global dict 14:08:18 * erider needs to find a workaround 14:08:53 seeya later 14:10:16 ok 15:16:47 --- join: kumul (~kumul@adsl-72-50-90-224.prtc.net) joined #retro 15:37:36 erider: and image should start with a jump to the main entry point 15:37:42 *an not and 15:37:49 apart from that, anything goes 15:38:14 I am trying to figure it out 15:38:15 the image is just a flat memory dump, nothing special in terms of headers and such 16:00:44 crc: just trying to figure out how to create an image that will run on top of ngaro 16:17:00 erider: assembler.toka will work, but at the cost of needing to implement all the support stuff you need from scratch 16:19:13 --- join: djohe (~djohe@178.249.150.87) joined #retro 16:19:14 e.g., include examples/languages/assembler.rx :main lit, 1 m, lit, 2 m, +, saveImage endApp 16:19:34 that should create an "appImage" that adds 1+2 16:19:34 --- part: djohe left #retro 16:20:05 you can't see what happens, unless you have a vm that dumps each execution step, since there's no standard library for assembly programs 16:21:20 (just tsted, and this does work) 16:27:31 where does the appImage save to? 16:27:37 pwd? 16:27:45 ttthe current working directory 16:27:46 yes 16:27:59 hmm, odd keyboard issues tday 16:28:04 ok I will give it another whirl 16:34:16 * erider just noticed that he you probably name retro -> ngaro 16:35:49 the executable gets named retro[.ext] to avoid confusions 16:36:12 crc: you should be able to use the appImage with ngaro --image appImage 16:36:40 or --with 16:36:49 nah it --image nevermind 16:37:16 --with is for source files, --image for images 16:38:21 yes 17:33:37 erider : i created an image by hand for the javascript version. On that one, retroImage.js just defines a plain old javascript array and you can type it by hand 17:34:41 https://raw.github.com/sabren/b4/master/ref/one-red-pixel-ngaro.org 17:35:03 < log of what i did, or at least what i remembered to jot down :) > 17:43:16 crc : thanks for the irc log link... i'm looking at rancid... is this running as cgi? node.js? 17:47:41 docl : wasn't really thinking about hosting a mud, but if we get it working, I wouldn't mind. I am definitely interested in making some better tools for pair programming over the net, though 18:01:12 tangentstorm: hi 18:06:06 hello! :) 18:12:23 mud mania :) 18:13:55 hopefully. it's just an idea right now. we've still got to translate it to code and see if it works :) 18:25:20 yeah I think it will be good 18:35:44 --- quit: kumul (Quit: WeeChat 0.3.8) 18:56:34 ok I'm home 18:56:42 wb 18:58:10 pair programming is a good goal too 18:59:20 i kind of think that if this works, we'll be able to use it for any kind of concurrency 18:59:48 yeah 19:00:11 so. message passing. that's just strings, right? normally? 19:00:32 we could pass actual forth words too, but there could be messy addressing stuff 19:00:33 could be anything 19:00:57 unless you want to pass pointers to words in a block that's frozen in time 19:01:56 well, strings seem like a good test case. easy to visualize. 19:02:00 passing pointers around gets you back into issues with threads and locking 19:02:25 yeah 19:02:34 i'm with you on passing strings around 19:03:21 that way we're not even tied down to one vm :) 19:04:23 i've been thinking for a while on a protocol for passing structured data around, though, to make parsing the messages easier 19:04:48 have you looked at struct.rx in the library? 19:04:51 it's mostly just about using those first 32 ASCII characters 19:05:09 yeah i was looking at it and the object one from fiction.rx 19:05:40 i've been sitting here re-reading the docs again 19:07:10 I believe the object is primarily dependent on struct' 19:07:52 it might actually be just a struct.. like a "game object" rather than an "oop object" 19:09:46 yep. it's just a particular struct with a bunch of fields for rooms 19:10:15 and descriptions and whatnot 19:12:10 docl : i noticed the compiler generates two return instructions... is that so you can append something to the end of the function the way you can to the beginning with the revectoring? 19:12:55 not sure 19:13:41 even if that's not what it's for, you could use it that way :) 19:14:18 you mean the noops after the ;? 19:14:35 those start the next word 19:15:02 or are you talking about the return stack? 19:15:15 no i was looking at the kernel.rx i think... it was a ;; or something.. it just put two return instructions 19:15:52 ;; compiles in an exit without exiting the compiler 19:16:12 yeah like line 54 defines t-; which does ;; ;; 19:16:24 hmm *checks* 19:16:38 ;; just writes instruction 9... prabably return? 19:17:28 interesting 19:17:30 yeah 19:17:47 I would think it would only have 1 ;; 19:18:52 the notes say you can save space by removing that, so i was thinking it's probably a hook for other dynamic stuff 19:19:37 yeah could be 19:19:52 makes sense 19:20:17 but I'm not sure why it's ;; ;; instead of noop followed by ;; 19:20:43 because the noop wastes an instruction, probably. :) 19:20:45 no wait, that should compile in 2 exits 19:20:49 yeah 19:20:50 hmm 19:21:03 but in the final it doesn't 19:21:13 and if you want to add a "debugger hook" or something, you overwrite the first exit 19:21:23 and after your hook finishes, the second one fires 19:22:39 well no wait you're right it puts in 2 exits. must be like you say. 19:25:29 two exits mark the end of a function (for autopsy to be able to find the end) 19:25:57 aha 19:27:13 ooh 19:27:20 now I remember 20:04:02 tangentstorm: here is a way to create words that are private to a person. https://gist.github.com/3824704 20:08:45 i'm intrigued... only understand about 45% of it though. 20:09:11 i see you're making a struct, but i don't see you using it... shouldn't there be a "user luke" in there somewhere? 20:09:40 or is clone: luke making a new user called luke? 20:10:02 yep 20:10:10 user is a struct I leave empty 20:10:36 could have values put in it to serve as defaults 20:11:19 i think your clone: does what the word "user" would do 20:11:57 like... in the struct.rx docs, it shows: employee Fred 20:12:53 i don't understand the struct code yet though.. i'm just looking at the docs 20:12:55 oh, wait. why did I never call user before clone? that's weird. 20:13:14 "clone" is making a new structure but doesn't define a name for it 20:13:49 that's a poor name choice ;) most languages would call that 'new', and 'clone' would be something that actually copied a record 20:13:54 er struct instance 20:14:37 so ... i *think* you can just say "user luke" and ditch the clone: word... not 100% , but that's how i'm reading it 20:14:44 hmm. well it does do that. it's supposed to. 20:16:00 : clone (a-a ) here swap size allot ; 20:16:52 that looks like it's just making an empty structure... not copying any data... :/ 20:17:08 size is on the previous line: 20:17:17 : size ( a-n ) 1+ @ ; 20:18:15 so... i think that means the struct itself has a number saying its size at the cell after it starts 20:18:27 there seems to be a bug in clone. when I do "getToken header" it's supposed to make a new header based on what I input 20:18:45 which it apparently does but only when there's nothing on the stack, for some reason 20:18:58 no, i'm talking about "clone" without the colon... from struct.rx... sorry 20:19:47 i think that should be called "new" and i think what you're doing with your "clone:" duplicates what happens when you just use the word 'user' 20:19:48 oh, there's no copy in that? I didn't realize that. 20:20:14 yeah, it's not cloning anything, except maybe the structure... it's just allocating memory 20:20:22 yeah just the structure 20:20:49 but the hidden "new" ... i *think* that's making a new word that does what your clone: does 20:21:25 it's making field words I think 20:21:54 * tangentstorm wishes he had a visual debugger :) 20:23:26 ooh now I see. "user" is a parsing word 20:23:47 because of &.word reclass ? 20:23:58 on line 2 of struct.rx ? 20:24:26 no.. because of the &.word reclass in the definition of "}"! 20:24:48 * tangentstorm is starting to be able to read this stuff :D 20:24:55 * docl updates the gist 20:25:15 it now does something a bit different. you will need to kill retro externally ;) 20:25:46 i haven't run it yet :( 20:26:08 just in my brain.. trying new version :) 20:26:26 * docl fixes it to be less hazardous 20:28:59 is ;parse saying parse until it sees a ';' ? 20:29:41 * tangentstorm logs into the pair account 20:30:31 yep 20:30:54 urgh.. my server seems to be down 20:34:15 okay, well the data center will probably work that out in a few minutes... if not i'll probably have to go freak out :D 20:34:51 you just put the .s's in there for debugging, right? 20:35:16 yep 20:35:42 I updated it so that both personal words are exposed 20:42:32 what are the two lines at the bottom doing? 20:43:30 one sets luke.personal = 0 and the next sets it to last... 20:44:47 it's tricky 20:44:58 one sets myfoo link to 0 20:45:10 so it doesn't see all those other words on the dictionary 20:45:34 the other sets last to the mybye link 20:47:12 @@.personal is all one token... but it "expands" to : .personal @ @ right? 20:48:05 yeah 20:48:21 so i have the address of luke, then .personal replaces that with the address of the personal field for luke 20:48:49 the first thing at that address is the link to prev, and that shows up on the stack after @ ... same with next @ 20:48:59 hmm. @@ doesn't seem functional. nesting of prefixes must not be implemented. 20:49:33 change it to @personal @ or personal @ @ 20:49:34 so now it's : 0 a on the stack and the ! cuts the chain 20:49:53 yep 20:50:26 what are the {{ }} doing? 20:51:01 i know they define a new vocabulary... but what does that actually mean? 20:51:48 there's no --reveal-- , so all of that's hidden, right? 20:52:55 yeah {{ saves @last whereas }} stores it back again 20:53:23 so anything created in the mean time gets lost unless you save it. 20:54:30 which is what your lines 12 and 13 do 20:54:39 and also what chain: / ;chain does 20:54:45 yeah 20:57:33 neat :) 20:58:19 * docl updated with a clone-copy 20:58:31 as always, .s is just for debugging ;) 21:05:15 what you've implemented here is basically the same as how method lookup works on javascript objects 21:05:58 prototype based inheritance... except there's no chain... it just ends with myfoo 21:07:16 hrm, no it isn't... that's more like what with/without do.. the chains of chains. nm. 21:13:41 so when a user logs in, we basically want to run {{ ( users[ i ] .vocab ) !last ( handle their command ) }} 21:13:48 or i mean when we switch to that user 21:14:22 note that with chains you can set them as the only visible thing. for example if you type strings' you can only see stuff in that vocab until you type the safety function %% which reattaches things. 21:14:43 * tangentstorm rushes to try that 21:15:37 strings' words -> words ? ... :( 21:16:24 words is in the main dictionary 21:16:33 %% will restore that for you. 21:16:59 we don't want luke and cloney to have a %% then 21:16:59 try: "hello" 'e strings' splitAtChar %% puts puts 21:17:34 we can take that out 21:18:05 there's a word for getting the last thing in a list. we can use that and then do 0 ! on it. 21:18:17 then you are locked out of the main dict forever 21:18:23 just like with my example 21:21:00 i really like this 21:21:26 something like : first repeat @ dup 0; drop again ; 21:22:35 :) 21:22:49 0; is the exit if zero instruction? 21:22:55 yeah 21:23:17 it drops the result which we don't want to lose hence the dup ... drop 21:23:38 hmm. no wait 21:23:41 that's wrong 21:24:22 : first repeat dup @ 0; drop @ again ; 21:24:36 because you need to look ahead to see if to exit or not 21:25:34 * tangentstorm sees how to do pattern matching in forth :) 21:25:40 of course, nowadays there are ways to do loops with quotes. I'm used to the repeat ... again stuff. 21:27:52 a quote is basically just a colon defnition without a header. ? 21:28:17 yeah 21:28:38 how does it cope with nesting? [ a [ b ] c ] 21:28:52 the text of [ b ] ought to be pushed on a stack somewhere 21:29:23 you leave a space for it... buffer it.. compile c; finish the definition, and then compile b 21:29:34 or [ b ] i mean 21:29:55 * docl is looking it up in kernel.rx 21:29:59 and then you write the address of [ b ] in that space you saved 21:30:23 or does [ b ] get compiled at runtime, dynamically? 21:32:56 I think it gets compiled as you type it 21:37:48 t: quote ( -a ) pop, 1+, dup, @, 1-, push, 1+, ; 21:37:48 t: [ ( -af ) ' quote # , here 0 # , compiler # @, compiler # on ; 21:37:48 t: ] ( fa- ) ;; compiler # !, here over !, compiler # @, 0 # =if 1+, ; then drop, ; 21:38:42 [ returns an address and a flag 21:39:07 the flag is the compiler state before it turns it on 21:41:01 cryptic 21:41:36 ... 21:41:48 pop +1 dup @ 1- push +1 .... incrementing the instruction pointer and returning what it was pointing at maybe 21:42:10 i was thinking each one had to be compiled separately because they would overwrite each other 21:42:26 i think they're just compiled in place, nested. 21:42:37 yes, I think so too 21:43:51 the ' quote # , part mystifies me, but the rest of [ makes sense. here 0 , is like an anonymous initialized variable 21:43:59 i'm expecting to see something to make the runtime instruction pointer jump over the compiled quotation 21:44:14 then you need to know at what point to turn the compiler off later and make sure it is turned on 21:46:16 it's compiling the instructions: pop 1+ dup @ 1- push 1+ 21:47:08 oh, yeah there's a ' there. so the address of that word is compiled in. 21:47:24 which word? 21:47:26 so it is later gonna look in that "here" area 21:47:29 quote 21:48:16 then it subtracts 1 from whatever was in that area and pushes it to the return stack instead of what was there before 21:49:29 then adds 1 (again) to the value it had popped off and leaves it on the stack. 21:52:54 ( -af ) means the flag is on top 21:53:08 ( fa- ) ... does that also mean the flag is on top, going in? 21:53:26 i would expect the comment for ] to be ( af- ) 21:53:46 am i thinking backwards or just missing something? 21:54:41 i see compiler # ! is writing the flag.. so the flag must still be on top. 21:54:48 yeah I am not sure if the stack diagram is correct there 21:54:50 so... is the comment backwards or me? 21:54:57 I think it's the comment 21:55:00 yay! 21:57:33 i don't think the word quote is what's getting quoted 21:58:05 but i can't find where ' is defined 21:59:17 ' is like & but in non prefix form 21:59:28 it grabs the xt for the word 21:59:54 where is it? 22:00:07 er where is it defined? 22:00:19 find drop @d->xt 22:00:33 probably t-' or something in the kernel 22:01:37 ah line 219 22:02:29 it parses ahead and if find is not zero it gets from d->xt using the header returned by find 22:02:55 otherwise it just returns 0 22:03:37 okay... so it's a lisp-style quote then 22:03:54 think so 22:04:08 why does it appear in userspace as ' and not t-' ? 22:05:02 later on there's a line with ' t-' word: ' 22:06:10 I'm guessing word: makes a new header by parsing ahead and then links it to the xt from the stack. 22:07:01 and also sets the header to have a link in the class offset to .word 22:07:13 not convinced. :) 22:07:33 i think it copies the definition of the word 22:07:46 from the compiler's image to the new image being built in ram 22:08:37 it's part of the metacompiler... it's just : word: ( a"- ) @'WORD entry ; 22:08:58 and 'WORD is just a variable defined at the top 22:09:19 : entry ( a"- ) t-here @link m, !link m, m, getToken $, ; 22:09:21 hrm 22:09:45 that sounds more like what you were saying that what i was saying :) 22:11:17 :) 22:13:01 pretty sure the t-whatevers are actually creating the words in the new image. they just need to be renamed to nicer names and given classes to handle their behavior so you don't need all the weird # , and so forth 22:15:04 completely off topic: 22:15:58 it used to be that if you pounded on your keyboard too quickly on a PC, the PC speaker would beep at you 22:16:24 probably you can still make that happen today... 22:17:02 that's not coming from the operating system... it's being triggered by the keyboard interrupt handler in the bios 22:17:53 which means that there must be an area of ram reserved for the keyboard input buffer 22:18:06 like tib here 22:18:23 seems like it 22:18:56 except tib is maintained by ... well... the top level loop basically. 22:19:38 seems kind of inefficient. 22:19:43 it's got to be continously polling for keyboard input 22:20:10 and that's what's making it so power hungry on a phone 22:21:58 yeah 22:22:32 whereas if we just let the host machine's own interrupt handlers trikle down to ngaro, then we could fire an interrupt to populate the input buffer and there would be no need for polling 22:23:34 the way BIOS works on a PC is a bit like revectoring in retro 22:23:49 there's just a table of addresses somewhere early in ram 22:24:16 so like in retro you compile a bunch of no-op functions... 22:24:26 and then go back and revector them on demand 22:24:54 * docl needs to go to bed 22:24:59 so when you hook up a printer or whatever... you can claim one of the irq (interrupt request) things... and put your own driver on that port. 22:25:01 interesting 22:26:23 my brain's telling me this is somehow related to what i'm seeing in how the metacompiler works... not seeing the connection yet :) 22:26:41 i won't keep you up by rambling about it though... thanks for explaining all this stuff to me :) 22:27:45 sure thing :) 22:28:20 * docl designed a lot of the struct/object kinds of stuff, nice to have someone interested in it. 22:29:07 i'm definitely going to use it soon, when i start building a pascal compiler on top of it :) 23:59:59 --- log: ended retro/12.10.02