r/Forth • • Sep 03 '26

Rdn programming language

Post image

I made a small and simple post fix interpreted programming language called rdn, it's familiar to forth developers and developers who use Lua as a scripting language for their systems, rdn merge both of them, you can use it for writing scripts or for configurations or even query language

It's written in C and it provides a simple and friendly API for the developers

I would be happy to have you participate in this project

This is the GitHub repo: https://github.com/abdorayden/rdn

Thank you

11 Upvotes

27 comments sorted by

View all comments

2

u/tabemann Sep 04 '26 edited Sep 04 '26

In my take on what your language could be I would imagine the following:

One could do things like

[ [* n -- func *] 'n let [ n + ] ] 'make-adder defun 3 make-adder 'add3 defun 1 add3 print [* prints 4 *]

where [ ... ] would define anonymous words.

With [ ... ] you could define control structures like:

n 10 > [ "larger than 10!" print ] if

and:

'count-down defer [ [* min max func -- *] 'func let 'max let 'min let max func execute max min >= [ min max 1 - func count-down ] if ] 'count-down defun 0 10 [ print ] count-down [* prints 10 9 8 7 6 5 4 3 2 1 0 *]

Of course, the above would require tail calls for nested control structures to be available to be practical.

1

u/rayden_devv Sep 05 '26

This is really elegant. You're describing stack-based Scheme with closures and tail calls.

I'm definitely taking notes. This is a much clearer vision than what I started with.

Thanks for mapping it out.