00:00:00 --- log: started forth/21.02.18 00:20:58 --- quit: Gromboli (Quit: Ping timeout (120 seconds)) 00:21:17 --- join: Gromboli joined #forth 00:22:34 --- quit: iyzsong (Read error: Connection reset by peer) 00:23:30 --- join: iyzsong joined #forth 00:28:17 --- join: xek joined #forth 01:05:18 --- quit: _whitelogger (Remote host closed the connection) 01:08:17 --- join: _whitelogger joined #forth 02:16:58 --- quit: neuro_sys (Ping timeout: 240 seconds) 02:26:54 --- join: neuro_sys joined #forth 02:26:55 --- quit: neuro_sys (Changing host) 02:26:55 --- join: neuro_sys joined #forth 02:39:07 --- join: f-a joined #forth 02:43:24 when you need to store and fetch stuff 02:43:47 you have to use different words for different sizes 02:43:50 i.e. @ c@ 02:44:18 does it make sense to make a «container» to abstract this out? maybe with https://gforth.org/manual/Mini_002dOOF-Example.html ? Or is it unforthy? 02:52:34 in general is abstraction frowned upon? 02:52:41 I'd say most of the time you just use "@". 02:58:09 you can also do something like : @MARBLES MARBLE-SIZE * MARBLES + @ ; for accessing array elements 03:08:47 appropriate 03:08:48 thanks 03:32:26 --- quit: f-a (Quit: leaving) 03:59:12 --- part: hosewiejacke left #forth 04:37:18 --- quit: proteus-guy (Ping timeout: 240 seconds) 04:42:59 --- join: proteus-guy joined #forth 06:07:31 --- quit: Zarutian_HTC (Ping timeout: 264 seconds) 06:23:09 --- join: f-a joined #forth 06:37:29 f-a: I didn't look very closely at your question, but just to mention: it is also possible to define a class with an instance behavior, without using an OO framework: 06:37:42 https://librehacker.com/2021/02/04/2d-array-problem-in-gforth/ 06:39:48 --- join: Zarutian_HTC joined #forth 06:40:03 thanks lispmacs 06:40:08 that is a much welcome answer 06:40:25 since the only things I know about polymorphisms come from Haskell 06:40:54 then, e.g., you could use the word `marbles' with a length parameter to create a marbles array called `mymarbles', then later call ` mymarbles' 06:41:31 `10 marbles mymarbles' then `2 mymarbles' later 06:41:51 magnificent 06:42:57 it is forths simple way of allowing you to define your own data types similar to `constant' and `variable' 06:44:16 the defining and instance behavior could be anything, so you could, e.g., create a data type that represents the memory on another computer chip 06:46:46 I'm not sure exactly how you would translate in the idea of multiple class functions, like in OOP. I suppose if you needed to simulate multiple instance behaviors, you could pass in a behavior parameter to switch between behaviors 06:53:36 --- quit: Lord_Nightmare (Ping timeout: 256 seconds) 07:15:15 --- quit: Zarutian_HTC (Remote host closed the connection) 07:38:41 "starting forth" uses >R and R> in an answer before introducing them in the text 07:38:42 :( 07:38:51 annoying book 07:39:48 the leo brodie one? 07:39:56 I found it nice to read, interesting regardless of forth 07:40:20 yeah, it's what I'm learning forth from 07:40:37 it's just being kinda annoying, using words in answers it didn't introduce in the chapter those questions are in 07:40:44 ditto 07:40:48 using a thing before you explain it can also be a teaching technique ;) 07:40:59 it uses R> in an answer in chapter 4 then only teaches R> in chapter 4 07:41:44 --- join: Lord_Nightmare joined #forth 07:42:19 MrMobius: works when you have a tutor near you imho 07:42:23 with a book it is annoying 07:42:27 before the internet: blocking 07:43:08 sometimes they're trying to get you to ask yourself what it is and guess what it's doing so when they explain it youre primed 07:44:08 whoever wrote that test suite thingo needs a statue 08:13:15 I worked through Starting FORTH first, and do not remember this. 08:28:40 --- quit: dave0 (Quit: dave's not here) 08:32:13 --- join: Zarutian_HTC joined #forth 08:49:26 nihilazo: Do you mean the answer to chapter 4 part 6, where it gives an answer without >R/R> and then one that does use them saying it's "a more efficient version, using tricks introduced in the next chapter" 08:50:43 --- quit: crest (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) 08:52:41 oh hmm, it's only showing me the second answer in the web version 08:53:51 --- join: crest joined #forth 09:06:18 --- quit: crest (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) 09:08:30 --- join: PDogJr joined #forth 09:10:24 --- join: crest joined #forth 09:36:34 lispmacs, the forth-cpu is cool. 09:51:36 --- quit: f-a (Quit: leaving) 09:51:49 --- join: f-a joined #forth 10:16:24 --- quit: f-a (Quit: leaving) 10:16:43 --- join: f-a joined #forth 10:19:31 --- quit: Zarutian_HTC (Ping timeout: 264 seconds) 10:24:38 --- quit: f-a (Ping timeout: 260 seconds) 10:25:08 --- join: f-a joined #forth 10:40:46 --- quit: gravicappa (Ping timeout: 246 seconds) 10:41:07 --- join: gravicappa joined #forth 10:56:05 nihilazo: Oh right yeah the web version is bad, use the scanned PDF 10:56:29 I am not surprised stuff is broken on the web version, I don't know if Brodie was even involved in the ANSI changes 10:56:29 I wonder on how popular ANS Forth was 10:57:06 I think ANS Forth 94 was a better standard than Forth 2012, except for environment query strings 11:04:31 veltas: OK I'll grab the scanned PDF 11:04:37 is it on forth.com too? 11:04:49 the first edition 11:05:40 yes, it is. OK, grabbing it 11:05:41 Yes I think so 11:05:59 Not that much stuff is outdated, and the places where things have changed are a bit of history and interesting 11:06:20 The bit on the block editor is probably worth skipping or skimming 11:06:26 I skimmed it anyway 11:10:59 ok 11:11:48 I find it interesting that a lot of earlier texts seem to consider forth an OS as well as a language 11:12:02 I assume that's in a similar way to BASIC being both OS and langauge on many earily home computers? 11:12:08 Some people still describe Forth as an OS 11:12:34 There isn't really a good definition of "OS" anyway, not in my opinion. Forth might as well be an OS 11:13:06 nihilazo, yes like BASIC 11:13:20 ok 11:13:38 actually I do know one early home computer that did come with forth rather than basic, the jupiter ace 11:13:45 sadly it didn't seem to be very successful, they're super rare now 11:14:28 Anything that runs on an older system and has general purpose programming + editor is essentially an OS 11:14:34 I love the illustrations in starting forth 11:14:39 the 2-headed SWAP dragon especially 11:14:43 --- join: shmorgle joined #forth 11:15:19 and the executioner etc. It has a fun vibe that I rarely see in programming books, even ones that are trying to be fun 11:18:39 --- quit: crc (Remote host closed the connection) 11:18:39 it feels like it's just the author understanding fun ways to illstrate concepts rather than an author trying to put jokes into an otherwise boring programming book 11:18:39 ↑ 11:18:39 --- quit: dnm (Ping timeout: 264 seconds) 11:19:11 --- join: dnm joined #forth 11:19:43 are I, I' and J old? I notice the web version has R@ instead 11:19:53 Yes and no 11:20:04 I and J are now not necessarily the 1st and 3rd return stack items 11:20:10 In the standard 11:20:24 ok 11:20:36 I' is not in the standard 11:21:29 You can tell why I and I' are the top and 2nd of return stack, because that's where the iterator and limit are retained on the original forths 11:22:06 The standard generally tries to assume less about e.g. return and control stack layout 11:23:32 ah, i is the iterator 11:23:33 that makes sense 11:23:39 and r@ is the top of the return stack 11:35:17 : a ( n n -- ) 0 do 0 do i j . . key loop loop ; 11:35:29 this loops infinitely, what am I doing wrong? 11:35:41 You haven't supplied a limit 11:35:51 Oh wait you have 11:36:07 (invoke it with `2 3 a`) 11:36:20 Yes sorry I always half-ass reading your code my bad :P 11:36:24 no worries 11:36:56 Okay the limit isn't supplied to the inner loop correctly 11:37:06 You need to retain it somehow for later loops 11:37:14 It's consumed the first major loop 11:44:32 is fixed point still the preferred math in forth even though we now have hardware FP on basically every modern machine? 11:44:39 like, if you are programming for a machine with hardware floating point 11:44:53 (well, "basically every modern machine", modern desktop platforms) 11:45:18 It's *faster* to do FP on many machines now 11:46:10 For embedded systems without an FPU often floating-point calcs would be extremely bloated 11:47:17 also if you're an ideologue like me, you might not want the default non-integer math to have negative zero and nan :P 11:47:59 so how does floating point work in forth? 11:48:09 There are floating point words in the standard 11:48:22 Optionally the floating point numbers get their own stack 11:49:06 --- join: crc joined #forth 11:49:10 For gforth: https://gforth.org/manual/Floating-Point.html 11:49:15 alright, thanks 11:49:38 : prova 3 3 0 do 0 do i j . . key cr loop loop ; 11:49:45 sorry mispaste :P 11:55:23 ah ok, pforth also has a seperate float stachpk 11:55:28 s/stachpk/stack/ 11:55:54 is it still worth reading the chapter on fixed point even if floating is faster on modern desktop platforms 11:56:14 actually the answer is "yes" because I probably will be programming forth on 8bit machines etc 11:56:15 oh veltas 11:56:22 now I see my error 11:56:23 tricky 11:58:23 nihilazo, cool that youre doing 8 bit stuff. which machine(s)? 11:58:27 --- join: X-Scale` joined #forth 11:58:39 probably c64? 11:58:48 awesome 11:58:52 I want to program for the c64 and forth seems like a nice step up from asm while still being able to use asm for stuff 11:59:01 when it needs to be super quik 11:59:04 s/quik/quick/ 11:59:21 I don't even have a c64, I'm using an emulator, but I want to program for an 8-bit machine for the sake of learning 11:59:24 --- join: scoofy_ joined #forth 11:59:26 --- part: scoofy left #forth 11:59:58 there is a subroutine threaded forth called TaliForth2 that runs on the newer 65C02, so not c64 compatible, but it's a neat thing to practice on. I have an emulated version on my website you can play with in the browser: http://calc6502.com/Simulators/TaliForth2/main.html 12:00:24 --- quit: X-Scale (Ping timeout: 272 seconds) 12:00:24 --- nick: X-Scale` -> X-Scale 12:00:41 subroutine threaded being generally the fastest but largest size model of forth 12:02:01 --- nick: scoofy_ -> scoofy 12:02:39 I would like to think it wouldn't be *that* heavy on 6502 comparitively, since 6502 itself is so verbose 12:03:20 nice, the one I saw for the c64 is https://github.com/jkotlinski/durexforth 12:03:36 veltas, what do you mean? 12:03:57 Which part? 12:04:14 heavy on 6502 12:04:41 I mean not that large compared to more conventional 6502 machine code 12:05:00 its much larger even if you dont count the 10k kernel 12:08:41 on a different note, is there a forth that can target the lua platform similarly to how fennel can with a lisp 12:08:50 just wondering how many different environments I can run forth in :D 12:09:42 one of the main selling point imho 12:09:47 how many environments can you run? there is a forth for just about everything I can think of 12:12:08 I'm wondering if I can program forth for tic-80 12:12:13 from real 8-bit platforms to modern fantasy consoles 12:12:35 I suspect so 12:12:39 (tic-80 uses a lua environment internally) 12:23:07 --- quit: f-a (Ping timeout: 264 seconds) 12:29:41 --- join: f-a joined #forth 12:32:35 damn, now I'm messing with tic-80 lol 12:48:00 --- quit: gravicappa (Ping timeout: 265 seconds) 13:06:15 --- quit: crc (Remote host closed the connection) 13:09:25 --- quit: rpcope (Ping timeout: 264 seconds) 13:09:25 --- join: rpcope joined #forth 13:13:08 --- join: crc joined #forth 13:30:38 --- join: dave0 joined #forth 13:48:06 --- quit: xek (Ping timeout: 260 seconds) 14:15:04 I dedided to program a tiny game for the GB to finally get into forth 14:15:21 and I am excited in whatever complexities I will find and how people usually solve them 14:15:28 once you get in the mood it is quite pleasant 14:16:02 crc: your retroforth is on hacker news! 14:24:40 --- quit: f-a (Ping timeout: 265 seconds) 14:26:17 --- join: f-a joined #forth 14:27:56 --- join: Zarutian_HTC joined #forth 14:45:28 https://gforth.org/manual/How-the-Cross-Compiler-Works.html 14:45:50 archeologist are still debating how to interpret this 14:56:25 lol I remember that page 14:59:52 --- quit: f-a (Read error: Connection reset by peer) 15:00:01 --- join: f-a joined #forth 15:00:01 --- quit: f-a (Client Quit) 15:00:19 --- join: f-a joined #forth 15:10:04 --- quit: f-a (Quit: leaving) 15:29:16 --- quit: shmorgle (Quit: [TalkSoup] via NEXTSPACE) 15:52:21 --- quit: Lord_Nightmare (Quit: ZNC - http://znc.in) 15:55:36 --- join: Lord_Nightmare joined #forth 16:20:03 Congrats veltas you wrote a whole forth thinking ABORT" was unconditional 16:28:43 crc: I just took a look at retroforth, and was wondering: did you have some kind of long term strategy of adding system interaction functionality to the vm? like, the ability to connect to network sockets or to gfx libraries? I see your Web server example skirts that question by using inetd 16:29:52 I was just wondering because I had been pondering one day writing a forth vm that had some basic desktop system interfaces, like an interface to a graphics window 16:38:15 lispmacs[work]: hmm... I have been thinking about this and I think just doing a vnc server in a forth on a vm that supports network sockets might be the easiest way 16:38:43 plus it is the way least likely to bitrot 16:46:52 virgl > vnc 16:58:36 --- quit: X-Scale (Ping timeout: 264 seconds) 16:58:44 --- join: X-Scale` joined #forth 16:59:15 --- nick: X-Scale` -> X-Scale 17:00:26 Zarutian_HTC: that sounds like a pretty good solution, excepting I think the inabilty to do any graphics hardware acceleration 17:04:24 lispmacs[work]: on a Unix host, the VM does support sockets 17:04:26 http://forth.works/chapters/techniques/sockets.html 17:04:42 --- join: shmorgle joined #forth 17:04:47 but even without gfx hardware acceleration, it would be a big improvement over what we have now as far as a graphical desktop interface for Forth, which so far as I can tell is pretty much nothing 17:05:03 Graphics are an ongoing research topic at present 17:07:34 I've built experimental VM implementations providing a framebuffer and higher level drawing primitives, but haven't settled on anything yet. (I don't write many things that need graphical support, so it's kind of a low priority for me) 17:33:29 klys: have not heard of virgl. 17:34:25 one other thing vnc has going for it is the plethora of vnc viewers available 17:37:32 klys: I see 17:37:59 might be quite more than my requirements 17:39:12 crc: is that framebuffer just some huge ALOTted rgba pixmap? 17:39:56 (the alpha channel could be omitted) 17:41:15 Zarutian_HTC: yes 17:42:37 then a minimal vnc server that gives access to that should not be that hard to write 17:59:26 --- join: gravicappa joined #forth 18:02:00 crc: is there an non-blocking version of socket:accept ? 18:05:49 Not that I've defined 18:06:11 The C part providing the sockets is forthworks.com:8000/file?name=vm/nga-c/dev-sockets.c&ci=tip 18:06:26 I'm pretty sure that all I've done in this is blocking 18:08:09 --- join: elioat joined #forth 18:08:28 --- quit: elioat (Client Quit) 18:09:08 This is another thing I don't use very often, so my experience with raw sockets is *very* minimal 18:11:03 the main I've used it for is an irc bot 18:36:55 --- join: boru` joined #forth 18:36:58 --- quit: boru (Disconnected by services) 18:37:00 --- nick: boru` -> boru 18:44:58 --- quit: gravicappa (Ping timeout: 240 seconds) 20:57:56 --- quit: sts-q (Ping timeout: 256 seconds) 21:01:08 --- join: sts-q joined #forth 21:22:16 --- quit: Zarutian_HTC (Ping timeout: 265 seconds) 22:03:16 --- join: gravicappa joined #forth 22:13:24 --- join: hosewiejacke joined #forth 22:54:24 --- quit: _whitelogger (Remote host closed the connection) 22:55:46 --- join: Zarutian_HTC joined #forth 22:57:22 --- join: _whitelogger joined #forth 23:22:27 --- quit: hosewiejacke (Ping timeout: 240 seconds) 23:26:39 --- join: hosewiejacke joined #forth 23:49:36 --- quit: proteus-guy (Ping timeout: 264 seconds) 23:59:59 --- log: ended forth/21.02.18