2024-10-04 01:57:42 found a forth in perl 2024-10-04 01:57:44 https://github.com/Bushmills/Perlforth/blob/master/perlforth#L6 2024-10-04 01:58:32 I assume most of you do not know perl, but it says like 30% is in forth code which you can see as a string at the start of the code 2024-10-04 01:59:09 I wonder how much of forth supports, it's a forth I can extend as much as I want since I do know perl 2024-10-04 01:59:59 can't you extend any forth as much as you want since you know forth? 2024-10-04 02:02:31 for me it would be cooler than using gforth 2024-10-04 02:05:26 you can try it with just perl that.file 2024-10-04 02:07:34 it's a bit broken I guess 2024-10-04 02:09:34 what cool forth implementations did you find? 2024-10-04 02:09:53 I see there is a forth in almost every programming language 2024-10-04 02:10:01 a "forth" 2024-10-04 02:21:06 https://github.com/fakedrake/awesome-forth-implementations 2024-10-04 04:09:42 it can be kind of confusing, but i now have a working virtual machine in forth with type tracking and relocations 2024-10-04 04:10:52 next i need to write some macros to start defining primitives in it, and then high level words built with those primitives 2024-10-04 04:11:25 then i can write the outer interpreter loop we all know and love, but it will be capable of cross compiling itself 2024-10-04 04:15:33 well, then i'll have to write the back end interface to actually do any cross compiling, of course, but compared to what i've done so far i think that will be the easy part 2024-10-04 22:11:24 zelgomer: congratulations!!! 2024-10-04 22:12:37 you may run into things down the road that are harder than you think. but don't give up! That's just a thing that happens 2024-10-04 22:13:29 oh, every day i think of new tricky things 2024-10-04 22:14:06 sometimes if you keep thinking about them you will find non-tricky alternatives 2024-10-04 22:14:11 or try hacking on them 2024-10-04 22:14:47 like today's, it occurred to me that a lot of relocations will just point to data that was created with "create", but the word itself is never used at runtime. in that case, it would be nice for the back end to know that it only needs to compile the data and not the execution token. 2024-10-04 22:15:27 headers are the immediate example of this 2024-10-04 22:26:23 because the word is used at compile time only? For example, to put a pointer to the created data into some other created data? 2024-10-04 22:29:11 right. i now have four object types: ints, raws (cells that were filled using c!), relocations, and xts. any time you create data, it begins with an xt object; it's effectively its code field. relocations are tree nodes describing how an address is transformed, with the root of all branches always ending in an xt. 2024-10-04 22:31:18 the xt is used to define interpretation behavior or how it should be compiled, or any other metadata i will need for it. but yeah, consider the header for a word foo: [][link][body][count][name] 2024-10-04 22:32:04 the leading is the code field (or metadata field or whatever you want to call it) for the header itself, the body field is the xt for foo 2024-10-04 22:32:21 I see 2024-10-04 22:32:26 but what gets linked into the dictionary is a relocation describing + 1 cell 2024-10-04 22:32:56 that relocation still points to , it has to, because that will be what defines the host and target addresses. but the the code field itself is actually never needed at runtime 2024-10-04 22:34:33 it wouldn't hurt anything for it to be compiled as an anonymous create word, it's just a waste of space :) 2024-10-04 22:38:05 right