00:00:00 --- log: started forth/18.10.01 00:05:32 btw, talking about TI-84, looks like TIs is best for portable Forth right now or are there better alternatives? 00:08:27 john_metcalf, ho ho hp ) your itsy is popular) 00:08:28 ; TI 84 Plus CE Forth by Brian O'Dell ; Based on Itsy-Forth by John Metcalf http://www.retroprogramming.com/2012/03/itsy-forth-1k-tiny-compiler.html 00:08:42 I'm writing a Forth for the TI-84 Plus https://github.com/siraben/ti84-forth , not the CE one 00:09:02 They have different machine code instructions. 00:10:03 I know about your Forth, that's why I asked about "portable Forth" :) 00:10:50 Ah, then no. It would be interesting for someone to find a way to integrate C code, SDCC and write a portable Forth, though. 00:11:58 I think because there's a lot of special stuff with the TI calculators (e.g. there's no carriage return, disk system etc.) that makes it hard to port existing implementations. 00:16:47 nerfur: What do you mean by "TIs is best for portable Forth"? 00:22:47 we probably misunderstood each other, I mean portable not like "porting from arch to arch", but as "carry with you" 00:23:32 Oh I was just about to say, yeah I suppose. All my friends have to have a TI calculator (84+ or the newer CE). 00:23:50 It's a microcomputer, and actually since getting my Forth to work I have carried it around with me 00:25:00 You could have a Forth for Android and iOS though. By using Termux for Android, and then finding a way to download a Forth app on iOS, although there's restrictions on arbitrary code execution 00:29:46 what about lifetime? 00:32:30 Then the TI wins out. I just change batteries once or twice a year. No hardware damage as long as you take reasonably good care of it. 00:49:25 --- quit: wa5qjh (Quit: No Ping reply in 180 seconds.) 00:50:43 power of z80 ) 00:51:34 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 01:28:25 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 01:33:55 nefur: thanks, I don't think I've seen the TI Forth based on Itsy before. 01:34:45 I have a half-completed Z80 version of Itsy here actually. 01:40:18 --- quit: wa5qjh (Remote host closed the connection) 02:03:21 --- quit: ashirase (Ping timeout: 268 seconds) 02:08:32 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:15:35 --- quit: dave9 (Quit: dave's not here) 02:27:17 I'll probably will try to port it to MSP430 02:27:54 I love my launchpad, forth and asm - so why not try to mix all fun things together) 02:54:19 I have a launchpad, but I think mine has one of the smaller MSP430. Also one of the EZ430-F2013 sticks. 02:54:57 I'd love to put Forth on it. 03:13:02 Launchpad? 03:20:24 http://www.ti.com/tool/MSP-EXP430G2 03:20:44 they also have similar kits for their other cpu/dsp 03:34:29 I wonder how much work has gone into reverse engineering car dashboards. 03:34:45 Forth on a car, anyone? 03:35:21 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 03:50:29 on a watch? https://goodwatch.org/posts/introducing-the-goodwatch/ 03:51:37 --- quit: nighty- (Quit: Disappears in a puff of smoke) 04:49:16 dne: Wow that was a fascinating read. Got any more? 04:49:33 There should be more dev-focused watches 04:55:06 siraben: re: forth on android & ios; gforth is available on android: https://play.google.com/store/apps/details?id=gnu.gforth and my retroforth is available for iOS: https://itunes.apple.com/us/app/retro-forth-12/id1170943580?ls=1&mt=8 04:56:27 crc: Ah that's cool. 05:12:58 How do I make my interpreter print "ok" only once after interpreting a word? 05:13:10 Whenever I have something like "1 2 + ." it prints "ok" four times. 05:15:21 --- join: nighty- (~nighty@s229123.ppp.asahi-net.or.jp) joined #forth 05:16:17 siraben: only print "ok" when the terminal input buffer is empty? 05:17:21 john_metcalf: Ah that helps. 05:19:51 siraben: dev-ficused watches? check ti ez430 05:22:40 I just realized that I shouldn't publish the screenshots of some RAM regions because it's the TI OS code, huh. 05:23:00 gotcha! TInja team incoming! 05:30:57 john_metcalf: What about things like "page quit", how do they work? 05:57:47 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 06:00:09 --- quit: MrMobius (Ping timeout: 268 seconds) 06:00:09 --- nick: [1]MrMobius -> MrMobius 06:01:36 --- quit: ashirase (Ping timeout: 252 seconds) 06:05:14 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 06:20:55 I just print ok after INTERPRET returns. 06:21:36 Most Forths, I think, don't print ok when compiling. I set mine up, though, so it prints ok after INTERPRET if we're interpreting, and ok... if we're compiling. 06:21:49 "Ok, got that, but I need more..." 06:22:24 siraben: In my system (and many - FIG worked this way) INTERPRET is an endless loop. 06:23:02 The system gets out of it by having the null string be an immediate word. It does an R> DROP "double return," so it returns all the way to INTERPRET's caller, which is QUIT. 06:23:52 QUIT endlessly obtains lines of input and INTERPRETs them, with a prompt after each one, and INTERPRET endlessly runs BL WORD, looks up the word, and processes it. 06:24:51 That null word trick always seemed quite unique to me, but in this system I've made conditional and multi-level returns an integral part of the word set. 06:25:02 Use them tons - they get you shorter faster code. 06:27:03 So the proper way to answer your question is to say that you get just one prompt at end of line by putting the prompt in QUIT, which processes lines, not in INTERPRET, which processes words. 06:27:40 You also wind up using INTERPRET in LOAD, and since INTERPRET doesn't make the prompt, you don't get a bunch of prompts while you're loading and compiling disk blocks. 06:27:53 You only want a prompt when user input is expected. 06:27:58 I see. 06:30:37 siraben: If you can get your hands on a book called "Forth Fundamentals" by McCabe, grab it. Volume one goes into great detail about all this sort of "under the hood" stuff. Based primarily on FIG Forth, I think. 06:30:57 Volume 2 is a glossary of words, and for the ones that aren't primitives (i.e., typically defined in Forth) it gives definitions. 06:30:58 KipIngram: How does it compare to Starting Forth? 06:31:12 FF is more about how Forth works under the hood, and less about using it. 06:31:15 SF is the opposite. 06:31:30 FF v1 is really like a "technical reference" for Fig Forth. 06:31:34 What about Thinking Forth? 06:31:51 Thinking Forth is one of my favorites; it's primarily about the "philosophy" of Forth programming. 06:31:57 Best practices and things like that. 06:32:06 To some extent it applies to any programming, but it is Forth focused. 06:32:07 yeah, but it won't teach you Forth 06:32:17 No - you would want SF on hand as well. 06:32:24 It helps you become better at Forth. 06:32:28 Right. I've already read through Starting Forth and started reading Thinking Forth 06:32:36 TF doesn't teach much Forth. 06:32:50 But has good teachings on the philosophy of Forth. 06:32:52 That's great. I don't think FF is very easy to find, but it really rounds out the set - if you've got all three of those you're golden. 06:33:00 Right. 06:33:18 And of course you don't have to implement your Forth the way it's described in FF - you're free to change anything. 06:33:29 But my very first Forth I wrote "blind." I just knew how it was supposed to work. 06:33:30 And it did. 06:33:39 But when I read FF I realized how poor mine was. 06:33:51 It's like an example of a "clean" implementation. 06:34:28 Once you've seen that sort of "well done implementation," you're then able to deviate from it intelligently. 06:45:41 KipIngram: Thanks for the recommendation. I'm trying to find FF but to no avail currently. 06:48:22 KipIngram: What do you make of jonesforth? 06:51:56 I haven't studied it in any detail; sorry. 06:52:16 dave0/dave9 seems to have looked into it to some extent. 06:52:51 These days I mostly write my own rather than study others. 06:53:42 KipIngram: My Forth is loosely based on jonesforth, it's a pretty good implementation. 07:01:23 I would say mine's loosely based on FIG, and I'm pretty happy with it too. I'm adding quite a few things I've never had in one of my Forths before (multi-process / multi-task, source compression, etc.) 07:01:41 Just coming to working on the multi-process support now. 07:01:49 KipIngram: Where's that implementation? 07:02:04 FIG 07:02:15 Oh, uh, I don't know where you'd find it online these days. 07:02:28 I used my FF book back when I needed a reference at hand. 07:02:36 These days I just sort of know what to do. 07:02:52 Huh there's https://github.com/ForthHub/FIG-Forth 07:03:13 Mine deviates from FIG a fair bit now. 07:03:27 What language is it in? Which assembler? 07:03:27 FIG stores headers and definitions consecutively - I have headers separated, etc. 07:03:33 nasm on MacOS. 07:03:41 Is the source available? 07:03:58 I've used macros to try to make it as portable as possible, and I plan to try to port it to an Adafruit Cortex M4 board. 07:04:05 No, source isn't available yet. 07:04:53 Just curious, any particular reason for not publishing it yet? 07:05:00 I'm still working on it. 07:05:06 I see. 07:05:30 Plus I have *possible* commercial aspirations. Not for the Forth itself, but it may wind up being the operating system for things I try to commercialize. 07:05:39 Industrial control, lab instrumentation, etc. 07:05:45 Ah, makes sense. 07:06:55 --- quit: tabemann (Ping timeout: 240 seconds) 07:07:12 As a side note, I like how Forth makes mutation and other side effects quite explicit, otherwise most words can be considered "pure" and just work with the stack. 07:07:28 Makes debugging easier. 07:09:00 KipIngram: How do I go about understanding how DO and DOES> work? 07:09:02 I'd like to implement those. 07:15:27 Well, those are completely different things. 07:15:49 DO is used in loops; DOES> relates to being able to write the runtime behavior of a class of words in Forth. 07:16:08 Send me a PM and we can chat about them. 07:20:35 Ah sorry not DO, I meant DOES> and CREATE, we can discuss it later. 07:20:48 I know CREATE, but not how it interacts with DOES> 07:24:17 Yes, DOES> usually involves a bit of hoop jumping; it's "one step away" from what Forth doesn naturally and easily. 07:24:44 There are several ways you can implement it - when you're ready to do the chat I'll try to explain what's going on, and you can pick an approach. 07:41:46 I don't think any of them are particularly pretty. 07:42:12 We'll talk much later, I have to go sleep soon. 07:43:55 KipIngram: : (DOES) R> DUP CELL+ SWAP @ >R ; \ is the thing that gets invoked when a CREATEd word is run, no? 07:44:01 --- nick: Zarutian_2 -> Zarutian 07:45:05 Hmmm. That doesn't look like anything I've ever done, but maybe I've overlooked a better way. 07:45:49 I've done it two different ways - one using a "dodoes" runtime in machine code (what you have above may be the Forth equivalent), and I've also made it work using plain vanilla Forth. 07:46:21 You mean a CREATEd word that has a DOES> involved, right? 07:46:34 I've always had CREATE make the word just run dovar. 07:46:49 Then that gets modified in various cases as required. 07:50:48 The "plain Forth" approach may have had the code you've got above, or something close to it, just not factored out or named like that. 07:52:24 : SWAP >R >R ; IMMEDIATE : DOES> R> HERE R> ! >R ] ; IMMEDIATE \ is what I came up with / half remembered just now 07:52:34 If I recall correctly, what I did in that case was have the words defined by the defining word have a small colon definition at the beginning, which placed the address of a "few cells later" (after the : def) on the stack and then ran the code provided after DOES>. 07:53:25 I think I did not use CREATE in that case; I had a different word I called MAKER, because it needed to build that little : def BEFORE it ran the code that did the storage allocation. 07:53:33 damn, I think I made mistake 07:54:37 So the final words were actually : definitions, but right after that def some extra space was left for the data area. 07:55:50 That def consisted of a literal that put the data space address on the stack, a call to the DOES> code, and (;). 07:55:52 right! s/IMMEDIATE// 07:56:23 Then right after (;) was the address pushed by the literal, and the code in between MAKER and DOES> was then run to move HERE on however far along it needed to go. 07:57:54 and s/>R ] ;/DROP ;/ 08:01:16 --- join: kumool (~kumool@adsl-64-237-236-14.prtc.net) joined #forth 08:01:43 --- quit: kumool (Read error: Connection reset by peer) 08:02:04 --- join: kumool (~kumool@adsl-64-237-236-14.prtc.net) joined #forth 08:06:50 --- quit: reepca (Read error: Connection reset by peer) 08:07:16 --- join: reepca (~user@208.89.170.250) joined #forth 08:26:17 I should be able to do this much more cleanly in this new system. I'll have a machine code "dodoes," an an extra pointer in the header. So a pointer to the does> code and a pointer to the data. 09:25:37 --- quit: kumool (Quit: Leaving) 10:00:39 --- quit: reepca (Read error: Connection reset by peer) 10:01:24 --- join: reepca (~user@208.89.170.250) joined #forth 10:02:41 --- quit: ncv (Remote host closed the connection) 10:24:11 --- join: dys (~dys@tmo-102-234.customers.d1-online.com) joined #forth 10:43:36 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 10:47:03 --- quit: MrMobius (Ping timeout: 252 seconds) 10:47:03 --- nick: [1]MrMobius -> MrMobius 10:58:48 --- part: john_metcalf left #forth 11:21:43 --- quit: dys (Ping timeout: 246 seconds) 12:42:38 --- join: kumool (~kumool@adsl-64-237-236-14.prtc.net) joined #forth 13:13:26 --- join: pierpal (~pierpal@host168-226-dynamic.104-80-r.retail.telecomitalia.it) joined #forth 15:50:24 --- join: kumul (~kumool@adsl-64-237-235-5.prtc.net) joined #forth 15:52:39 --- join: wa5qjh (~quassel@175.158.225.198) joined #forth 15:52:39 --- quit: wa5qjh (Changing host) 15:52:39 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 15:53:23 --- quit: kumool (Ping timeout: 268 seconds) 16:07:23 --- quit: nighty- (Quit: Disappears in a puff of smoke) 17:38:08 --- join: dave9 (~dave@90.20.215.218.dyn.iprimus.net.au) joined #forth 17:38:57 hi 18:11:22 --- quit: wa5qjh (Remote host closed the connection) 18:13:16 --- join: wa5qjh (~quassel@175.158.225.198) joined #forth 18:13:16 --- quit: wa5qjh (Changing host) 18:13:16 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 18:32:43 --- join: kumool (~kumool@adsl-64-237-235-198.prtc.net) joined #forth 18:33:12 --- quit: kumul (Ping timeout: 252 seconds) 19:14:38 --- join: tabemann (~tabemann@2602:30a:c0d3:1890:b90b:3bee:a83b:ed44) joined #forth 19:29:39 --- quit: dddddd (Remote host closed the connection) 19:38:36 --- join: catern (~catern@catern.com) joined #forth 19:38:47 hi #forth, is there a classic book on concatenative programming that I should read to grasp the power of such languages? i'm hoping for an equivalent to SICP or the Little Schemer 19:41:04 strictly speaking, concatenative programming is basically just a way of applying functions. It's not as large a paradigm difference as, say, functional vs imperative or meta (macros) vs non meta (non macros) programming. 19:44:06 I see 19:44:07 running isnt that different to walking, so why is it so difficult for babies!? 19:44:20 just RUN 19:44:41 there are some "classic" texts on forth specifically, but I susepct you'll find that they're more often geared toward explaining a mindset or an implementation than a paradigm. 19:44:57 kumool: fair point. 19:45:31 sorry i had to use a metaphor, but... its just faster 19:50:04 --- quit: NB0X-Matt-CA (Quit: WeeChat 2.0.1) 19:53:20 f(a,b) = add(multiply(a, a), multiply(b, b)) => f = dup multiply swap dup multiply add 19:57:58 the cool stuff is when you do square = dup multiply f = square swap square add 19:59:19 yeah, as long as you keep your data flow on the stack, all the obstacles to just naming a piece of code and setting it aside for reuse disappear 20:02:44 what took me a while to wrap my head around was writing code that executes at compile-time 20:03:16 which, of course, once you are able to do that you can write code that makes your own control structures 20:20:11 --- quit: wa5qjh (Remote host closed the connection) 20:22:02 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 20:29:03 --- quit: wa5qjh (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) 20:29:55 --- quit: pierpal (Quit: Poof) 20:30:12 --- join: pierpal (~pierpal@host168-226-dynamic.104-80-r.retail.telecomitalia.it) joined #forth 20:30:55 --- join: wa5qjh (~quassel@175.158.225.198) joined #forth 20:30:55 --- quit: wa5qjh (Changing host) 20:30:55 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 20:32:52 --- quit: dave9 (Quit: dave's not here) 20:33:53 --- quit: pierpal (Read error: Connection reset by peer) 20:34:11 --- join: pierpal (~pierpal@host168-226-dynamic.104-80-r.retail.telecomitalia.it) joined #forth 20:34:21 --- quit: wa5qjh (Remote host closed the connection) 20:36:47 --- join: wa5qjh (~quassel@175.158.225.198) joined #forth 20:36:47 --- quit: wa5qjh (Changing host) 20:36:47 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 20:48:23 --- quit: pierpal (Read error: Connection reset by peer) 20:48:34 --- join: pierpal (~pierpal@host168-226-dynamic.104-80-r.retail.telecomitalia.it) joined #forth 20:49:27 --- join: nighty- (~nighty@kyotolabs.asahinet.com) joined #forth 20:51:57 --- quit: kumool (Quit: Leaving) 20:55:32 --- quit: siraben (Remote host closed the connection) 20:56:12 --- join: siraben (~user@unaffiliated/siraben) joined #forth 21:01:43 --- quit: siraben (Ping timeout: 268 seconds) 21:09:34 --- quit: pierpal (Ping timeout: 245 seconds) 21:45:54 --- quit: wa5qjh (Remote host closed the connection) 21:48:16 --- join: wa5qjh (~quassel@175.158.225.198) joined #forth 21:48:16 --- quit: wa5qjh (Changing host) 21:48:16 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 21:48:19 --- join: pierpal (~pierpal@host168-226-dynamic.104-80-r.retail.telecomitalia.it) joined #forth 21:50:05 --- join: dys (~dys@tmo-080-213.customers.d1-online.com) joined #forth 22:01:44 --- quit: pierpal (Read error: Connection reset by peer) 22:59:32 --- join: dave9 (~dave@90.20.215.218.dyn.iprimus.net.au) joined #forth 23:06:16 --- quit: irsol (Ping timeout: 246 seconds) 23:10:51 --- join: nonlinear (~nonlinear@unaffiliated/discrttm) joined #forth 23:22:19 --- quit: dys (Ping timeout: 268 seconds) 23:24:44 --- join: irsol (~irsol@unaffiliated/contempt) joined #forth 23:28:25 --- quit: epony (Read error: Connection reset by peer) 23:41:18 --- quit: irsol (Ping timeout: 272 seconds) 23:55:09 --- join: irsol (~irsol@unaffiliated/contempt) joined #forth 23:59:59 --- log: ended forth/18.10.01