00:00:00 --- log: started forth/14.09.20 00:23:17 --- quit: mr-foobar (Read error: Connection reset by peer) 00:23:41 --- join: mr-foobar (~mucker@49.206.63.113) joined #forth 00:48:06 --- quit: mr-foobar (Read error: Connection reset by peer) 00:49:46 --- join: mr-foobar (~mucker@49.206.63.113) joined #forth 00:55:38 --- quit: mr-foobar (Quit: Leaving...) 00:57:29 --- join: mr-foobar (~mucker@49.206.63.113) joined #forth 01:29:37 --- quit: DGASAU (Ping timeout: 260 seconds) 01:32:16 --- join: DGASAU (~user@p50993595.dip0.t-ipconnect.de) joined #forth 02:00:33 --- join: proteusguy (~proteusgu@180.183.50.66) joined #forth 02:56:21 --- quit: mr-foobar (Read error: Connection reset by peer) 02:56:48 --- join: mr-foobar (~mucker@49.206.63.113) joined #forth 03:25:36 --- quit: dzho (Ping timeout: 258 seconds) 03:25:36 --- quit: joneshf (Ping timeout: 258 seconds) 03:25:53 --- join: dzho (~dzho@unaffiliated/dzho) joined #forth 03:28:59 --- join: joneshf (~joneshf@98.208.35.89) joined #forth 04:32:58 --- join: protist (~javery@152.224.69.111.dynamic.snap.net.nz) joined #forth 05:22:56 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 05:35:53 --- quit: carc_00 (K-Lined) 06:06:44 --- quit: proteusguy (Remote host closed the connection) 07:22:42 --- join: nighty^ (~nighty@hokuriku.rural-networks.com) joined #forth 07:24:28 --- join: impomatic_ (~digital_w@156.248.90.146.dyn.plus.net) joined #forth 07:25:16 --- quit: beretta (Ping timeout: 246 seconds) 08:15:05 --- quit: dys (Remote host closed the connection) 08:18:08 --- join: proteusguy (~proteusgu@ppp-110-168-229-230.revip5.asianet.co.th) joined #forth 08:34:00 I have two mutually recursive words...the order of their definition makes them not work 08:34:13 do I have to refactor?...or is there a way around this? 08:37:05 hmmm http://rosettacode.org/wiki/Mutual_recursion#Forth 08:39:06 depends on how your dictionary is implemented 08:40:08 the usual way is to define a stub for one or the other which then invokes the real implementation of it once both words have been defined 08:41:35 --- quit: nighty^ (Remote host closed the connection) 08:47:34 i used defer 08:47:39 is that what you meant by a stub? 08:47:51 the word that ends up getting the xt of the later word? 08:49:43 have my nested linked lists printing right now :) 08:49:45 null 3 int cons null 2 int cons cons print-value ((2 )3 ) ok 08:49:57 : word1 [ 1 CELLS ALLOT HERE ] ; : word2 ... word1 ... ; : word1_real ... word2 ... ; XT word1_real ! 08:50:01 or something like that 08:50:16 s/!/SWAP !/ 08:51:17 ah interesting :) 08:53:21 defer has an matching word yes? 08:53:41 defer new_word ... resolve new_word ? 08:54:10 Zarutian: this is what I did: http://pastebin.com/gFseyiEv 08:55:07 I wonder what defer and is do in that. 08:55:36 or more clearly how they do what they do 08:55:52 most likely something similiar to what I wrote above. 08:56:29 my guess: defer makes a stub, is takes an execution token and makes it the thing the stub with the wordname after it does> 08:56:38 yeah i'm guessing very similar 08:56:46 could use `see' I guess 08:57:02 : Defer 08:57:03 header reveal dodefer: cfa, 140339730366800 , ; ok 08:57:16 : [IS] 08:57:17 ' POSTPONE ALiteral 140339730367576 compile, ; 08:57:19 latestxt 08:57:20 interpret/compile: IS ok 08:57:25 this is in gforth? 08:57:28 yeah 08:57:33 hence all messy :p 08:58:52 well, I like to play with forth on much smaller and much bare metal machines. (Though said machines are usually just very simple VMs usually implemented as an giant switch statement in an while loop.) 08:59:43 by VM do you mean your FORTH implementation itself? 09:00:02 I wrote an indirect threaded FORTH in x86 09:00:11 32-bit gas asm 09:00:15 AT&T 09:00:59 wrote a direct threaded one in C...that was less fun in a lot of ways :p 09:04:01 trying to write a back-end for compilers with a gc in FORTH at the moment 09:09:13 no I mean I specify an small VM spec (less than 32 instructions) and implement it in what ever is handy (usually C, Tcl, Lua or ecmascript) 09:12:18 ah 09:12:37 and then you make a FORTH and use it there? 09:12:43 do you do this at work?! 09:12:58 no, purely for hobby 09:13:04 oh ok 09:13:07 hehe 09:13:30 and when I want to have ultra portable stuff. 09:14:35 if you implement the vm in an untyped language with higher order functions...then instead of a switch, you might be better of dispatching based on a hash table of instruction->function 09:15:12 then you go from O(n) to O(1) on the lookup of the instruction 09:17:08 depends. If the switch compiles down to a jump table then the overhead of hash table might be too much. 09:19:08 the overhead could be in issue if you have few instructions 09:19:30 a jump table is O(n) though 09:20:13 in Lua (which doesnt have switch statement) I usually just use an if else tree. 09:20:25 ide imagine if you are in a high-level interpreted language like Lua, then the overhead of a hash-table may be minimal compared to 1 if and 31 elses 09:21:53 you havent heard of an if else tree? Basicly it is an control flow version of a binary tree 09:22:59 are you just taking about an abstract syntax tree for if else statements? 09:23:08 if bit5 then if bit4 then ... else .. end else if bit4 then ... else ... end end 09:23:28 in a binary tree you get to reduce options by 1/2 every time leading to O(ln(n))....in if else you can't do that 09:24:01 no, I am talking about how the thing actually looks as control flow graph. 09:24:38 any way you represent if else semantics you end up with O(n) 09:25:16 I am not chaining a lot of "if instr == then" clauses with elses 09:26:00 do you have nested if elses that prune the search tree? 09:26:09 yeb nested 09:26:16 good :) 09:26:55 still bet dispatching on a hash table will be faster in Lau or other very high level langauges 09:26:58 languages* 09:27:42 but I only use this kind of hackery when the language/enviroment doesnt offer easier way of dispatching. 09:27:57 do you ever use the hash table version? 09:27:58 depends on how huge and complicated the hash function used is. 09:28:04 sometimes. 09:28:07 ah ok 09:29:01 ah and by jump table you meant adding the instruction value to an address? 09:29:04 I usually try diffrent aproaches, profile and select the fastest one. 09:29:20 think i've heard several things called that before, could be just ignorant though 09:29:21 jump table[value] basicly 09:29:30 ah then that is great 09:30:05 it first fetches the destination from a, usually, constant table using the value as index 09:31:26 if I had the cash, space and inclination then I wouldnt be afraid of implementing an Forth cpu core in airvalve logic. 09:32:19 (such are sometimes used in industrial control where there might be quite some electrical noise or metallic parts arent allowed nearby) 09:32:55 never heard of air valve logic 09:32:57 interesting 09:33:56 I am not sure that it is called that in English. I learned about them in "Loftstýringar" and air valve logic is my closest translation. 09:35:55 heck I even think there are standard paper tape readers that are air driven and are completely mechanical. 09:36:40 --- quit: Zarutian (Quit: Zarutian) 09:51:34 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 10:01:24 protist: and usually in the VM spec I define problem (user) and priviledged (kernel) modes, instruction traps (a bitmap defines which instructions are trapped in problem mode) and under/over-flow traps. Funnily enough that is enough to constrain 'machine' user code. 10:02:30 constrain how?.... what do you mean by "machine"? 10:03:16 preventing it from causing too much havoc inside the VM and by 'machine' I mean code that is directly running on it 10:03:56 ah 10:06:33 trapping on ! and @ instructions one can implement memory section protection or even Virtual Memory Mapping (up to a point) 10:07:24 by trapping you mean you still halt the program, right? 10:07:51 trapping on BRZ, JMP, CALL (usually implict but included in the aforesaid bitmap) and EXIT instructions one can implement preemptive time slicing 10:08:49 trapping as in meaning that the VM goes from problem mode to priviledged, pushes the address of the current instruction onto the returnstack and continues execution at trap vector address. 10:10:08 (it also pushed onto the stack what kind of trap it is) 10:11:38 that is cool for debugging...but once a program has gone awry, I don't care too much what it does :p 10:11:55 i need to go to sleep haha 10:11:57 goodnight 10:12:01 goodnight 10:13:40 --- quit: protist (Quit: Konversation terminated!) 10:39:40 --- join: DKordic (~user@79-101-246-2.dynamic.isp.telekom.rs) joined #forth 11:55:07 --- quit: zlrth (Ping timeout: 246 seconds) 12:46:55 --- join: _spt_ (~Jaat@host-92-12-220-77.as43234.net) joined #forth 12:46:55 --- quit: _spt_ (Changing host) 12:46:55 --- join: _spt_ (~Jaat@unaffiliated/-spt-/x-5624824) joined #forth 12:57:02 --- join: Mat3 (~Mat@91.65.76.247) joined #forth 12:57:06 hello 13:28:32 --- quit: nisstyre (Quit: WeeChat 1.0) 13:28:47 --- join: nisstyre (yourstruly@2400:8900::f03c:91ff:fe69:7f3d) joined #forth 13:29:09 --- quit: nisstyre (Client Quit) 13:45:04 --- join: xyh (~xieyuheng@2001:250:3002:5550:6ea1:cc0f:bcb2:b187) joined #forth 13:54:10 --- join: pgomes (~pgomes@ipb2182f12.dynamic.kabel-deutschland.de) joined #forth 14:21:21 --- quit: Mat3 (Quit: Verlassend) 14:39:02 --- join: bbloom (~bbloom@cpe-68-173-7-82.nyc.res.rr.com) joined #forth 14:40:02 --- quit: pgomes (Ping timeout: 245 seconds) 15:07:10 --- join: ehaliewicz (~user@50-0-50-37.dsl.dynamic.sonic.net) joined #forth 15:55:19 --- join: zlrth (~user@c-71-206-216-100.hsd1.pa.comcast.net) joined #forth 16:13:36 --- quit: TodPunk (Ping timeout: 244 seconds) 16:13:49 --- quit: _spt_ (Quit: irc- et) 16:23:09 --- join: TodPunk (~Tod@50-198-177-186-static.hfc.comcastbusiness.net) joined #forth 16:32:20 --- part: xyh left #forth 17:08:07 --- quit: es_ (Ping timeout: 260 seconds) 17:19:57 protist do this 17:20:02 defer a; 17:20:04 defer b 17:20:23 ugh i been coding c too long, move the ; on that first line to /dev/null lol 17:20:35 : foo ... b ... ; 17:20:42 : bar ... a .... ; 17:20:50 ' foo is a 17:20:53 ' bar is b 17:21:28 --- join: nisstyre (yourstruly@2400:8900::f03c:91ff:fe69:7f3d) joined #forth 17:21:49 or better yet, refactor your algorithm so that mutal recurison is not required lol 17:21:50 --- quit: nisstyre (Client Quit) 17:53:43 --- join: xyh (~xieyuheng@2001:250:3002:5550:6ea1:cc0f:bcb2:b187) joined #forth 18:09:26 * Zarutian throws I440r and life preserver as he is clearly lost at C 18:22:02 --- join: bbloom_ (~bbloom@cpe-68-173-7-82.nyc.res.rr.com) joined #forth 18:22:14 --- quit: bbloom (Ping timeout: 246 seconds) 18:23:51 --- quit: Zarutian (Quit: Zarutian) 18:27:44 you dont know the half of it lol 18:38:58 --- join: nisstyre (yourstruly@2400:8900::f03c:91ff:fe69:7f3d) joined #forth 18:51:43 --- quit: proteusguy (Ping timeout: 260 seconds) 18:55:11 --- part: xyh left #forth 19:28:52 --- join: ehaliewi` (~user@50-0-50-37.dsl.dynamic.sonic.net) joined #forth 19:31:53 --- quit: ehaliewicz (Ping timeout: 272 seconds) 19:44:28 --- nick: ehaliewi` -> ehaliewicz 20:46:47 --- quit: ehaliewicz (Ping timeout: 246 seconds) 22:38:27 --- quit: mr-foobar (Ping timeout: 246 seconds) 23:36:26 --- join: mr-foobar (~mucker@49.206.63.113) joined #forth 23:55:42 --- join: pgomes (~pgomes@ipb2182f12.dynamic.kabel-deutschland.de) joined #forth 23:59:59 --- log: ended forth/14.09.20