learn

scriptresult

Overview

What is programming ?
What is Forth ?
Note on operating systems

Design

My instruction set differs from standardized Forth.

I think those changes were necessary to reduce the noise. Control structure words are not compiled, they create jumps. They better look like symbols than executed words.

Look at it this way, in the C language, the "if" statement really means to compare the value of an expression with 0. If I have to think about the real value that will be passed to "if", to calculate whether the following block will be executed, I might as well write it as such. Hence [0 for if-false and [1 for if-true. It is also shorter and has the mnemonic of a block, terminated with ]].

Another change is colon and semi-colon. They did too much at once. ":" used to parse the next word, define an entry and switch to compilation. Now, it only defines an entry. This allows to use the same technique to define variables and words. The semi-colon ";" is now used to update a definition for later inlining optimization.

In general, eliminating parsing (immediate) words is important, to simplify the language. A side-effect of this design choice is that strings are always put on the stack in the form "address length". That rule is only broken by single-quote ' and double-quote ".

Manual

For an in-depth look at logiqub hacking, consult the hacking book .