User:Deltayelta/Dredge

From Esolang
Jump to navigation Jump to search
Dredge
Paradigm(s) imperative
Designed by User:Deltayelta
Appeared in 2025
Memory system unbounded counters
Dimensions one-dimensional
Computational class Unknown
Reference implementation Unimplemented
Influenced by LOOP, FlooP
File extension(s) .drg

Dredge is an an extension of the LOOP programming language, intended to make it Turing-complete.

Description

The only major change from LOOP is in the semantics of the LOOP statement.
In LOOP (the language), a LOOP statement of the form LOOP x DO P END will run the procedure P the number of times equal to the value of x before the LOOP statement, where the number of times the procedure P is run will not change, even if the value of x changes in P.
In Dredge, however, when the value of x is changed, the number of times P will be run also changed.

This can be thought of as each LOOP statement having its own counter, where the counter is set to the value of x before the statement, and decreases by 1 for each time P runs.
(Note: In this sense, each LOOP statement is similar to C's for loop.)

For example, in the LOOP language, the following program would set x0 to 2, while in Dredge it would be an infinite loop:

x0 := 0;
LOOP x0 DO
    x0 := x0 + 1
END

(Note: Subscripts and bold text added for readability. In an actual program, x0 would be written x_0.)

There are no implements for indirect addressing, so "useful" programs could possibly use Gödel numbering for storage or some sort of preprocessor.