HeadlinesBriefing favicon HeadlinesBriefing.com

R3forth: New Concatenative Language Inspired by ColorForth

Hacker News •
×

R3forth is a new concatenative programming language derived from ColorForth that compiles directly to native 64-bit code. Created by Pablo H. Reda, the language features a small core designed for direct OS interaction, real-time applications, and games. The project recently released a comprehensive 1,841-line tutorial covering everything from basic concepts to complete game examples.

Unlike traditional Forth implementations, R3forth compiles the entire program before execution rather than using an interactive REPL. The language uses a unique prefix system with eight different prefixes that determine how words are interpreted, including hexadecimal ($FF), binary (%1010), and address ('word) notations. The tutorial emphasizes that spaces define word boundaries and that words must be defined before use, as forward references are not allowed.

The language includes a predefined dictionary of approximately 200 words and features a clean module system where only exported definitions become visible when files are included. R3forth's design philosophy centers on stack-based execution using postfix notation, where operands come first followed by operators. The tutorial provides practical examples ranging from simple arithmetic operations to complete game implementations, positioning R3forth as a modern tool for developers seeking a fast, compact language with direct hardware access.