Skip to content

defini7/URM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cutland URM (Unlimited Registers Machine)

Implementation details

  1. Registers are 0 indexed
  2. Lines are indexed starting from 1
  3. Rope is self-expandable

Syntax

In Cutland's URM we would write

J(1,2,3)

but here we would write

J 1 2 3

Example

#include "urm/urm.h"

int main()
{
    const TextBuffer code = read_file("examples/sum.urm");
    Rope rope = {0};

    rope_set(&rope, 0, 5);
    rope_set(&rope, 1, 2);

    urm_exec(&rope, &code);

    assert(*rope_get(&rope, 0) == 7, "5 + 2 != 7");
}

References

  • "Computability: An Introduction to Recursive Function Theory" by Nigel Cutland

About

Cutland's URM implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published