2024-04-13 00:22:50 Playing a dangerous game, writing "this page intentionally left blank" on one page and then next one entirely blank 2024-04-13 01:38:25 I don't think I'd feel safe guessing without measuring. 2024-04-13 01:38:59 The thing is, you can fetch several tokens in a single cell fetch, so for 4 or 5 or 6, depending on your token size, tokens you're executing out of a register. 2024-04-13 01:39:09 The fetch cost gets amortized over all of those. 2024-04-13 01:39:35 And I've looked at the instruction sequence to do it - it's not particularly longer than the usual address-per-cell NEXT. 2024-04-13 01:41:09 You maybe right - it may be a little slower, but as you say not a whole lot. I won't be shocked if I find it's as fast or faster, though (again, not by much probably). 2024-04-13 01:41:55 Most of the cells you need to fetch for that will probably wind up in cache anyway, so avoiding a fetch might not bring too much benefit. 2024-04-13 01:56:22 I'll bet it's markedly slower, but not by lifechanging amounts 2024-04-13 01:56:53 I don't promise anything but I might be working on a token threaded forth 2024-04-13 01:57:22 for x86, so may be able to profile that 2024-04-13 03:00:41 it's a lot slower on 6502 for example 2024-04-13 03:00:57 of course architecture has a lot to do with it 2024-04-13 09:14:36 MrMobius: I've not profiled it on Z80 but I think it was about 50% slower 2024-04-13 09:14:58 I could do a test, it also depends on what you're doing. For typical usage it's not incredibly different 2024-04-13 09:15:08 Because a lot of key routines are all in CODE anyway 2024-04-13 09:15:30 So I think it's also fair to say it will depend on what you're doing 2024-04-13 10:12:17 For example when the screen scrolls on zenv, 90% of the time is spent in CMOVE which is just a wrapper for a LDIR instruction. Scrolling is thus just as slow on DTC and TTC. 2024-04-13 13:40:27 Ya if you can spend as many cycles as you can in the primitive then the dispatch overhead matters less and less 2024-04-13 13:41:36 CMOVE is the exception though. Most primitives don't take many cycles. FigForth for example takes 80+ cycles per primitive on dispatch. Most primitives don't need that many cycles to do their work 2024-04-13 13:50:16 Yes it's true, it does really depend on workload though 2024-04-13 13:50:43 The slowest bits of my forth tend to always be stuff that's trivial to optimise 2024-04-13 13:50:58 I've not even bothered optimising the LDIR, which is easy to make maybe twice as fast 2024-04-13 13:51:07 And has a big impact 2024-04-13 13:51:58 I would say even with a token threaded forth, it's still "fast enough" that it isn't going to prevent you from doing most things you'd care about 2024-04-13 13:52:07 On zenv anyway 2024-04-13 13:52:18 It's still miles faster than the BASIC that comes with it for instance 2024-04-13 13:55:11 For trivial operations it's probably 100 times slower than assembly 2024-04-13 13:55:23 On the order of 2024-04-13 13:55:44 That's decent for a high-level language IDE that fits in a few KB 2024-04-13 13:56:12 Which also makes it easy to drop to assembly ... in theory, I've not added the assembler but a minimal implementation would be easy to add 2024-04-13 13:56:19 I've just not spent a ton of time on zenv 2024-04-13 13:56:23 i'll sell the fact my toy lang is so slow as a way to encourage the user to write performant code 2024-04-13 13:56:29 :D 2024-04-13 13:56:39 it's not slow, it's a feature 2024-04-13 13:57:29 it let's you appreciate the performance of your code 2024-04-13 13:57:39 Any updates on that? 2024-04-13 13:58:34 on what? i'm not aiming at performance, and the day i focus on performance will be by generating code i guess 2024-04-13 13:59:13 No I just mean on your toy lang 2024-04-13 13:59:22 i'm rewriting it again 2024-04-13 13:59:37 https://termbin.com/7tar 2024-04-13 14:00:31 nothing interesting i guess 2024-04-13 15:04:49 Have you been using it much? 2024-04-13 15:11:27 veltas nope, but i'm near to start using it 2024-04-13 15:11:52 i only made some tests and had a fight to make a cgi handler 2024-04-13 15:12:29 i want to try to make some simple blog, and later i'll start adding bindings to sdl 2024-04-13 15:26:37 i only have a simple test i made for the html word 2024-04-13 15:26:40 https://termbin.com/zpoo 2024-04-13 15:28:06 which prints the html https://termbin.com/tt2i 2024-04-13 15:55:51 the only difference now is " is a complete word when reading, so i don't have to put a space, but i also can't define words like "S or ." because they would be taken as two different words 2024-04-13 15:56:00 same with ( for lists 2024-04-13 16:08:48 Interesting 2024-04-13 16:09:07 Are you going to put all the code in a web repo somewhere? 2024-04-13 16:10:32 it's just one file which is a perl module and a command that uses that module 2024-04-13 16:10:48 i should document it though 2024-04-13 16:11:42 but i'm not planning to use github or alike, at least not now 2024-04-13 16:12:42 rlwrap perl -I/home/vms -e 'use vms; vms::process_args()' -- "$@" 2024-04-13 20:36:33 question. :noname [ ( do you expect for there to be an xt on the stack here?) ] ... ; ( or here?) 2024-04-13 21:31:36 zelgomer: looking at the irc logs i see your question, but i don't understand and no idea if it was for me or in general 2024-04-13 21:32:46 if it's for me, i have no xt because i have no memory allocation, so my xt is just the name of a word with a quote, any word that expects code would execute it 2024-04-13 21:33:06 but a list would also work as code 2024-04-13 21:33:33 btw any hint about some kind of template system in forth? 2024-04-13 21:34:03 i'm thinking on making some sort of word that expects a string and performs some kind of templating 2024-04-13 21:34:40 the idea now is to just do something like: "this is some text in an html {red website}" 2024-04-13 21:34:59 my question was to the channel. when you sit down at a forth that has implemented :noname, what behavior do you expect to see? 2024-04-13 21:36:53 i would expect the word to leave the "lambda" on the stack 2024-04-13 21:37:10 once it is on the stack you can put it in the dictionary or whatever you want 2024-04-13 21:37:35 please read the question again 2024-04-13 21:38:04 :noname [ ( do you expect for there to be an xt on the stack here?) ] ... ; ( or here?) 2024-04-13 21:38:50 that is what i wrote 2024-04-13 21:43:31 i have no idea :D, let's see the ones who really know forth 2024-04-13 21:43:52 i'm trying to see examples of :noname, but i don't get it 2024-04-13 21:44:38 :NONAME DUP + ; CONSTANT dup+ for example 2024-04-13 21:45:24 what don't you get? 2024-04-13 21:48:33 the xt you're expecting 2024-04-13 21:48:52 i assumed you were asking where the new created xt should go 2024-04-13 21:48:56 but it's not 2024-04-13 21:49:14 what's not what? 2024-04-13 21:49:23 as for the example i understand the xt ends on the stack 2024-04-13 21:49:38 but this is not what you're asking for 2024-04-13 21:49:55 yes, is it pushed by :noname or after the definition is concluded with ; ? 2024-04-13 21:50:31 i'm not asking where the xt goes in memory, i'm asking where the xt is pushed in the sequence of parsing 2024-04-13 21:50:42 /when/, rather 2024-04-13 21:50:45 the semicolon is what ends the definition of :noname 2024-04-13 21:50:49 so it should be the one 2024-04-13 21:51:02 it has to be able to recognize we are in a :noname word 2024-04-13 21:51:26 that's what i'm asking. is it strictly necessary? what is the normal expectation? 2024-04-13 21:51:35 :NONAME DUP + ; CONSTANT dup+ 2024-04-13 21:51:42 that works either way 2024-04-13 21:52:06 the xt could have been pushed immediately after the creation of the anonymous word, before dup is parsed 2024-04-13 21:52:16 i assume after the ; but if you're asking is because you would like to have the xt present while defining the word? 2024-04-13 21:52:32 it's simpler to implement that way 2024-04-13 21:53:48 i guess you have to try the other forths and see if they leave the xt on the stack, but it seems like they won't 2024-04-13 21:54:39 sigh. 2024-04-13 21:55:02 i wouldn't expect that, and the documentation of the :noname word does not say anithing about 2024-04-13 21:55:08 anything* 2024-04-13 21:55:31 okay, i have one vote for "after the semicolon." i will await input from others 2024-04-13 21:55:36 as far as i understand, the xt is on the stack once ; executes 2024-04-13 21:55:48 got it, thank you 2024-04-13 21:55:55 but if you prefer the other way, i like the idea because you can write code that manipulates it 2024-04-13 21:56:25 http://lars.nocrew.org/forth2012/core/ColonNONAME.html 2024-04-13 21:58:14 This leaves the execution token for the word on the stack after the closing ; 2024-04-13 21:58:21 this is what gforth says 2024-04-13 21:58:28 https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Anonymous-Definitions.html 2024-04-13 21:59:00 i can't see any post where the xt is present after the semicolon 2024-04-13 21:59:09 they would mention it 2024-04-13 21:59:28 still, it's your forth, so if you like better the other way, you should go for it 2024-04-13 22:00:08 anyways i don't see much benefit from it, more than that you say it's easier that way 2024-04-13 22:00:47 i was asking for the opinion of other members of the channel, and you've chosen to flood the channel with blabber 2024-04-13 22:01:00 yeah, sorry 2024-04-13 22:03:07 no worries, kip will be here shortly to derail the topic with something completely unrelated to forth, anyway 2024-04-13 22:21:17 at least he is a nice guy