2024-11-26 02:59:12 veltas: I've found the standard somewhat useful for it, although not as useful as one might hope 2024-11-26 11:18:28 xentrac: Don't get me wrong, I recommend the standard to people looking for that common subset, but it has to come with many caveats like "you can just ignore `ENVIRONMENT?`" etc 2024-11-26 11:29:51 And quickly the refusal of simple guarantees causes friction, like the fact the return stack doesn't have to contain one single return address for colon words and that generally modifying them is undefined 2024-11-26 11:30:56 Forth probably needs 3 standards anyway: small, ROM, and big. This is roughly what BASIC did 2024-11-26 11:32:24 There's two BASIC ISO standards: Minimal BASIC and Full BASIC. 2024-11-26 11:32:51 And obviously those 3 standards should have a common subset 2024-11-26 13:52:07 veltas: I was thinking of things like dpl 2024-11-26 13:55:57 I'm not sure exactly why dpl isn't in the standard, but it isn't. vocabulary isn't in the standard because ANSI decided to standardize wordlist instead. things like dpl, vocabulary, and the single-return-address guarantee you mention are the kind of things I'd like to have documented as part of "know which behaviors are common to most Forths and which are, say, GForth features" 2024-11-26 13:58:21 also maybe "why is not called invert in GForth?" 2024-11-26 14:47:41 Are you saying you'd like single return address only to be officially standard, or just listed somewhere as "widely typical"? Seeing as how I'm currently contemplating a system that would put two items on the stack on calls, I don't feel like that should be something prohibited. 2024-11-26 15:39:55 I don't think technical standards can actually prohibit things, generally speaking, unless something like advertising or milspec gets involved 2024-11-26 15:41:34 rather, their role is to document a sort of Schelling point: if your implementation does such-and-such, you can expect such-and-such code to run on it; and if you want to write code to do such-and-such, the facilities implemented for that purpose are such-and-such, which have such-and-such deficiencies 2024-11-26 15:42:58 and, ideally, to document *which* implementations support those facilities, and with which bugs 2024-11-26 15:43:34 so it's very useful to know that many Forths do in fact push just a single item on the return stack on calls, because it makes it possible to implement things like my dynamic-scoping hack from a few weeks ago, which works on at least GForth and F83 2024-11-26 15:45:02 and it's very useful to know that dpl is a variable containing the location of the decimal point in the double-precision number last typed by the user; without any way to get that information, there's no way to build a fixed-point user interface 2024-11-26 15:45:40 the fact that the standard is just completely silent on this question is profoundly unhelpful 2024-11-26 15:49:25 (that's another thing that is in common between GForth and F83) 2024-11-26 15:51:29 as long as general-purpose software development toolchains are available for popular platforms, nobody can prohibit you from writing a Forth that puts two items on the stack on calls. But it would be very useful to know that that is in fact the case for eForth, F83, pForth, GForth, and a number of other Forths, because it allows you to write code that's portable across those Forths, even if it's not 2024-11-26 15:51:35 portable to Forths for which that is not the case 2024-11-26 16:42:56 ive asked this before out of curiosity but do we have many examples of forth programs ported to another port? 2024-11-26 16:43:04 im curious how that went 2024-11-26 18:53:01 xentrac: By "prohibit" I just meant that doing it differently would render you non-compliant. 2024-11-26 18:56:31 right, I think the whole conceptualization in terms of "compliance" is part of the problem 2024-11-26 20:42:00 Well, I assume it's an objective thing - given an implementation, it's either compliant or it's not, right? 2024-11-26 20:42:45 yes 2024-11-26 20:42:46 Here's a question. Say I write a Forth that's not compliant, but have a LOADable block set that will make it compliant. Is that implementation compliant? 2024-11-26 20:42:54 I don't remember 2024-11-26 20:43:04 I think there are actually a lot more gray areas than that 2024-11-26 20:43:12 but sure, in theory it's objective 2024-11-26 20:52:37 I'm reminded of MAF - Minimal ANS Forth https://vfxforth.com/flag/fig-uk/codeindex/topics/tutorial_by_date.html 2024-11-26 21:32:48 KipIngram: In ANS Forth standard scope it specifically excludes the nature of setup 2024-11-26 21:33:16 I don't see any good reason why you can't implement a standard-compliant Forth that isn't 'complete' until you load something else 2024-11-26 21:34:59 Oh there's also actually a specific provision in chapter 3 of ANS, "A system need not provide all words in executable form.... 2024-11-26 21:35:30 ... The implementation may provide definitions, including definitions of words in the Core word set, in source form only...." 2024-11-26 21:36:12 .... If so, the mechanism for adding the definitions to the dictionary is implementation defined." 2024-11-26 21:39:23 That would be an environmental dependency 2024-11-26 21:58:08 veltas: aha, thanks! 2024-11-26 23:13:51 probably a really stupid question, but is there a way to define a word which captures the value of a variable at the point of its creation? like variable state 10 state ! : state-was [ state @ ] ; 2024-11-26 23:20:30 I think you want : state-was [ state @ ] literal ; and probably choose a different name for the variable 2024-11-26 23:26:02 ah - that's what i was looking for - name was unimportant - if i can do that, can i also do 20 : stack-was [ 4 roll ] literal ; stack-was . or is that just a hacking cludge? :) 2024-11-26 23:26:14 (and how do you get bold in irc? :)) 2024-11-26 23:27:51 sure, although roll is generally bad style 2024-11-26 23:28:17 bold is ^B and normally displays as B 2024-11-26 23:29:08 hmm - running weechat in a tmux session.. ctrl-b is picked up by tmux 2024-11-26 23:29:36 I forget how you send ^B through a default tmux 2024-11-26 23:29:59 tried ^b^b without success - will dig around 2024-11-26 23:30:55 what's wrong with roll? :) 2024-11-26 23:31:15 ^B B https://unix.stackexchange.com/questions/19072/using-ctrlb-in-less-within-tmux 2024-11-26 23:31:38 roll suggests that you are not using enough variables 2024-11-26 23:31:46 ah - maybe? 2024-11-26 23:31:48 nope 2024-11-26 23:32:09 (that was me trying ctrl-b b) 2024-11-26 23:32:41 hmm - ok - was actually trying to avoid vars in this case 2024-11-26 23:33:21 but at the same time, i guess the values i want are floats anyway, so no roll actually required 2024-11-26 23:33:41 try not to try to avoid vars 2024-11-26 23:34:08 I mean, in your first years of Forth 2024-11-26 23:35:09 sure - not averse to them in general - just in the particular use case i'm looking at, they feel a bit clunky 2024-11-26 23:36:34 rare that they're as clunky as roll! 2024-11-26 23:41:24 :) - perhaps - but in this case, fliteral is possibly enough :) - only, it's a pair of values i want - 1e 2e : state-was fliteral fliteral f. f. ; <- is fine :) - no roll or froll in sight :) 2024-11-26 23:43:51 yeah, that's perfect :) 2024-11-26 23:44:16 fliteral sounds like a device for spraying pesticides 2024-11-26 23:44:24 :D 2024-11-26 23:48:46 basically for the graph drawing stuff, i've added r=(( 5e )) <- draw circle with an origin of 0,0 and a fixed radius of 5 - there is also 5e 5e +r=(( 5e )) which changes the origin (theta is also provided so it doesn't need to just provide circles of course) - the idea i'm looking at now is caching all the :noname's created so that i can re-render them after changing x-range/y-range etc - like, 2024-11-26 23:48:48 getting zoom in/out iyswim 2024-11-26 23:50:53 still toying with the idea of rending to opengl/sdl or even just an allocated rgb raster which can be saved as a ppm/bmp/png or whatever 2024-11-26 23:52:57 to re-render it properly, i want to preserve colour and origin info 2024-11-26 23:53:17 that's great! 2024-11-26 23:53:37 think it's starting to head in possibly useful direction 2024-11-26 23:53:53 a thing to keep in mind is that normally :noname appends to the dictionary; you don't have garbage collection 2024-11-26 23:53:57 (no doubt re-inventing wheels along the way) 2024-11-26 23:54:10 I mean unless you implement it 2024-11-26 23:54:15 indeed - already noted - so caching should be trivial 2024-11-26 23:54:24 just need to know where they are 2024-11-26 23:54:33 yeah 2024-11-26 23:55:05 and on a desktop machine today you're going to take a loong time to run out of dictionary space by interactively typing expressions 2024-11-26 23:56:12 yup - and i am kinda thinking that the input will be handled by a higher level language so i can finally do the infix to postfix/forth transation 2024-11-26 23:56:35 possible in forth, but seems unnecessarily painful?