2024-12-16 00:06:06 what do you guys like for pastebin? 2024-12-16 00:06:49 termbin.com 2024-12-16 00:08:27 https://termbin.com/dbpy 2024-12-16 02:31:28 i started my second attempt at learning Forth recently, my previous one was after learning Tcl and finding that amazing and coming in with expectations which resulted in me being thoroughly disappointed as to how raw Forth is... but this time around it's after coding a lot of asm so it actually feels really nice 2024-12-16 02:32:12 currently going through the ritual of bootstrapping my own interpreter lol 2024-12-16 02:36:26 awesome :) 2024-12-16 08:11:10 GreaseMonkey: I've rolled several systems as well - it's a lot of fun, isn't it? 2024-12-16 08:11:22 That moment when it first begins to "really work" is a great moment. 2024-12-16 08:11:47 Code/subroutine threaded, or some form of direct or indirect? 2024-12-16 08:13:21 rolling other things is only fun with a roll bar. and maybe a five-point harness 2024-12-16 08:15:19 KipIngram: yeah, currently just getting some basic words in but the approach i'm taking is compiling it to native code with the power of "call" opcodes 2024-12-16 08:15:29 specifically targetting 8086 in DOS for now 2024-12-16 09:16:40 I've mostly written indirect threaded systems. I did do one direct threaded quite a few years back. I haven't written a code-threaded one so far, but my next one will be of that sort. But instead of running on a native instruction set it will run on a vm with an F-18A like instruction set. 2024-12-16 09:17:33 Not a "precise emulation" of the F-18A; I'm just borrowing a number of architectural ideas from it. 2024-12-16 11:41:48 GreaseMonkey: Yeah Forth is very weird and 'raw', with your new expectations hopefully you enjoy it or like me will get burned out and come back to it repeatedly for years 2024-12-16 11:44:56 veltas do you get burned out with forth? :0 2024-12-16 11:45:03 why 2024-12-16 11:45:12 I think a lot of us do 2024-12-16 11:45:32 Because it's difficult and flawed 2024-12-16 11:45:40 But we come back because it's interesting and fun 2024-12-16 11:46:44 "Burned out" is a bit strong, more like 'fed up' or 'disinterested' 2024-12-16 11:47:16 so it's like why I'm being such a masoquist? let's just use any other language that does the job 2024-12-16 11:47:31 but then the masochism kicks on again and you come back 2024-12-16 11:47:44 masochist* 2024-12-16 11:48:57 I think the main reason I have interest in it is because I'm expected to abuse colon words 2024-12-16 11:50:53 that "extend the language until it suits the problem" thing 2024-12-16 11:51:13 also aren't you making your own forth, you can address the flaws in your own implementation and do some things different 2024-12-16 11:51:59 what flaws do you see in it? 2024-12-16 11:54:06 so at the end is it hard for forth to escape it's niche of interacting with hardware? 2024-12-16 11:54:47 like it will not usually be the good answer for most other computing problems? specially what is known as "modern programming" 2024-12-16 11:56:04 almost all claims about forth like small, low resources, raw, a repl to your hardware, etc do not really interest me 2024-12-16 11:56:54 what mainly interests me is the encouragement of making my own abstractions, utilities, operators... and to build stuff on top of them 2024-12-16 11:57:19 also I like the "I live in my own world and the only rules that apply are the ones I create" attitude 2024-12-16 11:57:39 it's like "the rules of your stupid world do not apply to me" 2024-12-16 11:58:18 which I guess is what allows you to think out of the box and come with solutions you will not find in other languages 2024-12-16 12:22:19 that said, it must be super exciting to play with forth and hardware and have a repl 2024-12-16 12:27:50 https://flashforth.com/ 2024-12-16 12:28:32 I always thought pic microcontrollers would be a great way to get started with embedded systems 2024-12-16 12:34:58 but arm is what makes sense today 2024-12-16 13:03:08 Yeah embedded Forth use is definitely a good fit 2024-12-16 13:53:22 PICs are not a great architecture; ARM is much nicer 2024-12-16 14:11:07 i have a pic with a mips isa that i wanted to program for fun. nearly a year later i still haven't loaded a single byte on it because i'm lost in a compiler rabbit hole. 2024-12-16 14:26:52 haha, "a pic with a mips isa" 2024-12-16 14:26:57 Microchip is playing us all for absolute fools 2024-12-16 14:27:15 MIPS is a fine architecture too from the little I've seen 2024-12-16 14:28:53 it looks like it would be pretty easy to compile for 2024-12-16 14:29:31 but I haven't tried; all the compilers I've written have targeted i386 (or a non-machine-code language like SKI-combinators or JS) 2024-12-16 14:37:05 I think I will be using these definitions as standard https://termbin.com/4q7z 2024-12-16 14:37:10 Or equivalent 2024-12-16 14:38:35 So you can do 5 ARRAY TEST DIM TEST ? ( 5 ) 0 TEST DIM TEST @ ERASE ( wipe ) 3 TEST ( address of index 3 ) ( etc ) 2024-12-16 14:39:09 Because I was playing with TH and decided I don't really like it that much 2024-12-16 14:40:17 But I do use dumb arrays a lot 2024-12-16 15:22:40 Talking Heads? 2024-12-16 15:23:25 xentrac> haha, "a pic with a mips isa" -- in my best joe biden impression, "not a joke!" 2024-12-16 15:24:37 array is what I'd normally use; dim is a new idea to me 2024-12-16 15:24:51 well, I guess array without dup , is what I'd normally use 2024-12-16 15:27:58 dim or dimension is usually associated with arrays, but 'size' is a much more broad term I don't want to define in the main wordlist 2024-12-16 15:28:24 Also size can mean size in bytes, dimension is usually more the logical size 2024-12-16 15:28:37 That said, not familiar to everyone 2024-12-16 15:29:08 And the dim is settable by design, it's useful to be able to play with the size of an array that's pre-allocated 2024-12-16 15:29:20 The dim can be used to track actual length vs capacity 2024-12-16 15:31:25 I'm used to the operators "length", "len", and "size" in other languages 2024-12-16 15:31:36 well and "sizeof" but that's wrong 2024-12-16 15:40:41 Yeah dim is more like len 2024-12-16 15:40:52 lua uses # :) 2024-12-16 15:41:22 maybe : # DIM @ ; 2024-12-16 15:41:23 xentrac: : TH ( addr idx -- addr ) CELLS + ; 2024-12-16 15:41:34 For what TH is 2024-12-16 15:41:42 what does that stand for? 2024-12-16 15:41:56 5 TH = 5th 2024-12-16 15:42:13 If you are happy that 0th is first etc 2024-12-16 15:42:29 ooh 2024-12-16 15:42:37 I'll admit it looks nicer in lowercase 2024-12-16 15:42:52 yeah if i'm using that notation i usually call it "nth" 2024-12-16 15:44:02 I think my ARRAY definer makes more sense 2024-12-16 15:44:14 I think something like that is in Starting Forth but I don't see it used much 2024-12-16 15:44:34 But I like it and will try using it 2024-12-16 15:44:59 i'll allow this to continue. for now. 2024-12-16 20:27:20 depends on what you mean by "from scratch." if you're ok with using the IDE, it has a simulator which is a big help if you want to develop a forth system 2024-12-16 20:27:33 I know a guy who loves mips and always wondered why 2024-12-16 20:28:13 it's also really easy to set up gdb+qemu if you like linux stuff. I did that for writing MIPS asm and it was great 2024-12-16 20:29:52 by "from scratch" i mean i program the device by reading the docs and using no vendor or open source tooling 2024-12-16 20:30:57 apart from a compiler for my development machine, of course 2024-12-16 20:38:01 I suppose you could dig into all the setup code and duplicate that in your forth if that's your idea of fun 2024-12-16 20:38:26 I settled for a C project that jumps to my code and never returns 2024-12-16 20:38:49 what did you write your code in? 2024-12-16 20:48:22 for that project, assembly 2024-12-16 20:48:56 https://hackaday.com/2022/12/24/blinky-project-is-6502s-all-the-way-down/ 2024-12-16 20:49:07 but i mean, what was the assembler? 2024-12-16 20:51:29 GNU as 2024-12-16 20:51:58 escaping gnu as or gcc is part of the goal for me 2024-12-16 20:52:03 since it's MIPS, you can just use regular MIPS GCC and the associated tools 2024-12-16 20:53:08 like i said, if i'm just going to use someone else's tools then i could make it blink in no time and i wouldn't be here 2024-12-16 20:53:53 could you compile an empty project with one call to your code using GCC then save the binary file from that and glue your own code to it? 2024-12-16 20:54:06 so the user never needs GCC from then on 2024-12-16 20:54:25 how would i generate my own code? 2024-12-16 20:54:27 i am the user 2024-12-16 20:54:39 it's like you're missing the point 2024-12-16 20:54:58 i don't have a project that i'm trying to build 2024-12-16 20:55:04 does the forth run on the microcontroller or your PC? 2024-12-16 20:55:05 the development environment /is/ the project 2024-12-16 20:55:09 I understand 2024-12-16 20:57:25 im just saying you could read docs and generate the sequence of instructions to bring up the chip without involving GCC which would be painful 2024-12-16 20:58:15 as i've said twice now, i haven't even made it that far. bringing up the chip without gcc honestly sounds like the easy part to me. 2024-12-16 20:58:22 OR you could generate a binary with GCC that does the initialization for you and save that binary then uninstall GCC. from there, every project would be adding bytes to a copy of that binary 2024-12-16 20:58:51 yes, i could do something very hard, or i could just not do that hard thing which was the entire goal in the first place. thanks for your input. 2024-12-16 20:58:52 so the user (yes, you) never needs to touch GCC again once the binary is generated 2024-12-16 20:59:23 but now i have an opaque binary blob from some third party that i depend on and i have no idea what's in it or what it does or how it was generated 2024-12-16 21:00:00 of course you know what's in it and how it was generated 2024-12-16 21:00:05 this is "just make it work and ship it" thinking 2024-12-16 21:01:02 and it's not even addressing the part that i've said has sucked up all of my time 2024-12-16 21:01:03 feel free to do this yourself. I'm not saying you shouldn't. im just speaking from experience when I say that reinventing that wheel can really suck worse than you might think. that's not a reason not to do it though 2024-12-16 21:02:22 i honestly don't even know what you're getting at. as i've said now for the fourth time, i haven't even gotten to the stage of trying to put code on a device yet. the point of my original comment was that forth or compiler design itself turned into an interesting enough subject that it's held my attention. 2024-12-16 21:04:36 im not disagreeing with you or trying to solve your problems 2024-12-16 21:06:09 so if my comments don't need to address what has sucked up all your time or anything else