2023-09-17 00:08:55 It's very Vogon 2023-09-17 01:25:20 gordonjcp: t=0 is the point x=1, y=0. It's on the circle too. 2023-09-17 01:25:36 So as far as I can tell it's ANY integer. 2023-09-17 01:26:13 The parametrization is x=(1-t^2)/(1+t^2), y = 2*t/(1+t^2). 2023-09-17 01:30:06 You get this: 2023-09-17 01:30:13 x = (1-t^2)?(1+t^2) y = 2*t/(1+t^2) 2023-09-17 01:30:14 x^2 = (1-2*t^2+t^4)/(1+2*t^2+t^4) 2023-09-17 01:30:15 y^2 = 4*t^2 /(1+2*t^2+t^4) 2023-09-17 01:30:16 x^2+y^2 = (1+2*t^2+t^4) / (1+28t^2+t^4) 2023-09-17 01:30:18 x^2+y^2 = 1 2023-09-17 01:30:46 So, x^2 + y^2 is IDENTICALLY 1. The denominators 1+t^2 can never be zero, for any integer, so it works for any value. 2023-09-17 01:31:34 Ooops - got a ? where I should have had a / up there. 2023-09-17 01:33:22 You know, this projective stuff is really neat, because points and lines are represented by triples (x,y,z). The meaning is (x/z,y/z,1), but since only the proportions matter you can use the flexibility of z to clear fractions. So it holds the prospect of purely integer arithmetic. Really nice for calculations on a computer. 2023-09-17 01:33:51 and given its applicability to graphics, that seems like something of good value. 2023-09-17 01:35:48 veltas: Who knows - I may wind up writing something like recognizers for my system before they ever get around to it. 2023-09-17 01:36:56 Standards groups are like any other group - their own existence and influence becomes their primary goal. 2023-09-17 01:37:25 I have so little interest in the standard that it's really a little shameful. :-( 2023-09-17 03:45:30 i'm going to make " to not be a word, but a special syntax so it does not need a space 2023-09-17 03:45:49 same for ( as it will create lists 2023-09-17 03:46:26 i dislike a lot to have to ( do that ) instead of (do that) 2023-09-17 03:47:00 not for one list, but nesting is ugly ( oh ( my ( cat ) is ) very ) 2023-09-17 03:47:48 when it could be (oh (my (cat) is) very) 2023-09-17 03:48:12 and a "string" instead of " string" 2023-09-17 03:49:55 i realized that since i use a fake debian i can use common lisp, but for some reason i ended liking my own abomination because it's a mix of what i like from lisp and forth 2023-09-17 03:50:35 it has lexical scope, closures, code as lists, quote, etc 2023-09-17 03:50:51 but also rpn, stack based, colon words and concatenative 2023-09-17 03:51:44 having to wrap every paren with spaces makes me a bit sad, so i'll try to fix it 2023-09-17 03:51:59 and do the same with " 2023-09-17 03:53:18 vms14: That's exactly the struggle I've had internally. The space requirement becomes annoying sometimes. 2023-09-17 03:53:37 KipIngram: i know ( in forth is for comments 2023-09-17 03:53:40 And consider - what if you WANTED a space as the first character of your line? 2023-09-17 03:53:49 but always triggers me to see ( this) 2023-09-17 03:54:29 what? i ignore initial spaces 2023-09-17 03:54:38 and newlines and tabs 2023-09-17 03:55:08 I'm just noting that there are reasons to want to be able to treat every single char between the delimiters as legit data. 2023-09-17 03:55:38 well every word can implement a new syntax 2023-09-17 03:55:56 but it has to be a word 2023-09-17 03:56:52 about that, i'm somehow interested in having words with spaces 2023-09-17 03:57:01 but looks troublesome 2023-09-17 03:57:20 i mean compound words 2023-09-17 03:57:40 I've thought about that too. 2023-09-17 03:57:43 i can always make a special syntax with delimiters for evaluating them, but meh 2023-09-17 03:58:01 KipIngram: and what are your thoughts? 2023-09-17 03:58:09 I keep thinking regular expressions play into this somehow. 2023-09-17 03:58:25 Like, you'd have a list of regexes, empty initially. 2023-09-17 03:58:28 You could add to it. 2023-09-17 03:59:02 The next part of the input stream would be checked against those, and if it "fits" one of them then that would yield the interpretation of that input. 2023-09-17 04:00:03 But a string wouldn't be handled by seeing " and running a " word that gobbled the rest of string. 2023-09-17 04:00:26 Rather, the system would see " followed by chars follwed by " and would say Aha, that's a string; gimme it. 2023-09-17 04:00:37 It's a "wholistic" thing. 2023-09-17 04:01:30 so the regex are matched against the whole input line? 2023-09-17 04:02:12 Yeah. 2023-09-17 04:02:37 So you could say "this is what strings look like, this is what arrays look like, etc." 2023-09-17 04:02:52 regex can give a lot of funny troubles 2023-09-17 04:02:59 I know. 2023-09-17 04:03:16 When I say regex I'm referring to the original, "early days" regex before they added a lot of feature bloat to them. 2023-09-17 04:03:26 the ones that are really efficient to process. 2023-09-17 04:03:31 i sometimes think about an interpreter with states 2023-09-17 04:03:43 Well, we have that now. 2023-09-17 04:03:51 compile state vs. interpret state. 2023-09-17 04:03:55 yeah, the compiling flag 2023-09-17 04:04:11 but with the ability to add new states 2023-09-17 04:04:19 and switch from one to the other 2023-09-17 04:04:56 there are a lot of ideas to try 2023-09-17 04:09:52 See, think of it like this. 2023-09-17 04:10:14 Existing Forth approach. What the system does is take the next bit of input and runs a bunch of tests on it. 2023-09-17 04:10:24 Most of those tests are match tests against specific strings. 2023-09-17 04:10:30 The last one is a number check. 2023-09-17 04:10:37 But they're really just "a list of tests." 2023-09-17 04:10:44 Why can't those tests be more flexible? 2023-09-17 04:10:55 Involve wild cards, specific combinations of items, etc.? 2023-09-17 04:11:17 And not necessarily just one word at a time, but whatever format of chars the test needed to check for? 2023-09-17 04:11:33 If "upcoming input" matches a pattern, take that input and run the instructions associated with that pattern. 2023-09-17 04:12:42 Same "general strategy" - just "more flexible." 2023-09-17 04:13:31 The standard Forth input processing approach is really quite primitive (though of course that's by design - simplicity). As simple as possible. 2023-09-17 04:14:09 A "string test" would see if the upcoming input was a quote mark followed by n non-quotes followed by a quote mark. 2023-09-17 04:14:15 i also want some day to improve errors 2023-09-17 04:14:23 Wouldn't matter whether there were spaces in that in-between part. 2023-09-17 04:14:39 and make them some sort of object or event 2023-09-17 04:14:58 actually they seem to be best represented as events 2023-09-17 04:15:11 Maybe these tests could yield a score. If they all failed, you could use the one that produced the highest score to guide you in error messaging. 2023-09-17 04:15:30 "Looks like you were trying to enter a numeric array, but you got it wrong here: ..." 2023-09-17 04:15:45 and i had a basic way of event handling already, which is just a hash table 2023-09-17 04:15:54 You like hash tables. 2023-09-17 04:16:04 i use perl 2023-09-17 04:16:25 Hash tables do seem pretty important these days. 2023-09-17 04:16:41 But good ones are O(1), so, hard to beat. 2023-09-17 04:16:44 when perl devs prepare to battle, they prepare their hashes and regex 2023-09-17 04:17:08 Forth uses the simplest possible way there too. 2023-09-17 04:17:14 imagine a hash of regex 2023-09-17 04:17:17 Doesn't get much simpler than an O(N) linked list. 2023-09-17 04:17:53 But a hash is a *calculation* on the DATA of the input. 2023-09-17 04:18:02 I don't really see how you put that together with regex. 2023-09-17 04:18:03 v8 has a very efficient hash table 2023-09-17 04:18:16 Everyone does, mostly, these days. 2023-09-17 04:18:20 It's "the modern way." 2023-09-17 04:18:30 Dictionaries like in Python rather than Forth. 2023-09-17 04:18:42 they are remarkably fast compared to other lang implementations 2023-09-17 04:18:58 Yes, but I think they work for looking up SPECIFIC STRINGs. 2023-09-17 04:19:09 Not really going to help me recognize a literal array in my input. 2023-09-17 04:19:24 js hash tables are actually object properties 2023-09-17 04:19:59 object.key = value 2023-09-17 04:20:20 Yes, but you have to actually have the key before you can look something up in there. 2023-09-17 04:20:22 they are much faster than perl's 2023-09-17 04:20:41 Like I said, they can be O(1). 2023-09-17 04:20:47 Ammortized. 2023-09-17 04:21:01 well v8's js is just much faster than perl overall 2023-09-17 04:21:43 well you can iterate the keys 2023-09-17 04:22:01 but idk if a linked list serves you better 2023-09-17 04:22:22 hmm... I been meaning to write something like a Lua table implementation in that object system I have described 2023-09-17 04:22:43 I'm sure a hash table would serve Forth's particular needs better than a linked list. 2023-09-17 04:22:55 There's just more to them and they're not as simple. 2023-09-17 04:23:00 in my case i'll keep not worrying about performance 2023-09-17 04:23:00 for interning string based symbols I recommend tries 2023-09-17 04:23:28 it does not make sense, except for learning 2023-09-17 04:23:56 an trie is rather neat datastructure 2023-09-17 04:24:56 made up of nodes in a tree like fashion where each node has say 256 branches 2023-09-17 04:25:29 I've been thinking about numeric type management too. Int vsl float vs. complex. I kind of think structures should promote up that chain as calculatoins require it, and then it should be possible for the code to deliberately demote them if it chooses to. 2023-09-17 04:25:47 and if you have a parent pointer in each node then you can extract a string out of it again but it will be reversed 2023-09-17 04:25:47 KipIngram: but you mean a hash table for the dictionary? 2023-09-17 04:25:54 I.e., if you have an array of ints, but do math on it that produces a floating point result, the array gets promoted to float. 2023-09-17 04:26:17 Take the square root of a negative number, the array gets promoted to complex. 2023-09-17 04:26:52 i assume then you want to do like gforth does 2023-09-17 04:27:01 Yeah, I think in a desktop Forth targeting high performance I'd use hash tables for the dictionary these days. 2023-09-17 04:27:07 so homogenious arrays only or hetregenious ones too? 2023-09-17 04:27:09 mantain both the libked list and the hash table 2023-09-17 04:27:23 I'm leaning toward requiring all array elements to be the same. 2023-09-17 04:27:40 So if one item got changed, you'd change the whole array. 2023-09-17 04:27:45 if you loose the linked list you loose forget and a lot of stuff i suppose 2023-09-17 04:27:47 Just so you can still index it like an array. 2023-09-17 04:28:06 Sure - if you lose your data you've lost your data. 2023-09-17 04:28:17 Start over. 2023-09-17 04:28:38 i mean, you're forced to mantain both versions 2023-09-17 04:28:58 it's not nice, i wonder if the performance you get is worth 2023-09-17 04:29:03 If you have both, I guess. There's no reason you couldn't do it full hashing. 2023-09-17 04:29:23 But yeah, I've also thought about having the linked list built in, and building a hash table on the fly in unused RAM. 2023-09-17 04:29:24 I see, I prefer to use that objsys as I can invoke an general getter method on it and not be fussed about how it got the value 2023-09-17 04:30:21 I doubt I'll want to have ALL of the decisions made at run-time. 2023-09-17 04:30:43 And certainly not on an array element by array element basis. 2023-09-17 04:30:52 I came up with that objsys because I wanted an easy way to do graphics composition easily 2023-09-17 04:30:52 Look at the type of the array, know what to do - do it to everything. 2023-09-17 04:30:54 ACTION has no compile time 2023-09-17 04:31:43 ^ That's part of why your performance is low. 2023-09-17 04:31:55 That's what compile time IS - getting work done once so you won't have to later. 2023-09-17 04:32:31 i made a fake compile by taking decisions in compile time and it helped a lot with the performance 2023-09-17 04:32:43 I'm moving some decisions to run time - I don't see any way to get the use model I want without doing that. 2023-09-17 04:32:48 but it sucks so much 2023-09-17 04:32:52 But I'll still be trying for "reasonable" performance. 2023-09-17 04:33:21 for instance I have in my notes a sort of blitter thing that acts like an pixmap but actually references two pixmaps and a bitmap or apple quickdraw like mask 2023-09-17 04:34:37 KipIngram you looked into partial evaluation and the three transforms by Proffessor Futamura? 2023-09-17 04:36:27 the latter is basically a way to transform an interpreter into a compiler that tries to do as much as possible at compile time and emitt code to do the rest at runtime 2023-09-17 04:36:49 Zarutian_iPad: someone recommended me about using partial evaluation when asking about transpilers 2023-09-17 04:39:10 it's mainly what my fake compile did 2023-09-17 04:40:04 it avoided the switch case at runtime, the switch case was executed at compile time and it returned a function that would perform the action of that case 2023-09-17 04:41:04 so a colon word for example was converted to a list of functions that had some decisions at compile time 2023-09-17 04:41:52 actually the compile function was a copy of the interpret function returning closures instead of executing code 2023-09-17 04:48:03 vms14: What I really wish I could do is have the compiler make all of the "type" decisions and just compile the right code for the right situation. Then when it ran it would just run - no decisions then. 2023-09-17 04:48:16 more recently though I've been thinking about more run-time decisions. 2023-09-17 04:48:35 I'm not sure it has to be THAT bad. 2023-09-17 04:49:22 Doesn't really hurt that much to add one "type-driven" table lookup to a word's execution. 2023-09-17 04:50:32 KipIngram: then you want type inference 2023-09-17 04:50:57 That sounds like something that has a specific meaning and I'm not sure what it is. 2023-09-17 04:51:48 I just figure the stack item will give me easy access to the item's type - a type-flexible word would check that and table jump to code to do 'that" to "that type." 2023-09-17 04:52:07 Type inference is the ability to automatically deduce, either partially or fully, the type of an expression at compile time 2023-09-17 04:52:29 So, if it's a pointer to a complex array, the + word will see that and jump to a routine to add complex arrays. 2023-09-17 04:52:42 a guy recently told me he wanted to make some sort of scope for the types 2023-09-17 04:52:52 Well, maybe compile time maybe run-time. 2023-09-17 04:53:03 My most recent thoughts have been toward doing it at run time. 2023-09-17 04:53:13 in the sense that a type can change over the course depending on the scope 2023-09-17 04:53:14 But more type inference would be better, yeah. 2023-09-17 04:53:29 but this being at compile time 2023-09-17 04:53:39 I'm kind of talking about both. 2023-09-17 04:54:11 hah so you also want a half interpreter and half compiler 2023-09-17 04:54:17 I may be trying to be too general. What I actually KNOW I want is numeric arrays. 2023-09-17 04:54:18 well, forth was always that 2023-09-17 04:54:24 that I can do scientific modeling with. 2023-09-17 04:54:48 in my case the compiler part does not exist 2023-09-17 04:55:07 but i keep wanting to have half transpiler at the end 2023-09-17 04:55:09 The way I see it, numeric array entries can be either integers, floating point, or complex (two floating point). 2023-09-17 04:55:19 And arrays can have any dimensionality. 2023-09-17 04:56:09 The APL interest of late has been for getting a handle on the array stuff. They seem to have a lasso around that. 2023-09-17 04:56:20 haha 2023-09-17 04:56:28 you went to apl to steal arrays 2023-09-17 04:56:49 Well, and I like the "math rigor" they have. 2023-09-17 04:57:31 i have to learn prolog 2023-09-17 04:57:56 i already have a perl module that implements prolog entirely in perl, so i can use it to provide prolog 2023-09-17 04:58:23 i think it can be very useful in a lot of tasks, but i have to learn it first 2023-09-17 04:59:01 i don't even see the power of prolog 2023-09-17 04:59:08 but i know it has 2023-09-17 04:59:49 and it feels like it is something i always wanted to have 2023-09-17 05:00:27 i have to do so many things 2023-09-17 05:02:24 for the error i think it's cool to just use what i have for events 2023-09-17 05:03:03 event is a word that takes a string from the stack and looks a hash table for that string 2023-09-17 05:03:51 if there's something it's a list of handlers, which will be executed one by one 2023-09-17 05:04:20 there's an alternative event word that can also give arguments to them 2023-09-17 05:05:07 then there's a word named watcher which just takes an event name and code and pushes it to that list 2023-09-17 05:05:20 it registers the handler 2023-09-17 05:05:33 i think error should follow the same approach 2023-09-17 05:05:46 for now my error function just prints text xd 2023-09-17 05:06:13 but i could have error handlers just by doing the same 2023-09-17 05:08:03 althought i should check also the java exception/error system and specially the common lisp condition system 2023-09-17 05:08:17 but i need to implement oop before that 2023-09-17 12:31:38 :O 2023-09-17 12:45:45 about the error handlers, it can end being useful cause they can return something on the stack and execution should continue 2023-09-17 12:47:06 for example they could take input from the user if an argument was wrong and push it on the stack 2023-09-17 12:47:26 execution should resume after the error word 2023-09-17 12:48:19 and an unhandler error should terminate the program 2023-09-17 12:48:27 unhandled* 2023-09-17 12:48:43 at least looks much better than just printing an error 2023-09-17 12:49:58 and you have a return stack, so you can even play more tricks 2023-09-17 17:32:06 Yeah, I guess you could try to have an exception handler "correct" a bad situation. However, in the vast majority of cases the error occurs because you did something wrong - such a handler would have to be able to figure out "what you really intended" and that doesn't strike me as very easy. 2023-09-17 17:32:37 I'm content to just do what's necessary to keep the system from crashing - I fail gracefully and put things back as they were to start with so I can try again. 2023-09-17 17:33:07 That way I don't have to fret over "what part of my input line ran and what part didn't?" 2023-09-17 17:33:28 If there's an error - none of ran. Clean and simple. 2023-09-17 17:33:34 And well-defined. 2023-09-17 17:41:12 Bayes theorem questions sure are popular on Quora. Always seem like someone's homework problem. 2023-09-17 18:26:55 What??? 2023-09-17 18:26:57 https://www.youtube.com/watch?v=94mV7Fmbx88 2023-09-17 18:27:41 probably for folks trying to get into data science or AI 2023-09-17 18:39:50 I just find it fascinating that Pythagorean triples and the Fibonacci sequence are related. Numbers are just so cool. 2023-09-17 19:07:22 KipIngram: yeah it blows my mind how often the value of sin(pi) crops up in maths 2023-09-17 19:09:12 at least they put beangate behind them 2023-09-17 19:24:56 beangate? 2023-09-17 19:28:34 "Pythagoras's Belief That Beans Are Human May Have Killed Him", etc 2023-09-17 19:43:16 thrig: serious? 2023-09-17 19:47:13 https://www.britannica.com/science/Pythagoreanism etc 2023-09-17 19:53:03 weird 2023-09-17 19:53:09 oh well, the maths still works out 2023-09-17 20:42:14 seems to work 2023-09-17 20:42:23 (oh(my(cat"is")very)"nice") it can read this 2023-09-17 20:43:41 it seems able to read them with any combination of spaces or lack of them 2023-09-17 20:44:26 and for what the interpreter knows, ( and " are just a word 2023-09-17 20:45:37 ((( will be read as three separate words 2023-09-17 20:46:13 actually the first ( will trigger the reading of the other and the other the last one 2023-09-17 20:46:46 i never got used to the " strings" 2023-09-17 20:47:00 i always forget the space and i dislike it a lot 2023-09-17 20:47:20 now i'm happy 2023-09-17 21:00:38 lisp 2023-09-17 21:00:57 I think you just want a lisp 2023-09-17 21:02:43 yes 2023-09-17 21:03:16 my lang is becoming a lisp gradually 2023-09-17 21:03:38 it was never a forth :/ 2023-09-17 21:03:59 but every time it gets closer and closer to lisp 2023-09-17 21:04:53 from the start it used lists as code, then quote and quasiquote, then lexical scope and closures 2023-09-17 21:05:07 now it can read s-expressions properly 2023-09-17 21:05:40 just need apply and eval 2023-09-17 21:09:45 it's weird to see how i made a path from forth to lisp 2023-09-17 22:02:12 You made a path to lisp while chatting in a Forth channel. :-) 2023-09-17 22:03:33 It's kind of fun thinking about how you might implement lisp in Forth. Hint: ) does all the heavy lifting. 2023-09-17 22:04:16 ( just says "open a new list" (like on a stack of lists - ( would tell you to push an empty list onto the stack. 2023-09-17 22:04:31 All the items other than ( and ) would have you append to that list. 2023-09-17 22:04:48 And finally ) would "process" the top list on the stack, leaving the result as an "item." 2023-09-17 22:06:07 in my case ( reads by "words" and if it finds another (, a : or a " it will execute that word 2023-09-17 22:06:50 Yeah, that's the recursive version of what I just said, I think. 2023-09-17 22:06:59 recursion vs. iteration. 2023-09-17 22:07:21 : does the same, but it makes a new environment for the new word and sets it as the current environment 2023-09-17 22:07:23 Or something along those lines. 2023-09-17 22:07:55 so if another : is executed, it will be created inside the other : automagically 2023-09-17 22:07:56 Yeah, that's one place where your setup deviates quite a lot from Forth. In most Forth's, : just makes a dictionary entry and changes STATE. 2023-09-17 22:08:30 For me a second : does exactly what the first one did - just makes a header and points it at HERE. 2023-09-17 22:08:48 No differences at all. 2023-09-17 22:08:59 KipIngram: your ; can be grouped? like ;; 2023-09-17 22:09:02 my : works in the same way as vms14's - so the execution of the word creates the inner words 2023-09-17 22:09:09 or it was a different kind of ; 2023-09-17 22:09:13 vms14; Don't think of ;; that way. 2023-09-17 22:09:19 ;; is a word, of its very own. 2023-09-17 22:09:28 It just happens to return two levels instead of one level. 2023-09-17 22:09:34 hmm 2023-09-17 22:09:43 The pattern ; vs. ;; is just a naming convention. 2023-09-17 22:09:52 I don't have ;;; or ;;;; etc. 2023-09-17 22:10:14 i can make them be together like ;;; they would be recognized as three words 2023-09-17 22:10:14 The compiler doesn't in any way treat ;; as ; ; 2023-09-17 22:10:37 Yeah, because your : is looking for the next ; 2023-09-17 22:10:41 Makes sense. 2023-09-17 22:11:28 it reads by words, but i can hook the ; to the reader so it does the same as it does with ( ) and " 2023-09-17 22:11:28 When I have : nested, the inner one sets STATE=1 just like the outer one does, but since it was already 1 it doesn't matter. 2023-09-17 22:12:36 In particular, when I nest : items, it doesn't create any kind of "nested" dictionary structure. No "scope" funny business. 2023-09-17 22:12:42 Just makes another name in the dictionary. 2023-09-17 22:13:32 I do have those .: words, and generally they are not visible later, but to achieve that I explicitly remove them from the dictionary when I'm ready to. 2023-09-17 22:18:08 in my case ; is not even a word 2023-09-17 22:18:27 it's just a token for : 2023-09-17 22:18:58 same for ) 2023-09-17 22:19:42 Right. Just delimiters. 2023-09-17 22:20:29 the first times i tried to implement ( and ) i did push tokens on the stack xD 2023-09-17 22:20:56 i thought it would be cool cause i could manipulate them and alike 2023-09-17 22:21:16 but it sucked so much cause they got in the way when executing words 2023-09-17 22:22:10 So, in normal Lisp, if I had something like this: 2023-09-17 22:22:17 i tried once to count how many elements are pushed since i execute the list start delimiter 2023-09-17 22:22:25 ((...explained below...) 3 4 ) 2023-09-17 22:22:39 And ...explained below... resulted in '+', would that yield 7? 2023-09-17 22:22:56 an error 2023-09-17 22:22:59 Or rather (...explained below...) results in '+' 2023-09-17 22:23:08 ah, it should work 2023-09-17 22:23:13 let me check 2023-09-17 22:23:16 Can you "compute operators" like that? 2023-09-17 22:23:30 it depends on what explained below is 2023-09-17 22:23:44 Anything that produces '+' 2023-09-17 22:23:47 () is a function call in lisp unless it's quoted 2023-09-17 22:24:12 but you can for example call a funtion that returns another 2023-09-17 22:24:39 ((find-fun "something") something args) 2023-09-17 22:24:46 it should work 2023-09-17 22:25:53 ((lambda (x) x) 'oh) 2023-09-17 22:25:56 Ok - that's what I was asking. 2023-09-17 22:25:58 for example 2023-09-17 22:26:23 in scheme i guess you have to call apply or funcall 2023-09-17 22:26:23 That would work in the Forth implementation of it I described above. 2023-09-17 22:26:41 oh i guess in scheme also works the same 2023-09-17 22:27:39 It's not particularly hard to write Forth that processes infix arithmetic either. 2023-09-17 22:27:54 just call next 2023-09-17 22:28:00 And supporting normal precedence of operators is readily done too. 2023-09-17 22:28:38 i never saw how forth achieves metaprogramming 2023-09-17 22:29:08 What do you mean by metaprogramming? 2023-09-17 22:29:10 in my case i have lists as code, which makes it very easy 2023-09-17 22:29:19 KipIngram: code that generates code 2023-09-17 22:29:30 for example lisp macros 2023-09-17 22:29:39 i know forth does not need them 2023-09-17 22:29:43 "generating code" is just adding data to the end of the dictionary. 2023-09-17 22:29:53 they achieve the same goals in different ways 2023-09-17 22:30:09 right 2023-09-17 22:30:20 in forth is even more usual than in lisp 2023-09-17 22:30:31 I don't see why you think it would be hard? 2023-09-17 22:31:02 it's hard in other kind of languages because of their syntax 2023-09-17 22:31:07 For the most part that's what's done with STATE. As you find words in the dictionary, if STATE=0 you execute them. If STATE=1 you add them to the end of the dictionary. 2023-09-17 22:31:38 well in forth you have the definition opened 2023-09-17 22:31:46 When you come to ; it's an immediate word, which executes right away - it adds a return to the end of the dictionary and sets STATE=0. 2023-09-17 22:31:49 this does not usually happen in other langs 2023-09-17 22:32:00 Sure it does - it just happens at compile time. 2023-09-17 22:32:45 By the time you run a C program it's finished - can't add more code then. 2023-09-17 22:33:18 SBCL is a C program and can add more code 2023-09-17 22:33:26 :o 2023-09-17 22:33:28 But the C compiler does something very similar while it runs. It starts with an empty buffer and as it processes your source it adds code to it. 2023-09-17 22:33:37 actually sbcl is mostly written in lisp 2023-09-17 22:33:51 Yeah, seems like that ought to be possible.