00:00:00 --- log: started forth/09.02.13 00:00:52 --- join: H4ns (n=hans@p57A0F0EB.dip.t-dialin.net) joined #forth 00:17:50 --- join: workthrick (n=mathrick@0x55529153.adsl.cybercity.dk) joined #forth 00:22:37 --- quit: nighty__ (Read error: 104 (Connection reset by peer)) 00:25:27 --- quit: ASau (Remote closed the connection) 00:27:39 --- quit: [Forth] (brown.freenode.net irc.freenode.net) 00:27:39 --- quit: schme (brown.freenode.net irc.freenode.net) 00:27:39 --- quit: Baughn (brown.freenode.net irc.freenode.net) 00:27:42 --- quit: slava (brown.freenode.net irc.freenode.net) 00:27:42 --- quit: segher (brown.freenode.net irc.freenode.net) 00:27:43 --- quit: uiu_ (brown.freenode.net irc.freenode.net) 00:27:43 --- quit: H4ns (brown.freenode.net irc.freenode.net) 00:27:44 --- quit: Deformative (brown.freenode.net irc.freenode.net) 00:27:45 --- quit: nxt (brown.freenode.net irc.freenode.net) 00:27:47 --- quit: kspaans (brown.freenode.net irc.freenode.net) 00:27:47 --- quit: nighty^ (brown.freenode.net irc.freenode.net) 00:27:48 --- quit: workthrick (brown.freenode.net irc.freenode.net) 00:27:49 --- quit: proteusguy (brown.freenode.net irc.freenode.net) 00:27:51 --- quit: uiu (brown.freenode.net irc.freenode.net) 00:27:52 --- quit: gogonkt (brown.freenode.net irc.freenode.net) 00:27:52 --- quit: malyn (brown.freenode.net irc.freenode.net) 00:27:52 --- quit: preflex (brown.freenode.net irc.freenode.net) 00:27:55 --- quit: mathrick (brown.freenode.net irc.freenode.net) 00:27:55 --- quit: madgarden (brown.freenode.net irc.freenode.net) 00:27:55 --- quit: mr_uggla (brown.freenode.net irc.freenode.net) 00:27:57 --- quit: maht (brown.freenode.net irc.freenode.net) 00:28:00 --- quit: Quartus` (brown.freenode.net irc.freenode.net) 00:28:00 --- quit: gnomon (brown.freenode.net irc.freenode.net) 00:28:01 --- quit: I440r (brown.freenode.net irc.freenode.net) 00:28:01 --- quit: tarbo (brown.freenode.net irc.freenode.net) 00:28:38 --- quit: pippin (Remote closed the connection) 00:28:48 --- join: slava (n=slava@li13-154.members.linode.com) joined #forth 00:28:48 --- join: ASau` (n=user@193.138.70.52) joined #forth 00:28:48 --- join: workthrick (n=mathrick@0x55529153.adsl.cybercity.dk) joined #forth 00:28:48 --- join: H4ns (n=hans@p57A0F0EB.dip.t-dialin.net) joined #forth 00:28:48 --- join: gogonkt (n=info@218.13.53.150) joined #forth 00:28:48 --- join: [Forth] (n=Forth@ip70-162-227-36.ph.ph.cox.net) joined #forth 00:28:48 --- join: proteusguy (n=proteusg@61.7.144.97) joined #forth 00:28:48 --- join: schme (n=schme@sxemacs/devel/schme) joined #forth 00:28:48 --- join: nighty^ (n=nighty@x122091.ppp.asahi-net.or.jp) joined #forth 00:28:48 --- join: Deformative (n=joe@71.238.45.45) joined #forth 00:28:48 --- join: I440r (n=mark4__@ip70-162-227-36.ph.ph.cox.net) joined #forth 00:28:48 --- join: kspaans (n=kspaans@nat/uwaterloo/x-02923c6b706bd301) joined #forth 00:28:48 --- join: Baughn (n=svein@084202037181.customer.alfanett.no) joined #forth 00:28:48 --- join: tarbo (n=me@unaffiliated/tarbo) joined #forth 00:28:48 --- join: mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 00:28:48 --- join: nxt (n=nxt@77.207.25.109) joined #forth 00:28:48 --- join: Quartus` (n=Quartus`@207.245.250.55) joined #forth 00:28:48 --- join: madgarden (n=madgarde@CPE001d7e527f89-CM00159a65a870.cpe.net.cable.rogers.com) joined #forth 00:28:48 --- join: malyn (n=malyn@unaffiliated/malyn) joined #forth 00:28:48 --- join: maht (n=maht__@85-189-31-174.proweb.managedbroadband.co.uk) joined #forth 00:28:48 --- join: uiu (n=ian@HSI-KBW-085-216-030-033.hsi.kabelbw.de) joined #forth 00:28:48 --- join: gnomon (n=gnomon@CPE001d60dffa5c-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 00:28:48 --- join: segher (n=segher@84-105-61-45.cable.quicknet.nl) joined #forth 00:28:48 --- join: uiu_ (n=ian@schihei.net) joined #forth 00:28:48 --- join: preflex (i=mauke@rm-f.net) joined #forth 00:28:48 --- join: mr_uggla (i=mzsillan@melkinpaasi.cs.helsinki.fi) joined #forth 00:28:48 --- mode: irc.freenode.net set +o slava 00:29:42 --- join: pippin (n=pippin@bilk.XCF.Berkeley.EDU) joined #forth 00:35:32 --- quit: H4ns (Read error: 110 (Connection timed out)) 01:34:34 --- join: qFox (i=C00K13S@132pc222.sshunet.nl) joined #forth 01:58:16 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #forth 02:22:25 --- join: H4ns (n=Hans@p57BBA649.dip0.t-ipconnect.de) joined #forth 02:53:44 --- quit: gogonkt (Read error: 60 (Operation timed out)) 03:05:33 --- quit: crc () 03:11:00 --- quit: uiu_ (brown.freenode.net irc.freenode.net) 03:11:23 --- join: uiu_ (n=ian@schihei.net) joined #forth 03:26:42 --- join: schmx (n=schme@c83-249-80-232.bredband.comhem.se) joined #forth 03:28:37 --- quit: proteusguy (Read error: 113 (No route to host)) 03:29:11 --- join: proteusguy (n=proteusg@61.7.144.97) joined #forth 03:42:09 --- quit: schme (Read error: 110 (Connection timed out)) 04:26:21 --- join: snowrichard (n=snowrich@12.169.182.169) joined #forth 04:31:08 --- quit: snowrichard (Client Quit) 04:36:24 --- join: sofa` (i=76570347@119.101.234.125) joined #forth 04:36:48 --- part: sofa` left #forth 04:37:06 --- join: sofa` (n=76570347@119.101.234.125) joined #forth 04:37:09 --- part: sofa` left #forth 04:47:25 --- join: sofa` (i=76570347@119.101.234.125) joined #forth 04:49:26 ..... 04:50:40 --- part: sofa` left #forth 06:20:04 --- quit: workthrick (Read error: 110 (Connection timed out)) 06:32:05 --- join: tathi (n=josh@dsl-216-227-91-166.fairpoint.net) joined #forth 06:32:05 --- mode: ChanServ set +o tathi 06:34:38 --- join: gogonkt (n=info@218.13.53.150) joined #forth 07:24:25 --- quit: Quartus` (Read error: 110 (Connection timed out)) 07:45:45 --- nick: ASau` -> ASau 08:27:15 --- join: snowrichard (n=snowrich@12.169.182.169) joined #forth 08:29:20 --- join: hagna (n=hagna@70.102.57.178) joined #forth 08:31:52 --- quit: snowrichard (Client Quit) 08:36:32 --- join: workthrick (n=mathrick@users177.kollegienet.dk) joined #forth 08:39:03 --- mode: ChanServ set +o I440r 08:39:24 --- topic: set to 'Welcome to #forth. We discuss the Forth programming language and a variety of technical subjects. Introduction and Helpful Reading: http://forthfreak.net/index.cgi?FnFC | ANS/ISO Forth Standard doc: http://tinyurl.com/nx7dx | Gforth compiler: http://tinyurl.com/s8uho | http://quartus.net/search | Paste: http://forth.pastebin.ca | http://www.isforth.com' by I440r 08:39:34 might as well set that been as it exists now lol 08:43:16 so memory management in forth where is that link? 08:45:06 is there a way to UN sqlite_escape_string a string? 08:45:30 because i have to sqlite_escape a string to store it in a database but when i retrieve it i dont want my ticks to be escaped but they are 08:46:19 i.e. i have an entry that has something like blah blah 'blah' blah blah but when i retrieve and display that i get blah blah \'blah\' blah blah 08:47:19 sqlite_unescape? 08:48:50 doesnt seem to exist 08:49:17 in what language? 08:49:23 php 08:49:34 and i meant to ask that question in #php lol\ 08:49:36 how about unescape? 08:49:44 hagna: did you get your questions answered by looking at the rekonstrukt project page? 08:50:03 stripslashes? 08:50:09 let me try that 08:50:13 H4ns: yep that helped 08:51:28 H4ns: I have to buy an fpga now 08:52:05 hagna: :) the avnet s3a evaluation board is propably your cheapest option. 08:55:07 H4ns: so will that bitstream work for that one as well as spartan 3e 08:55:35 hagna: no, but i have that board and i'm going to port that over once i have repaired the power supply 08:56:37 hagna: it does not have a lot of i/o gizmo to play with, though. 08:57:12 hagna: http://www.em.avnet.com/spartan3a-evl 09:23:19 yep saw that 09:39:44 Does anyone know if an 8-bit Atmel microcontroller would be a suitable environment to write a Forth in? I've always wanted to do this. :) 09:41:28 see amforth 09:41:49 http://amforth.sourceforge.net/ - it is actually pretty nice. 09:42:13 --- quit: H4ns ("Leaving.") 09:42:21 Ahh, darn, that's my whole idea, already done. :P 09:43:41 kspaans: maybe not "Amforth does not work on ATmegas with more than 128 KB flash memory." 09:44:20 hagna: Ahh, OK. Well I was thinking of the smaller boards, likely with less than 128KB. 09:45:01 How could it not work with _MORE_ memory? 09:45:12 kspaans: yeah that's what I want to know 09:45:34 kspaans: so you want to write a forth vm? 09:48:06 hagna: Yes, just for fun. And at some point a Scheme interpreter too. 09:49:00 I think Forth is _really_ cool. It's like it's own programming paradigm. 09:49:14 kspaans: yes I'd also like to write a forth vm 09:51:36 I think I should learn to write programs in Forth first. :) 09:59:42 --- join: GeDaMo (n=gedamo@dyn-62-56-77-42.dslaccess.co.uk) joined #forth 10:02:32 kspaans: yeah like the sieve of erasthones 10:03:05 http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes 10:04:20 --- quit: proteusguy (Read error: 104 (Connection reset by peer)) 10:15:33 Or there's Project Euler 10:15:37 or Ruby Quiz 10:17:32 plenty of ideas out there for playing around with a new language :) 10:18:15 tathi: what's a good way to remove an item from an array in forth? 10:18:37 that depends: how is your array implemented? :) 10:20:12 for now I'll stick with create myarray 42 cells allot ? 10:20:27 thought so 10:20:42 you would have to move everything after it back a space 10:22:11 well a linked list would be cool 10:22:34 yeah, it depends on how you're going to use it. 10:22:58 then I can just change the pointers instead of moving everything back a space 10:23:03 if you want fast random access, and not so many insertions/deletions, a straight array is probably best 10:23:07 that's probably prematurely optinizing 10:23:18 yeah ok 10:23:32 --- join: proteusguy (n=proteusg@61.7.144.97) joined #forth 10:23:40 if you want to insert and delete a lot, and don't need the "find the Nth element" operation to be as fast... 10:23:58 yes that's probably it 10:24:04 for a straight array (insertions and deletions) you'll want to use MOVE 10:25:02 MOVE isn't in my manual what does it do and what manual is it in? 10:25:10 huh. What Forth? 10:25:47 move ( from to length -- ) 10:26:09 http://ficl.sourceforge.net/dpans/dpans6.htm#6.1.1900 10:26:26 Hmm. Are you aware of the FFL? http://ffl.dvoudheusden.net/ 10:27:21 I'm usually just doing simple things, so I don't use it much. 10:27:38 gforth 10:27:42 But it's nice when you just want to have a data structure without thinking about it too much. 10:27:55 tathi: yep sure is 10:28:14 tathi: wait huh? don't use what much? 10:28:23 I don't use the FFL much. 10:28:41 I'm usually in no hurry and it seems like a little overkill. 10:28:56 But if you just want a singly-linked or doubly-linked list, or hash tables or whatever 10:28:59 tathi: ahh ok that's good 10:29:02 it can be nice to just have a library. 10:29:16 or dynamically-allocated strings 10:29:23 though I guess gforth has those already 10:30:08 --- join: JasonWoof (n=jasonwoo@unaffiliated/herkamire) joined #forth 10:30:08 --- mode: ChanServ set +o JasonWoof 10:30:20 see move in gforth yeilds 20 lines of asm, hehe 10:30:33 yup 10:34:06 --- quit: gogonkt (Read error: 60 (Operation timed out)) 10:35:45 --- join: gogonkt (n=info@218.13.54.149) joined #forth 10:52:03 --- join: ygrek (i=user@gateway/tor/x-1272bbb1dd15ac49) joined #forth 10:55:08 what does this notation mean r@ invoice>month ! 10:56:33 --- quit: gogonkt (Read error: 60 (Operation timed out)) 10:57:18 Depends what invoice>month does, presumably produces an address 10:57:35 GeDaMo: and invoice>month that's just a word I guess nothing special 11:00:33 --- quit: ygrek (Remote closed the connection) 11:01:39 hagna: are you trying to understand some code? 11:02:32 GeDaMo: yes this http://ffl.wikidot.com/using#toc8 11:04:01 --- join: ygrek (i=user@gateway/tor/x-1621b4a52ba8750f) joined #forth 11:08:22 Ok, I think I see what it's doing 11:08:41 invoice>month adds an offset to an address 11:09:54 Giving the address of a field in a structure 11:10:58 so why invoice% and not invoice? 11:12:15 That's the name used in the structure definition 11:12:38 but it follows begin-structure 11:12:46 and it's an argument? 11:12:56 Parsed out of the input stream 11:16:34 how would I know how begin-structure works? 11:16:49 s/know/learn ? 11:17:43 what is this "unique id" i see in my apache environment? 11:17:49 Isn't the code for it available on that site? 11:17:54 mischan 11:18:20 Misfenestration :P 11:18:33 GeDaMo: yep and I'm using it in gforth 11:18:39 GeDaMo: I can do see begin-structure 11:19:17 an english description would be nice 11:19:56 --- join: H4ns (n=hans@p57A0E2BA.dip.t-dialin.net) joined #forth 11:21:58 hagna: do you know how create ... does> works? 11:22:10 GeDaMo: no but I'm willing to read 11:22:18 I don't know where yet 11:23:17 * H4ns just wrapped his head around create does> this morning, as maisforth needed defer 11:23:38 hagna, create does> is some cool stuff 11:23:47 http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm#create 11:23:52 I440r: ok so I found a chapter on it in Stephen Pelc's book 11:24:00 H4ns, err : defer create , does> @ execite ; ? 11:24:25 I440r: right. now i've got to figure out how to make it work when compiling to rom 11:24:29 hagna, a definition for constant might be : constant create , does> @ ; 11:24:50 H4ns, does your "rom" also have ram? 11:25:23 I440r: certainly. i'll have to make defer work in the so-called user area when cross compiling. 11:25:34 im assuming harvard architecture here. in this scenarion a variable is a compiled as a constant in rom and the value it returns is a ram address 11:26:56 what does , do? 11:27:40 hagna: it stores a value at the current location in the dictionary 11:27:55 hagna, comma is the compiler 11:28:14 comma takes the item at the top of the parameter stack and stores it at "here" 11:28:25 "here" is advanced past the stored data 11:28:55 "here" ? 11:29:01 hagna, thers usually a variable called dp (meaning dictionary pointer) 11:29:15 the forth word here is usually defined as : here dp @ . ; 11:29:31 But without the . :P 11:29:35 if you code asm 'here' is similar to an assemblers $ 11:29:48 oh ya duh my bad 11:30:04 : here dp @ ; 11:30:23 USUALLY you do not touch the dp variable. its considered internal 11:30:46 but this is forth. if you thing -5 dp +! is useful and valid its legal 11:31:01 tho... maybe not in ans forth. you can never tell with ans 11:31:31 ans forth is like C, it likes to protect you from you by not allowing you to do things IT considers harmful 11:32:11 I feel harmed trying to read it 11:33:58 so is , like . at all? 11:34:25 no 11:34:34 . (dot) displayes the number at the top of the stack 11:34:39 , (comma) compiles it 11:34:49 both operate on the top of the stack 11:35:02 by "compiles it" i mean it stores it at here and advances here past the data 11:35:04 yes. 11:35:28 both take one parameter from the stack and process it in some way. 11:40:01 so 3 constant fred 11:40:09 does 11:40:18 : constant create , does> @ ; 11:40:29 : constant create 3 does> @ ; 11:40:43 ok. the word "constant" creates a new word called fred 11:40:53 oops I mean 11:40:57 the "create" in the definition for constant creates it 11:40:57 : constant create fred does> @ ; 11:41:20 the comma compiles the value 3 into the new word (fred) 11:41:46 and when fred is executed it calls the code thats after does> 11:41:58 its complicated heh difficult to explain 11:42:18 but when you execute the word constat the stuff after does> is not executed with it 11:42:32 everything to the left of does> is the compile time action (it creates a new word) 11:42:48 everything to the right of does> is the run time action (carried out by the word that was created to the left of the does>) 11:43:15 so 0 constant blah creats a word called blah which has a value of 0 compiled into it 11:43:23 when you execute blah the "value" is fetched 11:45:46 hagna: : constant create fred does> @ ; isn't equivalent - create isn't executed, it's compiled so it won't parse "fred" out of the input stream 11:53:05 GeDaMo: how about 11:53:19 hmm ok no idea 11:55:45 Do you know about interpret / compile modes and immediate words? 11:56:31 a little 11:56:41 ; takes you out of compile mode 11:56:45 : puts you in 11:57:42 You have to think about when a word will be executed 12:01:15 hagna, actually the word [ takes you out of compile mode and the word ] places you in compile mode 12:01:20 so how does : constant create, does> @ ; ever get associated with fred? 12:01:25 : and ; reference those words 12:01:33 I440r: ok good to know 12:01:38 the word "constant" is a parsing word 12:01:43 0 constant fred 12:01:50 create takes the word off the input stream 12:02:01 when you execute "constant" it parses the input stream and feches the string "fred" 12:02:12 it then creates a new word called fred 12:02:33 in your above example where you had : constant create fred blah blah ; 12:02:54 in this case "fred" is not in the input stream when constant is executed 12:03:07 --- join: impomatic (n=John@nat67.mia.three.co.uk) joined #forth 12:03:17 Hi :-) 12:03:27 hi :P 12:03:34 Hi impomatic :) 12:04:05 Someone on reddit mentioned a (rumored) Forth interpreter in 40 bytes. Any idea where I can find it? 12:04:19 Link to comment on reddit http://www.reddit.com/r/programming/comments/7x43w/optimising_assembly_like_an_80s_hacker/c07ndgv 12:04:42 This one is 66 bytes http://pygmy.utoh.org/3ins4th.html 12:04:56 Thanks :-) 12:05:34 Although calling it Forth may be a bit of a stretch :P 12:11:18 Hmmm... 12:33:57 --- join: H4ns1 (n=hans@p57A0E2BA.dip.t-dialin.net) joined #forth 12:34:12 --- quit: H4ns (Nick collision from services.) 12:34:14 Is there anything slightly more advanced? With at least a data stack and simple arithmetic 12:34:15 --- nick: H4ns1 -> H4ns 12:37:21 You want to look at a Forth implementation? 12:37:33 There are quite a few of them about :P 12:39:34 I'm just interested in any really small implementations you can suggest :-) 12:39:51 I've got about a dozen on my computer, but I don't want to miss anything interesting 12:40:14 I'm looking for ideas, because I might implement Forth in Redcode 12:42:01 http://www.colorforth.com/forth.html 12:42:26 That shows the instruction Chuck Moore implemented on one of his Forth chips 12:43:20 Thanks 12:43:40 You might find this useful too http://www.ece.cmu.edu/~koopman/stack_computers/index.html 12:46:39 I thought the cover art looked 80's before I read the first paragraph ;-) 12:49:14 :P 12:55:42 You can remove a number from Chuck's set of words to get a more minimal set 12:58:22 1f nop? 13:01:52 You could also do without a! a *+ - !r !+ @r @+ -if 13:05:11 Is there any kind of standard or spec for a minimal Forth? 13:06:15 --- join: gogonkt (n=info@218.13.54.205) joined #forth 13:06:16 I don't think so 13:06:36 yay! i've successfully vectorized maisforth's output! now for some emits to the lcd display 13:06:39 I've seen discussions about minimal Forths on comp.lang.forth 13:07:22 Not recently though 13:14:17 --- quit: gogonkt (Read error: 60 (Operation timed out)) 13:19:08 Minimalist Forths have the same value as minimalist bicycles: they work, but you wouldn't ride the Tour de France on one. 13:55:13 --- quit: GeDaMo ("Leaving.") 14:05:05 --- join: JasonWoof1 (n=jasonwoo@c-66-31-44-71.hsd1.ma.comcast.net) joined #forth 14:07:23 --- quit: JasonWoof (Read error: 113 (No route to host)) 14:07:35 --- join: gogonkt (n=info@218.13.54.40) joined #forth 14:10:49 H4ns: nice! 14:28:42 --- quit: hagna ("leaving") 14:29:22 --- join: hagna (n=hagna@70.102.57.178) joined #forth 14:29:52 still not getting it 14:30:03 10 constant fred 14:30:12 how does fred get the right runtime behavior? 14:42:04 ok hagna lets go all the way back to the very basics 14:42:06 create blah 14:42:14 when you type something like taht forth creats a new variable 14:42:25 when you execute the variable blah it returns its "body" address 14:42:34 you can how say 10 blah ! and store 10 in the body of blah 14:42:41 ok. lets look at constant again 14:42:48 : constant create , does> @ ; 14:43:29 when constant calls create it creats a variable. but. the does> modifies the new variable so that instead of just returning its own body address it actually fetches the contents of the body address 14:43:49 because of the @ (fetch) after does> 14:44:05 ok and what's the comma for again? 14:44:21 that part does not get executed at COMPILE time (when the new constant was created). it gets executed at RUN Time. when the new constant is executed 14:44:30 ok. well you have to specify a value for a constant 14:44:46 the comma compiles the value of the variable into the variables body 14:45:16 10 constant blah will first create a variable called blah. it will then comma in the 10 into the body of the new variable 14:45:46 then it patches the new variable to call everything after the does> (which in this case contains only a fetch operation) 14:46:09 ok it's making more sense 14:46:14 --- quit: JasonWoof1 (Read error: 110 (Connection timed out)) 14:46:37 trey im going to quote that on isforth.com hehe 14:48:24 wow! i've got emit redirected to the vga port now. this is fun 14:48:39 hagna: it makes more sense when you've got some hardware to play with :) 14:49:02 hagna, what OS do you use? 14:49:04 H4ns: yes I bet :) 14:49:11 I440r: linux gforth 14:49:19 ok 14:49:36 I440r: thought there is an atmel atusb192 or something here 14:49:44 s/thought/though 14:49:54 not a huge fan of gforth myself. any forth that cant compile its own sources is not a forth i would like 14:50:02 yet even isforth cant do that yet /cry 14:50:17 i dont like forths that are coded in c 14:50:19 personallyu 14:50:22 personally 14:50:34 hagna, do you code asm? 14:50:43 --- quit: gogonkt (Read error: 60 (Operation timed out)) 14:50:51 I440r: I have before, but not for anything serious 14:51:00 ok but you can read asm yes? 14:51:24 I440r: only a few words at a time, yes 14:51:47 well then as an aid to learning forth i would say download my forth from www.isforth.com 14:51:58 I440r: you wrote it? 14:52:01 yes 14:52:09 cool 14:52:11 ok downloading 14:52:13 its NOT ans compliant 14:52:33 I440r: you wrote it in asm? 14:52:36 if you see a new forth word and want to understand what it does look in my sources. 14:52:37 yes 14:52:40 asm and forth 14:53:07 ignore the macros, they are complex and might confuse you but the code for each forth definition should be easy to understand 14:54:42 I440r: oh so I don't have to build it 14:54:51 you dont have to 14:55:08 i included both the kernel (called kernel.com) and the extended forth (called isforth) 14:55:14 to launch it type ./isforth 14:55:21 it SHOULD run just fine 14:55:21 yes nice colors 14:55:35 words [enter] 14:55:37 type that 14:55:47 and that isnt ALL of them lol 14:55:54 oh 14:55:57 hers a nice feature 14:55:59 type this 14:55:59 --- quit: ygrek (Remote closed the connection) 14:56:11 : testme 100 0 do i . cr loop ; 14:56:16 then say debug testme 14:56:31 hehehe 14:56:32 space will single step through the definition 14:56:44 single setep a few itterations to see it happen 14:56:58 then when your on . (dot) press the enter key isntead of space 14:57:10 you will nest into the definition for . and you can then single step through that 14:57:27 you can nest as deep as you want to go into ANY colon definition 14:57:55 you can press the O key to see the output screen 14:58:14 this can help you SEE what forth does as it executes 14:58:35 if you have an address of a variable at the top of the stack (the left stack displauy) you can press the M key 14:58:44 and the memory window will dump that address 14:58:55 be careful tho because if you dont OWN that address you will segfault :) 14:59:10 both the parameter stack and return stack contents are displayed 14:59:59 is there a standard siwtch/case wordset in forth? 15:00:05 sort of 15:00:25 but i dont know if its part of "THE" standard (puh puh) 15:00:42 how do I exit debug 15:00:53 q if i remember rightly 15:00:59 i don't care so much, i just want to avoid deeply nesting if/thens 15:01:02 I440r: tried that 15:01:09 escape? 15:01:12 I440r: it;'s in a loop 15:01:18 is it executing it? 15:01:19 I440r: yep ESC 15:01:23 I440r: nope 15:01:27 it doesnt matter if its in a loop 15:01:28 oh. 15:01:36 ah, or maybe better, is there a word that i can call to return from the current word? 15:01:59 you can press the up/down keys and move a green highlight within the current definition and then press the h key and it will RUN to that point 15:02:06 if you press H it will single step to that point 15:02:16 exit 15:02:19 but! 15:02:52 if anything in your definition that you want to exit from has put anything on the return stack you have to clean it off 15:03:00 sure. thanks! 15:03:25 i.e. if you did >r you have to use r>drop if your in a for loop you have to use "undo" or as they limp wristedly call it in ans forth... 15:03:26 unloop 15:03:47 exit expects top of return stack to be the current words return address 15:04:12 which is also NOT guaranteed to even be on the stack in an ans forth (because of possible inlining by the compiler) 15:04:44 I440r: see , 15:04:44 ok 15:04:51 there are blanks in there 15:04:54 you executed see , ? 15:05:07 oh 15:05:08 yes 15:05:12 i would not think that returning nilly-willy out of words is a good idea in general, but it is a good way to get something like switch/case in a word that does just that. 15:05:15 you cant "see" a coded definition 15:05:38 I440r: you mean the asm? 15:05:45 correct 15:05:51 i dont have a built in disassembler 15:05:57 ok 15:06:06 so what does comman do again? 15:06:06 code ',', comma 15:06:07 mov eax, [dp+5] ;get next dictionary address 15:06:07 add dword [dp+5], byte 4 ;allot dictionary space 15:06:07 mov [eax], ebx ;write data n1 into dictionary 15:06:07 pop ebx 15:06:07 next 15:06:09 * hagna ducks 15:06:50 oh 15:06:53 it fetches the contents of the variable DP into the EAX register. it then adds 4 to DP (alloting space) 15:07:09 it then stores the contents of the EBX register in the address DP used to point to 15:07:18 ebx is the top of the parameter stack in isforth 15:07:31 i cache top of stack in a register for speed. it also simplifies ALOT of definitions lol 15:08:17 I440r: so can you port it to the atmel 192 usb? 15:08:24 beginnings of my terminal emulator, any comments would be appreciated: http://forth.pastebin.ca/1336528 15:08:27 probably not lol 15:08:41 its linux specific. its x86 specific 15:08:52 there used to be an FBSD port but it isnt working any more 15:09:06 and tathi used to maintain an PPC port of it but doesnt any more 15:09:06 hagna: amforth worked quite well for me when i tried it. 15:09:10 so thats b0rked too 15:10:55 H4ns: I'll have to try it when after I comprehend comman 15:10:56 , 15:11:01 hi 15:11:08 hi slava 15:11:13 hi 15:11:33 hagna, do this in isforth 15:11:36 hagna: you'll not have to deal with comma often, so why bother? 15:11:37 here dup 20 dump 15:11:41 100 , 15:11:43 20 dump 15:12:16 hmmm that's interesting 15:12:20 H4ns, , is used quite often 15:12:28 create my data 1 , 2 , 3 , etc etc 15:12:34 erm create mydata even 15:13:12 or better yet hagna do this 15:13:13 I440r: hm, ok :) i'll need to do some more coding 15:13:23 : test here 100 , ; 15:13:26 then debug it 15:13:42 single step the here (press space) that will put the address of DP on the stack 15:13:49 press M here to display that memroy 15:13:54 then single step the rest of the definition 15:14:05 watch the memory get modified 15:14:25 when you finish "here" will point to the memory AFTER the bit that got modified 15:14:53 becuse DP (the dictionary pointer) gets advanced 15:25:14 does create v advance the dp too? 15:26:24 yes 15:26:33 because it allots space for the definition for v 15:26:51 seems like another stack 15:27:07 well not really 15:27:09 yeah, kinda 15:27:12 but sort of close 15:27:12 heh 15:27:14 In so far as any contiguous memory area with a pointer is a 'stack', sure. 15:27:27 Quartus: yep 15:28:11 Bear in mind CREATE doesn't have to move the dataspace pointer, in any given Forth; in some it does, though. 15:28:20 haha 15:30:07 so do you say that create takes an argument or do you say it another way? 15:30:37 CREATE's run-time behavior parses the input stream. 15:30:46 It parses a name. Doesn't take any arguments. 15:31:19 hagna, a parameter is what is on the stack. create is a parsing word which means it reads its 'parameters' for want ofa better word from the input stream 15:32:15 what does immediate word mean? 15:32:19 is create one? 15:32:25 ok good example 15:32:28 : blah ..... ; 15:32:37 CREATE is not immediate. 15:32:47 when you execute the word : (colon) it puts you in compile mode 15:32:53 so things get compiled not executed 15:32:58 but ; is an immediate word 15:33:07 so it EXECUTES even though yoru in compile mode 15:33:14 one of the things ; does is to turn off compile mode 15:33:26 ok 15:35:04 yipes so why doesn't "create ," put , in the dictionary? 15:35:12 It does, in fact. 15:35:32 because , is not in the INPPUT stream at that time 15:35:33 guh 15:35:34 Or are you doing : foo create , ; 15:35:38 : blah create , ... ; 15:35:41 yes that 15:35:51 the comma is already compiled. its not in the input stream now its in the execution stream 15:35:54 : foo create , does> @ 15:35:56 ; 15:36:16 Again, CREATE is not immediate. It's acting later. CREATE , by itself at the command line will, in fact, create a new word called , -- which is probably undesireable. 15:36:43 hi Quartus 15:36:47 Hi Slava. 15:37:00 Quartus: so when you're in compile mode how does forth know not to use , as the input stream? 15:37:14 because there is something else there maybe? 15:37:31 Same way that : foo 3 5 + . ; doesn't print '8' until you run 'foo' itself. 15:38:06 oh good 15:38:34 : puts the system in to compilation state; that stops the default action of most words, instead compiling them into the new definition. 15:39:17 Quartus: but suppose I don't supply an input stream it doesn 15:39:22 't accidently redefine , 15:39:35 because it's compiled code 15:39:36 ahhhhhh 15:39:38 woot 15:39:40 well, er, um, it has nothing to do with 'supplying an input stream'. 15:40:02 Quartus: yeah ok , gets replaced with the code when it's compiled, right? 15:40:13 hmm. No. 15:40:15 the code that goes with , 15:40:26 A call to the code for the , word gets compiled in. 15:40:42 Quartus: yeah or that 15:41:04 Conceptually speaking, anyway. The exact mechanism may differ, but that's the idea. 15:42:52 For example, a simple definition: : foo 3 5 + . ; defines a new word 'foo', consisting of (conceptually) -- 'call to code that places 3 on the stack' 'call to code that places 5 on the stack' 'call to the code associated with +' 'call to the code associated with .' 15:43:29 --- join: gogonkt (n=info@218.13.58.170) joined #forth 15:44:12 I440r: is that how isforth does it? 15:44:16 yes 15:44:59 Quartus: is this like a c call where you push stuff on the stack and return or is it something else? 15:45:00 A given Forth may (or may not) do all manner of clever things to optimize that sequence, but conceptually that's it. 15:45:28 You can think of them as function calls, roughly, with parameter passing done via the global data stack. 15:45:28 ok so it's up to the interpreter to be clever 15:46:23 Sure. Some Forths generate machine code directly, for instance. Others use various threading methods, byte code, what have you. 15:47:05 by threading you don't mean what I'm used to 15:47:16 no not multi tasking threading 15:47:21 heh yes that 15:47:25 forth threads are not related to multi tasking 15:47:40 Not anything to do with multitasking. It's just an implementation technique for laying down definitions. 15:47:50 but "threads" in the forth context are a little bit advanced for you atm 15:47:56 hehehe 15:48:13 Sure. I mention it only to say that there are various ways a given Forth might skin that cat. 15:48:15 but thers direct threading, indirect threading. subroutine threading, token threading just to name a few 15:48:27 I440r: so what do you do in isforth 15:48:30 direct 15:48:37 because its the easiest to understand 15:49:50 ok well it's been fun 15:49:53 gotta go 15:50:32 later 15:50:46 --- quit: hagna ("leaving") 16:15:12 --- quit: gogonkt (Read error: 60 (Operation timed out)) 16:21:37 --- join: gogonkt (n=info@218.13.51.181) joined #forth 16:39:28 --- join: madmacs (n=madgarde@CPE001d7e527f89-CM00159a65a870.cpe.net.cable.rogers.com) joined #forth 16:41:07 --- quit: qFox ("Time for cookies!") 18:12:00 --- quit: gogonkt (Read error: 54 (Connection reset by peer)) 18:12:02 --- join: gogonkt_ (n=info@218.13.51.181) joined #forth 18:12:21 --- join: xristos (n=x@dns.suspicious.org) joined #forth 18:17:30 --- quit: tathi ("leaving") 18:37:07 xristos is greek ? 18:38:52 This is a surprise? 18:39:14 ive never seen him before. and having a greek nickname is no guarantee 18:39:18 yasoo xristos 18:39:30 hi I440r 18:39:35 :) 18:43:48 --- join: gogonkt (n=info@59.38.235.36) joined #forth 18:46:44 : ( gadget title -- newgadget ) 18:46:44 labelled-gadget new-frame 18:46:44 /-----\ 18:46:44 |-----| 18:46:44 \-----/ ; 18:47:09 what does that do? 18:47:26 puts a text label over a gadget 18:47:39 I got a little silly with the internal word names here 18:47:43 lol 18:47:52 now its 18:47:53 /-FOO-\ 18:47:53 |-----| 18:47:54 \-----/ 18:47:59 that's more descriptive 18:51:37 --- quit: gogonkt_ (Read error: 60 (Operation timed out)) 18:52:10 fooey 19:02:48 --- quit: gogonkt (Read error: 60 (Operation timed out)) 19:03:03 --- join: gogonkt (n=info@218.13.51.215) joined #forth 19:19:39 --- quit: gogonkt (Read error: 60 (Operation timed out)) 19:22:27 --- join: gogonkt (n=info@59.39.13.121) joined #forth 19:38:51 --- join: JasonWoof (n=jasonwoo@unaffiliated/herkamire) joined #forth 19:38:51 --- mode: ChanServ set +o JasonWoof 20:02:34 --- quit: madmacs ("SYS64738") 20:24:23 --- quit: gogonkt (Read error: 54 (Connection reset by peer)) 20:27:02 --- join: gogonkt`` (n=info@59.39.13.121) joined #forth 20:44:56 --- quit: impomatic (brown.freenode.net irc.freenode.net) 20:44:56 --- quit: workthrick (brown.freenode.net irc.freenode.net) 20:44:58 --- quit: mr_uggla (brown.freenode.net irc.freenode.net) 20:44:58 --- quit: mathrick (brown.freenode.net irc.freenode.net) 20:44:58 --- quit: madgarden (brown.freenode.net irc.freenode.net) 20:45:17 --- quit: schmx (brown.freenode.net irc.freenode.net) 20:45:18 --- quit: maht (brown.freenode.net irc.freenode.net) 20:45:26 --- join: impomatic (n=John@nat67.mia.three.co.uk) joined #forth 20:45:26 --- join: workthrick (n=mathrick@users177.kollegienet.dk) joined #forth 20:45:26 --- join: mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 20:45:26 --- join: madgarden (n=madgarde@CPE001d7e527f89-CM00159a65a870.cpe.net.cable.rogers.com) joined #forth 20:45:26 --- join: mr_uggla (i=mzsillan@melkinpaasi.cs.helsinki.fi) joined #forth 20:46:01 --- join: schmx (n=schme@sxemacs/devel/schme) joined #forth 20:46:01 --- join: maht (n=maht__@85-189-31-174.proweb.managedbroadband.co.uk) joined #forth 20:48:29 --- join: X-Scale2 (i=email@89.180.1.67) joined #forth 20:51:49 --- quit: JasonWoof ("Leaving.") 21:07:46 --- quit: X-Scale (Read error: 110 (Connection timed out)) 21:27:02 --- quit: impomatic ("mov.i #1,1") 21:34:43 --- quit: workthrick (Remote closed the connection) 21:48:29 --- quit: gogonkt`` (Read error: 60 (Operation timed out)) 21:54:46 --- join: gogonkt`` (n=info@116.5.49.72) joined #forth 23:39:38 --- join: gogonkt`1 (n=info@59.38.230.236) joined #forth 23:41:06 --- quit: gogonkt`` (Read error: 60 (Operation timed out)) 23:45:07 --- join: gogonkt`` (n=info@119.126.14.63) joined #forth 23:46:52 --- quit: gogonkt`1 (Read error: 60 (Operation timed out)) 23:52:12 --- join: gogonkt`1 (n=info@59.39.12.87) joined #forth 23:53:04 --- quit: gogonkt`` (Read error: 60 (Operation timed out)) 23:53:05 --- quit: gogonkt`1 (Read error: 54 (Connection reset by peer)) 23:59:59 --- log: ended forth/09.02.13