00:00:00 --- log: started forth/19.08.28 00:18:00 --- join: xek (~xek@apn-31-0-23-82.dynamic.gprs.plus.pl) joined #forth 00:53:42 --- quit: gravicappa (Ping timeout: 268 seconds) 00:54:40 --- join: gravicappa (~gravicapp@h109-187-215-247.dyn.bashtel.ru) joined #forth 03:11:13 --- log: started forth/19.08.28 03:11:13 --- join: clog (~nef@bespin.org) joined #forth 03:11:13 --- topic: 'Forth Programming | logged by clog at http://bit.ly/91toWN backup at http://forthworks.com/forth/irc-logs/ | If you have two (or more) stacks and speak RPN then you're welcome here! | https://github.com/mark4th' 03:11:13 --- topic: set by proteusguy!~proteusgu@cm-58-10-209-120.revip7.asianet.co.th on [Wed Jun 26 09:13:14 2019] 03:11:13 --- names: list (clog gravicappa xek Keshl dave0 karswell rdrop-exit john_cephalopoda pareidolia jedb_ X-Scale +proteusdude kori MrMobius jpsamaroo cantstanya reepca cp- diginet2 chunkypuffs deesix sigjuice DKordic tp a3f dne C-Keen mstevens remexre rann presiden jimt[m] siraben nonlinear[m] APic catern rprimus cheater +KipIngram rpcope alex4nder dbucklin louisg jackdaniel WilhelmVonWeiner malyn nonlinear djinni Kumool gabc ullbeking lchvdlch koisoke pointfree dave9 tangentstorm) 03:11:13 --- names: list (phadthai irsol jn__ jhei guan amuck lonjil ovf +crc ecraven bluekelp dzho Lord_Nightmare yunfan zy]x[yz arrdem) 03:11:23 Not familiar with apt 03:11:23 which keeps speed by storing words as their AST and compiling them upon first excution 03:11:42 then I just store it all in a big big map 03:11:45 :^) 03:12:23 ASTs are not very Forthish :) 03:13:02 No, but they are Pythonic 03:13:28 and I want to be able to inline Python code in this program. 03:13:50 I still haven't taken the time to delve into Python, I should really watch an intro video sometime soon 03:14:15 I use inlining a lot in my host Forth 03:15:13 so I can use it to live-code, like a LISP, but with the packages available in Python at my fingertips 03:15:20 Python is really great. 03:16:08 C/C++, Python, Forth: A formidable arsenal 03:16:20 What do you mean by live-code? 03:17:18 I'm sorting my Poker chips, have a game tomorrow 03:23:21 live-code as in 03:23:30 script everything while it's running 03:23:34 for a little game engine 03:23:52 but from some kind of terminal 03:23:57 really I forgot the word script 03:24:25 Ah ok, got it 03:30:00 love a game of poker 03:30:47 before my phone destroyed my short term memory I used to do a lot of counting 04:00:25 --- join: dys (~dys@2a01:598:918d:caa8:9eb6:d0ff:feee:f529) joined #forth 04:30:02 --- join: `presiden (~presiden@unaffiliated/matematikaadit) joined #forth 04:56:44 --- join: ryke (~Thunderbi@71-9-169-152.dhcp.jcsn.tn.charter.com) joined #forth 05:19:10 <`presiden> morning forthnighter 05:30:19 --- quit: rdrop-exit (Quit: Lost terminal) 06:18:56 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 06:25:32 WilhelmVonWeiner, your python-ast based forth sounds pretty cool. 07:40:41 well, I read about the `compile()` function and went "huh" 07:41:34 because I've been playing with the ast module lately 08:04:27 --- quit: dave9 (Remote host closed the connection) 08:04:35 --- quit: dave0 (Ping timeout: 245 seconds) 08:07:40 --- quit: ryke (Ping timeout: 272 seconds) 08:12:00 --- join: dave9 (~dave@069.d.003.ncl.iprimus.net.au) joined #forth 08:24:33 --- quit: dys (Ping timeout: 252 seconds) 09:07:19 --- join: dys (~dys@2a01:598:918d:caa8:226:5eff:fee9:68d2) joined #forth 09:10:42 --- quit: Keshl (Read error: Connection reset by peer) 09:11:04 --- join: Keshl (~Purple@207.44.70.214.res-cmts.gld.ptd.net) joined #forth 09:14:59 --- quit: Keshl (Read error: Connection reset by peer) 09:15:26 --- join: Keshl (~Purple@207.44.70.214.res-cmts.gld.ptd.net) joined #forth 09:36:21 --- join: wildtrees (~wildtrees@unaffiliated/wildtrees) joined #forth 09:37:19 --- quit: wildtrees (Max SendQ exceeded) 11:03:26 --- join: mtsd (~mtsd@94-137-100-130.customers.ownit.se) joined #forth 12:38:06 --- quit: gravicappa (Ping timeout: 272 seconds) 13:09:45 --- quit: mtsd (Remote host closed the connection) 13:29:59 how would you do a fizzbuzz without an else? 13:30:39 keep using if and dup dup dup? 13:31:04 good question 13:31:19 let me try this brain teaser 13:31:42 cmoore said elses are unnecessary in forth 13:31:47 so i'm like... mmm 13:32:17 baseless guess but he could've in context meant "use the return stack properly" 13:34:19 I never write else because I just rdrop out of words with an if; (: if; if rdrop then ;) 13:35:10 so many smilie faces there 13:36:33 lol 13:39:03 Kumool: you could probably do it with MOD 13:39:08 MOD and OR 13:39:46 ooh 13:40:10 --- quit: xek (Ping timeout: 272 seconds) 13:40:16 you store FIZZ at HERE 1 CELLS - and BUZZ at HERE 13:40:23 could probably abuse that too lol 13:41:11 http://tpaste.us/lZpn I mean, this was my old solution 13:41:26 and my awk solution does use arrays 13:43:26 bah, I was planning on being productive today! 13:43:43 lol. 14:01:28 --- join: ryke (~Thunderbi@71-9-169-152.dhcp.jcsn.tn.charter.com) joined #forth 16:00:02 http://forth.works/06d1967d1fdb511ddb5c4615ab1b8a8f is a retro implementation that doesn't feature ELSE 16:17:37 --- quit: john_cephalopoda (Ping timeout: 250 seconds) 16:30:46 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 16:40:32 --- join: dave0 (~davezero@069.d.003.ncl.iprimus.net.au) joined #forth 16:46:22 --- quit: ryke (Ping timeout: 272 seconds) 17:07:23 --- join: learning (~learning@47.138.187.107) joined #forth 17:15:06 --- quit: dddddd (Read error: Connection reset by peer) 17:18:15 --- quit: learning (Remote host closed the connection) 17:34:39 --- join: learning (~learning@47.138.187.107) joined #forth 18:42:58 --- join: ryke (~Thunderbi@71-9-169-152.dhcp.jcsn.tn.charter.com) joined #forth 18:48:37 --- join: rdrop-exit (~markwilli@112.201.162.86) joined #forth 18:49:30 Good morning Forthians 19:14:33 --- quit: learning (Remote host closed the connection) 19:38:46 --- quit: karswell (Ping timeout: 244 seconds) 19:53:42 --- nick: jedb_ -> jedb 20:28:02 --- quit: ryke (Ping timeout: 272 seconds) 20:28:20 I had to look up this fizzbuzz thing you guys were discussing on Wikipedia 20:32:20 : say ( u -- ) cr dup 3 umod 0= if ." fizz" then dup 5 umod 0= if ." buzz" drop then; u. ; 20:32:38 oops got reformatted 20:32:44 : say ( u -- ) 20:32:50 cr 20:32:56 dup 3 umod 0= if ." fizz" then 20:33:03 dup 5 umod 0= if ." buzz" drop then; u. ; 20:34:04 Ah wrong mistake, that won't work 20:53:00 : say ( u -- ) cr dup 15 umod 0= if ." fizzbuzz" drop then; dup 5 umod 0= if ." buzz" drop then; dup 3 umod 0= if ." fizz" drop then; u. ; 20:53:03 damn 20:53:10 : say ( u -- ) 20:53:15 cr 20:53:22 dup 15 umod 0= if ." fizzbuzz" drop then; 20:53:28 dup 5 umod 0= if ." buzz" drop then; 20:53:34 dup 3 umod 0= if ." fizz" drop then; 20:53:40 u. ; 20:56:25 ugly and slow, but it's just throwaway 20:57:05 need more coffee 21:07:39 --- join: ryke (~Thunderbi@71-9-169-152.dhcp.jcsn.tn.charter.com) joined #forth 21:19:43 should have put fizz before buzz 21:24:00 A more space consuming way would be to just have a 15 entry jump table 21:27:24 Then each play would boil down to something like: 21:27:25 : play ( u -- ) 15 umod cr say ; 21:28:46 where say performs the corresponing slot 21:28:57 *corresponding 21:30:26 : fizz ( -- ) ." fizz" ; 21:30:32 : buzz ( u -- ) ." buzz" ; 21:30:39 : fizzbuzz ( u -- ) fizz buzz ; 21:30:41 21:30:53 create sayers 21:31:10 ( 0-4 ) ' fizzbuzz , ' u. , ' u. , ' fizz , ' u. , 21:31:28 ( 5-9 ) ' buzz , ' fizz , ' u. , ' u. , ' fizz , 21:31:45 ( 10-14 ) ' buzz. , ' u. , ' fizz , ' u. , ' u. , 21:31:55 21:32:05 : sayer ( # -- a ) cells sayers + ;inline 21:32:14 : say ( u # -- ) sayer perform ;inline 21:32:21 : play ( u -- ) 15 umod cr say ; 21:32:54 (untested) 21:33:53 Some typos in there but you get the idea 21:34:37 buzz and fizzbuzz should be ( -- ) 21:40:28 Corrections: 21:40:47 : fizz ( u -- ) drop ." fizz" ; 21:41:05 : buzz ( u -- ) drop ." buzz" ; 21:41:28 : fizzbuzz ( u -- ) drop ." fizzbuzz" ; 21:42:02 I really should drink coffee before making a fool of myself :) 21:42:47 : play ( u -- ) dup 15 umod cr say ; 21:44:15 I will stop now before I cry 21:45:58 <`presiden> cry now 21:46:06 <`presiden> before you stup 21:51:04 :'( :'( 21:51:32 --- join: gravicappa (~gravicapp@h109-187-215-247.dyn.bashtel.ru) joined #forth 21:57:30 --- quit: ryke (Ping timeout: 245 seconds) 22:00:19 Anyway despite my barin farts, jump tables (execution vectors) are very simple and useful implementation pattern in Forth 22:00:43 *brain farts 22:00:47 :'( 22:11:16 --- quit: louisg (Ping timeout: 258 seconds) 22:21:50 --- quit: rdrop-exit (Quit: Lost terminal) 22:24:07 --- join: louisg (~louis@x-160-94-179-187.acm.umn.edu) joined #forth 22:30:23 --- join: rdrop-exit (~markwilli@112.201.162.86) joined #forth 22:31:57 --- quit: rdrop-exit (Client Quit) 23:33:31 --- quit: dys (Ping timeout: 252 seconds) 23:56:11 --- join: xek (~xek@apn-31-0-23-82.dynamic.gprs.plus.pl) joined #forth 23:59:59 --- log: ended forth/19.08.28