00:00:00 --- log: started forth/02.01.19 00:04:18 lol 00:04:22 eh 00:04:33 gforth runs on bsd i think... 00:04:34 yeah 00:04:36 it does 00:04:45 u do make and it compiles it 00:04:56 Open, too? 00:05:08 * Xuz gives it a shot :) 00:05:16 um 00:05:25 can i get a copy of your gforth interfacing thingie 00:05:54 It's on my other computer. 00:06:48 and you can't boot up your other comp? :) 00:07:15 i should look in the logs 00:07:30 mrreach told me stuff about interfacing with gforth 00:07:46 Nope. It was dropped when I moved. 00:07:51 I haven't gotten a new motherboard for it, yet. 00:13:10 ahh 00:13:33 * Xuz gets GForth up and running. 00:13:40 Ahh, yes, I remember how I did this now. 00:13:57 why not just take out the hd for now or something. but if you don't, will you remember to email me or will i have to remind you later? 00:14:06 btw, what are you doing in forth these days? 00:14:14 (i probably asked yesterday, but i forget..) 00:14:22 (or the day before yesterday..) 00:14:27 Earlier than that. 00:14:36 And. . . . nothing since September :) 00:15:07 heh 00:15:43 got any big projects that involves forth but you haven't been working on it because you are lazy or some other reason.. like me and my forth mud :) 00:17:10 Well, more 'cause I hadn't bothered trying to get GForth on this computer. . .so yes. 00:18:17 so tell me about your forth projects :) 00:18:38 Something like an IDE. 00:19:09 And one of these days I need to hack at the GForth kernel so I can get callbacks working. 00:21:02 an IDE for forth? 00:21:06 a Forth IDE ? 00:21:13 an Editor and other leet tools? 00:21:25 just wait until isforth comes out :P 00:22:38 Think of VI. 00:22:55 No think of it with some of the features of emacs (like being able to have a Forth interpreter running inside it) 00:23:01 Now think of it done in Forth instead of Lisp. 00:25:36 ooh 00:25:43 there already is an emacs with forth isn't there? 00:26:49 I don't like Emacs. 00:26:58 ahh, heh :) 00:27:00 And there's a way to run GForth inside and Emacs buffer, yes. 00:27:21 ftp://ftp.taygeta.com/pub/Forth/Tools/forth.el 00:27:24 i dunno what that is 00:27:35 This is basically an editor written in Forth with VI-like bindings, scripting available in Forth, and a Forth evaluator inside it. 00:30:11 you want a usability hint? :) 00:30:14 put in a menu 00:30:22 like in EDIT.COM or some other editor you like 00:30:44 * Xuz laughs 00:30:49 that way people who have no clue and don't want to read the documentation can at least blunder thru the menu and figure it out for themselves 00:30:58 hell, edit.com doesn't need documentation at all 00:31:01 I've never really used those in my editors, I just learn the hotkeys. 00:32:28 yeah, but for newbies, menus are good 00:32:42 and besides, the menu show the hotkeys next to the command 00:32:53 so that you can remember it next time 00:33:04 vi and emacs both suck, because there's no menu 00:33:13 you have to read the damn documentation, that's just plain stupid 00:33:25 * Xuz doesn't consider reading documentation stupid :) 00:33:41 making the documentation a necessity is stupid 00:34:08 i read a usability article at some website, and guess what, most people don't read :P 00:34:22 not in terms of illiterateness, but in terms of not bothering to read 00:35:42 documentation is nice, but it is secondary.. i love documentation as much as the next guy, but i also don't always like to read documentation, i just want to go right ahead and start using the application 00:36:01 an intuitive application is merely an application that has a menu and shit like that :P 00:44:14 Xuz 00:44:19 what's VI-like bindings? 00:44:29 is that hotkeys or something else? 00:44:57 Sorry, was coding :) 00:45:19 It means it feels like VI when you're using it. 00:46:31 ah 00:46:34 so what are you coding? 00:46:43 you installed gforth and now you are coding in it? 00:49:45 xuz 00:49:46 :) 00:52:54 Yes. 00:52:58 I'm rewriting my library interface. 00:53:25 eh? 00:53:30 you have the library interface? 00:53:35 No, I'm rewriting it. 00:54:09 heh 00:54:12 * aaronl is away: I'm busy 00:59:34 * Xuz really should set this thing up so you can define if you need underscores or not. 00:59:41 * Xuz won't, however, at the moment. 00:59:54 underscores for what? 01:00:00 do you know anything about "select" cause i don't heh :) 01:04:39 Yep. It lets you see if you can perform an action on a file descriptor. 01:06:53 do i need to read the socket library documentation or something in order to figure out how to use the sockets and stuff? :) 01:10:06 Yes. You need to read the documentation :) 01:10:11 The stuff in info is nice. 01:10:17 which documentation? :) 01:10:21 You could also do a man select 01:10:26 main select? 01:10:38 Just type: man select 01:10:40 At the Unix prompt. 01:10:55 oh, man select lol, i read it as "main" i'm pretty tired :P 01:12:07 ARM Forthmacs. You must have an ARM powered Acorn RISC OS computer 01:12:23 i wonder if anybody has such a computer that i can telnet into so that i can check out forthmacs :) 01:12:38 or maybe there's an emulator.. hmmm 01:12:49 I think there is, actually. 01:13:24 how would i search for an emulator that is "an arm powered acorn risc os" ? :) 01:13:24 is there a better keyword? 01:17:54 "ARM Forthmacs emulator" ? 01:19:21 No idea. 01:19:27 I'd just look for an ARM emulator. 01:19:36 Or an Acorn emulator. 01:20:55 * Xuz notes that the bottom few lines are very specific to OpenBSD 3.1 :) 01:23:43 bottom lines of what? 01:24:01 The file I just sent you. 01:24:06 Well. . . the file I'm trying to send you. 01:24:16 via dcc? 01:24:21 Yes. 01:24:53 * Xuz takes the bottom few lines off, in fact. 01:25:01 well this mirc client has some crazy scripts on it, it's my friend's comp, i dunno how to allow dcc.. just a sec 01:25:16 Oh, well in that case. 01:25:26 it should pop up asking me 01:25:30 http://uberfuchs.dyn.dhs.org/~aemerson/lib.fs 01:25:32 but i guess it's not 01:26:23 hmm 01:26:25 thank you for it :) 01:26:57 now if i only understood it :P 01:30:31 It has some comments. 01:31:50 yeah 01:32:13 i'll probably figure it out when the time comes for me to access the sockets 01:37:16 i'm going to go to bed 01:37:19 so good night :) 01:39:42 --- quit: futhin ("-HAVOC- laters") 01:42:25 --- join: aum` (~aum@l76-137.world-net.co.nz) joined #forth 01:43:33 --- quit: Xuz ("ircII EPIC4-0.9.16 -- Are we there yet?") 03:07:23 --- quit: aum` (Read error: 54 (Connection reset by peer)) 03:38:10 --- quit: Speuler ("using sirc version 2.211+KSIRC/1.1") 11:48:46 --- join: kholmes (~kholmes@client559.sedona.net) joined #forth 11:51:24 --- join: futhin (thin@h24-66-212-245.cg.shawcable.net) joined #forth 11:51:35 wow kholmes 11:51:39 you are up early :P 11:52:01 12:51pm is early? 11:52:10 hey wow, it's the same time for me 11:52:15 yay, you are in my time zone 11:52:34 heh...where at? 11:52:45 if you live next to me...that would be weird 11:53:15 calgary 11:53:18 canada 11:53:29 oh...AZ, United States 11:53:36 like Canada only warmer 11:53:49 heh 11:53:52 yup 11:54:14 someday canada is gonna ask the u.s.a "wanna switch places? and we'll give you the secret to good beer" 11:54:27 and u.s.a will be like "hmm, ok, the beer is worth it" 11:54:34 :) 13:11:23 --- join: Speuler (~l@a161161.upc-a.chello.nl) joined #forth 13:11:28 'oi 13:12:47 oi 13:12:55 how's bf coming along? 13:13:58 'bout 15 primitives 13:14:10 and got an idea how to implement a stack or two 13:14:18 how are you implementing the primitives? 13:14:23 you are using AND and OR ?? how does that work 13:14:41 stack is ntot the problem, but getting the pointer back to a known position ... 13:14:57 no, that's another forth 13:15:09 oh 13:15:11 doh 13:15:18 as far a gate logic simulator 13:15:21 how are you implementing the primitives in bf? 13:15:35 doing any tricks or is it straightforward? 13:15:44 like this: [-]>>+[<->>+<<]> 13:16:20 is tricky 13:16:46 took me 2 days to get a usable idea how to divide by 2 13:18:54 heh 13:19:36 --- join: Xuz (aemerson@bgp01079860bgs.wanarb01.mi.comcast.net) joined #forth 13:19:53 --- mode: ChanServ set mode: +o Xuz 13:19:54 hi xuz! :) 13:20:00 Hiya 13:20:03 good morning or whatever it is for you :) 13:20:21 i went to bed at 5:48 am and got up at 10:30 am.. normally i sleep 9 hours heh 13:20:29 hi xuZ 13:20:35 normally my bedtime is 10 pm too 13:20:52 hmmm... my shift finger was lagging 13:21:06 * Xuz went to bed at the same time you did. He didn't fall asleep until 8. 13:21:14 Then people woke me up at noon and dumped Chinese soup on my pants. 13:21:26 is that common? 13:21:54 No. 13:22:18 * Xuz was dreaming about being chased by mechanical fruit, in any case, so isn't too annoyed about having been woken up :) 13:23:22 i dreamt a bouncy red ball was my friend and i was at his house eating supper with him and his parents 13:23:28 * Xuz laughs 13:23:29 he had eyes and mouth 13:23:41 * Xuz thinks we tie for weirdness thsi time :) 13:25:21 lol 13:25:21 heh 13:25:31 was the soup accidental or purpose? 13:26:46 Accidental. 13:27:05 I was actually woken up to go eat Chinese food, having it as a liquid fashion accessory was just a bonus. 13:27:31 takeout or homemade? 13:27:37 Buffet. 13:29:45 hmm, i was testing if you were asian or something :P response homemade = IF speak" chinese food is leet, are you asian? :)" THEN but you gave me an ambiguous answer! nooo! :P 13:31:25 I am a mutt. German, Irish, Scottish, Welsh and Albanian. Most recent cultural influence on my cullinary skills having been from the Deep South and the Old Country (Albania). However I can cook Chinese food as well. 13:32:35 But there's something nice about being able to spend $7 and get all of the things that are a real pain to make. 13:35:21 i can cook irish stew :) 13:36:06 I can't, actually :) Well,. . . I might. I make stew, I just don't knwo what's in Irish stew. 13:36:22 * Xuz mmms. . . having a sudden craving for okra. 13:36:55 i'm english, belgian/french, irish.. 13:37:34 Ahhh. 13:37:36 water, salt, sheep, onions, potatoes, pepper 13:37:44 That's it? 13:37:49 patience 13:38:03 takes about 8 hours or more 13:38:21 can we put the whole sheep in it, hair and all? :P 13:38:28 * Xuz has made 14 hour stew. . . he adds alot more stuff in it, though. 13:39:06 Like homony and parsnips. 13:39:35 it would still be stew but not an authentic irish stew :) 13:40:56 * Xuz gets a sudden craving to see if he can implement a work of IF in Forth. 13:42:10 Xuz: eh? 13:42:31 IF in Forth? 13:42:38 where IF already exists? 13:43:00 : IF IF ; 13:43:14 Interactive Fiction. 13:43:16 lol 13:43:19 eh? 13:43:23 not IF THEN ? 13:43:30 : IF IF ; IMMEDIATE 13:46:29 : IF IF does> [IF] ; IMMEDIATE ? :P 13:46:37 nonsense code! 13:46:43 xuz 13:46:54 interactive fiction 13:46:55 hmm 13:49:56 Yes. 13:51:34 so the user interacts with the fiction? 13:51:53 or you are interacting with the fiction to create more fiction? 13:52:02 Ever play Zork? 13:52:48 nope 13:53:21 i'm probably familiar with the concepts tho.. i've mudded and played other text-based games.. 13:53:31 zork is text-based with puzzle solving isn't it 13:53:44 yes. 14:04:10 * aaronl is away: jammin' 14:46:29 --- quit: kholmes ("Client Exiting") 15:25:35 * aaronl is back (gone 01:21:25) 15:37:43 --- quit: futhin ("bye") 15:40:34 --- quit: Xuz ("ircII EPIC4-0.9.16 -- Are we there yet?") 16:07:06 --- join: TheBlueWizard (TheBlueWiz@ip-216-25-202-206.vienna.va.fcc.net) joined #forth 16:07:10 hiya all 16:07:26 --- mode: ChanServ set mode: +o TheBlueWizard 16:59:48 gotta go...bye 16:59:51 --- part: TheBlueWizard left #forth 17:15:30 hya tbw 18:08:11 --- join: XeF4__ (~xef4@dsl-XIII-175.kotikaista.weppi.fi) joined #forth 18:08:13 asdf 18:20:57 jklözxcvnm., 19:10:18 --- join: Xuz (aemerson@bgp01079860bgs.wanarb01.mi.comcast.net) joined #forth 19:10:43 --- mode: ChanServ set mode: +o Xuz 19:23:01 --- quit: Speuler ("using sirc version 2.211+KSIRC/1.1") 19:24:33 --- quit: XeF4__ ("pois") 20:00:24 --- quit: Xuz ("ircII EPIC4-0.9.16 -- Are we there yet?") 20:12:32 --- join: MrReach (~mrreach@209.181.43.190) joined #forth 21:21:00 --- join: qless (~qless@clgr000977.hs.telusplanet.net) joined #forth 21:30:04 --- quit: qless ("changing dimensions") 21:36:26 --- join: kholmes (~kholmes@client631.sedona.net) joined #forth 21:47:36 --- quit: MrReach (carter.openprojects.net irc.openprojects.net) 21:47:36 --- quit: oxygene (carter.openprojects.net irc.openprojects.net) 21:57:49 --- join: futhin (Havoc36@ab-cal-a52-01-37.look.ca) joined #forth 22:10:49 --- join: MrReach (~mrreach@209.181.43.190) joined #forth 22:10:49 --- join: oxygene (oxygene@linux-future.de) joined #forth 22:10:57 hihi!!! 22:11:06 :) 22:16:08 --- quit: MrReach (carter.openprojects.net irc.openprojects.net) 22:16:08 --- quit: oxygene (carter.openprojects.net irc.openprojects.net) 22:19:15 --- join: MrReach (~mrreach@209.181.43.190) joined #forth 22:19:15 --- join: oxygene (oxygene@linux-future.de) joined #forth 22:27:57 shame on you guys for netsplitting :P 22:31:06 futhin 22:31:21 yeah 22:31:23 ok, 22:31:28 some guy in #lisp says that cons cells are usually implemented as pairs of words 22:31:31 i'm just checking on how to make the array 22:32:01 variable 22:32:04 allot 22:32:29 so variable array 1024 allot 22:32:33 variable is a forth word 22:32:37 yeah 22:32:45 and allot is 22:33:04 and variable creates a new word called array 22:33:24 --- part: aaronl left #forth 22:33:52 now for cons 22:33:59 okay...worked for me 22:34:59 : cons array ! array 1 + ! ; 22:35:07 this is extremely crude though 22:35:26 when you have the name of the variable, it returns the address 22:35:38 then ! stores the value on stack into the address 22:35:43 actually 22:35:53 : cons swap array ! array 1 + ! ; 22:36:10 and 1 + increments the address by one byte.. 22:36:13 i think heh 22:36:13 :P 22:36:27 and the 2nd number gets stored into array 22:36:57 hmm 22:37:43 why swap? 22:40:07 the stack would look like 22:40:16 address 1 address 2 22:40:26 four items? 22:40:27 like, address 2 would be the top of the stack 22:40:42 so when you use cons, it's like 22:40:51 address1 address2 cons 22:41:17 so address1 and 2 need to be swapped, so that address1 is on top of stack 22:41:21 and then array ! 22:41:29 address1 array ! 22:41:38 ooo...it would be nice if cons would push the address to the cons cell onto the stack 22:42:24 ok 22:42:38 ok, it could work like this 22:43:48 --- join: Xuz (aemerson@bgp01079860bgs.wanarb01.mi.comcast.net) joined #forth 22:44:01 --- mode: ChanServ set mode: +o Xuz 22:44:02 * Xuz waves 22:44:10 hey Xuz 22:44:11 * futhin waves 22:44:53 : cons swap array ! array 1+ ! array (then put some code here that increments the address of the array by 2 ) ; :P 22:45:41 array ! go together? 22:45:45 to store the array 22:45:47 VARIABLE Array1 100 ALLOT 22:47:07 VARIABLE ArrayPointer 22:47:26 Array1 ArrayPointer ! ( stores Array1's address into array pointer) 22:47:48 : cons 22:47:49 swap 22:47:51 array ! 22:47:55 array 1+ ! 22:48:01 :would just do 'create array1 100 allott' himself. 22:48:11 array ( puts address on stack) 22:48:13 Er, allot 22:48:41 oops 22:48:45 start over cons code heh 22:48:47 : cons 22:48:48 swap 22:48:54 ArrayPointer ! 22:49:01 ArrayPointer 1+ ! 22:49:13 ArrayPointer ( puts address to cons cell on stack) 22:49:52 ArrayPointer 2+ ArrayPointer ! ; ( increments array pointer for next cons cells.. for next time cons is used) 22:50:07 2,2-0,2Xuz2,2---: yeah, it's faster? 22:50:16 oops, sorry for the color, this client sux :P 22:50:31 friend's comp yay 22:51:01 2,2-0,2kholmes2,2---: you with me so far? 22:51:05 oh no 22:51:08 more color 22:51:11 heh :P 22:51:23 oh...yeah 22:51:37 let me put this into an editor 22:52:06 you understand " ArrayPointer ! " right? it takes the number off the stack and puts it into the address that ArrayPointer puts on the stack.. 22:52:20 whats the extension for forth code? 22:52:22 variables put their address on the stack 22:52:39 doesn't matter.. i use blah.f 22:52:47 i dunno what other ppl use 22:53:00 2,2-0,2Xuz2,2---: what's the official extension for forth code? :) 22:53:32 emacs recognizes it as forth code :) 22:53:44 lol 22:54:29 be back in 10 minutes, gotta drop off a movie 22:55:08 okay 22:56:12 * Xuz sorries, he was idle playing with his kittycat. 22:56:41 There is no official extension for Forth code :) I use .fs 22:57:25 And. . . for one thing variable foo allot 100 actually allots 100+cell-size. 22:58:09 Not to mention that VARIABLE looks like a single-cell variable (at least to me) and Create looks like something special. It flips a different switch in my mind. 22:58:50 hihi ... reading backlog 22:59:30 hmm 23:00:44 I'm new to forth...so I'm not sure what create does yet :) 23:00:50 And using 1+ will kill your alignment :) 23:01:03 oh...alignment 23:01:07 :/ 23:01:26 CREATE is like VARIABLE, but doesn't actually allot a cell's worth of mem in the dictionary 23:01:55 CREATE builds the word that returns the address of the data field 23:01:57 okay...and what exactly is a cell in this sense? 23:02:05 but doesn't actually put anything in the data field 23:02:20 a cell is the stack width 23:02:30 4 bytes on a 32 bit machine 23:02:32 * futhin is back 23:02:35 Usually either 16 or 32 bits. 23:02:38 brb 23:02:47 The problem with ALLOT 100 (well, the other one) is that you get 100 bytes, not cells. 23:02:50 ahh 23:03:35 i thought you wanted your cells only byte sized? 23:03:48 Nope. Cells are whatever the word-length on your machine is. 23:04:06 wait...CREATE builds a word? 23:04:07 2,2-0,2Xuz2,2---: i know, but he wasn't using cells in the sense of the forth definition 23:04:23 eh.. 23:04:33 So you can't take an address, do a 1+ on it, and then store something in the result, you'll have one over-write the other. Try c! if you want bytes. 23:04:51 Yes. Create makes a dictionary entry. 23:04:58 2,2-0,2Xuz2,2---: doesn't 1+ on the address increment the address by 1 byte ?? 23:05:08 hmm, i need to turn off this script 23:05:19 well...how big is an address becaust thats all the cons cell needs to store 23:05:44 An address is one stack-width wide. 23:05:49 A character is one byte. 23:05:50 xuz: just testing the script 23:05:59 If you want to store bytes, you can do that, just use c! instead of !. 23:06:13 But if you want to store addresses, you want !. And cell+. 23:06:33 ahh 23:06:44 futhin: then thats what we want :) 23:06:51 xuz: incrementing the address by 1, means the address is pointing at the next byte... right ?? 23:07:13 ok, cell+ :) 23:07:28 Yes, next byte. 23:07:36 But ! stores multiple bytes. 23:07:55 Xuz: how do you get the next cell? 23:08:18 ANS defines a word called cell+ 23:08:40 If you aren't using an ANS forth, just figure out if it's a 16-bit or 32-bit forth, and do either 2 + or 4 + 23:08:49 Or you can even define your own cell+, if you like. 23:09:11 I take it forth code isn't portable :) 23:09:38 it is, but some coding is architecture specific 23:09:59 and good coders avoid being architect specific unless they are lazy :P 23:10:34 back 23:10:34 well...I think gforth is ANS forth... 23:10:39 wb 23:10:39 yes, it is. 23:10:47 And Forth code can be portable. 23:10:48 Sometimes. 23:11:18 forth is the most portable language though 23:11:27 Depending on what you want to do. 23:11:50 okay 23:11:52 what would you want to do that would limit portability? aside from cell+ which is mostly braindead :P 23:12:08 DEFER/IS 23:12:27 I would not say forth is the *MOST* portable 23:12:30 so CREATE can replace VARIABLE in place? 23:12:37 It can in THAT place. 23:12:43 why is DEFER/IS not portable ? 23:12:46 okay....good enough :) 23:12:51 but to have true portability, you give up hardware specific advantages 23:13:00 Variable followed-by ALLOT should just be Create followed by ALLOT 23:13:06 futhin: only because it is not defined by ANS 23:13:09 Because DEFER/IS isn't in the standard. 23:13:29 If you have the same version OF forth running on different machines, there's no reason things can't be portable between different architectures. 23:13:39 we need a new standard 23:13:45 or no standard heh 23:13:54 : DEFER ( -- ) CREATE 0 , DOES> @ EXECUTE ; 23:13:59 chuck moore wanted a publication standard.. whatever the heck that is 23:14:52 Xuz: that's true, for the most part 23:15:14 hmm...this is complicated 23:15:34 kholmes: which part? 23:16:23 MrReach: oh...the bit twiddling...I guess I'm not used to visualizing the memory yet 23:16:37 yeah, that's kinda tricky 23:16:43 it helps if you know assembly 23:16:45 * Xuz afks 23:16:50 ok, generally as "address unit" is one byte 23:17:20 a cell is usually the number of bytes needed to represent the address range 23:17:32 MrReach: that makes sense 23:17:38 so a cell in memory will span several address units 23:17:44 so in 23:17:47 ArrayPointer 2+ ArrayPointer ! ; 23:17:54 does 2+ need to be 23:18:06 cell+ 2* or something? 23:18:17 hmmm. ... try ... 23:18:21 no, just cell+ 23:18:33 ArrayPointer 1 CELLS + ! 23:19:13 okay 23:19:14 no 23:19:17 that won't work 23:19:21 the phrase "2+" will work only on machines where the stack width is 2 address units wide 23:19:42 mrreach: the ArrayPointer is being incremented by a cell for the next time cons is called. 23:19:42 oh, you're right, my code was not exactly the same 23:19:51 ArrayPointer 1 CELLS + ArrayPointer ! 23:20:08 then you need a fetch in there, too 23:20:11 what is it.. CELLS + or CELL+ ? 23:20:14 ArrayPointer @ 1 CELLS + ArrayPointer ! 23:20:25 or is CELLS and CELL different things? 23:20:29 I use CELLS myself 23:20:55 hmm 23:21:12 and I won't be able to check this until I implement car and cdr :) 23:21:18 CELL+ adds the memory size of a cell to whatever is TOS 23:21:21 no, the code is like this: 23:21:24 * kholmes is waiting for an error 23:21:32 ArrayPointer @ CELLS + ArrayPointer ! 23:21:34 CELLS takes TOS and multiplies it by cell size 23:21:41 no 1 in the code 23:22:05 the 1 needs to be there 23:22:17 no, it's incrementing the ArrayPointer @ value ... 23:22:19 because we're only adding one cell to increment 23:22:27 oh ah 23:22:28 i see 23:22:30 well...we want to go over two cell widths, right? 23:22:37 otherwise, we're adding ArrayPointer number of cells 23:23:03 : CELL+ 1 CELLS + ; 23:23:06 alternatively, the code could be: ArrayPointer @ CELL + ArrayPointer ! 23:23:07 right ? 23:23:14 oh 23:23:16 ok 23:23:36 yes, but "CELL+" instead of "CELL +" 23:23:40 yup 23:23:56 kholmes: how many cells yoiu want to move past? 23:24:14 MrReach: two for the next call to cons 23:24:46 yeah, so 2 CELLS + 23:24:51 : test ( adr1 -- adr2 ) 2 cells + ; 23:25:00 futhin: you learned this from that tutor? 23:25:53 kholmes: i read starting forth first.. but you'll learn quickly from the tutor.. i found that i had to re-read a few times, but it helped a lot 23:26:44 bbiam 23:26:49 ok 23:27:41 ~/me comes back 23:27:48 heh 23:29:14 kholmes: i found the tutor to explain the memory and CREATE and DOES> pretty effectively 23:29:37 back 23:29:40 heh, DOES> nearly always gives newbies total brain bend 23:29:54 But, once you get it, you'll never know how you lived without it :) 23:29:56 brain bend? 23:30:08 hmm 23:30:36 for example ... 23:30:40 You can think of DOES> as something like a closure if it helps. 23:30:42 brain bend.. after scuba diving for a lenghty amount of time, you get lots of nitrogen in your blood, if you rise too quickly you get the bends.. or something :) 23:30:42 is this the way forth coding is in general? this low level stuff? 23:31:08 yes, forth is considered low level 23:31:15 in fact, that is why I use it 23:31:22 kholmes: heh, kinda, but you can implement high-level stuff and use those and forget about the low-level 23:31:38 MrReach: then you need to argue with the other folks on this channel who I was speaking to yesterday :) 23:31:42 if the tool that I want isn't present, I know I can write it (or shamelessly pirate it) 23:32:07 or a couple days ago 23:32:14 kholmes: eh? forth is still high-level 23:32:20 I've heard the phrase "high level assembly" ... which I'd mostly agree with 23:32:27 mrreach, tell him forth is high-level too :P 23:32:32 that would be I440r? 23:32:42 MrReach: I think so 23:32:56 heh, he and I disagree about more than we agree about 23:33:02 which I find valuable 23:33:25 * Xuz would (and did) say you can think of it as a high-level language for low-level manipulation. 23:33:43 it is high level in the extant that libs are easily built and used, external facilities are often provided 23:34:15 but low level in the sense that the language itself can be changed on a whim 23:34:22 it is high-level because coding in forth is essentially creating a new language.. an application language, a whatever language 23:34:35 you could make it parse and act precisely like LISP, if yoiu wanteed 23:34:48 mrreach: just because forth is reflective doesn't mean it is low-level.. 23:34:50 MrReach: which is whay I am trying to do :) 23:35:17 ok, let's define "low level" and "high level" then 23:35:26 well...I guess asking if a language is high-level or low-level is too subjective to get a concrete answer 23:35:39 unless you are haskell, ML, scheme, etc. 23:35:41 forth can be coded INTO a high-level language, therefore it is high-level 23:35:52 to me, the biggest advantage and biggest disadvantage is that forth is completely untyped and unchecked 23:35:52 futhin: so can assembly 23:36:13 okay...so forth is an interpreter right? 23:36:21 some kind of low-level interpreter 23:36:23 Well. . . . 23:36:28 generally, yes 23:36:34 kholmes: assembly can't be coded into a high-level language and still be assembly.. 23:36:34 Msotly. 23:36:38 but the interpreter can be cut out 23:36:42 or rewritten 23:37:10 futhin: I guess I don't know what you mean then =) 23:37:19 Core words like 'if' could be thought of as subverting the interpreter like that. 23:37:20 MrReach: hmm 23:37:21 heh, that's another point ... there is no part of the language that cannot be altered 23:37:35 kholmes: i might be talking out of my ass though :P 23:37:58 this forth is a strange beast 23:38:11 yup, it's the best :P 23:38:26 generally, interprets text streams 23:39:01 parses the streams into space seperated "words" or "tokens" .... which it then looks up in the dictionary 23:39:06 and executes 23:39:34 : (colon) is just another word to execute, but it starts the compiler loop 23:40:05 which compiles the found words into the current definition, unless they are IMMEDIATE 23:40:27 --- join: Scavenger (Havoc36@ab-cal-a52-01-37.look.ca) joined #forth 23:40:27 --- quit: futhin (Read error: 104 (Connection reset by peer)) 23:40:40 --- nick: Scavenger -> futhin 23:40:44 hmm 23:40:48 heh, Scavenger 23:40:55 heh 23:41:41 hmm, i'm gonna go to bed, so good night everyone 23:41:47 good night 23:41:53 Sleep well. 23:42:02 kholmes: how close to LISP do you want the result to look? 23:42:02 --- quit: futhin (Client Quit) 23:42:36 and why not just use an already written LISP interpreter? 23:43:02 You might want to get used to Forth as Forth first before changing it into something else. 23:43:05 MrReach: well...the syntax isn't important right now 23:43:29 MrReach: and...I'm trying to learn forth in this way 23:43:31 oh, you just want something to process lists effeciently? 23:43:38 MrReach: for now 23:43:48 MrReach: and to hold lisp code 23:43:55 better to keep forth syntax, and write a list library. 23:44:07 Xuz: do you have any better ideas for a learning project? 23:45:05 list library... 23:45:17 isn't that what I am doing? 23:45:20 Nope. I said that before getting more specifics, sorry. I was thinking you were after mroe extensive changes. 23:45:37 sorry, don't know what you're doing, came in the middle of the convo 23:46:18 MrReach: okay...I am trying to write some primitives of scheme...cons, car, cdr, lambda and others in forth 23:46:32 MrReach: cons seems like a good beginning 23:46:54 I don't know how much you know about lisp 23:47:03 ok, is cons an executional item or a data structure? 23:47:11 the very basics 23:47:19 but cons cells are the building block for lists 23:47:21 not really the internals, though 23:47:23 MrReach: both 23:47:38 * MrReach nods, "But that doesn't really tell me how they're built" 23:47:40 a cons word that creates a cons cell 23:48:10 ok, as I remember ... 23:48:19 cons needs to take two arguments from the stack, two address and stores them next to each other in memory 23:48:29 a list of composed of a linked list of "items" ... which may or may not be executable 23:48:33 is that right? 23:48:36 and I think it needs to return the address to the cons cell 23:48:45 MrReach: yeah 23:48:54 the first item of the list is called the "cons" and the rest the "cdr"? 23:49:00 no 23:49:06 the first item of the list is called car 23:49:13 the rest is called cdr 23:49:15 ah! ok 23:49:29 car and "coodra" ... cons is how to build the car 23:49:45 kinda 23:50:03 ok, let's try this is a first run ... 23:50:05 cons builds a cons cell which is just two address 23:50:35 let's say we have a tree-type environment 23:50:40 the first address (car) points to an object the second address (cdr) points to another cons cell 23:50:49 the top level items of which are a list 23:51:13 the head of the list is pointed to by a variable, say "LLIST" 23:51:26 okay 23:51:39 each item in this top level resides in allocated memory 23:52:06 and contains two cells, a pointer to a data blob, and a pointer to the next item in the list 23:52:24 the last item in the list has a pointer of "0" in the link field 23:52:45 how close is this to LISP? 23:53:08 close 23:53:08 any one of the data fields can point to sub-lists 23:53:24 but the first pointer can also point to other lists 23:53:34 ok, that's a start, but we'll probably keep adding stuff 23:53:45 that is correct, and what I meant to say 23:54:06 you mean adding items to the list? 23:54:24 ok, on top level there might be 3 items 23:54:41 and the second item might point to another list 23:55:21 lets call the two fields we've defined so far DATA and LINK fields of the list item 23:55:39 in lisp vocab they are CAR and CDR 23:56:05 so now we have a list ... what do we want to do with it? 23:56:27 we want to get the CAR and CDR of the list 23:56:39 and the CAR of the CDR 23:56:40 and so on 23:56:57 that's called "list traversal" 23:57:02 accessing each element of any (even nested) list 23:57:24 : CAR ( adr -- adr ) ; 23:57:28 a do-nothing word 23:57:33 okay...sure 23:57:52 : CDR ( adr1 -- adr2 ) CELL+ @ ; 23:57:54 ? 23:58:15 oh 23:58:15 CDR CDR CDR will walk to the third item from where we started 23:58:43 okay...thats what we want :) 23:59:16 LISP is a *LOT* more complex, if I recall 23:59:34 its not all that complex 23:59:45 aren't all list items in one flat namespace? 23:59:48 lots of higher computer sciency stuff in there though 23:59:54 each distinguised by name? 23:59:59 --- log: ended forth/02.01.19