12:04:29
##forth
<vms14>
I'm trying to stick more to a forth like this time, even without memory
12:04:52
##forth
<vms14>
it "pretends" to be a forth
12:05:24
##forth
<vms14>
for example now has the compiling state flag and immediate words have dual behavior
12:05:48
##forth
<vms14>
I got rid of all the lispy features, environments, lexical scope, evaluating lists, etc
12:06:04
##forth
<vms14>
now colon definitions are like in forth
12:06:17
##forth
<vms14>
: oh 1 2 3 ; : oh oh ;
12:06:29
##forth
<vms14>
it overrides and calls the first oh
12:07:02
##forth
<veltas>
vms14 have you looked up how indirect threading works?
12:07:06
##forth
<vms14>
if also works like in forth and can be nested. but I'm not too proud of it
12:07:17
##forth
<vms14>
veltas not really
12:07:19
##forth
<veltas>
Because you could implement ITC in javascript/perl/etc
12:07:28
##forth
<veltas>
And then it's a really classic Forth :P
12:07:32
##forth
<vms14>
but I wonder if it's what I'm doing
12:07:58
##forth
<veltas>
Well the ITC dictionary structure might be similar to what you're doing
12:08:20
##forth
<veltas>
The ITC 'threading' mechanism no, because that really requires machine code or arbitrary jumps
12:08:20
##forth
<vms14>
there are the primitives which are perl subroutines and colon words are a closure that will have a list of all the subroutines it uses and execute them
12:08:40
##forth
<veltas>
Yeah that's basically ITC layout
12:08:42
##forth
<vms14>
for example : oh 1 ; the 1 will be converted into a perl sub that will push that number
12:09:10
##forth
<vms14>
oh becomes a function that when executed just iterates its code list which is a list of subroutines
12:09:26
##forth
<vms14>
I have no memory, but variables work like in forth at least externally
12:09:38
##forth
<vms14>
variable oh 24 oh ! oh @
12:10:52
##forth
<vms14>
variable creates a hash table with two closures capturing a value { fetch => sub {}, store => sub {} }
12:10:52
##forth
<vms14>
! and @ just take that hash table as argument and execute either the fetch and store closure
12:11:03
##forth
<vms14>
so you can extend any kind of data type to be used with fetch and store by creating a hash table with two closures
12:11:18
##forth
<vms14>
I have r> and >r, but no return stack
12:11:36
##forth
<vms14>
is an auxiliar stack, do loop +loop work and push the index there so you can nest them and have I j k
17:40:17
##forth
<vms14>
what is the best resource you know about implementing forth?
17:40:27
##forth
<vms14>
or the one you recommend
17:41:33
##forth
<vms14>
I want to try implementing a proper one, even if it's in perl and the memory will be an array xd
17:47:45
##forth
<GeDaMo>
"MOVING FORTH Part 1: Design Decisions in the Forth Kernel"
17:51:46
##forth
<vms14>
ty GeDaMo
18:12:50
##forth
<pgimeno>
I learned a lot from the jonesforth tutorial, but it's quite specific to indirect threading and somewhat specific to assembler, so I guess it might not be of much help. It was for me because the Juppy uses indirect threading too.