Use of REXX to build CREXX - adesutherland/CREXX GitHub Wiki

An aim of the project is to implement as much of the CREXX Architecture as possible in REXX itself. To achieve this however core SYSTEM REXX facilities are needed (detailed below). These SYSTEM REXX facilities will be used to implement classic REXX and modernised REXX variations. Moreover OOREXX (and modernised variations) could also be implemented in SYSTEM REXX.

  • Stage 1 - REXX Standard functions will be implemented in SYSTEM REXX
  • Stage 2 - REXX Languages (Interpreters / Compilers) will be [re-]implemented in SYSTEM REXX

SYSTEM REXX Components

REXX Bytecode & Assembler

This includes an Assembler, Disassembler, Debugger and threaded bytecode interpreter. These will be implemented in C90 to make them as lightweight and as portable as possible. Although the Assembler & Disassembler could be implemented in REXX, a C implementation is preferred to avoid bootstrapping, and because there is no particular advantage for a REXX version.

Additionally, a REXX Assembler to LLVM IR Compiler will be needed for LLVM backends - this can be developed in SYSTEM REXX itself.

SYSTEM REXX Language

This includes a simplified REXX language to bootstrap the REXX language family implementations.

This language will need facilities to implement REXX lexing and parsing (for stage 2).

TASK - Define requirements / syntax

SYSTEM REXX Functions

These are fundamental functions that are needed to implement the standard built in REXX functions, and REXX compilers (stage 2), covering:

  • Variable access and manipulation (e.g. accessing a character in a string)
  • Base IO (e.g. simple POSIX Streams type capabilities)
  • Memory Access (TBC)
  • Maths
  • Lexing and Parsing (stage 2)

Note: The REXX Bytecode will directly support (i.e. have instructions that implement) the SYSTEM REXX Functions - there will be no separate SYSTEM REXX runtime library as such, although a library might be needed for compiler capabilities (stage 2) including AST and Symbol Tables.

TASK - Define requirements / syntax