00:00:00 --- log: started forth/18.12.08 00:03:46 --- quit: pierpal (Ping timeout: 250 seconds) 00:06:56 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 00:25:26 --- quit: pierpal (Read error: Connection reset by peer) 00:36:47 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 00:39:08 --- quit: pierpal (Read error: Connection reset by peer) 00:40:47 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 00:43:31 --- quit: pierpal (Read error: Connection reset by peer) 00:43:44 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 00:47:57 --- quit: pierpal (Ping timeout: 244 seconds) 00:48:38 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 00:50:39 --- quit: pierpal (Read error: Connection reset by peer) 00:50:48 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 00:50:51 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 00:54:54 --- quit: pierpal (Ping timeout: 250 seconds) 00:57:29 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:02:29 --- quit: pierpal (Ping timeout: 268 seconds) 01:04:39 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:06:56 --- join: gravicappa (~gravicapp@h109-187-52-39.dyn.bashtel.ru) joined #forth 01:08:56 --- quit: pierpal (Ping timeout: 246 seconds) 01:17:08 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:23:37 --- quit: pierpal (Read error: Connection reset by peer) 01:24:57 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:27:11 --- quit: pierpal (Read error: Connection reset by peer) 01:27:27 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:29:28 --- quit: pierpal (Read error: Connection reset by peer) 01:31:32 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:34:57 --- quit: pierpal (Read error: Connection reset by peer) 01:35:13 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:50:22 --- quit: pierpal (Ping timeout: 250 seconds) 01:54:57 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:57:09 --- quit: pierpal (Read error: Connection reset by peer) 02:00:17 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:03:25 --- quit: ashirase (Ping timeout: 246 seconds) 02:04:29 --- quit: pierpal (Ping timeout: 240 seconds) 02:06:57 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:08:22 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:10:21 --- quit: pierpal (Read error: Connection reset by peer) 02:10:36 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:15:00 --- quit: pierpal (Ping timeout: 245 seconds) 02:17:07 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:20:09 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 02:21:09 --- quit: pierpal (Ping timeout: 240 seconds) 02:24:58 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:27:24 --- quit: pierpal (Read error: Connection reset by peer) 02:29:13 --- quit: john_cephalopoda (Quit: Trees can see into your soul.) 02:29:28 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 02:33:18 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:36:14 --- quit: pierpal (Read error: Connection reset by peer) 02:36:22 Hey 02:37:52 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:39:56 --- quit: pierpal (Read error: Connection reset by peer) 02:40:06 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:57:45 --- quit: pierpal (Read error: Connection reset by peer) 02:59:33 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 03:03:01 hi john_cephalopoda 03:06:56 --- quit: pierpal (Ping timeout: 244 seconds) 03:11:27 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 03:13:15 dave0: z80? Where? 03:13:31 I know some z80 myself ;-) 03:13:44 ehehe 03:14:07 a little bit of z80 assembly for practise 03:14:47 i looked z80 up on wikipedia... they made lots of computers with z80's in it 03:15:02 lots with 6502 too 03:15:25 I got a Z80 (TI 83 + calculator) at home :þ 03:15:29 --- quit: pierpal (Ping timeout: 240 seconds) 03:15:43 why doesn't it have forth on it! 03:16:17 Didn't get to it yet. 03:17:06 I still didn't manage to write my own Forth. 03:17:53 me too... i keep getting distracted with little interesting side-things 03:18:52 I want to write a game in Forth. Using sixels for graphics. 03:19:21 like space invaders? or something totally new? 03:19:28 Something more advanced. 03:19:45 An RPG maybe. 03:21:14 Shouldn't be too hard to make. 03:22:16 --- quit: dddddd (Remote host closed the connection) 03:22:21 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 03:23:03 i like simple games where it's easy to learn and play 03:23:38 --- quit: pierpal (Read error: Connection reset by peer) 03:24:13 i'm impatient when it comes to games :-) 03:24:36 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 03:24:49 simple like you can dive into it really easy 03:28:45 --- quit: pierpal (Ping timeout: 245 seconds) 03:28:58 Use my Forth for TI calculators! 03:29:29 john_cephalopoda: dave0: https://github.com/siraben/ti84-forth 03:30:49 But beware there's limitations on how many new words you can define, it's direct threaded, and the program counter can't exceed $C000 otherwise the OS crashes 03:31:04 There's a prebuilt binary available. 03:31:18 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 03:33:44 --- quit: pierpal (Read error: Connection reset by peer) 03:37:13 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 03:39:03 * dave0 checks out ti84-forth/forth.asm 03:40:44 siraben: i was experimenting with the register assignments on z80 03:40:58 siraben: i think subroutine threading would be good for z80 forth 03:41:14 but it would result in a performance hit 03:43:03 There's a lot of words that were originally interpreted but then I used SEE to decompile them 03:43:04 Including SEE itself 03:43:18 siraben: your next_sub is 47 cycles in forth.asm but call/ret is 17+10 cycles 03:43:42 Huh that's true. 03:44:01 What would the register assignments be? 03:44:18 sp would have to be the return stack 03:45:21 i have hl as data stack and de as top-of-stack 03:45:43 Then you'd be hit with a slower stack, right? 03:45:55 yep :-( 03:46:58 I was thinking of going indirect threaded, but that would result in losing TOS and a slower NEXT 03:47:11 But you treat words as data not code, because it's just a list of addresses 03:47:20 Means that I don't need to worry about IP exceeding $C000 03:47:46 However, I've been looking into writing an OS for the calculator and there is a way to disable this memory limit 03:48:01 if sp is the data stack, push is 11 cycles, pop is 10 cycles 03:48:09 Forth based OS, so to speak. I would need a better assembler than this one, though, because the macro system isn't cutting it. 03:48:15 Might have to write my own assembler 03:48:16 if hl is the data stack, it's 26 cycles for push and pop 03:48:31 26 cycles each 03:48:41 Ah, how does one calculate these costs? Do I have to look them up manually? 03:49:04 yeah i used the data sheet 03:49:56 i don't think i wrote down the url :-/ 03:51:07 d-oh 03:51:34 oh wait 03:51:55 https://www.ticalc.org/pub/text/z80/z80.txt 03:52:29 that lists all the instructions 03:53:24 siraben: subroutine threading is also bigger 03:53:50 3 bytes for a call instruction vs. 2 bytes for an indirect address 03:55:39 siraben: i like z80, it has lots of registers and they're 16 bits 03:58:32 how much of a different programmer i would be if those 8-bit computers ran Forth instead of basic ;-) 03:59:13 i learned basic on a trs-80 in the early 80's by typing out programs in a magazine 04:06:08 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 04:09:10 --- quit: MrMobius (Ping timeout: 245 seconds) 04:09:10 --- nick: [1]MrMobius -> MrMobius 04:10:13 dave0: huh, I wish z80 had more registers 04:10:25 Maybe it's just enough 04:10:37 There's also the index registers and shadow registers 04:11:11 siraben: try 6502 it has 4 8-bit registers 04:11:18 hehheh 04:11:31 I think the calculator's a good way to experiment with Forth. RAM should be treated as something transient and it's ok to crash it (as long as you don't screw up flash in the process!) 04:11:41 By crashing it I mean overwriting OS code 04:12:48 your readme file says it's a popular calculator with students 04:13:21 It's mandatory, basically. 04:13:53 Everyone in my high school has a TI, every single person. The exact model differs, a lot have 84+, none have 83+, some have the color displays or the newer CE models 04:14:11 Because you need it to take the SAT/ACT/Subject Tests/IB/AP 04:14:27 oh! 04:25:51 Education these days is full of monopolies. 04:26:07 College Board probably makes the most money out of all these organizations 04:26:43 According to Wikipedia, its 2014 revenue was US$840.7 million 04:36:49 --- join: rdrop-exit (~markwilli@112.201.164.82) joined #forth 04:37:30 My high school was strict, no calculators at tests, only slide rules. 04:38:30 --- quit: pierpal (Ping timeout: 250 seconds) 04:38:52 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 04:38:53 rdrop-exit: at least they werent sufferring from abacaii 04:38:55 I read about them before in a book, seemed convenient 04:39:53 They were fun, I've been thinking or reacquiring one for the hell of it. 04:42:53 I still have a couple of calculators, HP-16C and the last calculator I ever bought, an HP-48GX. 04:43:08 --- quit: pierpal (Ping timeout: 246 seconds) 04:43:26 Stack based calculators were popular in the US, right? 04:44:53 Yes, for a while, the HP ones. 04:45:24 No one seems to know about them here, at least where I live in Bangkok. Most people know of and have used the standard pocket calculators 04:46:02 I think in the british or thai curriculum schools they tend to use casios 04:46:51 The HP calculator engineers were into Forth, the language on some of them, called RPL was Forth inspired. 04:47:22 Yeah I think KipIngram used it heavily at the time 04:47:26 He's mentioned it before 04:50:12 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 04:50:27 My favorite calculator was the 16C, it was really oriented towards bithacking 04:51:04 Only 200 or so bytes of RAM 04:51:17 https://en.wikipedia.org/wiki/HP-16C 04:51:39 Wow, only 200 bytes? 04:52:44 You could set the word width on it up to 64 bits, and set it to 1s-complement arithmetic 04:52:55 --- quit: pierpal (Read error: Connection reset by peer) 04:53:08 Much too little RAM for my tastes 04:53:09 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 04:54:09 It's just for calculations, especially bitwise operations 04:54:44 It was the only calculator designed specifically for computer programmers/engineers 04:55:50 The keys on that Voyager series of calculators are the best keys ever on a calculator 04:57:33 --- join: Zarutian_2 (~zarutian@89.17.133.173) joined #forth 04:57:34 Cost me $120 in the early 80s 04:57:42 --- quit: Zarutian (Read error: Connection reset by peer) 04:57:53 --- nick: Zarutian_2 -> Zarutian 04:58:03 --- quit: pierpal (Ping timeout: 268 seconds) 04:59:33 Bought it at Macy's in San Francisco 05:00:16 https://en.wikipedia.org/wiki/HP-16C#/media/File:Hp16c.jpg 05:01:21 Cool 05:01:33 I haven't seen old calculators at all in real life 05:03:20 Hopefully you'll get a chance to check some out at some point 05:04:01 Today's calculators feel really cheap by comparison 05:04:28 Cheap in what way? 05:04:33 That they can't do as much? 05:04:56 No, I mean the physical feel of the keys and the case 05:05:40 Personally I can't tell because I haven't used any other. 05:05:43 New calculators feel more toy-ish 05:06:10 There should be cheap calculators that take advantage of powerful technologies and chips 05:06:20 I'd like to see a greenarray based one, that'd be interesting 05:07:35 right 05:08:25 The CPUs on the old calculators were 4-bit 05:08:45 nibble machines :) 05:09:04 https://en.wikipedia.org/wiki/HP_Saturn 05:09:50 Interesting fact: I watched in a talk that the ALU for the Z80 is actually 4 bit but because it's fast it can do two rounds of 4 bit calculations to simulate 8 bit 05:09:57 That's the CPU on my HP48GX 05:10:47 right 05:11:23 https://youtu.be/aHx-XUA6f9g?t=341 05:11:55 Cool 05:12:30 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 05:12:41 siraben: let me guess. It is fast rom logic based? 05:12:42 Nice 05:12:52 Zarutian: what is? 05:13:02 siraben: the Z80 alu 05:13:24 Looks like actual adders and so forth 05:13:56 There's also an interesting video by the guy who reverse-engineered the 6502 05:14:02 right, because the feature size of those chips didnt make affordance to such. 05:15:01 https://www.youtube.com/watch?v=fWqBmmPQP40&t=36s 05:15:49 --- quit: pierpal (Read error: Connection reset by peer) 05:16:03 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 05:21:01 Gotta go, chat again soon 05:21:12 --- quit: rdrop-exit (Quit: Lost terminal) 05:54:49 Better buy a phone, not a calculator. 05:55:03 The TI83 plus still costs like 80 EUR. 05:55:55 isnt there an TI83 emulator app on android these days? 06:06:17 wabbitemu 06:06:43 Simulates the entire system to the chip 06:21:24 Hmmm... 06:26:23 It's pretty amazing, because the OS is completely oblivious to the fact that it's an emulator and happily works with the LCD display, reads and writes to flash and so on 07:05:11 --- nick: kipingram1 -> KipIngram 07:05:21 --- mode: ChanServ set +v KipIngram 07:06:59 Hey KipIngram 07:14:03 Any of you here use NixOS? 07:14:33 I've been experimenting with it and customizing it all day today, it's such a good distribution 07:15:04 Got CRUX on all my boxes :þ 07:15:14 I used Alpine once. 07:15:50 What do you like about alpine? 07:16:44 Just used it on a server that I got ssh access to. It seems like a fine distro. 07:17:42 I see. 07:18:05 I like NixOS because it takes a purely functional approach to package management. 07:18:22 My entire configuration is controlled by a single file (could be multiple files later), all the packages and settings and so on 07:19:00 If there was an advanced Forth OS with all the tools one needs, I'd probably transition to use that. 07:19:07 If I screw up my configuration, I can go back to previous working ones. So in that way I can really do anything and not worry about it 07:19:20 An advanced Forth-based OS would be an interesting idea. 07:19:48 I think there needs to be a safer way to do things in Forth, there's too much arbitrary code execution going on for me to trust it for security purposes. 07:19:49 Should not be too complex to write one. 07:20:03 I wouldn't consider it a "safe" language 07:20:07 "Arbitrary code execution"? 07:20:36 I suppose it depends on how you structure the OS 07:20:38 It is nice and layered. You can build protections into ALLOT and ! and @ to make sure that only a specific memory area can be addressed. 07:21:02 Ah, I forget that chips like x86 actually have memory protection 07:21:14 My understanding of Forth is completely tied to Z80, heh 07:21:33 Right, no doubt you could reach that level of abstraction quickly. 07:21:53 Even without memory protection, you can use layers. Redefine ! in the top kernel layer, so a userspace program can only use a part of it. Even without MPU. 07:22:00 C has a lot of ambiguity, whereas with Forth that tends no to be the case 07:22:12 I saw a program that implemented exceptions in Forth 07:22:25 I don't really know how exceptions work. 07:22:41 Semi-magical, really adds a lot of protection to one's program 07:22:54 You can restore state as it was before you tried an action and failed 07:23:25 You can use a variation exceptions to simulate complex control structures like backtracking and non-determinism 07:23:35 https://github.com/AlexandreAbreu/jonesforth/blob/ea66dd72848b59f2113da8f2da0db73d5130e407/jonesforth.f#L1193 07:24:26 Backtracking: https://www.complang.tuwien.ac.at/forth/backtracking-in-ansforth 07:24:41 Exceptions fit right in with safety 07:25:00 Less reliance on magical NULL values 07:26:39 A Forth-based shell would be natural to most people, like how unix pipes are used 07:27:23 john_cephalopoda: What other ideas could be useful? 07:28:22 I think what KipIngram is working on has a lot of elements of an OS in place alread.y 07:32:06 What was KipIngram's project again? 07:33:21 I think "Everything is a file" is a pretty nice concept. Doing actions on files is quite simple with Forth. 07:33:35 --- quit: gravicappa (Ping timeout: 246 seconds) 07:43:49 It's hard to keep an overview over projects here :þ 08:21:19 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 08:53:54 KipIngram is writing a forth for macOS 09:15:11 --- join: PoppaVic (~PoppaVic@unaffiliated/poppavic) joined #forth 09:29:06 siraben: Ah, right, the mysterious forth for macOS that isn't available anywhere yet :þ 09:29:22 heh 09:29:48 No harm in that, he might have commerical plans for it 09:30:06 Plus he's given enough details in some places to indicate that it's very likely a real project 09:30:18 --- join: gravicappa (~gravicapp@h109-187-52-39.dyn.bashtel.ru) joined #forth 09:30:38 An eventual public release wouldn't hurt, though :D 09:39:36 siraben: Well, nothing wrong with that, but if it's not released it can't be used to do fun things with it. 09:40:02 #can't show support for it if it isn't Free Software 09:40:30 Keep that proprietary stuff outta my systems! 09:41:31 That's ironic, since it's for MacOS. 09:41:57 Could run Darwin. 09:42:19 Isn't there some FOSS mac OS clone floating around anyway? 09:43:06 s/Darwin/OpenDarwin/ 09:45:44 Yes, something such as that. 09:46:03 Will this Forth have graphics primitives, I wonder. 09:46:37 I am working on graphics primitives for sixels in gforth right now :D 09:48:44 I considered writing a Common Lisp library for sixels, but I was unable to find any terminal that actually supports them. 09:48:50 I had no luck with xterm. 09:48:52 Lole. 09:49:15 unlike many people I am not averse to just opening an image viewer 09:49:37 `sxiv -a file.ext` heh 09:51:24 I just thought it would be neat to support. 09:53:10 verisimilitude: Try mlterm. 09:53:19 verisimilitude: What's your distro? 09:54:57 I use GuixSD and OpenBSD, currently. 09:55:30 Well, the former doesn't have mlterm, it seems. 09:56:02 xterm should support it but that of your distribution may not be compiled with it by default 10:03:12 --- quit: dave0 (Quit: dave's not here) 10:45:39 verisimilitude: https://thecutecuttlefish.org/ports/crux-3.4/mlterm/Pkgfile 10:45:46 Instruction to build mlterm. 11:13:21 --- quit: pierpal (Read error: Connection reset by peer) 11:22:11 siraben: My Forth isn't really "for" MacOS; it will run there because that's my development platform. But I'm really hoping for it to be more generic than that - my primary target for it is embedded systems I build in the future. 11:45:56 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 11:57:08 --- quit: gravicappa (Ping timeout: 246 seconds) 12:13:08 KipIngram: What are the features of your Forth? 12:43:10 --- quit: verisimilitude (Remote host closed the connection) 12:59:14 Will it be a competitor to Mops 13:05:37 --- quit: irsol (Ping timeout: 246 seconds) 13:24:18 --- join: irsol (~irsol@unaffiliated/contempt) joined #forth 13:43:01 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 14:23:56 --- quit: pierpal (Ping timeout: 250 seconds) 14:50:42 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 14:55:34 --- quit: Zarutian (Read error: Connection reset by peer) 14:55:40 --- join: Zarutian_2 (~zarutian@173-133-17-89.fiber.hringdu.is) joined #forth 14:56:03 --- nick: Zarutian_2 -> Zarutian 15:02:23 --- quit: mark4 (Ping timeout: 268 seconds) 16:13:58 --- join: rdrop-exit (~markwilli@112.201.164.82) joined #forth 16:14:18 Good morning Forthwrights :) 16:21:56 --- quit: pierpal (Ping timeout: 268 seconds) 16:33:09 Hi rdrop-exit 16:33:18 Hi John 16:48:13 --- quit: nerfur (Ping timeout: 272 seconds) 16:49:26 --- join: nerfur (~nerfur@broadband-95-84-184-13.ip.moscow.rt.ru) joined #forth 16:58:37 --- quit: john_cephalopoda (Ping timeout: 252 seconds) 17:00:44 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 17:30:26 Um, well, let's see. 17:31:30 64-bit data items, 32-bit "internals." Largely FIG-like word set. But on the interesting side, it supports stack frames (a sort of local variable implementation, though not "fully"), and formatted numeric output. 17:31:56 On the language front it supports conditional returns, multi-level returns, and a few other "non-standard" things. 17:32:04 KipIngram: do you have exceptions and non-local exits? 17:32:08 I've found the conditional and multi-level returns to be useful as hell. 17:32:10 Ah you mentioned that 17:32:12 Totally changed the way I code. 17:32:24 No exceptions. 17:32:25 exceptions still make me want to scream 17:32:44 What do you mean by "non-local" exit? 17:32:44 PoppaVic: why? 17:33:00 Erm, I think of Scheme's concept of "continuations" 17:33:07 In the C world it's setjmp/longjmp 17:33:08 Not familira with that. 17:33:10 Ah. 17:33:14 No, I don't really have that. 17:33:15 siraben: because if I wanted C++ I'd use C++ - I almost never see a reason for "exceptions' 17:33:35 Because you can use non-local exits to implement interesting control structures 17:33:35 KipIngram: seyjmp/longjmp is easy to grok 17:33:40 Multiple returns, nondeterminism, etc. 17:33:50 Well, it supports FIG Forth ERR and ?ERR, which is a limited, single-purpose sort of longjmp thing. 17:34:00 You can't use it within a program and target it to anything other than error recovery, though. 17:34:14 I can do multiple returns. 17:34:34 I have ;, in addition to ; - ; compiles the runtime (;) and switches STATE back to interpret. 17:34:39 ;, just compiles (;). 17:34:48 Oh, and it supports tail optimization on both of those. 17:34:52 PoppaVic: Exceptions are a language feature, you can use it or not. 17:35:05 siraben: as long as it's got a hammer. 17:35:13 I think it's reasonable to have it (or an equivalent) in a sufficiency advanced programming language 17:35:25 sufficiently* 17:36:27 Exception handling is simple, although ANS makes it them more complicated than necessary 17:37:03 It shouldn't be that hard to add something like setjmp/longjmp, implemented in Forth. 17:37:03 Two primitives are all that's really required 17:37:10 rdrop-exit: which ones? 17:37:15 The way Forth gives you access to the return stack makes all kinds of things possible. 17:37:22 KipIngram: exactly. 17:37:31 It's the concept of "continuations", embodied in a stack 17:38:04 I think combining data and return addresses in a single stack obscures a lot of ideas to ASM programmers 17:38:06 (try) and (tried) 17:38:06 I've found that the conditional and multi-level returns have reduced my use of IF ... THEN to almost zero. 17:38:29 Me too, hence my user name :) 17:38:34 siraben: I can get behind that idea - yeah. Separating them is very nice. 17:38:42 :-) 17:38:43 KipIngram: can you give an example? "foo IF bar ELSE baz THEN ..." 17:38:58 ^to your reduction of IF THEN 17:39:02 go, kip ;-) 17:39:02 Well, IF ELSE THEN is a bit more involved. harder to replace. 17:39:07 Let me do an IF THEN example. 17:39:12 Sure 17:39:24 So say you have 17:39:37 : foo if ... then ; 17:39:46 Or rather 17:39:53 : foo 0= if ... then ; 17:39:58 That would just become 17:40:12 : foo 0<>; ... ; 17:40:24 If it's NOT zero, return. Otherwise do it. 17:40:48 In my Forth they would be: 17:40:50 It does require factoring that stuff into its own word, with no other clutter, to work, but I like factoring anyway. 17:41:02 : foo ... ?; ... ; 17:41:13 and : foo ... 0; ... ; 17:41:42 actually in the wrong order 17:42:04 ?; is exit on non-zero 17:42:11 0; is exit-on-zero 17:42:38 ?bail; is rdrop and exit on non-zero 17:43:25 ?2bail; is 2rdrop and exit on non-zero, etc, etc... 17:43:28 So ?bail; does an extra return level? 17:43:32 Yes, ok. 17:43:41 yes 17:43:49 Well, I like my naming convention, but obviously just because I made it up to suit myself. :-) 17:44:11 That's the beauty of Forth, you can have it your way :) 17:44:15 siraben: Do you know about tail recursion? 17:44:18 Yes, absolutely. 17:44:24 Tail optimization, rather? What it is? 17:44:25 We're the Burger King of languages 17:44:32 lmao 17:44:34 Right. 17:47:18 KipIngram: why of course 17:47:28 It's mandatory for Scheme implementations 17:47:40 --- join: dave0 (~dave0@47.44-27-211.dynamic.dsl.syd.iprimus.net.au) joined #forth 17:47:48 Oh, ok. :-) Well, just checking. I don't know Scheme, so... 17:47:49 Hence why writing tail recursive functions is optimal 17:47:55 It's too useful not to know. 17:47:55 hi 17:48:00 Hi dave0 17:48:29 Ah I see. There's a lot of deep ideas that can be found in scheme 17:48:32 hi KipIngram 17:48:40 I haven't understood them completely 17:49:01 Back to exceptions, there are simpler ways than the one the ANS committee settled on 17:50:33 How does Chuck handle exceptions? 17:50:36 Siraben: you're right about the combination of data and return stacks causing complications 17:51:27 One example is coroutines which are super simple in Forth, but convoluted to implement in other languages 17:52:25 I was just reading a paper on "asymmetric" and "symmetric" coroutines and it made me laugh 17:53:14 https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.58.4017 17:54:01 In Forth we have both types trivially 17:57:49 Chuck has a one instruction coroutine yield in Color Forth 17:58:17 correction Machine Forth 18:01:37 The Wikipedia page on coroutines is pretty bad as well 18:03:18 The salient difference in Forth between a Cooperative Task and a Coroutine is that the task has its own stacks and instruction pointer, while coroutines share them. 18:05:44 I've never actually had a need for coroutines, but it is neat how trivial they are in Forth. 18:06:34 afaik, yer only "coroutine" in forth is a Task 18:07:51 Not really, just add a coroutine yield primitive to your forth: 18:08:07 yield ( -- )( r: a -- ip ) 18:09:37 Yield to coroutine, exchange the instruction pointer with the top of the return stack 18:10:10 Chuck has a different name for the instruction which I can't recall off the top of my head 18:10:42 That's all you need 18:11:10 A cooperative task is more heavyweight, requires its own stacks and instruction pointer 18:12:48 You can interleave words by yielding back and forth between them, as long as they're stack neutral at each yield point 18:15:08 Yield is the lightweight analogue to pause, but for coroutines 18:16:40 --- quit: ncv (Remote host closed the connection) 18:19:44 Chuck calls the instruction EX and uses it as a factor of an EXECUTE macro in Machine Forth 18:22:00 Sometimes I feel that the functional programming oriented computer scientists get buried in their abstractions. 18:23:31 While Chuck just cuts to the heart of the matter. 18:37:20 Gotta go, kids are coming over for Sunday brunch. Chat again soon. 18:37:30 --- quit: rdrop-exit (Quit: Lost terminal) 18:45:55 --- join: sonofentropy (~textual@84-10-10-170.static.chello.pl) joined #forth 18:49:35 KipIngram: yield is very similar to "call-with-current-continuation" in Scheme 18:50:05 One you have that, then you have any control structure you wish 18:59:06 --- quit: PoppaVic (Ping timeout: 268 seconds) 18:59:59 --- join: johnnymacs (~user@c-73-83-39-203.hsd1.wa.comcast.net) joined #forth 19:00:21 --- join: PoppaVic (~PoppaVic@unaffiliated/poppavic) joined #forth 19:10:49 --- quit: sonofentropy (Read error: Connection reset by peer) 20:04:49 --- quit: johnnymacs (Ping timeout: 240 seconds) 20:44:15 --- join: gravicappa (~gravicapp@h109-187-52-39.dyn.bashtel.ru) joined #forth 20:59:05 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 21:02:10 --- quit: proteusguy (Ping timeout: 250 seconds) 21:13:37 --- quit: pierpal (Ping timeout: 268 seconds) 22:24:27 --- quit: dddddd (Remote host closed the connection) 23:59:59 --- log: ended forth/18.12.08