2024-11-19 09:40:17 :) - what's a saner way of doing this: defer x-equation : x-create-equation s" : x-equation-impl { F: x } " 2swap s+ s" ; ' x-equation-impl is x-equation" s+ evaluate ; s" x" x-create-equation 2024-11-19 09:55:46 ... or s" x fsin" x-create-equation or even s" 0e" etc (actually, i'll probably change x-equation to y= as it's possibly more reflective what's going on) 2024-11-19 13:49:10 zelgomer: using Forth probably will not help you amass wealth. Attracting beautiful women is a definite possibility: either they might like Forth, or you could livecode music in Forth 2024-11-19 13:52:50 lilo_booter: I'm not sure either how that code works (what's s+?) or what problem it is designed to solve 2024-11-19 13:57:46 Maybe it should be wealth first, forth later. 2024-11-19 14:07:32 Mike Perry, one of the authors of F83, did amass wealth and retire in his 30s to a fancy resort in Mexico. But it wasn't because of Forth; it was because he founded Paradise, the company that made a single-chip EGA, which then got used in clone EGA cards from lots of companies. And then he got bought out. 2024-11-19 14:09:05 Though I guess he founded Paradise with people he knew from working on firmware for a laptop in the 01970s, in Forth. So, although Forth won't make you rich, it might introduce you to people who will. 2024-11-19 14:09:29 Any of you guys rich? :P 2024-11-19 14:10:53 No. I think these days it's more likely to introduce you to people who voluntarily pass up golden opportunities to get rich ;) 2024-11-19 15:05:48 xentrac: admittedly weird - probably better way to do things - s+ is string append and the whole things it works as follows: defer x-equation <- allows me to define a word which uses x-equation before defining it - like: : x-loop ( "equation" -- ) x-create-equation xy-width 0 do i col-to-x x-equation i y-to-row col-row-at loop ; - create-equation turns the provided string into an instance of 2024-11-19 15:05:50 x-equation - so to a simple y=x plot, s" x" x-loop is sufficient (i did mention that i was looking for a saner approach :)) 2024-11-19 15:15:19 in essence, given an input s" x" x-create-equation constructs and evaluates a string which contains: ": x-equation-impl { F: x } x ; ' x-equation-impl is x-equation" 2024-11-19 15:16:48 I see 2024-11-19 15:18:16 you could just define the equation directly as a word that takes x (on the floating-point stack or by invoking a word called x) and use is to set a deferred word to it, or you could pass the xt of the function to plot to your plotting function 2024-11-19 15:18:35 but if you prefer doing it with strings that seems okay too 2024-11-19 15:19:23 i considered the manual word definition, but it seemed somewhat verbose 2024-11-19 15:20:25 like if you wanted to plot x² - x + 3 you could :noname dup dup * - 3 + ; plot or the floating-point equivalent 2024-11-19 15:20:39 lilo_booter: is there a reason to have x-create-equation use colon definitions instead of using :noname for this? 2024-11-19 15:21:12 i guess that would just be ignorance on my part :) - sounds better 2024-11-19 15:21:49 which I think might be :noname fdup fdup f* f- 3. d>f f+ ; plot 2024-11-19 15:22:40 I've been wondering lately if there would be any use to have your compiler look up words but cache a certain number of them instead of writing them to the dictionary so a later word can process them if that's useful and otherwise they get written automatically or when you hit ; 2024-11-19 15:22:41 well, i was kinda thinking that i might allow an infix specification of the equation 2024-11-19 15:23:22 but plot wouldn't have to care how the word it was invoking was defined internally, unless it wanted to do something other than evaluate it at different points. symbolically differentiate it, for example 2024-11-19 15:25:12 so instead of `FLOAT 1.23e4 FLOAT 4.56e7` you might have `1.23e4 4.56e7 FLOATS` since if for example your forth doesnt understand floats and FLOAT needs to parse the same word, you could just cache 1.23e4 and 4.56e7 and FLOATS would look back at the cache and handle those words 2024-11-19 15:25:47 handle those numbers I mean 2024-11-19 15:27:05 not that useful here since you might do `FLOATS 1.23 4.56 ENDFLOATS` to save typing but I wonder if there are more interesting things you could do with that 2024-11-19 15:31:31 forgetting to type endfloats might be hilarious? 2024-11-19 15:31:35 well, that relates to another thing i wanted to ask - is there a way to drop the exponent requirement from the floating point number input? don't mind doing it in the code, but if the user is required to type "x 3e f**", it feels like there are a couple of points that a newbie would struggle with there (rpn itself is one hurdle, but the e and f are, well, kinda nasty) 2024-11-19 15:32:53 hence, considering the idea of parsing the string, and if i'm doing that, infix is a hop, skip and jump away (well, kinda) 2024-11-19 15:35:26 yeah 2024-11-19 15:36:14 another interesting idea might be to pass a forth word to the interpreter for it to call when it doesnt recognize something. that word could see if it's a float or something and if not, generate the standard not found error 2024-11-19 17:24:34 hmm - yeah, looking into :noname and leaving an xt on the stack - not quite the push to the higher level input i was looking for (as above though, my current use of evaluate is hardly stepping far from forth implementation details at the moment, but it feels like a step in the direction i want to head) - however, my current approach is broken as each time i redefine the x-equation-impl word, i get 2024-11-19 17:24:36 a noisy diagnostic on stdout or stderr which mangles the graphs i'm plotting, while using :noname and executing the xt has no such side effect, so i will definitely use that one 2024-11-19 17:26:29 (ie: still using using string appends and evaluate, but dropping the defer/named word 2024-11-19 17:26:41 how are you allocating the memory for the string appends? 2024-11-19 17:27:36 i was hoping that s+ was doing that for me? might be building on a false premise though 2024-11-19 17:31:32 checking under valgrind, i get a clean bill of health when using it - no leaks 2024-11-19 17:31:57 and no invalid access to uninitialised memory 2024-11-19 17:32:25 so it seems like for my use at least, this type of string concatenation is ok 2024-11-19 17:34:11 s+ isn't a standard word, and I wouldn't trust Valgrind to be able to tell when you're not writing in C :) 2024-11-19 17:34:19 it's an extension by whatever Forth you're using 2024-11-19 17:36:58 heh - yeah - probably a valid point for valgrind - and i'm probably going to fall into a few gforth specific traps :) 2024-11-19 17:37:50 oh, are you using GForth? 2024-11-19 17:38:14 yup 2024-11-19 17:38:22 bad idea? 2024-11-19 17:38:32 GForth is fine, but s+ doesn't appear in https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Word-Index.html#Word-Index 2024-11-19 17:39:58 do you know if there's a standard way to concate two strings then? 2024-11-19 17:41:48 well, you could use + swap move 2024-11-19 17:42:04 looks nice :) 2024-11-19 17:42:37 I guess you probably want to save the resulting string length though 2024-11-19 17:42:45 the bigger issue is that you need to allocate enough buffer space for that to work 2024-11-19 17:43:09 which, in most cases, means you need to deallocate it later 2024-11-19 17:43:34 if you just copy one string to the end of another, you better hope that the first string wasn't a string literal in a word definition 2024-11-19 17:43:49 hmm - strings seem to be deallocated on type/evaluate from what i've seen? 2024-11-19 17:44:27 not in general 2024-11-19 17:44:51 am gonna have to break for dinner - i definitely want to pick this up later - much appreciate the info 2024-11-19 17:45:23 generally Forth only allocates memory at "compile time" 2024-11-19 17:45:35 as you're adding stuff to the dictionary 2024-11-19 17:45:59 it's just like c, strings are just addresses. the scope and lifespan of the memory of that address depends on how it got there. 2024-11-19 17:46:01 there's a heap-allocation vocabulary: https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Heap-Allocation.html#Heap-Allocation 2024-11-19 17:46:42 which is basically just the C standard library facilities ported to Forth 2024-11-19 17:47:19 lilo_booter: happy to help! 2024-11-19 17:47:38 I'm sorry for the unpleasant surprise 2024-11-19 18:09:03 Hi everyone! Do you get any performance improvement by not using variables and keeping everything on the data stack? New to Forth so happy to be pointed to reading material 2024-11-19 18:09:51 usually not, but sometimes 2024-11-19 18:10:54 trying to keep everything on the data stack is a huge pitfall for Forth newcomers 2024-11-19 18:11:22 it's easy to write code that you can't debug because it's full of over nip r> 2dup 2024-11-19 18:12:05 so start out by storing values in variables in the same places you'd store them in variables if you were programming in C or JS (although I prefer value to variable myself) 2024-11-19 18:12:07 Thanks for the advice, I was implementing matrix multiplication and it was very hard to keep to track of 2024-11-19 18:12:47 it's much easier to add a little bit of stack manipulation to code that's already working than it is to get code working when it has too much stack manipulation in it 2024-11-19 18:13:26 I find value a bit less error-prone and more concise 2024-11-19 18:14:19 Couldn't agree more ther! How come value is less error prone? 2024-11-19 18:19:26 well, it's pretty rare that I intend to pass the address of a variable to some other word so that it can store into it. Generally I'm either storing into the variable x ! or fetching from it x @. So the opportunity to write x when what I meant was x @ isn't helpful; it's just a chance to introduce a bug into my code. And it makes the code more verbose, too, because I fetch from variables at 2024-11-19 18:19:32 more callsites than I store into them 2024-11-19 18:19:47 i essentially use VARIABLEs and VALUEs for globals 2024-11-19 18:20:07 so with 0 value x I write x and to x rather than x @ and x ! 2024-11-19 18:20:43 yeah, that's a style I see pretty often, amby, but my experience is that Forth newcomers tend to tie themselves in knots with stack manipulation if they try it :-) 2024-11-19 18:20:47 TactfulCitrus: in my systems, variables are slower than stack, but I use variables when they make the code cleaner & more readable. 2024-11-19 18:20:57 if forth had locals, sure 2024-11-19 18:21:17 if you have 10 things on the stack, accessing them is going to be pretty slow too, crc :) 2024-11-19 18:21:23 but like. i have an instinct to avoid using globals for stuff that doesn't need to be global 2024-11-19 18:21:40 xentrac: ive never really had to go deeper than 4 or 5 2024-11-19 18:21:43 yeah, I do too. but after long and painful experience I learned that that instinct was wrong in Forth 2024-11-19 18:22:01 at least for my limited brain 2024-11-19 18:22:07 i have considered adding locals 2024-11-19 18:22:14 i have a reasonably good idea how you'd do it too 2024-11-19 18:22:14 maybe you have an easier time with stack manipulation than I do! 2024-11-19 18:22:33 I don't delve that deeply into the stack in most cases 2024-11-19 18:23:02 you want locals when you start using >r and r> 2024-11-19 18:23:09 (most of my words only really ever touch the top 1-3 elements) 2024-11-19 18:23:25 just to disambiguate, I'm not being sarcastic here. I really do believe that some people have an easier time visualizing stack effects than I do 2024-11-19 18:23:26 basically you put locals on the return stack 2024-11-19 18:23:45 I wonder if it's even more correct to use locals than to use the return stack as auxiliary data storage 2024-11-19 18:23:48 depending on how complicated you wanna make it, you either pre-declare all locals before using any 2024-11-19 18:23:49 a la old c 2024-11-19 18:23:53 but other people have a harder time 2024-11-19 18:24:18 or you could rig it up to be able to create new locals mid-definition 2024-11-19 18:24:26 which would be harder to implement but potentially easier to use 2024-11-19 18:24:40 and for us, it's better to use a variable or a value than to try to keep track of things 4 or 5 deep in the stack 2024-11-19 18:24:47 i personally would implement them like VARIABLEs 2024-11-19 18:24:49 but it's true that locals would make you lazy and will affect your factoring 2024-11-19 18:24:56 so that the option to take a pointer is there 2024-11-19 18:25:17 the maiin thing about forth is that managing stack elements can become so increasingly hard that it forces you to factor 2024-11-19 18:25:24 small functions 2024-11-19 18:25:43 also having locals makes structs less painful to work with 2024-11-19 18:25:51 because you can chuck them on the return stack 2024-11-19 18:25:52 I don't think that's the main thing about Forth. Forth was invented as a tool to make easy things easy and hard things possible, not a tool to make easy things hard 2024-11-19 18:26:24 since I'm only a noob in forth, I find easy things to be incredibly hard 2024-11-19 18:26:26 xd 2024-11-19 18:26:28 word-scoped variables like GForth's "locals" facility makes it harder to factor words into smaller pieces though 2024-11-19 18:26:41 while we're at it, check out em-1 from that one tanenbaum paper 2024-11-19 18:26:50 but I assume it's just because I do not have the mindset of a forthwright 2024-11-19 18:26:57 xentrac: that's the nice thing about not using locals 2024-11-19 18:27:10 at the end in my world only strings hash tables and lists exist 2024-11-19 18:27:15 you can just chop out a section of a word and it still behaves as it did in context 2024-11-19 18:27:23 I'm not a Forth expert but I *did* write StoneKnifeForth 2024-11-19 18:27:24 it's function composition 2024-11-19 18:27:26 amby: yes 2024-11-19 18:27:28 if you remove them I do not know what to do 2024-11-19 18:27:32 what's em-1? 2024-11-19 18:27:54 stack machine designed to minimise compiled code size 2024-11-19 18:28:00 xentrac: did not realize you were the author of SKF! 2024-11-19 18:28:12 vms14: you may be interested in reading Adam Rosenberg's book about how to program without hash tables, lists, or structs: http://www.the-adam.com/adam/rantrave/st02.pdf 2024-11-19 18:28:26 zelgomer: well it's not really a Forth 2024-11-19 18:28:30 it doesn't have IMMEDIATE words 2024-11-19 18:28:39 at the end I made an interpreter very different from forth, and sometimes I even prefer it, the only problem is it's just a toy language 2024-11-19 18:29:30 xentrac ty I've saved it 2024-11-19 18:29:33 vms14: I'm not sure whether the style Rosenberg advocates is actually good, but it's surely a useful toolkit in languages like Fortran 77, BASIC, and Forth which don't have those things 2024-11-19 18:31:21 and it's different enough from the mainstream approaches that it requires some explanation 2024-11-19 18:31:21 xentrac: maybe so, but it is one that i came across and enjoyed reading, and no doubt gave me ideas 2024-11-19 18:31:33 it has lexical scope, lists, hashes, can evaluate lists as code, etc 2024-11-19 18:31:41 needs a better design overall, has several flaws 2024-11-19 18:31:48 it sounds a lot like PostScript, although PS doesn't have lexical scope 2024-11-19 18:31:59 for example everything is mutable, even colon words 2024-11-19 18:32:17 it looks cool! 2024-11-19 18:32:32 you can : oh 1 2 3 ; 'oh word .code pop drop => now it's : oh 1 2 ; xd 2024-11-19 18:32:48 which is dirty 2024-11-19 19:27:48 xentrac: thanks for the pointers and the info, and no problem at all :) - fwiw, the :noname migration works a charm and cleans up the diagnostic - as for append logic... gforth also offers >string-execute :) - https://gforth.org/manual/String-words.html 2024-11-19 19:28:17 for the purposes of what i'm doing, tying myself gforth isn't an issue anyway 2024-11-19 19:30:06 What is the concatenation needed for? 2024-11-19 19:34:07 veltas: well, it's a bit of a hack - but basically, i want the user to be able to provide me with a string which it will then plot as graph - like s" x 3e f**" x-loop - now, i can evaluate the string for each point, or i can do it once and create a word out of it - so i was trying to hack a solution which did the latter and currently have: : x-create-equation ( "equation" -- xt ) s" :noname { F: x 2024-11-19 19:34:08 } " 2swap s+ s" ;" s+ evaluate ; 2024-11-19 19:34:42 sorry for line split - : x-create-equation ( "equation" -- xt ) s" :noname { F: x } " 2swap s+ s" ;" s+ evaluate ; 2024-11-19 19:35:09 this is probably a horrible thing to do :) 2024-11-19 19:35:10 Is there a reason why the user can't do e.g. :noname .... ; themselves? 2024-11-19 19:35:41 Like :noname .... ; PLOT-THIS 2024-11-19 19:36:13 Anyway you don't need to concatenate the strings, you can call evaluate twice 2024-11-19 19:36:40 nope - except i don't necessarily want them to provide me with forth - i might want to allow the user to give me in-fix like s" x ** 3" and i'll provide a translation to forth 2024-11-19 19:37:01 ah didn't actually try that 2024-11-19 19:38:03 Well if you're going to parse it eventually anyway then you're not going to use evaluate in the end, and can write it to not need the concatenation yourself 2024-11-19 19:38:47 If you want to compile stuff yourself word-by-word you can use FIND / COMPILE, etc 2024-11-19 19:39:07 sure - was just being lazy (and may not write parser - just a hypothetical maybe at this point) 2024-11-19 19:39:43 It's not an unreasonable thing, to want to concatenate a string, but I just rarely find it necessary 2024-11-19 19:40:38 sure - but when i tried this just now: : x-create-equation ( "equation" -- xt ) s" :noname { F: x } " evaluate evaluate s" ;" s+ evaluate ; i get a failure 2024-11-19 19:41:40 and i'm not too surprised by that - we are currently evaluating the : stuff, so the second evaluate will be part of the word of the i'm defining 2024-11-19 19:44:39 The issue is that EVALUATE always interprets and you want to compile 2024-11-19 19:44:53 yup 2024-11-19 19:45:33 EVALUATE is quite useless unfortunately 2024-11-19 19:45:50 It always runs up against these kinds of problems 2024-11-19 19:46:26 meh - works for this case - i can use it for each point, and with the strcat to define the :noname it's fine too - i'm not suggesting it's pretty or optimal though :) 2024-11-19 19:46:46 That's precisely my complaint 2024-11-19 19:47:06 I mean this isn't JavaScript, it's Forth, so EVALUATE is 'useless' by Forth standards 2024-11-19 19:47:08 and it's why i brought up the conversation in the first place :) 2024-11-19 19:47:34 In JavaScript you wouldn't think twice about allocating a new string, or even be that aware that you're doing so 2024-11-19 19:48:01 But Forth can run on computers where you can literally see it sweating over a handful of bytes 2024-11-19 19:49:14 yeah, sure i get that - what i'm doing isn't targetted at that level of hardware though, so i'm not going to sweat that particular detail :) 2024-11-19 19:50:18 have clock cycles and memory to burn - all i want to make sure is that i don't leak and run reasonably efficiently without breaking too many established rules in the process 2024-11-19 19:54:20 Where is the string coming from? 2024-11-19 19:56:40 at this point, the variable part comes from user input on the stack - s" x 3e **" x-loop or s" x" x-loop or s" 1.0e" x-loop etc - as above, the eventual goal is to parse the input given and translate it (preferably to a compiled word) - i don't need to write part that up front if i temporarily stub it with evaluate 2024-11-19 19:57:12 s/write part/write that part/ 2024-11-19 19:57:24 So the user is inputting stuff directly into the interpreter? 2024-11-19 19:57:30 The Forth interpreter? 2024-11-19 19:57:39 at this point, the user is me, so yes :) 2024-11-19 19:58:20 You're making the assumption here that you can iterate assuming that the source doesn't matter, my problem is that I don't think that's true! 2024-11-19 19:58:24 It does matter in Forth 2024-11-19 19:58:43 When I say 'iterate' I mean like 'iteratively develop' 2024-11-19 19:59:37 that's a fair point - i can post my code if you want to critique it 2024-11-19 19:59:49 A strong argument in my favour: strings aren't first-class citizens in Forth. Strings are bytes in memory: there's a limited vocabulary for manipulating them, and doing compilation tricks and redirections 2024-11-19 20:00:15 The problem is that your code isn't the destination, so the current code may be irrelevant to solving your actual problem 2024-11-19 20:00:55 To be specific, it would be good to know right now what requirements you actually have for how the user will input this string 2024-11-19 20:01:58 And whether you want this to be 'portable' ANS Forth, whether a specific Forth will be used, what sort of computer it will run on 2024-11-19 20:02:05 You've already specified some of that 2024-11-19 20:02:20 yup 2024-11-19 20:04:15 i still think that if i can take an input and derive a word of the float in/float out variety, i don't need to worry too much about the detailsn up front (esp. considering i'm just having a bit of fun and am deliberately doing this just to see where the boundaries are) 2024-11-19 20:05:20 I mean Forth is a general purpose programming language, capable of any programming style, like most programming languages I know. But in any language, and Forth especially, there are ways of doing things that run against the grain 2024-11-19 20:05:35 for sure 2024-11-19 20:06:05 For instance I think the smoothest Forth code that allows user interaction relies on the Forth interpreter as-is, if possible 2024-11-19 20:06:15 Just caught up on all the messages, thanks for the pointers guys! 2024-11-19 20:08:06 If it can't use the interpreter then using stuff like WORD or PARSE , and FIND COMPILE, etc makes sense because you're using parts of Forth itself to do the job 2024-11-19 20:09:00 And worst case scenario you need to start implementing everything yourself, or modifying string buffers for use in EVALUATE 2024-11-19 20:19:51 https://pastebin.com/CNBKzctz <- well, this is what i have - to my mind, your critique is valid and discussions in here have refined my approach quite a bit already - lines 258 and 272 are the main points of contention i believe - i'm quite happy to hear other criticisms too :) 2024-11-19 20:21:36 but note the "very silly" comment and the tongue in cheek name :) - this is me just having a bit of fun :D 2024-11-19 20:26:47 is the first forth code I see not using caps 2024-11-19 20:27:02 i prefer my code not to shout at me :) 2024-11-19 20:27:53 I guess you could create a vocabulary to avoid prefixing everything with t 2024-11-19 20:28:40 ah - is that possible with gforth? (i don't know it at all tbh - i use stack evaluation all the time, but not forth) 2024-11-19 20:30:06 https://gforth.org/manual/Vocabularies.html 2024-11-19 20:31:02 thanks - will look into that 2024-11-19 20:31:51 https://www.reddit.com/r/Forth/s/ZrBTWi4Nys 2024-11-19 20:32:50 does that help in anyway with tab completion? that's the main reason i was trying to limit the prefixes i use... 2024-11-19 20:33:06 (though tab completion in gforth is... well... ugh?) 2024-11-19 20:34:26 you can use rlwrap 2024-11-19 20:34:50 i tend to use it, you can add a file with word names to add autocompletion 2024-11-19 20:34:52 oh yeah - had forgotten about that one 2024-11-19 20:35:15 but i guess it won't dynamically add new words to dictionary 2024-11-19 20:35:29 and decide what characters break a word, and autocomplete files too, but that might be annoying 2024-11-19 20:35:41 yeah it won't :/ 2024-11-19 20:36:01 fwiw - this was my attempt to learn rust and wasm - http://rrpn.geminidev.be/ (if you get the black monitor, type help) 2024-11-19 20:36:04 you would have to create your own repl to wrap it 2024-11-19 20:36:30 yeah - my preference for this kinda stuff is linenoise 2024-11-19 20:37:09 have been avoiding readline for years - find it somewhat ott for what it actually provides 2024-11-19 20:38:22 I like rlwrap, I use it for my toy lang, but I assume eventually I will have to make my own with curses or alike 2024-11-19 20:39:44 if you're c based, you could do worse than linenoise - header only, no dependencies, ugly as sin, but minimalist and powerful 2024-11-19 20:41:10 also friendly license (unlike readline) 2024-11-19 20:42:07 at the end I only need tcsetattr 2024-11-19 20:43:16 well, maybe.. :) - but i don't think it's an entirely trivial bit of functionality to add - i wouldn't have the patience to write it myself anyway 2024-11-19 20:45:29 I dislike to not be able to have 'key' as forth has without requiring a dependency 2024-11-19 20:46:05 there are ways, like using bash, but that's dirty 2024-11-19 20:47:11 gforth has it, in pforth key does not work without a newline 2024-11-19 20:47:56 ah - yeah - you definitely want that one 2024-11-19 20:48:41 need to break for a bit - bbl - thanks for the chats guys :) 2024-11-19 20:55:02 see you soon lilo_booter 2024-11-19 20:55:18 I liked that bootloader, it was used in slackware 2024-11-19 21:50:54 vms14: That's funny because most Forth code I see is lowercase 2024-11-19 21:51:12 I write uppercase but I feel like the exception 2024-11-19 22:01:55 Sorry lilo_booter, I don't get what you're trying to do honestly, if I wanted to pass "y = sin x" to a word I would be pushing ' FSIN without hesitation, or "y = x^2 - 10" :NONAME FDUP F* 10E F- ; 2024-11-19 22:02:21 But I think I'm missing something 2024-11-19 22:07:53 veltas: yeah - i would too - but, i think most people would assume "2 ** 10 -" if they had an inkling of postfix or "x**2 - 10" it they didn't? either way, the idea of parsing the equation is just to add a bit of spice to the demo (and tbh, it's already gone way beyond its purpose anyway which was just an example on the wider subject of stack evaluation :)) 2024-11-19 22:10:53 there's a much better demo which is part of the same thing which uses video and audio files and connects things together with filters and is all rpn based and which is a bit more relevant to the audience (and, ultimately, more impressive), but you know - itches sometimes need scratching 2024-11-19 22:13:12 Or :NONAME 2DUP 100 M/ 10 M*/ 10.000 D- ; if you're based 2024-11-19 22:16:15 i kinda like the { x } local thing because it removes the stack manipulations (one less thing to explain) - if i want y = 5, i don't have to involve x or the stack - s" 5e" is sufficient 2024-11-19 22:17:02 Do you end up calculating this function for a large number of input values? 2024-11-19 22:18:37 well, possibly :) - currently, i'm using the terminal width (with a massive zoom in at some points :)) - but my feeling is that i should be able to use, say, an sdl window and use its resolution for the iteration 2024-11-19 22:18:49 zoom out rather 2024-11-19 22:18:57 Nice 2024-11-19 22:19:15 theoretical of course - no idea if i'd ever get round to doing it (ditto for parsing) 2024-11-19 22:19:34 i don't any reason why it wouldn't form a base 2024-11-19 22:19:40 For that I might consider trying to make a DSL for specifying the function to build SIMD code 2024-11-19 22:19:53 ooh - that would be nice :) 2024-11-19 22:20:11 Especially if it was for a 'real' reason, but yeah for a little project would depend on motivation/interest 2024-11-19 22:20:57 with gforth you might end using sdl quite easily 2024-11-19 22:21:00 indeed - one thing that is missing from this is plotting lines between the calcualted points - that is probably the next thing i'll do 2024-11-19 22:21:13 vms14: indeed - i saw some examples already 2024-11-19 22:21:14 https://rosettacode.org/wiki/Draw_a_pixel#Forth 2024-11-19 22:21:41 I like the stack notation as ffi interface 2024-11-19 22:21:42 nice - and an example of c bindings too 2024-11-19 22:21:52 yup - works for me 2024-11-19 22:22:10 I dislike the fact it will have to generate code compile and link every time you run your program 2024-11-19 22:22:30 but since it uses libtool there might be a way to configure that 2024-11-19 22:22:50 yeah - need to look into at some point i think 2024-11-19 22:23:46 i will also get a terminal variant working in the rrpn wasm thing i posted above :) 2024-11-19 22:23:55 (some of it is already there i guess) 2024-11-19 22:24:17 if I had a forth in c that was easy to add c bindings I'd probably stick with forth instead of making my own abomination 2024-11-19 22:24:53 I'm currently working on a Forth that's designed to be loaded as a shared object, starting with AMD64 Linux 2024-11-19 22:25:05 that could be interesting 2024-11-19 22:25:10 it could even be embedded into the browser with emscripten and add bindings to js through js_em 2024-11-19 22:25:11 And to coexist with C and C libraries 2024-11-19 22:25:21 em_js* I guess 2024-11-19 22:25:54 not familiar - i thought wasm was what all the kids were doing these days? 2024-11-19 22:26:15 emscripten uses wasm, previously used asm.js 2024-11-19 22:26:22 ah - ok 2024-11-19 22:26:57 they are even embedding postgresql into the browser with emscripten xd 2024-11-19 22:27:20 heh - nuts stuff :) 2024-11-19 22:27:23 a lisper did even embed clisp into the browser 2024-11-19 22:27:37 https://lispcafe.org/clisp/lisp.html 2024-11-19 22:27:53 nice :) 2024-11-19 22:31:52 fwiw, i had nothing to do with lilo - it was just that when i first connected to irc, i needed to choose a nick and i went with the first thing i'd done that day 2024-11-19 22:32:27 good job i'd gone to the toilet after the boot up 2024-11-19 22:40:45 yeah, I figured you weren't Werner :) 2024-11-19 22:40:54 :) 2024-11-19 22:41:13 and obviously you aren't Rob Leven 2024-11-19 22:43:13 nope :) - my main contributions to open source are related to the kino and mlt projects (kino is dead, but mlt lives on with https://www.shotcut.org/ - i've not had time to do that kinda thing for a few years - 3 kids and a full time job dragging me down) 2024-11-19 22:43:33 TactfulCitrus: happy to help! 2024-11-19 22:43:46 TactfulCitrus: don't hesitate to ask more questions 2024-11-19 22:45:19 lilo_booter: wow, that's great stuff! 2024-11-19 22:45:38 I'm tempted to do some video editing but I'm more leaning toward Blender 2024-11-19 22:45:49 *Levin 2024-11-19 22:45:54 ah - thanks - can't take any credit for shotcut though - that's all down to dan 2024-11-19 22:46:30 am thinking about releasing some stuff soon though... 2024-11-19 22:53:03 while I am very much not a fan of the shitty "talking-head idiot alternating with vaguely relevant stock footage" that seems to be a lot of YouTube today (and most cable news) I think there are some kinds of information that really benefit from animation to present them 2024-11-19 22:54:07 like, I spent a lot of time reading about automatic loom mechanisms and staring at mechanical diagrams without understanding how dobbies or jacquards worked 2024-11-19 22:55:33 but things like https://ciechanow.ski/mechanical-watch/ seem like maybe a better format than a prerecorded video 2024-11-19 22:57:16 https://www.youtube.com/results?search_query=usagi+electric <- i'm totally addicted to this guys stuff - he's trying to ressurect (and build) vacuum tube computers and it's a total eye opener for me to see how all this tech started 2024-11-19 23:01:43 (i literally can follow the about 5% of the guys descriptions of circuits... but there are bunnies and cats at the end of his videos which make it all worthwhile) 2024-11-19 23:02:56 xd 2024-11-19 23:04:29 vacuum tube computers are nuts 2024-11-19 23:04:38 cuz they all do some arcane bullshit for memory 2024-11-19 23:05:08 delay lines, storage tubes, magnetic hard drives 2024-11-19 23:08:34 yeah - doesn't feel like any of it should ever have worked at all 2024-11-19 23:10:39 xentrac: that watch thing is really interesting 2024-11-19 23:25:26 lilo_booter: I know! 2024-11-19 23:25:35 (I'm not Ciechanowski) 2024-11-19 23:37:48 :)