2023-10-31 05:30:31 There's eFORTH WEB :d 2023-10-31 05:35:24 https://github.com/MPETREMANN11/uEforth/blob/main/web/js/ueforth.js 2023-10-31 05:35:30 Probably just a VM 2023-10-31 06:06:58 I retract my complaints about irssi because they've helped me sort my broken config out and have even patched the manual to mention the setting I needed 2023-10-31 06:08:01 Let it be known from this day forward that I am no longer at war with irssi, ceasefire signed https://github.com/irssi/irssi/commit/363fbf048fd1b26ccb031df0aa4bf66507326ded 2023-10-31 06:25:27 https://github.com/linkedin/forthic - fucking linkedin made a forth dialect... 2023-10-31 06:40:32 That's quite a nice find olle 2023-10-31 06:45:42 https://i.imgur.com/Qcovzyi.png 2023-10-31 06:56:51 oh god xD 2023-10-31 06:57:12 https://www.youtube.com/watch?v=IxEXUlUexHU CF01 Why I created Forthic 2023-10-31 07:36:43 50 yo lang and not a single video on internet explaining create and does> :((( 2023-10-31 07:47:04 olle: you want to know how create does> works? 2023-10-31 07:48:44 Read Starting Forth 2023-10-31 07:48:45 GeDaMo: Yea, but I want a video on it I can repeat over and over until it sticks in my brain :) 2023-10-31 07:48:57 Do I need to read Starting Forth on YouTube? 2023-10-31 07:48:57 No time to read, working... Kinda. 2023-10-31 07:49:08 veltas: Would be a nice first step :D 2023-10-31 07:49:10 Sorry, I don't know of any videos 2023-10-31 07:49:50 I've put it in my 'articles' todo list but I'm definitely busy at moment 2023-10-31 07:50:29 There are automatic readers for voice that also helps 2023-10-31 07:50:30 https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/CREATE_002e_002eDOES_003e-applications.html#CREATE_002e_002eDOES_003e-applications 2023-10-31 07:50:58 I think Starting FORTH explains it best 2023-10-31 07:51:35 https://www.forth.com/starting-forth/11-forth-compiler-defining-words/ 2023-10-31 07:54:21 We definitely need more videos because people's attention spans are non-existent post-social-media 2023-10-31 07:54:49 I mean 2023-10-31 07:54:53 Videos help in a lot of ways 2023-10-31 07:55:18 Please give feedback on the only video I've done https://www.youtube.com/watch?v=eEqgZp-VSgs 2023-10-31 07:55:19 You get audio, picture AND text, instead of JUST text. 2023-10-31 07:55:28 I prefer reading to videos :| 2023-10-31 07:56:17 Hard to do in the background at work tho :) 2023-10-31 07:56:33 GeDaMo: Yeah me and all the old guard, but these zoomers think in instagram posts 2023-10-31 07:56:47 Or whatever tictok thing they're doing now 2023-10-31 07:58:16 Their mind shuts down when they don't hear "OKAY GANG TODAY WE'RE GOING TO LEARN HOW TO DEFINE YOUR OWN DEFINING WORDS IN FORTH, BUT FIRST LET'S HEAR A WORD FROM MY SPONSOR" 2023-10-31 07:59:22 Assumptious, sir. 2023-10-31 07:59:42 I am pulling your leg a bit :P 2023-10-31 07:59:48 I know you might not be a zoomer too 2023-10-31 08:00:09 My wife's arguably a zoomer and I pull her leg about it endlessly 2023-10-31 08:00:58 I'm genuinely concerned about Gen-Zed technical skills 2023-10-31 08:01:09 Can someone explain why people are always shouting in these videos? 2023-10-31 08:01:11 my stepdaugher cannot fault-find a not-working PC to save her life 2023-10-31 08:02:06 Hope everyone has a good All Saints Eve today 2023-10-31 08:02:58 Hmmmm is today? 2023-10-31 08:03:00 In UK? 2023-10-31 08:03:06 No wait 2023-10-31 08:03:24 All church activities are during the weekend here (SE) 2023-10-31 08:03:33 My mom died a month ago, so might go this year. :) 2023-10-31 08:03:40 All Saints Eve is also known as Halloween 2023-10-31 08:04:08 All Souls Day is more likely to have events (2nd Nov) 2023-10-31 08:05:02 That's the general day of mourning, I'm maybe attending one. People are meant to do vigils on All Souls Eve as well but it's sort of turned into something else...... 2023-10-31 08:05:12 All Saints* Eve 2023-10-31 08:06:11 Sorry for your loss olle 2023-10-31 08:07:01 Thank you. 2023-10-31 08:07:13 There's a church near by built in 1981 2023-10-31 08:07:26 GeDaMo: "TL note, All Saints Eve is also known as Halloween" 2023-10-31 08:09:26 https://upload.wikimedia.org/wikipedia/commons/f/fe/Sankt_Matteus_kyrka_%28Tryggheten_2%29.jpg 2023-10-31 08:10:18 https://www.svenskakyrkan.se/malmo/st-matteus-kyrka/om-st-matteus-kyrka/st-matteus-kyrkas-historia - some pics here, text in swedish 2023-10-31 08:11:03 You in Sweden? 2023-10-31 08:11:31 Yea 2023-10-31 08:11:35 Malmö 2023-10-31 08:11:39 Just moved back from Hamburg 2023-10-31 08:11:47 You must love the chocolate, talking in French, the alps ;P 2023-10-31 08:12:02 I'm seeing a lot of stuff at the moment about confusing Switzerland with Sweden :P 2023-10-31 08:13:04 Oh yea haha 2023-10-31 08:13:06 Did you consumer a lot of Hamburger sausage sandwiches (TL note, also known as burgers)? 2023-10-31 08:13:27 Sadly not as a fake vaggie, but I eat fish, so lots of Fishbrötschen :) 2023-10-31 08:13:34 Nice 2023-10-31 08:13:34 Fischbrötschen* 2023-10-31 08:13:39 veggie* 2023-10-31 08:13:44 You're missing out on currywurst 2023-10-31 08:14:18 I wonder :d 2023-10-31 08:15:44 Out of conscience or taste? 2023-10-31 08:16:19 I was a vegan when young. Now I'm not young. So. 2023-10-31 08:16:23 ^^ 2023-10-31 08:16:27 So conscience? 2023-10-31 08:16:32 I guess yea 2023-10-31 08:16:48 I do wonder about amount of meat people eat, probably too much. I'm a hypocrite if I moan though 2023-10-31 08:18:13 There are nice alternatives these days. But I guess it's a question of identity, to some regard. And money, perhaps. 2023-10-31 08:18:52 I'm paranoid about 'plant food', I see 'plant' and hear 'chemical' or 'plastic' 2023-10-31 08:19:34 I just think it would probably be better if people had less meat, more vegetables etc 2023-10-31 08:19:41 Better for env and people's health 2023-10-31 08:19:52 Don't need to eat fake meat 2023-10-31 08:20:01 Swedish pea soup is a tradition :D 2023-10-31 08:20:10 You can make it with or without fried pork 2023-10-31 08:20:25 I love chemicals personally. H20, NaCL, etc. 2023-10-31 08:20:44 Yeah it's traditional not to have meat constantly because long ago people couldn't afford to eat meat every day 2023-10-31 08:20:54 Not every meal needs to be a 'feast' 2023-10-31 08:20:59 A lot of excess 2023-10-31 08:21:15 Dihydrogen monoxide is very scary 2023-10-31 08:22:20 I'm a self-aware paranoid 2023-10-31 08:22:26 ^^' 2023-10-31 08:25:12 I do like Sweden, will hopefully visit one day, nice culture 2023-10-31 08:25:27 Visit and respectfully not small-talk with the nords 2023-10-31 08:25:33 DK and SE are close if you're in UK, just 60 min flight or so to CPH 2023-10-31 08:25:37 Hehe 2023-10-31 08:25:56 Liked your video btw, nice way to get more aquianted with the lang 2023-10-31 08:25:58 + spelling 2023-10-31 08:26:22 Thanks but you can tell me what's wrong with it, I have a thick skin 2023-10-31 08:26:32 I don't mind brutal criticisim 2023-10-31 08:26:52 My spelling is bad today, too much coffee 2023-10-31 08:29:48 veltas: But can you accept praise? :D 2023-10-31 08:30:47 No 2023-10-31 08:31:02 Hehe 2023-10-31 08:31:03 Honestly I think most people struggle to accept praise 2023-10-31 08:31:12 Might be cultural 2023-10-31 08:31:24 Maybe, in UK 2023-10-31 08:41:16 veltas: You only made one such video eh? 2023-10-31 08:41:29 Do one with create/does> and I'll buy you a beer :D 2023-10-31 08:42:07 Looks like you flip to an online doc to check word defs. No IDE integration for that? 2023-10-31 08:51:04 olle: That's not an online doc, it's mupdf-gl looking at one of the Forth standards 2023-10-31 08:51:11 Ah 2023-10-31 08:51:50 The IDE is vim, adding tags support for forth is definitely a good idea 2023-10-31 08:51:58 Doesn't exist as far as I know 2023-10-31 08:53:38 I use a syntax highlighter I wrote https://github.com/Veltas/forth-vim 2023-10-31 08:53:58 I need to update that really, I don't highlight hex, it hits too many words 2023-10-31 08:55:08 The best method to add tags for Forth would be dumping the LOCATE metadata after loading the program 2023-10-31 08:56:54 Well Forth is the IDE as well 2023-10-31 08:57:25 olle: You can do e.g. "locate open-file" in gforth and get docs 2023-10-31 08:57:43 But I just prefer reading the standard PDF for standard defs 2023-10-31 08:57:48 I use Vim with PHP and made a tiny script to fetch defs from php.net on p 2023-10-31 08:58:23 Hehe Forth is the be-all and end-all 2023-10-31 08:58:30 Really someone needs to write a visual editor for Forth 2023-10-31 08:58:43 It's been done already but I don't know of a good one for desktop 2023-10-31 08:58:54 There's a vi-like editor for a C64 forth 2023-10-31 08:59:21 And on Amiga? Where Vim was first made, IIRC. 2023-10-31 09:00:07 It's a good Forth project to cut your teeth on if you are familiar with text editors 2023-10-31 09:18:37 I wonder how Forth code would transpile to a script lang like js/python/php 2023-10-31 09:18:58 And if such a transpilation would still support create/does> macros 2023-10-31 09:30:57 Dunno honestly, it's different to how they do similar things 2023-10-31 09:46:25 :d 2023-10-31 09:49:21 I assume gforth compiles to asm directly? 2023-10-31 09:49:36 Wonder if I can hook into that. 2023-10-31 09:53:28 gforth compiles to machine code using GCC I think 2023-10-31 09:53:36 I think it's got an assembler too 2023-10-31 09:53:56 I'm not 100% sure what stage they enter into it 2023-10-31 09:57:46 Is it hard to make your own Forth that also supports create/does? 2023-10-31 10:15:51 No, not really. Exactly how you implement it depends on your Forth threading model (direct, indirect, code threading). My own opinion is that it's easiest to implement in an indirect threading system, but that may just be because I have the most experience with indirect threading. 2023-10-31 10:16:17 A normal indirect threaded definition has two important addresses somehow associated with its header. 2023-10-31 10:16:33 One of those addresses points to the machine code that causes the word to behave like a colon definition. 2023-10-31 10:16:45 The other points to the list of addresses that comrises that particular definition. 2023-10-31 10:17:03 So, one of them says "I am a colon definition" and the other says "I perform these actions." 2023-10-31 10:18:42 A word compiled with the CREATE/DOES> mechanism needs a slightly different setup. It still needs that first machine code definition that tells it what kind of word it is, and it still needs a pointer to the Forth code you wrote describing the word's behavior. So it needs all the same things a colon definition needs. But in addition it needs a third address, which is the address associated with the DATA 2023-10-31 10:18:44 that gets manipulated by your DOES> actions. 2023-10-31 10:19:40 The machine code that runs a create/does> word will push the address of the data field onto the stack and then transfer control to the does> code. So it kind of behaves like a Forth varaible and a Forth colon definition at the same time. 2023-10-31 10:20:30 We usually call the machine code that nests you into a new colon definition "docol." Similarly, we call the machine code that handles a variable "dovar." 2023-10-31 10:21:34 So the way I usually do this is write a little block of code that I call "dodoes," which will push the third item mentioned above (the data pointer) onto the stack and then runs something similar to docol to nest you into the does> code. 2023-10-31 10:22:05 This is really pretty straightforward once you get your head wrapped around it. 2023-10-31 10:22:23 It's just a notch up in complexity from colon definitions, since it encapsulates the dovar action as well. 2023-10-31 10:24:31 When CREATE gets called by your defining word, it makes a new header which is set up to behave like a variable. You then run the code in between CREATE and DOES>, which sizes and initializes the data associated with the new word. Then DOES> has to 'convert' that header made by CREATE from a variable type word to a dodoes type word. It has to change the pointer that was initially set to dovar to dodoes and 2023-10-31 10:24:33 it has to wire in the address of the does> code. 2023-10-31 10:25:53 It is possible to make this all work without having explicit dodoes code, but it's a lot more of a kludge. It's much simpler if you write dodoes in machine code and have it as an available resource. 2023-10-31 10:29:51 In indirect and direct threaded system, all Forth words are a bit like objects - each one has some data that you're going to do something with, and some code that knows how to do it. In the case of a colon definition the "data" is the list of addresses that make the word. In the case of a variable, the data is... well, the DATA of the variable. Either way, you run the word's code with the address of the 2023-10-31 10:29:53 data avaialble somehow, and the code makes the right thing happen. 2023-10-31 10:30:43 For a colon definition that code (docol) just pushes the instruction pointer to the return stack and aims the instruction pointer at the word's data (the new definition). 2023-10-31 10:31:33 and then it runs NEXT, like always, to move you to the next item addressed by the instruction pointer, which now will be the first word of the nested definition. 2023-10-31 10:33:21 create/does> words still have one code pointer (dodoes), but they have TWO data pointers> One points to the data the word's suposed to manipulate and the other points to the does> code that was compiled back when you defined the defining word. 2023-10-31 10:37:12 olle: https://www.bradrodriguez.com/papers/moving3.htm 2023-10-31 10:38:05 Read from "WHAT'S A CODE FIELD?" 2023-10-31 10:38:46 That's all the juicy detail and probably won't make sense yet 2023-10-31 10:39:16 It's not hard to do it inefficiently, but that article explains the techniques used to do it in a more optimal manner 2023-10-31 10:40:03 : definer create ...allocation... does> ...action... ; 2023-10-31 10:40:29 That gives you two things - how to allocate the data for each word defined by definer, and what actions to perform when such words are executed. 2023-10-31 10:40:39 definer alpha 2023-10-31 10:41:23 when alpha is executed, it has to know how to find the data that got allocated for alpha, and the also how to find the ...action... code common to all items defined with definer. 2023-10-31 10:42:09 It "dovars" the data that was allocated when you said definer alpha, and "docols" the ...action... code. 2023-10-31 10:42:19 There are a ton of ways to accomplish that, but that's the core idea. 2023-10-31 10:42:51 Exclusive leak: https://i.imgur.com/Z9AFxrs.png 2023-10-31 10:43:52 Taken from a git diff at work, go straight to the press with it 2023-10-31 10:44:17 I'm sure there's some way of getting git to shuddup about that but I don't know it 2023-10-31 10:44:17 alpha's header has to tell you where alpha's data is AND where the ...action... code is, and that's an item more info that other more normal words need. 2023-10-31 10:45:13 Ineffctive is fine for me veltas :) 2023-10-31 10:45:41 Are you working with assembly? 2023-10-31 10:46:13 Nop, PHP :D 2023-10-31 10:46:24 That's what I wanna transpile to 2023-10-31 10:46:37 Then as that article says you want a code field for each definition 2023-10-31 10:46:49 Alright cool :) Will check later 2023-10-31 10:47:01 Which will be a function reference (can you reference functions in PHP?) 2023-10-31 10:48:43 Yeah looks like you can https://www.php.net/manual/en/functions.anonymous.php 2023-10-31 10:49:53 Transpiling is also not a good idea, Forth is a live interpreter among other things, you probably want a Forth interpreter written in PHP 2023-10-31 10:50:03 create/does is something like a closure with function pointers elsewhere 2023-10-31 10:50:10 olle: All words have a code field (we often call it the CFA). That's the only thing you need for primtiives - the CFA just points to the primitive code, you run it and you're done. 2023-10-31 10:50:23 Unless you are okay eval'ing PHP? Maybe that is appropriate actually! 2023-10-31 10:50:34 Transpile to PHP on the fly? 2023-10-31 10:50:38 Other words have more information associated with them. Variables have to know where the variable lives, colon defs have to know where the definition lives. Etc. 2023-10-31 10:50:53 I usually say "PFA" to refer to that - parameteer field address. 2023-10-31 10:51:25 And then create/does> words have this third thing; I guess we could call it the DAA (does> action address). 2023-10-31 10:51:46 Or AFA, for action field address. it's not standardized the way the others are. 2023-10-31 10:51:46 That's straight outta fig-forth 2023-10-31 10:52:02 That would be what to expect from me. 2023-10-31 10:52:17 FIG has always been my most often used reference model. 2023-10-31 10:52:32 But in any case you still have these three things. 2023-10-31 10:52:39 One way or another. 2023-10-31 10:52:46 Regardless of how you "package" them. 2023-10-31 10:53:02 https://i.imgur.com/z24zvkF.png 2023-10-31 10:53:10 from a fig forth manual 2023-10-31 10:53:27 Page 51 http://forth.org/OffeteStore/1010_SystemsGuideToFigForth.pdf (PDF page 61) 2023-10-31 10:53:55 Oh, you mean my terminology. Yeah, definitely fig. 2023-10-31 10:54:15 though I've never actually seen a standard name for the field identifying the DOES> action in a create/does> word. 2023-10-31 10:54:35 I mean those are literally the words used in fig Forth to get those fields 2023-10-31 10:55:59 Yes. I don't follow those exactly in my system. My header layouts are somewhat different, and the precise words I need to call out to navigate a chain of fields is a little different. Same idea, though. 2023-10-31 10:57:13 In FIG the data for a variable or the definition for a : word just immediately followed the CFA. I have a PFA *pointer* right there next to my CFA, and the actual stuff is somewhere else, where the PFA points. 2023-10-31 10:57:30 And that's why I'm able to re-vector any word. 2023-10-31 10:59:32 I put my PFA first, and then my CFA. That makes it easy to leave out the PFA on primitives and save that cell of RAM. 2023-10-31 11:00:06 Then the link field is right after the CFA; 16 bits, and then the count byte and the name bytes. 2023-10-31 11:00:34 Putting the name last makes me never have to traverse the name backwards (or forward really, though I guess it gets traversed when name matching). 2023-10-31 11:03:31 It was either MrMobius or Zarutian-iPad that suggested putting the name last like that. It was too smart an idea to dodge. 2023-10-31 11:05:38 olle: A nice CREATE/DOES> example is CONSTANT : CONSTANT CREATE , DOES> @ ; 5 CONSTANT TEST TEST . ( prints 5 ) 2023-10-31 11:05:52 Or VARIABLE : VARIABLE CREATE 0 , DOES> ; 2023-10-31 11:06:10 Then I realized the other day that if I grew the headers down from the top of RAM instead of from the bottom up we can get rid of the link field - the count byte is adequate to jump us over the name. Although if I do that then I can't leave the PFA out of primitives, or if I do I have to know it's a primitive somehow, because dropping the link field means that everything other than the name needs to be fixed 2023-10-31 11:06:12 size so I know how to jump over it. 2023-10-31 11:06:45 : DEFER CREATE 0 , DOES> @ EXECUTE ; 2023-10-31 11:07:06 But if CFAs are 32-bit aligned, then the low two bits are available as flags; that could be used to identify primitives. 2023-10-31 11:08:57 veltas: Save it for your next video ;D 2023-10-31 11:13:51 But yea, think I've seen that one 2023-10-31 11:14:04 Hopefully because it's in starting forth 2023-10-31 11:14:35 Did look at those before 2023-10-31 11:14:51 Actually, got my recent program def from one of those: A program is a tree-structure of read-process-write pipelines 2023-10-31 11:19:40 I'm lost 2023-10-31 11:20:19 Yeah; I don't follow that either. 2023-10-31 11:21:11 I just think of a program as a inpuut-dependent sequence of actions. 2023-10-31 11:21:55 A state machine. 2023-10-31 11:22:30 functional peeps frown on mangling state 2023-10-31 11:23:05 Good thing I'm not a functional guy. :-) 2023-10-31 11:23:26 I used to actively dislike it, but I've at least come to think it has its place. 2023-10-31 11:23:27 yeah at the hardware level it's somewhat unavoidable 2023-10-31 11:23:37 I think of it as a "mathematical" way of looking at things. 2023-10-31 11:23:54 But yes - as a hardware guy, my whole mind set is about DOING THINGS TO STUFF. 2023-10-31 11:24:22 What functional programming calls "side effects" is the whole point to me. 2023-10-31 11:24:56 But the recent forray into APL has at least gotten me a little more open to the functional paradigm. 2023-10-31 11:26:43 I think it just makes more sense to everyone to talk about modifying state and making decisions based on state 2023-10-31 11:26:56 It certainly does to me. 2023-10-31 11:27:11 But obviously there's use in pure functions 2023-10-31 11:27:16 A state machine is an incredibly clean concept in my opinion. 2023-10-31 11:27:29 It's how we work. 2023-10-31 11:27:38 We see the world around us, and modify our memories accordingly. 2023-10-31 11:27:39 State machine isn't equivalent to what I said, in my opinion 2023-10-31 11:28:03 Hmmm. Ok. I don't really follow, but... 2023-10-31 11:28:10 Also see Aaron Beck: Concept of "mode" 2023-10-31 11:28:18 A 'state machine' as I see it used most is where you're always in one mode and switch between modes based on different stimuli 2023-10-31 11:28:19 "modifying state and making decisions based on state." 2023-10-31 11:28:24 Not sure how that's not a state machine. 2023-10-31 11:28:45 A state machine doesn't necessarily have to be single-state active. 2023-10-31 11:28:55 They often are, but you can think about multi-hot states. 2023-10-31 11:28:58 do you like this? https://bpa.st/PODQ 2023-10-31 11:29:28 I don't indent my Forth like that, but it makes sense. 2023-10-31 11:29:48 KipIngram: That's how I see it described by most people, just voicing that your terminology isn't very universal 2023-10-31 11:29:56 KipIngram, yeah usually i don't indent too, but it was just to keep track better of if's blocks 2023-10-31 11:30:45 That's fair. I would say that most of the time when you see "state machine" what's being talked about is a system that has one precise state at any given time. 2023-10-31 11:30:59 Exactly 2023-10-31 11:31:15 For a lot of people it's essentially a finite state automata 2023-10-31 11:31:19 But what you're talking about we could regard the entire combinatorial situation across the board as "a state." 2023-10-31 11:31:27 Change one bit somewhere, and that's a different state. 2023-10-31 11:31:38 Regard all of the information in the system as a single number. 2023-10-31 11:31:42 Then that number is your state. 2023-10-31 11:31:48 Technically yeah 2023-10-31 11:32:05 But now I understand why you objected. 2023-10-31 11:32:28 I thought I read it in Thinking Forth but can't find it right now. Meh. And also bah. 2023-10-31 11:32:43 That's contrived in practical matters though, that multiple state === one state; only relevant to mathematics of automata 2023-10-31 11:32:56 Yes, that's fair too. 2023-10-31 11:33:06 But I do think of it as all a very related set of ideas. 2023-10-31 11:33:21 I just like to keep my maths hat off for most of programming 2023-10-31 11:33:28 :-) 2023-10-31 11:34:11 In your model you're attaching meaning to "portions" of the state specification. 2023-10-31 11:34:24 Modifying the state in sections which we call variables. 2023-10-31 11:35:07 It's like an argument I had with Raymond Chen about algorithmic complexity, he was saying it's contrived to talk about O(f(k)) rather than O(f(n)) for algorithms operating on a number 2023-10-31 11:35:23 And I disagree because if you're operating on a number the 'size' of the input is k, not n 2023-10-31 11:35:51 But it's sort of contrived in the matter he was talking about, I'll admit 2023-10-31 11:35:54 I'm not clicking to the relative meaning of k and n here. 2023-10-31 11:36:02 Is one of them number of bits? 2023-10-31 11:36:05 Yeah 2023-10-31 11:36:10 Gotcha. 2023-10-31 11:36:20 "Hierarchical Input-Process-Output Designing" 2023-10-31 11:36:22 This chapter 2023-10-31 11:36:40 "HIPO chart,” which stands for “hierarchical input-process-output" 2023-10-31 11:36:46 https://kumisystems.dl.sourceforge.net/project/thinking-forth/reprint/rel-1.0/thinking-forth-color.pdf - page 15 2023-10-31 11:36:59 A program is a tree of pipelines :) 2023-10-31 11:38:21 Sounds like nonsense to me 2023-10-31 11:38:26 I feel like whether n or k would be appropriate would depend on the algorithm. 2023-10-31 11:38:49 veltas: Sounds like exactly what I do in web dev :) 2023-10-31 11:42:29 veltas: I actually do have a tendency to think of the "state of my system" as an actual state, and everything I do moves me from one state to another. That doesn't mean that I'm going to try to draw that as a literal state machine diagram, though. 2023-10-31 11:42:47 Radix sort is O(k), it's dependent on the size of the key, not the number of elements 2023-10-31 11:42:55 If I actually draw such a picture, I'm probably thinking about something much more limited. 2023-10-31 11:43:16 GeDaMo: Right - i think there would be cases where each one was appropriate. 2023-10-31 11:43:35 O(kn) 2023-10-31 11:44:47 I love radix sort though, I think that's the first sorting algorithm I learned 2023-10-31 11:46:01 You definitely want counting and radix sort in your mental toolbox 2023-10-31 11:50:44 It does bug the hell out of me that Linux ls sorts files like 0 1 10 2 ... etc. 2023-10-31 11:51:02 I've more than once had to do script gymnastics to work around that. 2023-10-31 11:51:47 %04d 2023-10-31 11:52:14 ACTION uses built-in sort functions... 2023-10-31 11:52:37 sort utility is a thing too 2023-10-31 11:52:37 Yeah. That ordering comes up twice in my tests, with a prefix and a suffix. I wisely used a fixed length prefix, 001- 002- etc., so that works out on its own. 2023-10-31 11:52:56 But the suffix was varaible length - it used to all be run from inside a script, so that was no problem. 2023-10-31 11:53:20 But when I moved to these new machines I wanted to have a directory per step, and those steps with variable length suffixes didn't run in the right order. 2023-10-31 11:53:43 And yes - the script gymnasitcs did involve just the kind of tooling you mentioned. 2023-10-31 11:54:22 What do you think shell scripting style stuff would look like in a forth OS? 2023-10-31 11:54:36 Well, like Forth. 2023-10-31 11:54:49 I would expect it to look like the Forth I already write. 2023-10-31 11:55:13 That's one of the things I like about Forth - it's "look and feel' stays the same across all levels of abstraction. 2023-10-31 11:58:06 Okay consider this though, I think the big feature of shell scripting is it abstracts memory and disk buffers away 2023-10-31 11:58:38 You're not resizing arrays, maintaining lists, moving stuff on and off of the disk. It's all done for you automatically, you're just processing streams of text or data 2023-10-31 11:58:43 Ok, that is a good point. Shell scripting tends to pipeline the input stream, more than manipulating a stack of data. 2023-10-31 11:58:53 At least the way bash encourages you to do it does that. 2023-10-31 11:59:08 I have scratched my head some over that dichotomy. 2023-10-31 11:59:42 In fact I was thinking a little about that yesterday when I mentioned macros. 2023-10-31 12:00:09 That first suggestion that a macro could shove its translation into the input stream bubbled up from thinking about input stream pipelining. 2023-10-31 12:01:12 Weirdly in a way UNIX itself is a scripting environment, a C program is kind of like a 'code' word 2023-10-31 12:02:03 A scripting environment where data and I/O is a 'file' or 'pipe', and functions are 'programs' 2023-10-31 12:02:05 That makes sense. 2023-10-31 12:02:49 I would really like to wind up with a situation where I can do the same kind of things I do when I script bash - it's a really useful toolkit. 2023-10-31 12:02:57 Exactly 2023-10-31 12:03:00 veltas: Yea, kinda like a input-process-output thing... 2023-10-31 12:03:07 Quiet you 2023-10-31 12:03:10 ^^ 2023-10-31 12:03:12 :-) 2023-10-31 12:04:02 http://olleharstedt.github.io/programming/php/2023/10/19/100-percent-coverage-zero-mocking.html - my WIP blog. You see the parallels between forth and pipelines 2023-10-31 12:04:05 ACTION shower time 2023-10-31 12:04:14 Forth has rather little orientation toward console stream as data. 2023-10-31 12:04:22 It really does regard it primarily as a command stream. 2023-10-31 12:04:31 No data there, really. 2023-10-31 12:04:45 Yeah and standard file words are kind of crap IMO 2023-10-31 12:04:55 Yes. 2023-10-31 12:04:56 Needs some though 2023-10-31 12:04:59 thought* 2023-10-31 12:05:15 To overcome I think we need forth tasks, that much is clear 2023-10-31 12:05:20 To do pipes 2023-10-31 12:05:31 I'm working on it. I do plan on having each of my Forth processes have "standard input" and 'standard output' and an ability to chain those together. 2023-10-31 12:05:59 I think that's the key step - to abstract stdin and stdout away from the keyboard and screen. 2023-10-31 12:06:07 We could do with a new standard honestly :S 2023-10-31 12:06:14 Probably. 2023-10-31 12:06:21 And then there will be N+1 standards 2023-10-31 12:06:22 I mean the implicit stack _is_ a pipe IMO :) 2023-10-31 12:06:24 Then I can tinkertoy those together into pipelines. 2023-10-31 12:06:25 Kinda 2023-10-31 12:06:36 I wouldn't say so olle 2023-10-31 12:06:36 Yes, it is a sort of pipe. 2023-10-31 12:06:43 I see what he means. 2023-10-31 12:06:48 It's not a "pure' pipe. 2023-10-31 12:06:58 Though we did have that document linked here with the "fifo forTH>" 2023-10-31 12:07:04 That was actually a pipe. 2023-10-31 12:07:07 In practice the forth data stack is an alternative to registers or automatic variables 2023-10-31 12:07:22 ^ that's more accurate I think. 2023-10-31 12:07:29 You have to squint a little to think of it as a pipe. 2023-10-31 12:07:32 It's not a good way of passing variable amounts of data, people do it but I don't think it works that well 2023-10-31 12:07:38 Except in very isolated niche ways 2023-10-31 12:07:40 But, a sequence of Forth words does hand the stack down the line. 2023-10-31 12:08:12 Look at stuff like GET-ORDER, it's just not a good interface IMO 2023-10-31 12:08:15 So at the whole stack level you can think of it as "the stack" flowing through a pipeline of words. 2023-10-31 12:10:59 I've only seen one program do this piping of data that I liked and crc wrote it for an advent of code 2023-10-31 12:15:00 Once you have the ability to stich a process's output to another process's input, I see no reason why you couldn't write tools similar to those in Linux. 2023-10-31 12:15:21 We just normally don't have those in Forth because we can't do that with our streams. 2023-10-31 12:17:43 I think you're right that having a revamped standard in that area would be valuable. 2023-10-31 12:18:42 We can do it it just requires some polymorphism-style code for file objects 2023-10-31 12:18:58 I suspect that's how it worked in old UNIX 2023-10-31 12:18:58 Well, fair enough - we CAN do practically anything. 2023-10-31 12:19:29 What would be nice is a forth operating system standard 2023-10-31 12:19:59 The main standard is aimed at being run as a program, but it would be nice to have a standard for running forth as the primary environment on a system 2023-10-31 12:20:10 I agree. 2023-10-31 12:20:11 Also a standard with better taste than the main one 2023-10-31 12:20:17 That's what forth was "born to be" anyway. 2023-10-31 12:20:39 I've always felt that it shines the most when it owns the whole show. 2023-10-31 12:32:14 At any rate, Linux has some really good ideas in play at that level. Worth pilfering. 2023-10-31 12:37:29 what about this notation? -my_flag +my_flag @getter =setter 2023-10-31 12:39:29 What would that do? 2023-10-31 12:40:34 -/+ set/unset some boolean flag, e.g. +banana sets some.state.banana = true 2023-10-31 12:40:40 or false with -banana 2023-10-31 12:41:14 Ok. Normal Forth would say banana on / banana off 2023-10-31 12:41:35 then, if i have to set/get something, i have: @name -> state.stack.push(state.name) or 'myname' =name -> state.name = state.stack.pop() 2023-10-31 12:41:41 and possibly banana toggle 2023-10-31 12:42:00 Though I'd probably call that flip instead of toggle 2023-10-31 12:42:07 yeah 2023-10-31 12:42:55 I mean, I think it looks fine; it's very different from what forth would normally support, but if you've built it suitably it seems fine. 2023-10-31 12:43:36 well, my forth is very different than normal one, i'm trying to use some symbols to get shorter names and that can be remembered 2023-10-31 12:43:46 I suspect I'm eventually going to wind up with "breaches" in the space delimitation requirement of normal Forth. 2023-10-31 12:44:39 well, i don't have " hello" these strings, but "hello" to specify a string, the lexer will recognize it 2023-10-31 12:47:43 I think that is preferable and i want something similar. 2023-10-31 12:47:57 In general I've come to be not thrilled with Forth's native support for literals. 2023-10-31 12:48:05 Basically it supports numbers, and that's it. 2023-10-31 12:48:13 And you're lucky if that includes floating point numbers. 2023-10-31 12:48:32 But why can't we have literal strings, and literal arrays, and ists, and so on? 2023-10-31 12:48:44 I think there needs to be a clean way of having all of that. 2023-10-31 12:48:50 And I intend to find one. 2023-10-31 12:49:26 part of the problem is that Forth doesn't have a memory model that gives you a solid well-defined way of STORING such literal data. 2023-10-31 12:49:47 Numbers it can put on the stack, but it has nowhere to put anything else, because it comes with ZERO dynamic memory capability. 2023-10-31 12:50:18 So I think that's key - I think there needs to be some sort of heap where you can put these transient literals, and then you put a pointer to them on the stack. 2023-10-31 12:50:46 And to differentiate among the different kinds of things you could point to, you need some kind of type support. 2023-10-31 12:50:50 that's my current thinking at least. 2023-10-31 12:52:11 yeah 2023-10-31 12:53:17 KipIngram, i solved that problem because my Forth doesn't rely on the CPU stack 2023-10-31 12:53:40 but i have a Stack where each Atom is an abstract object that can be integer, float, string, binary blob 2023-10-31 12:53:41 Oh, stack space isn't a problem. 2023-10-31 12:53:58 I don't think it will BE a problem, actually - I just have to build the necessary tooling. 2023-10-31 13:13:03 I'm not convinced a true full heap is necessary to get the functionality I want. 2023-10-31 13:14:00 I think the big majority of on-the-fly literals that you use (or that I would use) would be rather transient in nature. I'm considering ways of setting it up so that they always survive "long enough" for me to get my work done, but eventually just perish without explicit memory management required. 2023-10-31 13:14:47 In theory such a system would allow me to contrive a situation where it would fail, but if failure is "very rare" under my normal operating conditions, I may be happy enough with it. 2023-10-31 13:15:45 Basically I'd just allocate the next section of a cirular buffer for each new item, and wrap around when I come to the end. Each item would survive until it was overwritten the next pass. 2023-10-31 13:26:24 So if I tucked an address away on the stack and let it sit there for a long time and then tried to use it, that would blow up. 2023-10-31 13:26:39 Or at least wouldn't do what I expected. 2023-10-31 13:27:00 But I don't normally purposely shoot myself in the foot. 2023-10-31 13:27:39 Forth is chock full of ways you can commit seppuku. 2023-10-31 13:28:15 plenty of rope for a Kobayashi Maru to happen 2023-10-31 13:31:34 Yup. 2023-10-31 13:32:05 I liked Kirk's resolution of the situation. 2023-10-31 13:32:09 That's my boy. 2023-10-31 13:32:38 That was just about the best bit of The Wrath of Khan, and there was a lot that was good in that movie. 2023-10-31 13:33:04 That was a good movie even if you weren't into the Trek franchise - it stood just fine as a straight science fiction movie. 2023-10-31 13:33:48 https://www.foo.be/docs/tpj/issues/vol1_2/tpj0102-0009.html and look for "This particular contest was" 2023-10-31 13:34:02 That and "Khan. I'm *laughing* at the superior intellect." 2023-10-31 13:35:18 yeah - if he didn't break the rules he didn't break the rules. 2023-10-31 13:35:38 Apparently "common sense" rules also apply, with "common sense" decided by some arbitrary authority. 2023-10-31 13:37:08 Timothy Ferris, author of "The 4-hour Work Week" once won an Asian fighting contest by dehydrating for the weigh in to get into a lower weight class, and then won each round by throwing his opponents out of the ring. 2023-10-31 13:37:23 Everyone despised it, but technically he won the championship. 2023-10-31 13:37:38 It just wasn't "honorable" in their eyes. 2023-10-31 13:37:50 water is heavy 2023-10-31 13:38:11 Yeah I don't remember how much weight he shed for the weigh-in, but it was a lot. 2023-10-31 13:38:23 Enough to make him ABLE to toss his opponents out of the ring reliably. 2023-10-31 13:39:12 ... as anyone who has gone on 20 mile hikes with all the water they need on their back 2023-10-31 13:39:59 It's been a LONG time since I've covered that much ground in one go. 2023-10-31 13:40:15 I'm doing well to get in my half hour of jogging several days a week. 2023-10-31 13:40:38 ... or once on a 100 mile bike trip my buddy froze all his water so we could drink cold water, but all those bottles started leaking so we had to chug it ... 2023-10-31 13:41:45 Oh man. 2023-10-31 13:42:13 I did a hundred mile bike ride once. We have one here in Texas called the Hotter 'n Hell Hundred. 2023-10-31 13:43:06 And it lived up to the name - I almost didn't get to finish, because at about the 60 mile mark they were trying to close the route to further cyclists because it was getting dangerously hot. I was one of the last people to dodge through and I did it by pretty much ignoring the guy trying ti flag me down. 2023-10-31 13:43:27 They had water stops all along the way of course. 2023-10-31 13:43:41 this was in pakistan which can get pretty warm 2023-10-31 13:43:53 Near the end, I rounded a curve in this patch of woods and there was this rustic country house with a sign out front that saiD '98 1/2 mile beer stop." 2023-10-31 13:43:59 I was SO THERE. 2023-10-31 13:44:10 Hot waitresses and everything. 2023-10-31 13:44:43 It would have been easy to give up around 80 miles - I was feeling pretty punk. 2023-10-31 13:44:53 But I was stubborn and kept going, and made it to the end. 2023-10-31 13:45:07 I think it got to 113 F at the peak of the heat. 2023-10-31 13:50:09 I did that ride that year because I'd signed up for it in an earlier year but didn't get to do it. So I had this HHH cycling jersey that I was always ashamed of wearing. 2023-10-31 13:50:20 I felt the need to go earn it before I got too old be safely do it. 2023-10-31 13:50:28 s/be/to/ 2023-10-31 13:50:33 Not sure how I made that typo... 2023-10-31 14:00:57 Now I think I'm going to need to watch The Wrath of Khan tonight. Been a while. 2023-10-31 14:04:08 khaaaaaaaaaaaaaaaaaaaaaaaaaaan! 2023-10-31 14:05:43 I found Star Trek: The Motion Picture rather underwhelming, but The Wrath of Khan more than made up for it. 2023-10-31 14:15:54 banana split 2023-10-31 14:20:21 Oh, that needs to do something nifty... 2023-10-31 16:32:35 You know what, I'm reading fig-forth code that uses a lot of the return stack and I don't dislike it 2023-10-31 16:32:56 A lot of saving/restoring stuff with >R R> 2023-10-31 17:42:06 Interesting, fig forth sets DPL to number of digits after decimal place when interpreting a double integer 2023-10-31 21:24:39 does the stack or the return stack need to be addressable? 2023-10-31 21:33:06 hmm, I guess so for SP@ 2023-10-31 21:54:53 Yeah, there are a lot of return stack tricks that I didn't really catch on to the import of until fairly recently. 2023-10-31 21:55:04 If you work that angle you can really simplify quite a few things. 2023-10-31 21:55:45 Well, SP@ isn't really so much for addressing into the stack as it is to let you get the stack pointer for things like switching contexts. 2023-10-31 21:55:55 But of course you CAN use it to leverage stack indexing. 2023-10-31 21:56:31 Yes, FIG gives you a way to trace where the decimal point was. The conversion itself just treates it as a huge integer. 2023-10-31 21:56:54 But it's definitely set up to facilitate scaled integer work. 2023-10-31 21:57:57 Well, Wrath of Khan - as good as ever. 2023-10-31 21:58:04 That ending is really gut wrenching. 2023-10-31 22:05:15 your guts got wrenched 2023-10-31 22:05:39 not like in alien they didn't 2023-10-31 22:21:26 in alien i would say the guts were more screwed than wrenched 2023-10-31 22:24:41 kathairein in both cases