Welcome to Ripen, a stack-based scripting engine with highly readable syntax, that can be implemented with little code and effort in a language like C++ or Nim. It's informed by RetroForth and PostScript, but diverges from either in important ways, not least due to its string-threaded nature.

Ripen is based on principles explained in the article More About Tiny Scripting Engines. The point is having a single-file engine, easily copy-pasted into any application. For this reason, the default vocabulary is kept small. See the language overview for more details, but for a quick start try:

	( Hello, world! ) .. cr
	3 2 + 3 2 * < . cr

(In the web version, nothing is printed out until you use cr.)

News

20 July 2023
Version numbers were unified across ports, and compatibility improved.
2 March 2023
C++ port has been refreshed and relicensed.
1 March 2023
Nim port has been revived and relicensed; see below.
10 February 2022
Ripen was ported to C++ as "version 2.0".
20 December 2021
There's now an offshoot called Guava, by eli.
11 May 2021
Ripen (1.0) is used as the scripting language of Tipsy Turtle.

Beware that version 3.0 introduced breaking changes. Check the documentation.

The web page was upgraded to Console Form 2.0; documentation was updated.

Download

C++ port version 3.0 beta (2023-07-18); Boost Software License:

Nim port version 3.0 beta (2023-07-19); MIT License:

All archives include documentation + examples. See also:

Building and running

Ripen has multiple implementations; notes and/or build scripts are included with each source archive.

Binaries are built on a Debian 10 machine, and seem to have decent compatibility with other / older distributions. No promises.

Performance

The C++ port of Ripen is smaller but also slower than the Nim port. An informal test was performed with a modified version of the Rugg/Feldman benchmarks (#5), ported like this (yep, it's a one-liner):

:nop ; { $i 2 / 3 * 4 + 5 - =a nop } 1000 times $a . cr

While timings for this are hard to get on a modern PC, Ripen appears to be faster than Python 2.7, and even Tcl. Of course, both are much more complex.

Differences between versions

In the JS version, everything goes on the stack: numbers, strings and lists / code blocks. In C++ and Nim, lists and strings go to their own memory areas. That requires a number of additions, like the ? sigil used to show the definition of a user-defined word, and .. to display the contents of the scratch pad.

The C++ port only defines included in the stand-alone interpreter.

The JS port has alert, confirm and prompt words, but not included or bye.

Frequently Asked Questions

What do you have against parsing words?
Nothing at all! My very first Forth interpreter, that I made in 2009 for a tutorial, had parsing words and even quoted strings. This time I simply wanted to try something different after seeing RetroForth.
Does Ripen count as single-file anymore? The C++ code consists of two files.
The library proper is still just one file, ripen.hpp; the other one is a demo driving app so you can see that it works, and how to use it in your own projects.

Roadmap

Version 4.0(?)

Main goal: find ways to make the language more immediately useful.

Support

Questions and feedback are welcome. All archives include contact information. See my homepage as well.

If you like Ripen, please see on the blog for how to support me.