00:00:00 --- log: started forth/18.10.19 00:41:53 --- quit: rdrop-exit (Quit: rdrop-exit) 01:01:46 --- join: dlyund (~marksmith@ip-62-235-65-225.dsl.scarlet.be) joined #forth 01:41:05 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 02:02:37 --- quit: ashirase (Ping timeout: 252 seconds) 02:07:07 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:14:13 --- quit: wa5qjh (Remote host closed the connection) 02:38:11 moony: how bloody big is your screen 02:41:37 I'm implemeting a Forth-like in python and I want to punch Guido's bloody lights out sometimes 02:41:57 JUST LET ME OPTIMISE THESE TAIL RECURSIONS! 03:13:26 WilhelmVonWeiner: are you writing this in python 4.0 or 5.0? 03:14:16 I live in 2018, so 3.6.6 03:41:59 --- quit: lonjil (Ping timeout: 252 seconds) 04:01:19 --- join: lonjil (~quassel@2a02:418:6050:ed15:ed15:ed15:e741:32d6) joined #forth 04:15:08 --- join: john_metcalf (~digital_w@host86-144-16-11.range86-144.btcentralplus.com) joined #forth 04:20:19 --- join: DKordic (~user@178.220.204.97) joined #forth 04:56:15 --- quit: dlyund (Ping timeout: 245 seconds) 05:05:41 WilhelmVonWeiner: Why are you using recursion in python? 05:10:04 --- join: nighty- (~nighty@s229123.ppp.asahi-net.or.jp) joined #forth 05:34:02 --- join: dlyund (~marksmith@ip-62-235-65-225.dsl.scarlet.be) joined #forth 06:07:47 KipIngram: Zarutian : So it looks like the school doesn't sell my model anymore but they gave me the contact info of the vendor who may be able to fix it. In the meantime I'll work on writing an indirect-threaded Forth for another target. 07:00:36 siraben: because I use recursion in every language when I can 07:00:51 wh dont you write it in scheme! 07:01:31 I don't know scheme, anything I solved from SICP I wrote in Forth 07:04:28 O.o you wrote a Scheme interpreter in Forth and don't know Scheme? 07:04:45 That is, if you did that part of SICP, which is where it really gets fun. 07:04:56 I didn't go *that* far through the book because a lot of my thinking ended up as "but why?" 07:05:16 What do you mean, "but why?" it's a different way of thinking. 07:05:36 If you use recursion a lot, Scheme would be a good fit because implementations are required to have proper tail-call elimination. 07:06:13 And personally I would not endorse the use of recursion in every language (e.g. Forth) because it often leads to performance issues. 07:06:25 But it's a matter of taste. 07:07:00 Of course, the first part of the book is easy to express in Forth, because it's not what makes Scheme different. 07:07:38 Recursion in Forth is just modifying the return stack though 07:08:16 you could push the address of the word you're executing onto the return stack 07:08:44 I assume RECURSE does something like that, never really thought about it 07:09:14 Yes, but why? 07:09:34 why what 07:09:59 Why use recursion in Forth? 07:10:19 http://forth-standard.org/standard/core/RECURSE 07:10:56 idk, why not? 07:11:19 Can you give an instance where it helps? 07:11:29 Because it severely reduces speed. 07:12:02 Recursion is not a magical bullet. 07:12:07 How does it severly reduce speed? 07:12:25 It helps in making my code look nicer and easier to read 07:12:30 Tell, me, is it better to compute fibonacci iteratively or recursively? 07:12:56 and gives it a logical structure 07:13:27 who cares about computing fibonnaci, I'm not writing Forth to solve mathematic equations at hyper speed 07:13:36 Sure (+ (fib (- n 1)) (fib (- n 2))) looks better, but has time (and space) complexity of O(Fib(n)) when an explicit loop would reduce that to O(n), with constant space complexity. 07:13:48 recursion (particularly tail recursion) is just a loop 07:13:50 I suppose. But for me I don't use recursion at the low level. 07:13:56 I use it in Haskell very often though. 07:13:58 in forth, that is 07:14:07 yeah what zy]x[yz said 07:14:18 Only tail recursions are worth it, because they're equivalent to loops. 07:14:48 in forth, non-taio recursion is still just a loop but with some stack growth 07:15:00 and you can drop/rdop that if ya want 07:15:17 s/rdop/rdrop 07:15:20 I don't think that's the execution semantics of RECURSE, see the setandard. 07:15:27 standard* 07:15:37 what standard? i thought we were talking about forth 07:15:46 RECURSE: "Append the execution semantics of the current definition to the current definition." 07:15:52 Yes. 07:16:04 I mean, ignore the standard if you want, but it's there so that you can have portable programs. 07:16:04 zy]x[yz: lol 07:16:23 that can also be interpreted many ways 07:16:58 pushing a return address and jumping back to the beginning of the word satisfies that definition, as does compiling the execution token of the word 07:17:01 "append" so just compile a jump to the start of the current definition 07:17:42 either way, I can't imagine it has a significant performance impact versus rolling your own loo0 and stack logic 07:17:47 Ok. 07:18:11 By the way, in what way are you using recursion in Python? 07:18:29 You might be better off with using iterators and list comprehensions 07:18:39 I was, and am 07:19:29 I do have a recursive data structure for my dictionary but that's a data structure 07:20:15 Word = namedtuple('Word', ['name', 'link', 'code']) 07:21:55 Sure. 07:26:50 What do you think runs faster, >R or ROT 07:29:15 For me, it's >R 07:29:52 I'll add up the cycles and see exactly by how much 07:31:27 --- quit: tabemann (Ping timeout: 244 seconds) 07:32:14 >R touches 2 cells, ROT touches 3 07:32:38 oh depending on your TOS 07:32:55 My TOS is cached in a register 07:33:27 then ROT would be 2 cells, and it doesn't change the depth of your stack 07:34:01 My ROT takes approximately 4 times as more cycles than >R 07:34:07 wow it's closer than i thought... you might have to profile 07:34:22 Profile? 07:34:31 yeah that's surprising to me 07:34:41 measure the time it takes 07:34:53 Why not count the cycles? 07:35:04 Well I can't measure the time on my target, yet. 07:35:06 that's what i meant 07:35:10 that counts as profiling 07:35:18 Ok 07:36:49 i was going to do something productive on my day off today like find the last piece of heart in link's awakening, but you guys are making me want to work on forth instead 07:37:13 Yep. ROT takes 164 cycles, >R takes 56 07:37:22 2.92 times slower. 07:37:49 Oops >R takes 60 cycles 07:37:59 Do I count NEXT in my profiling? 07:38:35 I would just because I think it would make the ratios more representative 07:39:26 I guess you could argue either way 07:40:42 is your return stack a hardware stack 07:40:51 My NEXT is a jump instruction 07:40:56 No it's implemented in memory 07:41:10 it's all on github 07:41:20 https://github.com/siraben/ti84-forth/blob/master/forth.asm#L440 07:41:23 Here's the >R 07:41:45 PUSH_BC_RS is a macro that "pushes" the 16-bit register BC to the return stack. 07:42:09 BC is my TOS 07:42:35 is that Z80 ? 07:43:38 Yes! 07:43:50 that's cool 07:44:12 I have a love/hate relationship with it. It's a dead simple assembly language but devoid of more "advanced" instructions 07:44:39 Still very impressed that TI managed to turn it into a graphing calculator. 07:44:56 i downloaded the z80 pdf 07:45:15 the user manual 07:49:16 I was trying to compare speeds of RECURSE vs DO..LOOP... but the numbers get too high and Lina segfaults, lol 07:50:19 idk what gforth will do though 07:55:15 dave0: cool. My reference is http://tutorials.eeems.ca/ASMin28Days/ref/z80is.html 07:55:31 I should get to know interrupts better, still learning. 07:56:44 siraben: ah looks interesting... easier to navigate than the pdf 07:57:58 siraben: does it still work if you disable interrupts? 07:59:48 dave0: Does what work? 08:00:36 your forth 08:00:49 Yep. 08:00:51 Fully working. 08:00:59 cool! 08:01:06 I'm not sure if I disable interrupts, theoretically it should. 08:01:22 Actually, maybe bad things will happen when I try to read/write from the I/O port. 08:03:24 how did you get >R so fast? i'm going to look in your forth.asm file 08:05:36 Line 440 08:13:07 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 08:17:56 dave0: How fast is your >R, then? 08:22:54 i don't have one for z80, i've only done >R in x86 08:25:17 when i was reading the z80 pdf i tried to write a little bit of code to push HL onto a BC "stack" 08:27:39 Cool, what's your x86 assembly look like? 08:27:58 to push HL onto BC it was 34 cycles, and to pop HL from DE was 34 cycles, so i assumed >R would be push+pop for a total of 68 cycles (not including next!) 08:29:10 siraben: but yours is faster 08:29:13 doh! 08:30:44 "thinking" in z80 imposes a certain kind of thought pattern, it seems. 08:30:59 i.e. literally everything is scarce, even registers 08:34:59 it has like 5 16-bit registers but you can only read/write 8 bits at a time 08:35:23 and everything has to go through A 08:37:01 Well, sometimes they have to. 08:37:13 I just seize those times in which they don't. 08:37:33 And yes, you can only read/write one byte at a time. 08:37:49 IY is reserved for interrupts on my OS, so I can't use it. 08:37:58 ah 08:39:27 That leaves, BC = TOS, DE = instruction pointer, IX = return stack pointer 08:39:38 HL = working registers 08:39:42 register* 08:42:02 siraben: do you know an emulator for the ti84 for linux? 08:42:53 dave0: I'l ask in #knightos (basically the only TI84 related channel on freenode), brb. 08:43:27 siraben: thanks! 08:44:06 siraben: i think you used SP = data stack ? 08:44:37 Right. 08:45:03 I got this reply: "z80e, tilem" 08:45:16 i'll google 08:47:50 http://lpg.ticalc.org/prj_tilem/ 08:54:58 z80e comes with knightos 08:55:07 https://www.cemetech.net/projects/jstified/ 08:55:23 Ah, KnightOS is not the same as TIOS 08:55:34 My interpreter is only tested (and thus only works) on TIOS 08:57:10 Ok, there's an emulator for Android as well. 08:57:11 wabbit 08:57:54 tilem looks like the thing for me... it says 2012 which is when i last upgraded my linux box so it should work :-p 08:58:23 I've seen it work on my friend's phone, but you'll need a ROM, which can be pretty hard to find these days. I'll ask him about it. 08:59:19 no rush, i'll have to put tilem on linux first :-) 08:59:48 :-) It'd be nice to have other people test it out as well 08:59:56 And see what they can make and so on 09:00:33 I need to get an emulator working as well, not having a working calculator has essentially stopped all progress. 09:01:49 siraben: what's your normal machine that you code on? 09:02:21 That I write the assembly program in?? 09:02:32 I write it on my computer then flash it to the calculator 09:02:42 Oops I meant to use ? not ?? 09:02:52 yeah like emacs and gcc and everything? 09:03:46 or text editor and compiler? 09:05:00 Emacs, spasm-ng (assembler), TI-Connect (flasher) 09:05:08 linux? windows? 09:05:11 mac? 09:05:18 Mac 09:05:28 hmm KipIngram also has a mac 09:05:50 It should be possible to do everything on Linux, though 09:06:12 spasm-ng, and appropriate substitutes for TI-Connect 09:06:14 Like TILP 09:06:39 i'm all over the place with my computers 09:07:30 i've become less and less organized over the years 09:08:19 but Forth is interesting and it's sucked me in :-) 09:08:27 I wonder where KipIngram is today, hope he stops by. 09:08:28 Yeah, same here. 09:08:48 Especially with respect to managing system configurations 09:08:56 At least I have a backup system, so that's good. 09:14:08 I'm here. 09:14:27 Just been stressed at work recently, but suddenly everything has fallen into place. 09:14:37 So I'm looking forward to a nice worry-free weekend. 09:14:44 I was busy nailing down the last few bits of things. 09:14:58 What's new today? 09:15:08 And hey, thanks for wondering about me. :-) 09:24:23 siraben: tilem is on sourceforge: https://sourceforge.net/projects/tilem/ 09:29:38 siraben: i think you've read brad rodriguez web pages on Forth :o) 09:35:28 --- join: verisimilitude (~user@2604:180:2:725::698a) joined #forth 09:58:34 --- quit: Zarutian (Read error: Connection reset by peer) 10:02:50 --- quit: dlyund (Ping timeout: 272 seconds) 10:11:17 siraben: your next_sub: function is faster than you think... jp (hl) is only 4 cycles, not 13 10:46:32 --- quit: verisimilitude (Remote host closed the connection) 10:54:47 --- join: dys (~dys@tmo-081-172.customers.d1-online.com) joined #forth 11:55:43 --- quit: dys (Ping timeout: 268 seconds) 12:23:04 --- join: dys (~dys@tmo-116-158.customers.d1-online.com) joined #forth 13:05:30 --- join: Zarutian (~zarutian@173-133-17-89.fiber.hringdu.is) joined #forth 14:14:47 --- quit: dave0 (Quit: dave's not here) 14:32:27 I didn't realise gforth had all those $! $@ etc string handling words 14:32:38 God that makes everything in the world so much easier 14:33:45 --- quit: mtsd (Ping timeout: 245 seconds) 14:36:46 I may have spoken too soon, they're not in my distribution that's for sure, but they are in the online word index 14:40:51 ...`include string.fs`. 14:40:56 --- join: pierpa (4f12eaf7@gateway/web/freenode/ip.79.18.234.247) joined #forth 15:55:51 --- join: verisimilitude (~user@2604:180:2:725::698a) joined #forth 16:09:05 WilhelmVonWeiner, aaaa it's not forthy. It'd make more sense in forth if it was `."string.fs" include` or something :P 17:03:18 --- quit: verisimilitude (Remote host closed the connection) 17:08:20 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 17:10:51 --- quit: MrMobius (Ping timeout: 252 seconds) 17:10:52 --- nick: [1]MrMobius -> MrMobius 18:01:15 --- join: meta_x86 (18e4a485@gateway/web/freenode/ip.24.228.164.133) joined #forth 18:28:29 --- quit: meta_x86 (Ping timeout: 256 seconds) 18:48:49 --- join: meta_x86 (18e4a485@gateway/web/freenode/ip.24.228.164.133) joined #forth 18:48:53 Hello 18:49:22 Welcome meta_x86. 18:51:08 Hope all are doing well 18:51:25 i hope furq is suffering 19:04:21 ^ That gave me a good laugh 19:09:51 Don't know who 'furq' is 19:15:58 --- quit: bluekelp (Quit: Lost terminal) 19:21:31 oh damn i thought this was #lua 19:21:43 he's a guy in #lua 19:24:07 Oh. The lack of tags made it even funnier, and I'll admit I laughed for ~3 minutes 19:26:09 glad you enjoyed it! 19:27:36 I've been using forth-standard.org as a help guide as I finish up this Forth book, I noticed LEAVE and UNLOOP appear identical. What is the difference? 19:33:34 meta_x86: LEAVE transfers control to just past the next LOOP. 19:33:42 UNLOOP doesn't - it just continues execution. 19:33:51 They both remove the loop control stuff from the return stack. 19:34:21 Use LEAVE when you want to jump out of your loop - use UNLOOP follwed by EXIT when you want to *return* from inside your loop. 19:34:40 I see now! 19:34:45 Thank you 19:35:40 You bet. 19:36:41 UNLOOP is a lot simpler - it just didles the return stack and that's it. 19:37:55 LEAVE has to compile a jump to an as-yet-unknown target, so it hast to leave a patch address and a tag on the stack - that gets detected by LOOP. LOOP knows where the jump should land, so it goes back and patches up the jump. 19:37:56 --- join: tabemann (~tabemann@2602:30a:c0d3:1890:d004:a860:b5ff:7c1c) joined #forth 19:41:51 Interesting to keep in mind 19:42:30 I hope to write a forth, but am unsure if I will be capable of implementing everything in ANS, will probably be a subset 19:46:00 ANS-Forth 0< 19:49:48 --- join: rdrop-exit (~markwilli@112.201.162.180) joined #forth 19:49:52 ? 19:50:24 Hello Forthwrights :) 19:51:36 Hello :) 19:53:44 Hi! 20:03:15 : My-Forth-needs-ANS-compliance? key [char] y = if try-to-follow-ANS-words else make-subset endif ; 20:03:53 --- quit: pierpa (Quit: Page closed) 20:04:58 My Forths aren’t ANS compliant, not worth the trouble for me. 20:06:07 I find the ANS standard convoluted, simplicity has been lost 20:07:12 I’m not worried about portability 20:07:51 of source code 20:08:40 My host Forth is has a portable VM, any target code I produce doesn’t require portability 20:09:14 * crc agrees with rdrop-exit on this 20:09:34 I came to a similar conclusion but wanted to see what others thought 20:09:57 Forth seems more of a technique than a language per say. 20:10:29 But maybe the words in ANS will give ideas of possible words to include 20:10:39 I think of Forth as an approach to a computing technology stack, from hardware to user 20:11:50 I use an umbilical (AKA tethered) setup 20:12:38 The Host Forth runs on POSIX compliant Unix, and talks to the target over serial 20:14:24 I use the host forth to develop code to the target. The target code can be anbything from simple machine code to a full onboard Forth. 20:18:47 The ANS standard doesn’t cover many of the important aspects of a Forth, metacompilation, cross-compilation, multi-tasking… 20:22:31 The ANS standard is turning Forth into just another desktop language. 20:23:29 Where are those 3 aspects documented? 20:24:43 In the docs of specific Forths mostly, and in old articles and conference papers. 20:26:38 For examples of tethered Forths, see Forth Inc’s ChipForth and SwitX, I don’t remember the name of the equivalent MPE product. 20:26:48 *SwiftX 20:28:42 I think there are proposal drafts for adding cross-compilation and multi-tasking wordsets to ANS. 20:29:46 Thanks 20:29:57 My pleasure 20:32:26 BTW, can anyone recommend a IRC client for Mac? I’m using Colloquy and it’s buggy. 20:32:35 https://www.mpeforth.com/arena/XCtext5.PDF and https://www.mpeforth.com/arena/XCapp5.PDF are the (non-official) ANS cross compiler docs 20:33:52 Thanks! Have you had a chance to go over them? Any thoughts? 20:35:30 I've not looked at them in any detail. Both MPE & Forth Inc use this as a base for their cross compilers from what I understand. 20:37:36 Great, I’ll see what may be worth adopting and/or adapting. 20:38:47 It's not really relevant to my work at this point. (I use a variant of my own MISC VM for the limited embedded tests I've done, and haven't had to do anything umbilical yet) 20:39:46 Have you used Forth for high level applications? 20:40:09 https://www.mpeforth.com/arena/XC7man.pdf is a 208 page document about the MPE Forth 7 Cross Compiler 20:42:07 Yes. I use Gopher and HTTP servers written in Forth for hosting my personal servers, and have written a number of user facing applications for my employer that involve Forth. 20:43:23 Very nice. I don’t use Forth for anything high level. 20:45:37 [[http://pygmy.utoh.org/3ins4th.html][http://pygmy.utoh.org/3ins4th.html]] 20:46:02 [facepalm] 20:46:03 [[http://pygmy.utoh.org/3ins4th.html][3 Instruction Forth]] 20:46:37 I use a similar approach to 3 instruction Forth for my target monitors. 20:47:03 Gotta take the dogs out before it gets too hot. See you guys later. 20:47:22 --- quit: rdrop-exit (Quit: rdrop-exit) 20:51:26 See you later rdrop-exit 21:01:49 --- quit: john_metcalf (Ping timeout: 252 seconds) 21:04:45 I'm off to sleep. Thanks for the discussion guys 21:05:10 --- quit: meta_x86 () 21:09:38 --- join: verisimilitude (~user@2604:180:2:725::698a) joined #forth 21:42:52 --- quit: rpcope (Ping timeout: 264 seconds) 21:45:16 --- join: rpcope (~GOTZNC@muon.copesystems.com) joined #forth 21:49:12 --- join: bluekelp (~bluekelp@bluekelp.com) joined #forth 21:55:00 --- quit: dddddd (Remote host closed the connection) 22:39:31 --- quit: FatalNIX (Read error: Connection reset by peer) 22:39:34 --- quit: verisimilitude (Remote host closed the connection) 22:40:06 --- join: FatalNIX (~FatalNIX@caligula.lobsternetworks.com) joined #forth 23:01:39 --- join: verisimilitude (~user@2604:180:2:725::698a) joined #forth 23:06:24 --- join: dave0 (~dave@90.20.215.218.dyn.iprimus.net.au) joined #forth 23:06:52 hi 23:08:53 Hello. 23:09:59 What Forth-related material have you been working on lately, dave0? 23:10:09 hi verisimilitude 23:10:31 still just reading other people's code :-) 23:10:58 Alright. 23:11:18 I'd like to use Forth more, but I always seem to find myself needing to interface with something that makes it unpleasant. 23:11:20 i think subroutine threading is good for the old 8-bit cpu's 23:11:36 The filesystem is one such something. 23:12:02 is making files and directories in the Forth standard? 23:12:22 I believe so, but ANSI Forth itself is rather large. 23:12:50 i've only read the core words in the standard 23:13:14 Dynamic memory management is another extension word set I'd need for some things. 23:13:27 ansi forth looks much better than ansi c, which is where i come from :-) 23:15:31 I agree with you there. 23:16:14 So, I suppose my main issue with Forth is not having a problem that would benefit from its rather unique set qualities. 23:47:00 dave0: Not sure if you were around when I said in this channel that I have to switch to indirect threading 23:47:10 PC can't exceed $C000 23:47:57 siraben: is that for your calculator? 23:48:13 Yes 23:49:06 siraben: bummer 23:49:37 dave0: seems to be an OS limitation 23:49:37 i heard it's slower 23:49:48 Oh most definitely. 23:50:17 I can't figure out how to write NEXT without losing TOS and a significant slowdown. 23:54:28 jonesforth has code for that 23:55:04 --- quit: dys (Ping timeout: 252 seconds) 23:55:14 but it has those exact disadvantages 23:59:32 --- join: dys (~dys@tmo-122-215.customers.d1-online.com) joined #forth 23:59:59 --- log: ended forth/18.10.19