00:00:00 --- log: started forth/19.09.12 00:09:46 --- join: dys (~dys@2003:5b:203b:100:a64c:c8ff:fef4:13a6) joined #forth 00:19:49 --- join: mtsd (~mtsd@77.110.61.100) joined #forth 00:41:12 --- quit: ryke (Ping timeout: 240 seconds) 00:53:31 --- quit: mtsd (Remote host closed the connection) 00:53:57 --- join: mtsd (~mtsd@77.110.61.100) joined #forth 01:18:12 --- quit: cartwright (Remote host closed the connection) 01:20:36 --- join: cartwright (~chatting@gateway/tor-sasl/cantstanya) joined #forth 01:58:24 --- quit: mtsd (Quit: Leaving) 02:01:57 --- join: mtsd (~mtsd@77.110.61.100) joined #forth 02:46:49 --- quit: tp (Remote host closed the connection) 02:47:00 --- quit: mtsd (Read error: Connection reset by peer) 02:47:05 --- join: tp (~Terry@mecrisp/staff/tp) joined #forth 02:47:42 --- join: mtsd (~mtsd@77.110.61.100) joined #forth 03:17:24 --- quit: WickedShell (Remote host closed the connection) 03:35:45 --- quit: proteusguy (Ping timeout: 276 seconds) 03:43:31 --- quit: mtsd (Quit: Leaving) 04:05:18 --- quit: rdrop-exit (Quit: Lost terminal) 04:07:38 --- join: dave0 (~davezero@069.d.003.ncl.iprimus.net.au) joined #forth 04:10:25 --- join: proteusguy (~proteusgu@cm-58-10-208-146.revip7.asianet.co.th) joined #forth 04:10:25 --- mode: ChanServ set +v proteusguy 05:11:46 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 05:29:52 --- join: mtsd (~mtsd@77.110.61.100) joined #forth 06:44:38 --- quit: mtsd (Quit: Leaving) 07:30:15 --- quit: tabemann (Ping timeout: 245 seconds) 07:55:10 --- quit: dave0 (Quit: dave's not here) 08:17:20 --- quit: dys (Ping timeout: 245 seconds) 08:23:49 --- join: dys (~dys@fw-front.credativ.com) joined #forth 08:38:39 --- quit: dys (Ping timeout: 276 seconds) 08:39:02 --- join: dys (~dys@fw-front.credativ.com) joined #forth 08:43:12 --- quit: dys (Ping timeout: 240 seconds) 08:47:58 --- quit: proteusguy (Ping timeout: 246 seconds) 09:15:45 --- join: dys (~dys@2003:5b:203b:100:a64c:c8ff:fef4:13a6) joined #forth 09:23:10 --- quit: dys (Ping timeout: 245 seconds) 09:31:06 --- join: proteusguy (~proteusgu@cm-58-10-208-146.revip7.asianet.co.th) joined #forth 09:31:06 --- mode: ChanServ set +v proteusguy 09:32:36 --- quit: gravicappa (Ping timeout: 276 seconds) 09:58:14 --- join: MrBismuth (~ArcMrBism@2600:6c58:4200:ad9:39cf:ce08:94f8:bba4) joined #forth 10:01:12 --- quit: MrBusiness3 (Ping timeout: 276 seconds) 10:09:41 --- quit: dne (Remote host closed the connection) 10:10:02 --- join: dne (~dne@jaune.mayonnaise.net) joined #forth 10:34:34 --- join: xek (~xek@user-94-254-232-167.play-internet.pl) joined #forth 10:49:34 --- join: gravicappa (~gravicapp@h109-187-49-131.dyn.bashtel.ru) joined #forth 11:38:14 --- join: WickedShell (~WickedShe@159-118-128-145.cpe.cableone.net) joined #forth 11:54:51 --- quit: gravicappa (Ping timeout: 246 seconds) 12:18:22 --- join: DKordic (~user@178-222-28-243.dynamic.isp.telekom.rs) joined #forth 13:21:24 --- quit: xek (Ping timeout: 276 seconds) 14:19:34 --- join: ryke (~Thunderbi@mail.homecaregiverstn.org) joined #forth 14:22:09 --- quit: pareidolia (Remote host closed the connection) 14:23:12 --- join: pareidolia (~pareidoli@87.213.124.143) joined #forth 14:40:04 --- quit: pareidolia (Quit: ZNC 1.7.3 - https://znc.in) 14:45:50 --- join: pareidolia (~pareidoli@87.213.124.143) joined #forth 14:51:45 --- quit: dne (Remote host closed the connection) 14:57:08 --- join: dne (~dne@jaune.mayonnaise.net) joined #forth 15:26:51 --- quit: ryke (Ping timeout: 276 seconds) 15:43:46 --- quit: karswell (Ping timeout: 265 seconds) 16:36:45 --- join: ryke (~Thunderbi@71-9-171-192.dhcp.jcsn.tn.charter.com) joined #forth 16:36:59 --- join: dave0 (~davezero@069.d.003.ncl.iprimus.net.au) joined #forth 16:45:11 --- quit: amuck (Quit: ZNC 1.7.2+deb2ubuntu0.1 - https://znc.in) 16:45:27 --- join: amuck (~amuck@2a01:4f8:151:8317::2) joined #forth 17:08:34 --- quit: cartwright (Ping timeout: 260 seconds) 17:09:04 --- join: jn___ (~nope@aftr-109-90-233-87.unity-media.net) joined #forth 17:09:29 --- quit: jn__ (Ping timeout: 276 seconds) 17:12:00 --- join: cartwright (~chatting@gateway/tor-sasl/cantstanya) joined #forth 17:36:00 --- join: rdrop-exit (~markwilli@112.201.170.86) joined #forth 18:32:49 Good morning denizens of #forth 19:35:17 --- quit: proteusguy (Ping timeout: 265 seconds) 19:37:58 I'm making really good progress on my third attempt at a Forth implementation 19:38:12 nice 19:38:22 Kudos ryke 19:38:33 What platform? 19:39:12 well right now it's just a ruby based VM but I plan on using it to target either ARM or MIPS 19:40:51 Never looked into ruby, will check it out on Wikipedia 19:42:15 So you making a stacked based VM? 20:00:19 It's a VM in the broadest sense possible. Native instructions are replaced with lambdas which contain ruby code. 20:00:36 It's a pretty ugly way to do it but it's quick to implement 20:01:19 And I'm not too worried about it since I only really plan on using it to cross compile a separate implementation 20:02:10 ruby comoiles to native? 20:02:16 compiles 20:09:59 --- quit: dave0 (Quit: dave's not here) 20:12:15 No, or at least not that I know of 20:12:23 Sounds similar to the new Python based version of Pygmy Forth 20:14:50 I just looked at Pygmy and yeah it's somewhat similar 20:15:09 my forth still uses token lists in colon definitions though 20:15:50 Every word (regardless if it's primitive, colon, variable, etc.) has a ruby lambda as its XT 20:16:40 that lambda is only responsible for preparing execution of its word, the only exception being primitives 20:24:20 If its only meant to be run on a PC as a development environment for cross-assembly or cross-compilation than pretty much any implementation platform/language will do. 20:33:04 Yeah, the biggest challenge has yet to come 20:35:08 g'day amazing Forthers! 20:35:58 What's been called the separate systems approach, a Forth on a host machine used as a development environment for laying down object code for a target system. If the host and the target can talk to each other over a serial line, then it's called a tethered or umbilical Forth development environment, like SwiftX from Forth Inc, or Holon Forth by Wolf Wejgaard. 20:36:07 Hi tp! :) 20:36:31 hi Zen Forth master! 20:36:39 lol 20:36:55 --- join: gravicappa (~gravicapp@h109-187-49-131.dyn.bashtel.ru) joined #forth 20:37:37 I figured using separate systems was a pretty common way to go about it 20:38:07 Plus it's not really possible for me to develop on the target systems I have in mind since they're mainly game consoles 20:38:33 howdy tp 20:38:46 rdrop-exit, I was just now showing a guy my Forth development environment as he was travelling about 1000 miles and was going past. Ive been assisting him with basic forth for about 2 months and he seems to be going ok 20:38:54 howdy ryke ! 20:39:04 Cool 20:39:32 What's your environment look like tp 20:39:48 rdrop-exit, sadly once I got to the automatically generated bitfields file (cortex-m) his eyes just glazed over ... brainlock 20:40:43 ryke, I just update my notes on it: https://mecrisp-stellaris-folkdoc.sourceforge.io/devenv.html#devenv 20:40:46 ryke, separate systems are common for commercial Forths, but less common as free Forths 20:41:24 poor guy started with some earlier pic based basic, then arduino 20:41:32 Ah ok, is there a particular reason for that rdrop-exit 20:43:46 ryke, probably because the sheer number of Forths outnumbers 'tethered' Forth ? 20:44:38 Not sure, I guess it's that most new Forthers are just using Forth as a PC only scripting language] 20:44:41 I have two gpl'd 'tethered forths' here, one is "riscy pygness" by Frank Seargant, the other is "mecrisp-across" by Matthias Koch 20:45:23 rdrop-exit, in my world the new forthers are only using Forth on small systems embedded like cortex-m 20:45:50 Makes sense 20:46:03 I don't remember if Holon Forth is open-source 20:46:23 same as the guy who just dropped by, he wants to use Forth to build control systems for radio controlled aircraft 20:46:29 A lot of the people I see using Forth on mastodon use gforth primarily 20:46:45 I only ever looked at the old DOS version a long time ago 20:46:52 https://holonforth.com 20:47:11 ryke, I think the majority of Forth users online and on forums use Gforth 20:47:34 at least it's seems that way to me 20:47:58 The DOS version of Holon targets runs on a PC and targets 6502, 68hc11, 68300, Rabbit 2000. 20:48:06 this channel was a surprise tho, most seem to be building their own Forth 20:50:10 Gforth and the Forth Standard haven't covered cross-compilation or meta-compilation 20:52:22 They give newbies a very incomplete and skewed impression of Forth 20:52:49 rdrop-exit, Ive seen at least one cross compiled Forth for small embedded that does it via Gforth 20:53:27 Cool, hadn't noticed that 20:53:33 I didnt really understand how it worked, I think it only produced a binary, which to me defeats the purpose of Forth 20:55:17 picforth 20:55:18 ======== 20:55:18 Forth compiler for Microchip PIC16Fxxx microcontrollers. 20:55:18 This compiler has only been tested with gforth 0.7.3. 20:55:40 Will check it out, thanks 20:55:48 cool 20:58:28 Gforth's emphasis seems to be Unix scripting 20:59:21 picforth seems very complete, it doesnt look like a toy 21:00:42 Cool, just downloaded it from Github, will look through it (eventually, to do pile) 21:00:49 hmm, not complete according to the doc 21:00:52 2.2 Why this project? 21:00:53 I needed to write some code on a PIC to control a digital model 21:00:53 railroad system using the DCC (Digital Control Command) protocol. 21:00:53 However, writing it in assembly is error-prone and writing it in C is 21:00:53 no fun as C compiled code typically needs a lot of space. 21:00:53 So I wrote this compiler, not for the purpose of writing a compiler, 21:00:55 but as a tool to write my DCC engine. 21:01:50 I have some Microchip PIC16Fxxx microcontrollers, I must try it one day for fun 21:03:01 He uses it for model railroad control, cool 21:04:45 yes, developing a Forth just for a model railroad control has a very satisfying air about it to me 21:05:15 --- quit: dddddd (Remote host closed the connection) 21:11:13 Looks like the latest iteration of Holon is on tcl/tk, while the latest iteration of Pygmy is on Python. Interesting that neither chose GForth as their PC hosting language. 21:13:17 So I just came across something kind of confusing and maybe it can be chalked up to me being new 21:13:34 So Pygmy uses the word LOAD to load files right 21:13:46 load blocks 21:14:13 The DOS version stored blocks in files, the new version seems to 21:14:30 It can determine whether to open a text file or a pseudo-block file based on the argument's type 21:14:46 a text file if it's a string and a block file if it's a number 21:14:54 how do you think it accomplishes that? 21:15:42 rdrop-exit, I remember when Frank Sergeant advertised his new Pygmy on c.l.f he was brutally criticised because it was written in python 21:16:18 His psuedo-blocks in the new Python version aren't fixed size, they're markup based (or something) 21:17:10 each block is delimited by a comment I believe 21:18:58 tp, if it's the PC side of a tethered Forth, shouldn't really matter whatever's most convenient for his user interface and OS interface needs will do the trick. 21:21:34 rdrop-exit, oh I agree 100% 21:22:11 I loved his tethered 'riscy-pygness' which was tcl/tk on pc to Cortex-M3 21:22:34 I even understood some of it and was able to add primitives in machine code to it 21:22:43 cool 21:23:41 however it was only beta and had a lot of stability issues all way above what I could debug 21:25:42 ryke, search for filenameFromBlockNumber() in pygmykernel.py 21:26:48 I'm still haven't learned Python 21:27:02 * I still... 21:27:22 I decided to go straight from Perl to lisp 21:27:31 and bypass python 21:27:44 Hmm 21:28:14 I'm kinda disappointed that it just uses ranges of numbers 21:28:23 I was expecting something a little more elegant 21:28:42 for blocks you mean ? 21:29:34 yeah 21:29:45 I don't really care for his variable sized psuedo-blocks 21:29:59 thats how riscy-pygness did it, I liked it 21:30:01 But to each his own 21:31:26 I don't mind them being variably sized but using simple comments like ( block 3 ) seems pretty hacky 21:31:31 I switched to plain text files for a while, but eventually switched back to 1k blocks (stored in a Unix file on the PC side). 21:32:59 I think he'd be better off using control codes instead of printable characters 21:34:51 That's what the Canon Cat did, ASCII has fs gs rs us characters just for that purpose 21:36:11 The space character is the bottom of the hierarchy, standing in for word separator 21:36:48 us unit separator, rs record separator, gs group separator, fs "file" separator 21:37:09 5 nesting levels 21:38:01 I don't think that ascpect of ASCII ever caught on 21:38:27 * aspect 21:46:05 $ 1c constant fs \ aka ^\ 21:46:05 $ 1d constant gs \ aka ^] 21:46:05 $ 1e constant rs \ aka ^^ 21:46:05 $ 1f constant us \ aka ^_ 21:55:07 They're consecutively numbered from fs down to the space character $ 20 21:56:48 That's wild, I never knew that 21:59:59 Mostly forgotten ASCII lore :) 22:01:00 "for there are now now alive that remember the days of forgotten ASCII lore ..." 22:01:11 "for there are none now alive that remember the days of forgotten ASCII lore ..." 22:01:32 lol 22:34:33 --- join: dave0 (~davezero@069.d.003.ncl.iprimus.net.au) joined #forth 22:46:30 --- quit: cheater (Quit: leaving) 23:04:06 --- join: xek (~xek@user-94-254-232-167.play-internet.pl) joined #forth 23:04:25 --- quit: ryke (Ping timeout: 245 seconds) 23:13:21 --- quit: xek (Remote host closed the connection) 23:13:35 --- join: xek (~xek@user-94-254-232-167.play-internet.pl) joined #forth 23:21:45 : unrolled { # -- }( -- ? ) 23:21:46 ^ swap for dup compile, next drop ; directive 23:22:45 thats not my Forth ! ;-) 23:23:07 It's for unrolling loops 23:23:18 8 unrolled foo 23:23:33 will compile, 8 consecutive foo 23:25:09 Loop unrolling, also known as loop unwinding, is a loop transformation technique that attempts to optimize a program's execution speed at the expense of its binary size 23:25:24 is that correct ? 23:25:25 That it is 23:25:31 ta :) 23:26:39 I should rename it ]unrolled to make it clear that the count is compile-time 23:27:19 [ 8 ]unrolled foo 23:27:33 to compile, 8 consecutive FOOs 23:28:10 The point is not to bother with loop overhead when the count is small and fixed 23:28:37 matthias calls 'mecrisp-across' " a optimising compiler' and frankly Ive always been a bit sceptical about such things 23:29:15 but it's really surprised me 23:29:51 the darn thing produces more compact code than I can with MSP430 assembly 23:30:10 (in a 'blinky' test, the simplest test of all' 23:30:44 si Im a believer now 23:31:59 I think some small optimizations are ok for Forth (tail call elimination, constant folding, and simple things such as dup drop) but I don't want my Forth to automagically mess with my code beyond that 23:35:32 yeah, I'm the same 23:36:23 I have a higher level of opt available for Mecrisp-Stellaris but Ive never bothered with it, I have 64KB flash which is massive for what I do 23:37:12 Mecrisp-Stellaris has automatic constant folding 23:37:52 Most Forths do, you don't want to have to do "[ bla bla ] literal" all the time 23:40:03 On Forths that don't have constant folding I define : ]# ( x -- )( -- x ) & literal ] ; 23:40:09 oops 23:40:10 : ]# ( x -- )( -- x ) & literal ] ; 23:40:46 so I can do [ bla bla ]# instead of [ bla bla ] literal all the time 23:41:22 (note: & is my shorthand for postpone) 23:41:48 Constant folding leads to cleaner looking code 23:42:04 I'm not quite to postpone or compile yet 23:42:15 should be there in the next 12 months : 23:43:08 I tend to do a bunch of projects based around each new Word until understand them 23:43:59 I know I havent touched the most useful stuff yet but just the basics allow me to write all the Forth needed for small embedded projects 23:44:12 POSTPONing is basically delaying the compile-time action, it's useful for compiler directives (i.e. immediate compile-only words) 23:44:59 Ive read the definition, I think I have a basic understanding but I dont feel the code yet ;-) 23:46:15 I'll try to find an illustrative example, brb 23:46:23 the 'aha' moment hasn't happened for me with 'defining words' yet 23:48:21 You know for example that "[" switches you from compiling to interpreting 23:48:30 yes 23:49:10 i know most of the commands and have read the definitions, but understanding takes time 23:49:30 You know that ";" ends a colon definition and switches you from compiling to interpreting 23:49:43 because I did all the doc for my doc site Ive typed in everything with the descriptions 23:49:53 sure do, that part was easy 23:50:02 This is how ";" does the switching 23:50:26 : ; ( -- ) bla bla postpone [ ; immediate 23:50:40 oh! 23:51:24 If I handn't POSTPONed "[" it would have switched me to interpreting while I was defining ";" which is not what I wanted. 23:51:46 which stops : foo ( -- ) bar ; from being executed after its entered ? 23:52:01 ah I see 23:52:33 By doing something like: 23:52:34 that makes a LOT of sens to me 23:52:41 sense 23:53:03 : foo ( -- ) bla... POSTPONE foo blabla ; 23:53:18 recursive ? 23:53:52 no, i see 23:53:54 oops sorry, I should have used a different name, rewind... 23:54:00 it wouldnt accept foo 23:54:13 : foo ( -- ) bla... POSTPONE zeeborp bla... ; 23:54:21 because at that point foo was not defined ? 23:55:27 By postponing zeeborp I'm saying don't do the compile-time action of zeeborp yet, do it later when foo is executed 23:55:56 and you can then define zeeborp ? 23:56:17 The assumption is that zeeborp was defined earlier 23:56:24 so POSTPONE solves the 'chicken and egg' problem 23:56:27 oops 23:56:33 --- quit: xek (Ping timeout: 246 seconds) 23:56:42 Not really 23:57:11 : hi ." hello world" ; immediate 23:57:17 my mum owned a zeeborp but the harmonising modulator fell off 23:57:57 : foo ( -- ) blabla hi bla bla ; 23:58:49 If since hi is immediate " hello world" will be printed while I'm compiling foo 23:58:59 : foo ( -- ) postpone zeeborp ; zeeborp not found. <-- I see what you mean 23:59:20 : foo2 ( -- ) blabla POSTPONE hi blabla ; 23:59:59 --- log: ended forth/19.09.12