00:00:00 --- log: started retro/13.01.06 06:48:53 --- join: impomatic (~digital_w@46.208.50.63) joined #retro 07:39:52 --- join: ncv (~quassel@89.35.216.197) joined #retro 07:39:52 --- quit: ncv (Changing host) 07:39:52 --- join: ncv (~quassel@unaffiliated/neceve) joined #retro 10:47:35 --- join: nal (~nal@173.215.251.14) joined #retro 10:48:13 --- nick: nal -> Kumul 11:35:30 --- quit: impomatic (Quit: http://ukcaves.com) 12:12:53 --- quit: Kumul (Quit: Leaving) 12:19:36 --- join: impomatic (~digital_w@46.208.50.63) joined #retro 13:48:59 --- part: impomatic left #retro 15:10:16 --- join: kumul (~kumul@173.215.251.14) joined #retro 16:27:38 --- quit: ncv (Remote host closed the connection) 16:56:21 --- quit: kumul (Quit: Leaving) 17:07:13 --- join: kumul (~kumul@173.215.251.14) joined #retro 18:36:35 --- nick: tangentstorm -> tangentwork 18:48:11 --- join: haskill (~haskill@c-24-127-78-71.hsd1.va.comcast.net) joined #retro 18:48:31 --- nick: haskill -> blockhead 18:49:18 --- quit: blockhead (Changing host) 18:49:18 --- join: blockhead (~haskill@unaffiliated/blockhead) joined #retro 18:52:43 anyone on? 19:02:24 whats up? 19:05:08 blockhead: hey 19:05:08 hi 19:05:30 what brings you to #retro ? :) 19:05:35 well, I was checking out retroforth 19:05:55 and found myself distracted from retroforth into the underlying ngaro VM 19:06:05 oh no! :D 19:06:07 so I've been playing with ngaro 19:06:28 that happens a lot it seems :) 19:06:30 compiled just the emulator. made a crude assembler. 19:06:42 heh :) 19:07:37 so have been making the simplist of images and running them. you know: figure out how to print character, get that working. etc. 19:07:48 yep :) 19:08:02 you might take a look a test/ngaro/ngarotest.py 19:08:08 it has a simple example for each opcode 19:08:25 my actual question is ... is it possible to read from the keyboard without using a wait 19:13:11 oh 19:13:16 yes 19:13:16 heh :) 19:13:26 wait is obsolete 19:13:37 oh, it is? 19:13:47 at least, for all the implementations i've tested it's obsolete 19:13:58 this needs an update, then? http://retroforth.org/docs/The_Ngaro_Virtual_Machine.html 19:14:32 http://code.google.com/p/retro-language/source/browse/test/ngaro/ngarotest.py#411 19:14:42 that's why they're tested together. 19:14:52 there are multiple versions of the vm 19:15:02 oh 19:15:15 they're all meant to work the same 19:15:43 there are versions in c, python, javascript, pascal, go, etc... 19:16:03 i used the .c version 19:16:29 i know that for c, python, js, and pascal, IN and OUT are each sufficient to trigger the io loop, and WAIT is un-necessary 19:16:53 you still have to write a 0 to port 0 to trigger the io loop 19:17:28 crc's the maintainer of the project, but random people have contributed the various vms 19:17:59 one of my goals has been to get them all running under these tests so we know they conform to the spec 19:18:06 before attempting to change the spec :) 19:18:48 hmm. i had assumed they all were identical. so I'd hoped that compiling just the c version would result in a "reference" implementation ... 19:18:50 right now only c, pas, js, and py have test harness support though 19:18:56 yeah 19:19:09 but i'm saying c still supports the wait opcode even though it isn't actually really used 19:19:11 that I could then use to trial & error my own machine code :o 19:19:31 the c version is definitely the reference implementation 19:19:42 oh, whew. so I'm ok then :) 19:19:59 yeah 19:20:44 well actually i don't know that 100% but it's the one I use for reference :) 19:20:49 heh :) 19:21:12 it would suck if I built up a whole image that only ran on the .c ngaro :o 19:21:58 no, they're *probably* all compatible 19:22:08 :p 19:22:31 the go version has some extra support for multi-tasking and the pascal version has an extra opcode to trigger a debugger 19:22:58 but the retro images leave a block of zeros up at the front so there's room to add custom opcodes like that without screwing things up 19:24:37 they're *probably* all compatible (at least under vm/complete), but they're not all tested 19:24:40 i write 30 zeros at the front, but that's just to make sure any subroutines I write are above 30, so they can be called 19:24:44 understood 19:24:50 yep 19:25:30 retroImage starts with a jump instruction in the first cell, then the address of the startup procedure in the next cell 19:26:06 then it stores some of the more common variables in the other early cells 19:26:08 that would probbaly be faster than having it read 30 NOPs :p 19:26:44 most of the implementations fast forward through NOPS so it's not that big a deal, but yeah 19:34:28 ahhhhh, I see now. I took the "wait" out. ran it. it didn't wait. nice 19:34:35 i feel silly :) 19:39:48 hmm 19:39:57 i could be wrong 19:40:19 it might be that it's required at the moment, but there's no logical reason for it to be required 19:40:25 * tangentwork looks at the code 19:40:45 trail & error ... lit 1 lit 1 out lit 0 lit 0 out 19:40:53 returns 1 if no key was hit 19:41:01 otherwise, returns the key that was hit 19:41:07 http://code.google.com/p/retro-language/source/browse/vm/complete/retro.c#602 19:41:18 yeah, sorry. i was mis-remembering earlier 19:41:27 WAIT is what actually triggers the IO loop 19:42:11 but there's no particular reason it has to be that way. Both the write to port 0 and the WAIT are un-necessary. 19:42:21 usually, wait is simpler/easier. but I could imagine a situation where I would want to check for keyboard input without stopping other calculations 19:43:00 not possible yet 19:43:09 oh 19:43:17 except in the go version 19:43:18 seems I just did it though? 19:43:34 all you did was write a value to a port :) 19:44:00 well, I tested it by writing the image and then runnugn the image 19:44:25 I made a loop that checked the keyboard and if a value of 1 was rturned, loop around again 19:44:43 essentially a repeat-until-key-actually-hit 19:44:50 and what happened? 19:44:54 and it appeared to work (it stopped when I hit a key) 19:45:19 or rather, it exited the loop when I hit a key 19:45:41 but you didn't call wait? 19:46:18 not for the input. the "you pressed: " and bits after the loop called wait for their output 19:46:25 :) 19:46:39 okay so you have an array of ports 19:46:42 the ports are just numbers 19:46:47 usually there's 64 19:46:57 like I said, I've been playing around a bit. within the VM I have subroutines written for printing strings and numbers 19:47:12 wait doesn't mean "wait for keyboard input" 19:47:44 oh. then i'm confused 19:47:47 my guess is if you look closely, the last string you're printing isn't printing 19:47:57 and my code must be workgin by dumb luck :o 19:48:01 yeah 19:48:05 poop :( 19:48:13 post it on gist or something? 19:48:42 gist? 19:49:14 oh, this could get messy. I'm working in assember for ngaro, but using an assembler I wrote in .c :p 19:50:00 just post your assembly code. i'm not going to try and run it 19:50:21 dcc it? 19:50:43 i don't even know how to do that... we can try :) 19:50:59 i was just thinking pastebin or gist.github.com or whatever 19:51:13 there's also a semi-official syntax for ngaro assembly 19:51:32 i don't think i followed it in the assembler in ngarotest.py :/ 19:51:35 probably should fix that 19:52:12 this got complicated. I'm just going to live with a keyboard-read instruction that waits for the keyboard 19:52:28 http://code.google.com/p/retro-language/source/browse/examples/languages/assembler.rx 19:52:47 blockhead: yeah, it has to do that :) 19:53:09 i don't really need to see your code 19:53:19 my guess, though is that the last thing you try to do isn't actually working 19:53:23 ok. well, that answers my question then. :) 19:53:35 your guess was right. actually, it's worse than that 19:53:53 I was being a complete idiot with version control :p 19:54:01 :) 19:54:22 Have sorted it out and what I thought was working was (as you predicted) actually not working :) 19:54:33 the way to picture it is this: you have the ngaro vm which is a big array of ram, two smaller arrays to represent the stacks, and an array to represent the ports 19:54:50 then you have all the devices 19:54:51 ports are where I was getting hazy 19:55:03 devices communicate with the vm through the ports 19:55:15 the protocol looks like this: 19:55:31 you write a value to a particular port, and then you write the number 0 to port 0 19:55:41 then you run wait 19:55:46 wait triggers the device loop 19:57:38 which basically does: if (ports[0] <> 0 ) return; for (int i = 0; i < length(ports); ++i) { if (ports[i] <> 0) { run_port( i ); return }} 19:57:57 so basically exactly one port action is triggered per WAIT 19:58:17 and it's the job of the device to write a 1 to port 0 to signal that it's done 19:58:22 so no more than one port operation at a time 19:58:39 so if this were all multi-threaded, then port 0 would act like a lock, but it isn't actually multi-threaded 19:59:16 and the *lowest* port with a non-zero value is actually what gets triggered first (that's not a spec, just how it happens to always be implemented) 19:59:34 understood 19:59:41 so when you write the character request to the keyboard port and don't call wait, nothing happens 19:59:56 but then later, when you try to output text, it's going to see the keyboard thing first 20:00:04 because the value you wrote to the port is still there 20:00:52 so your WAITS are off by one and that's why the last one doesn't fire 20:01:16 oop :) 20:02:00 in fact i bet the first string you print actually prints before it waits for the keyboard input 20:02:40 err, well, it's been reverted now, to yesterday's code :p 20:02:56 so it's using the proper wait when reading input 20:03:01 ok :) 20:03:15 but you get what i'm saying for a hypothetical loop like you described :) 20:03:20 thank you for clearing that up! 20:03:23 np 20:03:33 oh yes. your explanation was cleared than the source code :o 20:03:34 i found that confusing too 20:04:38 once we get most of the vm working under ngarotest, i'm going to pester crc to drop WAIT and just trigger things immediately on IN and OUT 20:05:03 then we can implement WAIT in assembler if necessary 20:05:15 for things like writing an OS, being able to check the keyboard without waiting would be necesary 20:05:39 not saying I was *going* write one but the possibility had been in my mind ;) 20:05:40 we've also kicked around the idea of interrupts 20:06:41 the easiest way to do something like that in retro right now would be to make a new keyboard device that buffered it for you 20:06:58 and provided a message to check for a keyboard event 20:09:18 hm. we could just add that to port 1 but i guess so far there's never been a need 20:09:54 :) 20:10:14 I'm assuming ngaro is mostly used for running retroforth :) 20:10:33 i'm not sure 20:10:33 only a few oddballs like myself want to play in ngaro directly? 20:10:53 i'm writing a pascal compiler that targets it 20:11:26 well actually i decided to target retro, not ngaro directly 20:11:33 ooo, neat 20:12:09 probably eventually i'm going to build a very primitive subset... maybe like what's in kernel.rx 20:12:24 the plan was to call it b4 for bootstrap forth :) 20:12:33 :) 20:13:09 i was going to implement it atop ngaro, but eventually i started learning retro 20:15:58 try: retro --with librarry/help.rx 20:16:02 and then type help when it's done 20:16:53 er "library" of course :) 20:19:06 "help ?" 20:19:35 yeah, but it has to load help.rx 20:19:52 hmm 20:20:09 which version are you running? 20:20:26 looks like 11.3 20:20:33 oh you're way out of date 20:20:36 where did that come from? 20:20:43 i forget 20:20:47 :) 20:20:48 downloaded it a while ago 20:20:56 I work slow on these things 20:20:56 current is 11.5 20:20:59 on and off 20:21:18 it's usually pretty safe to just run the latest version from bzr or git 20:22:05 yeah, i started with 11.4 and wrote the help system to make it easier to learn retro rather than digging through the docs all the time 20:22:08 was a tar.gz from march :) 20:22:21 nice 20:22:55 https://twitter.com/i/#!/tangentstorm/media/slideshow?url=pic.twitter.com%2FkOXNc3VL 20:23:10 must log out 20:23:22 thanks again for your assistance :) 20:23:36 np. seeya 20:23:40 --- quit: blockhead (Quit: Leaving) 23:59:59 --- log: ended retro/13.01.06