Examples of custom control flow compilation words

Forth famously allows users to alter the language by defining new words for control flow (beyond those given by the standard: DO, LOOP, BEGIN, UNTIL, WHILE, REPEAT, LEAVE IF, THEN, ELSE, CASE, ENDCASE, etc.) Are there common examples of people actual

Can a Forth-like language be implemented with a single stack?

Forth has a stack and a return-stack. As far as I understand, the point of the return-stack is to store the previous values of the program counter. C programs put the previous value of program counter on the stack, and use no return stack. Does Forth

Debug using a test harness

I would like to use a simple test harness to test my code during debugging using the same methodology as the Forth test harness developed by John Hayes. The concept is to define a function, say my+ and then to define simple code snippets that will te

Forth: Portable undefined loop with multiple exit points

I need to implement an idefinite loop with multiple exit points. Unfortunately the most obvious solution - REPEAT - UNTIL with multiple WHILE doesn't work neither in Gforth nor in swapforth (Of course the loop in the example below may be implemented

Does Forth support multithreading?

I had a short look at the Forth programming language for a while. Is it possible to do multithreading with synchronization primitives in Forth? For example, is it possible to do n-by-n matrix multiplication with multiple threads in Forth? If so, what

Is it possible to call the Windows API from Forth?

In C/C++, Windows executables are linked against static libraries that import DLL files containing Windows API procedures. But how do we access those procedures from Forth code (e.g. GForth)? Is it possible at all? I'm aware that there's Win32Forth c

Forth Editor / Customizable Editor

I'm looking for an OS X editor (preferably a dedicated Forth editor, but I doubt it exists) that has/can be customized to change the font color of Forth variables, programs, etc. If not, is there any sort of workaround?UltraEdit has a Forth syntax hi

Function pointer array in C

I'm doing a Forth interpreter in C. I can't decide how to better implement the Forth dictionary. struct Word { struct Word* next; char* name; int* opcode; // int arg_count; } struct Dictionary { struct Word words; int size; } opcode is a sequence of

Accept user input for a variable

So, this should be an easy question for anyone who has used FORTH before, but I am a newbie trying to learn how to code this language (and this is a lot different than C++). Anyways, I'm just trying to create a variable in FORTH called "Height"

How to encode an application in Forth (or Factor)?

I'm potentially interested in exploring a stack-based language like Forth (or Factor). What I'd like to see is how an application might be built from the ground up, step by step. The tutorials I've found are rudimentary and are not helping me to unde

Programming languages ​​implemented in assembly language

Recently I've stumbled upon JONESFORTH, which is an interpreter for the Forth programming language implemented in plain assembly language. I find this implementation interesting, because it shows how a language can be implemented in assembly language

Which one to start wearing?

I'm looking to develop a new Forth system, aimed at making game development easier on one or possibly several retro console platforms. I'm something of a Forth beginner, and need your help deciding which Forth codebase to start porting from. I'm basi

Is it still used? If yes, how and where?

A long time ago I remember thinking that the Forth programming language was pretty cool. I really haven't heard anything about it in years. Is Forth still in use? If so, what types of applications is it being used for?It's still in use by people like

Square root function in Forth using x86 assembly?

I don't know much about assembly, but I am pretty sure that there are square root instructions on the x86? I am trying to get a square root function to work well in froth and the one that I have found gets bogged down somehow when I run it many times

Fourth performer in Java

Here I found a Simple Forth Interpreter implemented in Java. However I don't understand the significance of it if I want to use it? What could be the advantage of the Forth Interpreter: If the final compiled code to be executed by the JVM is still "B

What are the primitive operators Forth?

I'm interested in implementing a Forth system, just so I can get some experience building a simple VM and runtime. When starting in Forth, one typically learns about the stack and its operators (DROP, DUP, SWAP, etc.) first, so it's natural to think