2024-05-03 01:22:42 Gah. I need a bit of help guys. I'm trying to implement a basic version of [if] and [then] using other forth parser words, but I really don't understand. What words should I be reading about? 2024-05-03 01:22:57 I thought reading about how ( and ) are parsed would help, but alas, no. 2024-05-03 01:24:57 this being from the ans forth standard to detect if certain words are defined, right? 2024-05-03 01:28:22 yeah 2024-05-03 01:28:40 I want to use [if] and [then] as a basic macro for includirg other code 2024-05-03 01:28:44 when on a different system 2024-05-03 01:29:09 with nesting or not? 2024-05-03 01:38:57 nah, not necessary 2024-05-03 01:39:03 im just tryingto do: 2024-05-03 01:39:14 IS_GB [if] require thing.fs [then] 2024-05-03 01:39:28 gbforth doesn't implement [if] or [then], so I'm taking a stab at it 2024-05-03 01:39:33 so far, very unsuccessful 2024-05-03 01:40:12 gbforth? gameboy forth? wut? 2024-05-03 01:40:14 Yep 2024-05-03 01:40:45 If I do [host] IS_GB [if] ... [target] it works, because it's "stepping up" back into gforth, which does support [if] 2024-05-03 01:40:53 shurely you need ram chips in the cart to fit a forth in there 2024-05-03 01:41:04 It cross compiles 2024-05-03 01:41:14 Did you not see my awesome video? :) 2024-05-03 01:41:16 and does it support colour gameboy? 2024-05-03 01:41:36 https://www.youtube.com/watch?v=1cg2rssdJvE&feature=youtu.be 2024-05-03 01:42:05 https://github.com/ams-hackers/gbforth/pull/342/files 2024-05-03 01:42:42 I'm pretty sure I can implement [if] with parse-name and postpone, but the issue becomes checking the condition... 2024-05-03 01:43:07 I'm not sure how you check a condition like this without being able to call regular if/then 2024-05-03 01:43:21 ( uses word or such to look for ) no? 2024-05-03 01:44:51 Yea, but unconditionally. 2024-05-03 01:44:55 That's the tough bit 2024-05-03 01:45:08 (for me) 2024-05-03 01:45:20 isnt ( an immediate word? 2024-05-03 01:46:12 cfGB would be great. 2024-05-03 01:46:27 if someone did it right, and who knows what that actually means. 2024-05-03 01:46:46 you can define [then] to be an no op 2024-05-03 01:47:18 and do similiar thing as ( does only when condition is false, no? 2024-05-03 01:47:47 thinking 2024-05-03 01:49:02 what are my options for when something isnt defined 2024-05-03 01:49:26 [host] [if] ... [then] [target] works right. but not when running on gforth. can I tell gforth to ignore those words? 2024-05-03 01:49:28 somehow? 2024-05-03 01:51:18 kewl, having sha256 means one can use it to implement certain stuff such as hmac, ladder lamport-esque signiture and even a block cipher in stream chiper mode or such 2024-05-03 01:52:18 not familiar with gforth enough. eforth, figforth and others of that ilk I am somewhat familiar with 2024-05-03 01:52:30 I think I maybe did it 2024-05-03 01:52:43 : [if] if postpone [then] parse-name drop drop then ; immediate 2024-05-03 01:52:51 ' [if] alias [if] immediate 2024-05-03 01:53:10 this builds, and my forth code sorta compiles, so I must be getting closer :) 2024-05-03 01:53:41 examples/sha256/sha256.fs:7: No such file or directory 2024-05-03 01:53:43 require >>>ibm-font.fs<<< 2024-05-03 01:53:52 Not sure why but it's close :) 2024-05-03 01:55:06 as you said, [then] needs to be a noop 2024-05-03 01:56:04 btw I been binge watching thor at PirateSoftware stream hackmud.com and that has/is/will-be inspir(e|ed|ing) me to get creative again about making puzzles and crypto stuff 2024-05-03 01:56:57 wow it worked :) 2024-05-03 01:57:02 hell yeaaaaaaaa 2024-05-03 01:57:32 so it worked because... postpone is pausing compilation until it sees [then], right? 2024-05-03 01:57:45 no. 2024-05-03 01:58:12 postpone is just pausing compilation. [then] parse-name is then skipping input stream until it sees that 2024-05-03 01:58:53 ya got it 2024-05-03 01:59:09 then, after this "pre-compilation" process gbforth does, gbforth then goes to cross compile the resulting forth 2024-05-03 01:59:45 hm, I feel something is off 2024-05-03 02:01:48 yea no, this isnt working 2024-05-03 02:01:50 hm 2024-05-03 02:02:17 I think I need to invert things 2024-05-03 02:03:03 there we go 2024-05-03 02:05:08 what's the idiomatic way to do not if ... then ? 2024-05-03 02:05:30 "not" is apparentlynot implemented in gbforth - is that an unusual thing? 2024-05-03 02:06:59 : NOT IF FALSE ELSE TRUE THEN ; 2024-05-03 02:07:15 but it adds many instructions? :). 2024-05-03 02:07:32 I'm just going with 0 = if ... then for now 2024-05-03 02:07:57 Damn. I'm proud of myself. 2024-05-03 02:08:04 Even if it was just adding [if] [then] 2024-05-03 02:08:20 This is the frickin' power of Forth! 2024-05-03 02:08:27 Aauugh! :D 2024-05-03 02:10:45 Hm, seems to be a bug, where putting [if] ... [then] on one line is a bug 2024-05-03 02:10:54 but putting [then] on its own line is ok 2024-05-03 02:11:35 hm, seems to be : causing issues actually 2024-05-03 02:11:51 all good, dont care :D. 2024-05-03 02:13:01 Zarutian_iPad │ kewl, having sha256 means one can use it to implement certain stuff such as hmac, ladder lamport-esque signiture and even a block cipher in stream chiper mode 2024-05-03 02:13:25 I have intentions on at least writing some digital signature routines 2024-05-03 02:13:40 So I can sign messages from my My4th light machine which I'm going to build :) 2024-05-03 02:13:51 (Ordered 5 PCBs today :)) 2024-05-03 02:13:59 I'm going to be selling 3. 2024-05-03 02:14:02 one prob with ladder lamport, priv keys are single use 2024-05-03 02:14:13 To offset the cost of building 2, one of which I'm giving to my brother 2024-05-03 02:14:52 I think I can find 3 people obsessed enough with forth and $100~ to sell to 2024-05-03 02:15:05 I'm not looking to make profit, just cover my costs 2024-05-03 02:15:09 and maybe enough to order a pizza 2024-05-03 02:17:28 so, priv keys either need to be generated deterministically and the pub key for the next priv key in line needs to be signed along what ever data is actually being signed 2024-05-03 02:18:18 http://lars.nocrew.org/forth2012/core/POSTPONE.html 2024-05-03 02:18:23 I really need help interpreting this 2024-05-03 02:18:47 Skip leading space delimiters. Parse name delimited by a space. Find name. Append the compilation semantics of name to the current definition. An ambiguous condition exists if name is not found. 2024-05-03 02:19:02 is it ` postpone` ? 2024-05-03 02:20:50 why the hell isnt a definition being skipped 2024-05-03 02:20:54 driving me crazy 2024-05-03 02:21:14 ic 2024-05-03 02:22:03 you want to look for [then] in the input stream in the same way ( looks for ) 2024-05-03 02:23:35 I have no idea how it does, the def. for ( is ultra basic: 2024-05-03 02:23:46 : x( postpone ( ; ximmediate-as ( \ ) 2024-05-03 02:23:56 it's whack 2024-05-03 02:24:31 : ximmediate-as 2024-05-03 02:24:33 latestxt F_IMMEDIATE create-xname ; 2024-05-03 02:24:54 maybe they implemented it wrong 2024-05-03 02:25:04 probably 2024-05-03 02:25:28 I feel what I'm doing should work, but I'm also in a weird ass forth system 2024-05-03 02:25:34 so anything goes 2024-05-03 02:26:04 look at how they implement FIND or such 2024-05-03 02:31:49 not worth the hassle I think 2024-05-03 02:31:56 I'm really pushing this stuff I think 2024-05-03 02:32:04 and getting distracted :) 2024-05-03 02:32:10 I need to correct this bug on gameboy 2024-05-03 10:22:50 I've never really understood POSTPONE or its point. I didn't realize it was intended to replace COMPILE and [COMPILE], though I did see they were all related. Having never written a code-threaded system, I hadn't anticipated the problem with the usual definition of COMPILE. 2024-05-03 10:25:10 I'm glad you posted that, though - that wrinkle will come up in this next system I do, so now I can be mulling over the right way to tackle it. 2024-05-03 10:30:05 It's clear that words of that ilk will need to be a lot smarter in a code-threaded system, or for that matter in any system where the "next word" in the code stream is of variable possible size. 2024-05-03 10:33:08 They cite the "typical" implementation: 2024-05-03 10:33:11 : COMPILE R> DUP @ , CELL+ >R ; 2024-05-03 10:34:19 Looks to me like replacing @ with something like OP@ and CELL+ with OP+ would fix it - the intelligence about variable size would be in those OP words. 2024-05-03 10:43:16 You'd need something smarter than , too - the size variance affects adding it to the code stream too. Maybe : COMPILE OP@ OP+ OP, ; with the "address" just presumed to be on the return stack. 2024-05-03 11:15:48 I think for variable size code elements the cleanest approach would be to let DP address the next available BIT in the dictionary. 2024-05-03 11:16:13 It's not like we need, really, to be able to address 2^64 bytes. 2024-05-03 11:16:25 2^61 is still more than enough. 2024-05-03 14:32:35 compilr and [compile] require you to know how a word is implemented to get the effect you want, postpone doesn't 2024-05-03 16:13:42 I just want to quit everything and use forth 2024-05-03 16:13:45 aaaaugh. 2024-05-03 16:14:04 I have never felt this way toward a programming language before. 2024-05-03 16:14:48 The only other technology Ive felt this for is code CAD. 2024-05-03 16:21:18 For me it was too hard, I think 2024-05-03 16:21:23 Or perhaps it was the lack of GC thing 2024-05-03 16:21:25 Forth does that to you. 2024-05-03 16:21:48 No types, no GC :d I know of Factor. 2024-05-03 16:23:31 None built in. You can add them if you want them. 2024-05-03 16:23:36 But you have to do the work. 2024-05-03 16:23:49 Yea I've seen some attempts 2024-05-03 16:23:59 Has to work with 3rd party code too tho 2024-05-03 16:29:07 I don't care about that part. I do Forth for me. 2024-05-03 16:31:54 olle you just haven't used forth enough 2024-05-03 16:32:04 For real, Forth is _easier_ than C 2024-05-03 16:36:22 C? 2024-05-03 16:36:29 What kind of brag is that lol 2024-05-03 16:37:40 hell is other people's forth programs 2024-05-03 16:38:36 it's very nice for self-written things, though 2024-05-03 16:46:51 olle - it's easier than JS, Rust, etc 2024-05-03 16:47:41 That probably depends on the scale and size of the program. 2024-05-03 16:48:19 Absolutely. At larger scales Forth is even easier. It's insane composability makes it that way. 2024-05-03 16:48:32 It's/Its 2024-05-03 16:49:03 Nah 2024-05-03 16:49:04 I would love for you to share some Forth you find difficult to understand 2024-05-03 16:49:07 You'd have memory leaks 2024-05-03 16:49:23 Wish I had time for that :) 2024-05-03 16:50:10 I believe what lf94 said is true IF it's well-written Forth. And dlowe's comment is quite true as well. 2024-05-03 16:50:34 Forth lets you write things so that they make sense to you - that won't necessarily make sense to someone else. It's easier if it's good Forth, though. 2024-05-03 16:50:45 You can write incomprehensible code in any language. 2024-05-03 16:51:31 You can leak memory in any program, even Rust 2024-05-03 16:52:00 Also, you can 100% prevent memory leaks in any program 2024-05-03 16:52:07 It depends how you architecture the program. 2024-05-03 16:52:33 I'd consider that discussion a "solved problem" ;) 2024-05-03 16:52:47 At least not much new can be added to it at this point. 2024-05-03 17:07:35 forth is simpler than c, i don't know what "easier" means 2024-05-03 17:07:44 I think Forth in its "native form" made sense (and I guess still makes sense) in a system that has limited RAM (so you can basically manage it all "in dictionary") and limited storage (little enough to make manually dealing with block numbers manageable). Such systems would normally be serving some single purpose, and I think it's what Forth native is best suited for. 2024-05-03 17:08:13 But if you've got a modern level of RAM and a modern amount of storage, you really do kind of need some kind of memory management and some kind of file system, or database, or SOMETHING. 2024-05-03 17:08:38 Especially if you're going to be using the system for a lot of different things, the way we do our os. 2024-05-03 17:10:11 People, is the problem. Lots of lots of people (devs). :) 2024-05-03 17:10:14 Lots and* lots 2024-05-03 17:10:19 WhaT I'm not interested in is using my "Forth OS" to run C or Python or Rust or anything else - I want *Forth* to be my programming language. That makes it all but certain that I'd need to write various sorts of abstraction layers suited to the applications I'm pursuing. 2024-05-03 17:10:36 For number crunching, I'll need floats and vectors and matrices and so on, etc. 2024-05-03 17:11:10 Yeah, if you have to collaborate with a lot of people you don't get to have it 'your way." 2024-05-03 17:11:26 At least not all of it - you should get your share, I think. 2024-05-03 17:11:44 I've never done any team programming, though. 2024-05-03 17:11:48 Only lone wolf stuff. 2024-05-03 17:11:57 how? 2024-05-03 17:12:13 how do you avoid having to work on a team? 2024-05-03 17:12:27 That's just one of the reasons I don't regard myself as "professional" at software dev. 2024-05-03 17:12:44 do you write software for a living? 2024-05-03 17:13:06 I'm a hack that knows "a moderate amount." And I've dipped my toes into formal CS stuff a little bit, but not a whole lot. 2024-05-03 17:14:22 Maybe I'm somewhere around where an "early second year CS" student would be. Or late first year - something like that. 2024-05-03 17:14:35 guess i'm on his /ignore 2024-05-03 17:15:13 We had to take a couple of CS courses in my engineering program. The usual first intro to data structures and that sort of thing. 2024-05-03 17:15:39 Pascal was popular at that time. 2024-05-03 17:15:57 In academia, at least - I think the real world had moved on to C by then. 2024-05-03 17:16:25 That was around '82-'83. 2024-05-03 17:16:53 Pascal was still the introductory language when I started uni in 93 2024-05-03 17:17:03 :-) 2024-05-03 17:17:08 Academia can move slowly. 2024-05-03 17:17:19 SML was my first language at uni 2024-05-03 17:17:23 Gotta go tho, weekend now 2024-05-03 17:17:24 \o 2024-05-03 17:17:35 Guess the prof had all his lecture notes together and didn't feel like updating them yet. 2024-05-03 17:17:41 Enjoy! 2024-05-03 17:17:45 Stay safe. 2024-05-03 17:18:14 They'd probably paid for Turbo Pascal licenses and wanted to get their money's worth :P 2024-05-03 17:18:25 Ugh. Four of my boxes at work are running CentOS 7.9, and it's end of lifing at the end of June. 2024-05-03 17:18:35 The powers that be are already sending me regular notifications. 2024-05-03 17:18:49 And there is no moRE CentOS, so I can't fix it by upping to 8. 2024-05-03 17:19:20 So I will probably have to install fresh systems. What a pain. 2024-05-03 17:19:45 CentOS is Redhat derived? 2024-05-03 17:19:49 Yeah. 2024-05-03 17:20:02 It tried to be EXACTLY Redhat. 2024-05-03 17:20:08 I feel like there was drama around that recently 2024-05-03 17:20:10 Just without the support and branding. 2024-05-03 17:20:21 I'll probably go to Rocky 9. 2024-05-03 17:20:28 Yeah, it's caused some drama. 2024-05-03 17:21:14 I only use two of those four boxes in my actual workflow, so at least I've got a couple of guinea pigs. 2024-05-03 17:21:45 I've heard of a tool, called Alma-something, that will let you "upgrade" across distros. 2024-05-03 17:21:50 I may look into that. 2024-05-03 17:22:10 Apropos 3D, I remembered https://en.wikipedia.org/wiki/Generative_Modelling_Language which is a Postscript-alike for 3D modelling 2024-05-03 17:22:20 Also, my personal notebook is several levels down - Fedora 36, whereas 40 is current. 2024-05-03 17:22:39 Sometime soon I plan to make a backup of my disk image and see if I can roll it all the way forward. 2024-05-03 17:23:01 https://almalinux.org/blog/future-of-almalinux/ 2024-05-03 17:23:43 Fortunately those two that I do use do fairly straightforward things - should be easy to back up a couple of directories, install Rocky 9, and restore my directories. 2024-05-03 17:28:54 Wow, my My4TH light boards will be here fast 2024-05-03 17:28:56 May 7th 2024-05-03 17:29:04 Nice. 2024-05-03 17:29:25 And my components will be here literally next day when I order them, so I'm holding off 2024-05-03 17:29:31 I've got a gadget on order. I'm putting together a RAID5 NAS to put in my little network cabinet up in one of the spare bedroom closets. 2024-05-03 17:29:32 Until I receive the boards 2024-05-03 17:29:39 Going to run OpenMediaVault on it. 2024-05-03 17:29:43 Nice :) 2024-05-03 17:29:51 You should check out JellyFin 2024-05-03 17:29:59 Highly recommended 2024-05-03 17:30:10 I've heard of it - I will take a look. 2024-05-03 17:30:11 lf94: was it you who was asking about 3D? 2024-05-03 17:30:23 I'm going to do a 3D FPS in Forth yes 2024-05-03 17:30:45 Im mostly fearing portable network and input code 2024-05-03 17:30:58 Graphics isn't much of a concern, I want to use a framebuffer. 2024-05-03 17:31:00 You might get some ideas from Generative Modelling Language 2024-05-03 17:31:04 I'll check it out 2024-05-03 17:31:28 lf94: Are you running X or Wayland? 2024-05-03 17:31:37 So these My4th are costing about $70 each in components after shipping and taxes. What do you guys think is reasonable to sell assembled boards? 2024-05-03 17:31:41 KipIngram: X 2024-05-03 17:31:48 I've only heard bad things about Wayland 2024-05-03 17:31:51 Constantly 2024-05-03 17:32:01 I don't think Wayland is necessarily bad 2024-05-03 17:32:02 Ok, good. I've found that Wayland just refuses to do certain things, because they consider them "insecure.' 2024-05-03 17:32:11 But I know X "just works" :) 2024-05-03 17:32:13 Things like letting your program resize its own window. :-( 2024-05-03 17:32:44 Well, X is on its way out. May take another couple of years, but Fedora already ships with Wayland the default, and by 42 or so it sounds like it won't be there at all. 2024-05-03 17:32:59 Other distros are on a similar path. 2024-05-03 17:33:18 > The Procedural Cathedral 2024-05-03 17:33:20 love it 2024-05-03 17:33:34 On the good news front, they think they're within ayear or two of having the open-source Nvidia drivers fully functional. 2024-05-03 17:34:11 GeDaMo: looks like regular forth to me anyway :) 2024-05-03 17:34:25 lf94 │ So these My4th are costing about $70 each in components after shipping and taxes. What do you guys think is reasonable to sell assembled boards? 2024-05-03 17:34:30 For real, I'd love some answers. 2024-05-03 17:34:48 I had no complaints about Wayland until I tried to do a little graphics programming and discovered that issue I mentioned above. 2024-05-03 17:34:57 As far as "normal operation" goes, it's been fine. 2024-05-03 17:35:00 Also, not Forth related but cool "kkrieger: Making an Impossible FPS | Nostalgia Nerd" https://www.youtube.com/watch?v=bD1wWY1YD-M 2024-05-03 17:36:03 lf94: it might depend how bit the potential audience is 2024-05-03 17:36:21 I get the inclination to change to Wayland. The whole X architecture really relates to days when we ran our programs on a central computer somewhere and had a box by our desk that did our graphics. 2024-05-03 17:36:27 GeDaMo: you are the potential audience :) 2024-05-03 17:36:36 GeDaMo: yes I've seen that demo years ago. So great. 2024-05-03 17:36:39 Just me? :| 2024-05-03 17:36:41 Wayland is architected for modern systems. 2024-05-03 17:36:45 GeDaMo: your type ;p 2024-05-03 17:36:54 (which includes myself in that category) 2024-05-03 17:43:17 lf94: Maybe double it and add shipping. Something like $150. Not sure how you value the time spent in assembly. 2024-05-03 17:43:57 I believe the time I spent assembling is more enjoyable with pizza. So I believe adding the price of pizza to that price is fair. 2024-05-03 17:44:03 Or a beer 2024-05-03 17:44:23 I'm not necessarily looking to make profit 2024-05-03 17:44:34 But any profit I do make is simply going toward more Forth projects 2024-05-03 17:44:42 (My day job supports me.) 2024-05-03 17:45:15 Day jobs are nice in that sense. 2024-05-03 17:45:41 I'd rather get to play all the time, though. :-) 2024-05-03 17:45:50 One thing I do not expect is to be bored in retirement. 2024-05-03 17:46:01 Same. I doubt there are enough forth lovers to support me on My4th assemblies though. :). 2024-05-03 17:46:31 I'm thinking I stick another 5-6 years, and then call it done. 2024-05-03 17:46:51 Expenses will drop dramatically between now and then. 2024-05-03 18:08:52 KipIngram: instead these days we run our programs on a central computer somewhere and have a web browser that does our graphics 2024-05-03 18:09:20 we do? 2024-05-03 18:09:32 for some value of we 2024-05-03 18:09:47 the human race overwhelmingly uses smart phones to access computation 2024-05-03 18:12:11 ^ 2024-05-03 18:13:04 js on the browser is the ultimate language 2024-05-03 18:16:24 JS offers a nice programming interface. But forth has taught me you can mimic this interface very easily. 2024-05-03 18:16:35 myobj.property is perfectly easy to do in forth 2024-05-03 18:16:59 MyClass new \ could easily be forthy 2024-05-03 18:17:09 1 5 7 6 s" yes man" MyClass new 2024-05-03 18:17:26 Or, we program an object system into forth to pass named arguments. 2024-05-03 18:18:28 .{ 5 ok , 7 prop2 , s" okie dokie" name }. MyClass new 2024-05-03 18:18:36 something like that 2024-05-03 18:18:44 That was 5 seconds of imagination 2024-05-03 18:18:59 Imagine what 5 hours of imagination could do 2024-05-03 18:19:07 eh ship it 2024-05-03 18:19:11 ahahah 2024-05-03 18:19:39 You could completely mimic the new class notation, but it wouldnt be forthy. Forthy code is a strength 2024-05-03 18:19:59 If you want to mimic JS just use JS. 2024-05-03 18:20:11 _but_ I agree named arguments can be useful 2024-05-03 18:20:26 But you're going to have to debate it for each scenario :) 2024-05-03 18:20:50 forth fundamentals would just use words that set global variables for this sort of thing 2024-05-03 18:21:05 which... works... 2024-05-03 18:35:57 i was never fond of objects 2024-05-03 18:36:26 i like closures much more, which could be seen as the same thing somehow 2024-05-03 18:36:56 objects makes the life of the user easier 2024-05-03 18:37:17 but it's always more code and overhead for the one who makes them 2024-05-03 18:37:43 make* 2024-05-03 18:40:10 Not having to care about argument order, is nice. But there is overhead for that. 2024-05-03 18:40:24 You have to learn object names 2024-05-03 18:40:32 property names* 2024-05-03 18:40:38 well the order of arguments sometimes is hard to remember 2024-05-03 18:40:45 compare this to positions, which have no names. you just have to remember semantics. 2024-05-03 18:40:47 i would pay some price 2024-05-03 18:41:07 for complex objects you 99% of the time have documentation open. 2024-05-03 18:41:19 show me code with objects where you havent looked at documentation 2024-05-03 18:42:08 well objects are just a way to program stuff, you can't learn how to use X without reading documentation about, no matter is object or function 2024-05-03 18:43:22 "a bag of values" :) 2024-05-03 18:43:30 kind of 2024-05-03 18:43:45 but with methods attached 2024-05-03 18:44:45 there's no much difference in using a list of values or a hash and give it to a function 2024-05-03 18:45:11 hash keys are pretty easy to typo 2024-05-03 18:45:38 except if we start talking about inheritance and all those cool things about objects 2024-05-03 18:46:31 for me making a program by creating classes is a burden 2024-05-03 18:50:49 i should try to rewrite my toy lang into a bunch of objects actually 2024-05-03 19:04:57 js is object heavy yet very little inheritence