00:00:00 --- log: started forth/15.08.20 00:02:08 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 00:42:32 --- join: mtsd (~mtsd@customer-46-39-122-110.stosn.net) joined #forth 00:57:48 --- quit: darkf (Read error: Connection reset by peer) 00:58:14 --- join: darkf (~darkf___@unaffiliated/darkf) joined #forth 01:00:15 --- quit: ASau (Remote host closed the connection) 01:00:27 --- join: ASau (~user@176.4.75.183) joined #forth 01:05:48 --- quit: atommann (Read error: Connection reset by peer) 01:11:25 --- join: atommann (~atommann@58.251.2.94) joined #forth 02:10:40 --- quit: ASau (Ping timeout: 265 seconds) 02:10:41 --- quit: FireFly (Ping timeout: 244 seconds) 02:22:25 hello, I'm just starting forth and I'm going through project euler exercises. My code for the first exercise is a hundreds of time slower than the equivalent Go code. Pastebin here: http://dpaste.com/0J7BS3C.txt 02:23:23 I'm assuming I'm doing something dumb or abusing forth, but I'm wondering whether I should ever expect equivalent speed from forth as I get from Go, which has all sorts of optimizations for modern chips 02:25:13 speed isn't my main reason for choosing to learn forth, but it's a nice asset 02:32:59 --- join: true-grue (~grue@95-27-145-199.broadband.corbina.ru) joined #forth 03:05:23 --- quit: atommann (Ping timeout: 246 seconds) 04:04:09 --- join: azureus (~azureus@123.201.49.58) joined #forth 04:14:44 --- join: xyh- (~xyh@14.153.27.131) joined #forth 04:16:12 --- quit: xyh (Ping timeout: 245 seconds) 04:26:49 --- join: vsg1990 (~vsg1990@cpe-67-241-148-119.buffalo.res.rr.com) joined #forth 04:27:36 ksj: Go has stuff like hand-coded assembly for arithmetic on specific architectures, so you're not going to beat that unless you implement it the same way in your own forth 04:28:05 --- join: nighty^ (~nighty@hokuriku.rural-networks.com) joined #forth 04:47:13 --- quit: xyh- (Remote host closed the connection) 05:02:00 --- join: FireFly (~firefly@firefly.xen.prgmr.com) joined #forth 05:15:42 --- quit: azureus (Ping timeout: 256 seconds) 05:17:26 --- join: azureus (~azureus@123.201.49.58) joined #forth 05:20:18 --- join: atommann (~atommann@14.153.27.131) joined #forth 05:31:59 --- quit: mtsd (Quit: Lost terminal) 05:38:26 --- join: karswell` (~user@226.177.199.146.dyn.plus.net) joined #forth 05:39:58 --- quit: azureus (Read error: Connection reset by peer) 05:50:25 --- quit: TodPunk (Read error: Connection reset by peer) 05:57:41 --- join: TodPunk (Tod@50-198-177-186-static.hfc.comcastbusiness.net) joined #forth 06:06:03 --- join: mnemnion (~mnemnion@c-68-40-58-223.hsd1.mi.comcast.net) joined #forth 06:07:47 --- quit: atommann (Ping timeout: 240 seconds) 06:28:04 ok, that's what I assumed, but hundreds of times slower makes me think I'm doing something wrong... 06:30:38 ksj: What implementation are You using, have You even enabled optimizations (it there are any)? It is hard to say any language is slow, or fast. It can be said for implementations. ``As fast as C'' is a complete nonsense in my opinion. 06:32:54 --- join: atommann (~atommann@14.153.27.131) joined #forth 07:35:48 --- quit: atommann (Ping timeout: 246 seconds) 07:38:44 IsNoGood: I just tried running the same code in 4th rather than pforth, and it finishes in 50 seconds rather than >7minutes, so yeah, implementations seems to make a big difference! Or more correctly, how you use the implementation. 08:42:40 I am not sure if the both routines are doing the same thing actually. What I see, is a hugh stack consumption in the forth version. That does not seem to be correct, from what I interpret to be the purpose. 08:45:41 after 10 iterations 10 cells on ther data stack, after 100 iterations 100 elements on the data-stack, and so on. you better check your forth -.- 08:55:10 ksj: This [[http://thebeez.home.xs4all.nl/4tH/][4tH]]? I got 3m15.108 with my gforth, 32-bit cell. 08:55:47 IsNoGood: yeah. seems interesting. I'll go through the manual this weekend 08:56:40 allocating so much stack, one cell per iteration might consume quite some computation time, I guess 08:57:20 asagk: are you referring to my code? I tried putting a .s in the the loop and I'm only ever seeing one/two numbers on the stack 09:15:23 ksj: What ``4th'' do You mean? And how can it be faster than gforth? Here [[http://dpaste.com/16KZM44][it]] is with some indentation. 09:23:32 --- quit: MrMobius (Ping timeout: 260 seconds) 09:24:57 yes, ksj! Well, then my gforth 0.7.3 does something completly different to your 4th! When I place a ''.S'' at the end of the sums before semicolon. The stack had been ever growing, starting from 20 iterations=16 cells on stack left behind to 100 iterations = 80 cells on stack left behind, ''400 sums'' leave 320 cells on the stack, and so on... I am not sure if that was, what it should do?! ^^ 09:25:42 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 09:30:48 --- quit: MrMobius (Ping timeout: 250 seconds) 09:33:32 ksj, asagk: Works here. Stack comment of ``mod+'' is incorrect, it should be ``( sum n -- sum )''. 09:34:06 asagk: I assume something is wrong with Your copy rather than gforth. 09:34:36 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 09:37:58 --- join: fantazo (~fantazo@089144198254.atnat0007.highway.a1.net) joined #forth 09:39:05 IsNoGood: did you use the code from ksj? I do not see your code is the same ksj is using in http://dpaste.com/0J7BS3C.txt ... 09:39:43 And that makes a huge difference for my gforth, I can tell 09:39:59 asagk: Yes I ran both of them. 09:40:45 I see, I just can not beleive :) . 09:47:50 I am also wondering. Perhaps there is really something weired with my gforth, cause I do not get where this comes from. checked for typos many times now. *very disapointing* 09:48:40 Think I compile a new version. Maybe something is wrecked in the image? I'll see later... 09:49:23 asagk: Run gforth tests. 09:49:34 IsNoGood: yes, the 4th I'm referring to (that ran the same code in 50 seconds rather than 7 minutes) is the one here http://thebeez.home.xs4all.nl/4tH/ 09:50:02 Thanks. How can it be faster? 09:50:48 --- join: azureus (~azureus@122.172.166.179) joined #forth 09:51:56 I was comparing it to pforth performance, not gforth. I haven't tried running it in gforth, but bear in mind I have no idea what I'm doing with anything forth, so the fact that one implementation runs faster for me doesn't necessarily mean it IS faster 09:52:13 4th seems a really nice project. have you used it before? 09:58:30 ok, just tested gforth, and it runs in 40 seconds. we have a winner! still rather disappointing compared to Go's 2 seconds, but I guess that's to be expected 10:00:59 ksj: Not yet. Any way I would use ``: sum ( n -- sum ) dup 1+ * 2/ ;'' to solve that task. I bet gforth is a straight forward interpreter of Your code, so there is a simple explanation. Maybe there are some optimization procedures. 10:02:27 --- quit: fantazo (Ping timeout: 245 seconds) 10:02:30 well, after recompiling on my rasp it now works. very strange^^ 10:03:50 ksj: I heard GCC will optimize something simple as ``for(int n=0; n<=last; n++) { sum += n; }'' into above procedure. 10:07:14 IsNoGood: I'm confused about your sum word. how does that solve the task to find the sum of all multiples of 3 or 5? 10:16:46 --- join: fantazo (~fantazo@089144198254.atnat0007.highway.a1.net) joined #forth 10:41:08 --- quit: karswell` (Read error: Connection reset by peer) 11:01:46 ksj: http://dpaste.com/1159CGS 11:05:26 --- quit: MrMobius (Ping timeout: 244 seconds) 11:06:08 --- quit: darkf (Read error: Connection reset by peer) 11:09:16 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 11:41:17 --- join: karswell` (~user@226.177.199.146.dyn.plus.net) joined #forth 12:00:11 --- quit: vsg1990 (Quit: What's a Quit message?) 12:26:18 --- quit: MrMobius (Ping timeout: 250 seconds) 12:28:08 --- quit: carc (Ping timeout: 244 seconds) 12:29:10 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 12:44:20 --- join: impomatic (~impomatic@31.185.136.135) joined #forth 12:45:06 --- join: carc (~carc@unaffiliated/carc) joined #forth 12:46:58 --- quit: ggherdov` (Read error: Connection reset by peer) 12:49:14 --- join: ggherdov` (sid11402@gateway/web/irccloud.com/x-ubvunhhjhvnjrcjd) joined #forth 12:57:05 --- quit: fantazo (Quit: Verlassend) 13:18:44 --- quit: mnemnion (Remote host closed the connection) 13:25:44 --- join: mnemnion (~mnemnion@c-68-40-58-223.hsd1.mi.comcast.net) joined #forth 13:30:17 --- join: Zarutian (~Adium@168-110-22-46.fiber.hringdu.is) joined #forth 13:34:46 --- quit: Zarutian (Ping timeout: 250 seconds) 13:59:48 --- quit: mnemnion (Remote host closed the connection) 14:10:46 --- join: Mat4 (~claude@ip5b40b95e.dynamic.kabel-deutschland.de) joined #forth 14:10:48 hello 14:23:44 Mat4: Hello. Finished editor? 14:29:04 --- quit: true-grue (Read error: Connection reset by peer) 14:34:35 hi IsNoGood 14:35:36 just back from vacation so no 14:37:20 --- quit: azureus (Ping timeout: 246 seconds) 14:38:24 at current I experiment with tokenisation and some ideas for dynamic stack optimization 14:38:59 (the whole program state is known for an interpreter, so why not use it?) 14:41:44 --- join: ASau (~user@176.4.52.174) joined #forth 14:48:19 --- join: azureus (~azureus@122.172.166.179) joined #forth 14:58:05 --- join: mark4 (~mark4@cpe-97-99-38-29.tx.res.rr.com) joined #forth 15:00:21 --- join: mnemnion (~mnemnion@2601:400:8001:14c9:35ab:570:c1ac:a79f) joined #forth 15:02:24 --- join: asagk_ (~asagk@i59F6A317.versanet.de) joined #forth 15:04:41 --- quit: mnemnion (Ping timeout: 244 seconds) 15:05:43 --- quit: asagk (Ping timeout: 244 seconds) 15:06:48 --- quit: ASau (Remote host closed the connection) 15:07:00 --- join: ASau (~user@176.4.52.174) joined #forth 15:13:13 --- quit: asagk_ (Quit: Verlassend) 15:15:00 --- join: asagk (~asagk@i59F6A317.versanet.de) joined #forth 15:24:28 --- quit: Mat4 (Quit: Verlassend) 15:29:34 --- quit: ASau (Remote host closed the connection) 15:29:48 --- join: ASau (~user@176.4.52.174) joined #forth 15:38:42 --- quit: azureus (Ping timeout: 245 seconds) 15:44:02 --- quit: nighty^ (Quit: Disappears in a puff of smoke) 16:08:48 --- quit: ASau (Remote host closed the connection) 16:09:03 --- join: ASau (~user@176.4.52.174) joined #forth 16:12:12 --- quit: mark4 (Remote host closed the connection) 16:19:07 --- quit: ASau (Remote host closed the connection) 16:19:21 --- join: ASau (~user@176.4.52.174) joined #forth 16:19:25 --- mode: ChanServ set +v crc 16:26:21 --- quit: ASau (Remote host closed the connection) 16:28:23 --- mode: ChanServ set +o crc 16:28:50 --- join: ASau (~user@176.4.52.174) joined #forth 16:39:25 --- quit: ASau (Remote host closed the connection) 16:39:38 --- join: ASau (~user@176.4.52.174) joined #forth 16:46:37 --- quit: ASau (Remote host closed the connection) 16:46:55 --- join: ASau (~user@176.4.52.174) joined #forth 17:09:54 --- quit: ASau (Remote host closed the connection) 17:43:21 --- nick: karswell` -> karswell 18:44:20 --- quit: karswell (Remote host closed the connection) 18:45:29 --- join: karswell (~user@226.177.199.146.dyn.plus.net) joined #forth 18:58:44 --- join: mnemnion (~mnemnion@c-68-40-58-223.hsd1.mi.comcast.net) joined #forth 19:32:33 --- quit: MrMobius (Ping timeout: 264 seconds) 19:34:50 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 20:06:28 --- quit: mnemnion (Remote host closed the connection) 20:19:39 --- join: darkf (~darkf___@unaffiliated/darkf) joined #forth 20:40:36 --- join: atommann (~atommann@58.251.2.94) joined #forth 21:03:44 --- quit: MrMobius (Ping timeout: 246 seconds) 21:04:40 --- quit: darkf (Read error: Connection reset by peer) 21:05:05 --- join: darkf (~darkf___@unaffiliated/darkf) joined #forth 21:06:11 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 21:36:17 --- quit: MrMobius (Ping timeout: 244 seconds) 21:38:19 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 21:41:41 --- quit: atommann (Quit: Leaving) 22:46:48 --- join: xyh (~xyh@14.127.198.110) joined #forth 23:20:41 --- quit: MrMobius (Ping timeout: 244 seconds) 23:22:18 --- join: MrMobius (~Joey@c-68-45-16-225.hsd1.nj.comcast.net) joined #forth 23:59:59 --- log: ended forth/15.08.20