Direct Threading in TransForth

  Рет қаралды 5,059

Ashley Feniello

Ashley Feniello

Күн бұрын

Пікірлер: 15
@joshuadonahue5871
@joshuadonahue5871 8 ай бұрын
"the fifteen minute limit for KZbin" 😢 those were simpler times
@Gary190tube
@Gary190tube 11 жыл бұрын
That was actually beautiful to watch.
@laja131
@laja131 11 жыл бұрын
thanks, very informative!
@KotoOo
@KotoOo 2 жыл бұрын
omg, I've tried to implement that is JS, and we're ending up with pretty interpreter-style "compiler", ain't we? how could we say that the code is actually compiled, if there're memory addresses for each instruction of a colon-sys definition, and we're yet to find out where to execute per an instruction... I do believe that a real Forth machine performs all that work when it is facing a colon-sys word, and bundles up a machine code for it.
@0LoneTech
@0LoneTech 2 жыл бұрын
Just consider that the docol opcode switches to "all instructions are subroutine call" mode. The pointers are opcodeless instructions in that mode, and next is a return from subroutine. dosemi might be implemented as >r drop next. Include the colon mode flag in the return stack, and calls don't need to care whether the target routine uses colon or primitive mode. This is similar to how ARM activates Thumb instruction encoding. You could shortcut by recognizing that some subroutines have corresponding primitive behaviours, such as dolit=load immediate and dosemi=return. If those opcodes are known to be invalid as pointers, you could have a boundary between instructions and subroutine calls, and do away with the modes entirely. And then you could optimize by inlining words (particularly prim-next words like those shown here). The operations performed by docol, next and dosemi here are precisely what you'd see in some CPUs as enter, instruction fetch (not even an instruction itself, but a pipeline stage) and leave. So yes, the inner interpreter processing words here (next) is an interpreter, but an extremely simple one that could easily be the instruction decoder instead. It's no accident its variables were referred to as registers; the description is RTL, how we build hardware.
@Paylusche
@Paylusche 11 жыл бұрын
30 years ago i learned forth on apple II. where can i get?
@joshuadonahue5871
@joshuadonahue5871 8 ай бұрын
You have to implement it :)
@eliseulucenabarros3920
@eliseulucenabarros3920 4 жыл бұрын
link of blog ???
@briefcubing192
@briefcubing192 4 жыл бұрын
blogs.msdn.com/ashleyf
@briefcubing192
@briefcubing192 4 жыл бұрын
Also, github.com/AshleyF/TransForth
@eliseulucenabarros3920
@eliseulucenabarros3920 4 жыл бұрын
@@briefcubing192 thanks!!
@homelessrobot
@homelessrobot 4 жыл бұрын
i really don't understand the utility of having an instruction to increment the program counter. Why wouldn't this just happen automatically when control returns to the thing interpreting the instructions, like it does when a processor executes machine instructions? Seems really wasteful to not do something automatically that needs to be done for every non-branching/non-halting instruction anyhow.
@jhlagado1
@jhlagado1 3 жыл бұрын
The best way to understand this is to try to implement a machine yourself. in reality there are relatively few ways to do this. If you want to use the native machinery of the CPU, that's fine (it's called subroutine threading) but you will end up trading away other things and not necessarily be faster or as compact.
@encapsulatio
@encapsulatio 2 жыл бұрын
@@jhlagado1 Are there any web frameworks or web micro frameworks made in Forth?
FORTH - Better than BASIC?
14:30
NCOT Technology
Рет қаралды 40 М.
"Programming a 144-computer chip to minimize power" - Chuck Moore (2013)
40:13
Strange Loop Conference
Рет қаралды 13 М.
amazing#devil #lilith #funny #shorts
00:15
Devil Lilith
Рет қаралды 18 МЛН
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 137 МЛН
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 8 МЛН
GBForth: Using Forth to understand the Game Boy
29:31
FOSDEM
Рет қаралды 6 М.
Mecrisp Forth on STM32 Microcontroller (blue pill)
30:54
jephthai
Рет қаралды 22 М.
Stanford Seminar - Concatenative Programming: From Ivory to Metal
1:04:45
2022-03-26 --- Factor in 2022 --- John Benediktsson & Doug Coleman
58:01
Silicon Valley Forth Interest Group
Рет қаралды 5 М.
Ultimatic Squeeze Keying
13:22
Ashley Feniello
Рет қаралды 12 М.
A Little Bit of Forth (Jack)
19:37
thoughtbot
Рет қаралды 23 М.
Forth Programming Language - Shropshire LUG - Oct 2020
1:30:10
amazing#devil #lilith #funny #shorts
00:15
Devil Lilith
Рет қаралды 18 МЛН