19. Licensing


19. Licensing

This chapter describes how the files of the RVM are licensed: which files are under the Apache License 2.0 and which under the Common Public License 1.0 (CPL), why, what a new file must carry, how the generators keep the CPL header in what they write, and the third-party texts the RVM contains. It ends with the full per-file table, checked against the header of every file. It assumes nothing beyond the overview. It describes the state of the files; it is not legal advice, and the question listed at the end is for the owner and the Rexx Language Association to decide.

The model

Licence Copyright holders
Default (own work) Apache License 2.0 Josep Maria Blasco
Files derived from ooRexx CPL 1.0 IBM Corporation (1995, 2004), Rexx Language Association (2005-2026), Josep Maria Blasco (modifications)
Third-party texts inside a file their own (see glibc) their authors
  • The RVM lives in bin/modules/rvm/ of the Rexx Parser tree but is distributed apart from it (as rvm.zip; the Parser's .gitignore excludes bin/modules/rvm). It carries its own ../NOTICE, a copy of the Apache License 2.0, ../LICENSE, and a copy of the CPL, ../LICENSE-CPL. The Parser's own NOTICE says that the RVM is not part of that repository and has its own NOTICE.
  • ../NOTICE is the authoritative list. It states that the RVM is Apache 2.0 "except for the files listed below, which are derived from ooRexx", lists each CPL file with the ooRexx code it derives from, and records the reproduced ooRexx output, the glibc texts, the licence of the tests and of this documentation, and the status of ooRexx's test suite (used for verification, not distributed).
  • A file is under the CPL as a whole, never in part: a file that contains a port of some ooRexx code next to code of its own is CPL entirely, and says so in its header.
  • Every CPL source file says so in its own header, with the ooRexx files it derives from. Generated files get the same header from their generator (below). The two .rcode files cannot carry a header and are covered by NOTICE alone, which lists them as CPL (R-code generated from CPL sources).
  • ../LICENSE is the Apache License 2.0 text (the same file as the Rexx Parser's LICENSE); NOTICE refers to it and to the Apache URL. ../LICENSE-CPL is the literal CPL 1.0 text as ooRexx distributes it (CPLv1.0.txt in ooRexx's trunk).
  • Every header says that the file is part of "the RVM, the Rexx Virtual Machine", and a CPL header that the Apache License "covers the rest of the RVM (see NOTICE)". The copyright line of the RVM's own work, and of its modifications of ooRexx code, is Copyright (c) 2026 Josep Maria Blasco (with the e-mail address in source headers; Modifications Copyright (c) 2026 Josep Maria Blasco in NOTICE and in the boxes of the preludes).
  • Tests. The programs of smoke/cases/ and of the suites in tests/ are the RVM's own (Apache). The expected outputs of smoke/cases/ (*.out, *.err, *.rc) were produced by native ooRexx and contain ooRexx's error and message texts, which are ooRexx's (CPL); the hand-written expected outputs of tests/e2e/cases/ contain such texts too. NOTICE says so; the files themselves carry no header (they are compared byte for byte).
  • Documentation. doc/ is Apache 2.0; README.md says so for every chapter, and NOTICE too. The chapters quote short ooRexx error and message texts and name ooRexx files and functions.

What makes a file CPL

The RVM is written against native ooRexx as the oracle: behaviour is probed, and the ooRexx sources (C++ and Rexx) are read to understand it. Most of the code is architecture of its own with no counterpart in ooRexx (the compiler to R-code, the stack machine, the activity scheduler, the object world, the Node and browser hosts) and is Apache 2.0. A file is CPL when it contains at least one of:

Kind Meaning Examples
Translated an ooRexx algorithm ported on purpose, so that results match bit for bit (same steps, same order, often "line for line") the decimal arithmetic (NumberStringMath.cpp), the stem tail tree (CompoundVariableTable.cpp), PARSE (RexxTarget), FORMAT, DATE/TIME parsing, RANDOM's generator, Array's merge sort, the hash and List orders, RexxBehaviour and the building of class behaviours, the stream methods, hostemu's Bison parser, rxregexp's automaton, rxsock's C side, rxqueue
Copied ooRexx text included literally CoreClasses.orx, StreamClasses.orx, the error message texts of rexxmsg.xml / ERRORTEXT
Generated produced by a tool from a translated or copied file the .rcode of the preludes, rvm-prelude*.mjs, rvm-data.mjs

What does not make a file CPL:

  • Reproducing behaviour learned by probing. Code written from the observed output of rexx (error numbers, their order, trace formats), from rexxref or from ANSI is own work.
  • Using ooRexx. The ooRexx host runs on ooRexx: it uses its collection classes, its .Stream, its rxmath and rxregexp libraries at run time. That is use, not derivation; this is why ../RVM.RxMath.cls and ../RVM.RxRegExp.cls (which call the host's library) are Apache while their JavaScript counterparts ../js/rxmath.mjs and ../js/rxregexp.mjs (which reimplement the C++) are CPL. The same holds for RVM.HostFile in ../RVM.Host.cls (Apache: an ooRexx .Stream underneath) against ../js/hostfile-node.mjs (CPL: it reproduces what StreamNative and SysFile do).
  • Reading ooRexx sources that are not distributed. The ooRexx sources consulted and ooRexx's test suite (ooTest) are not part of the RVM.

A JavaScript file that ports an ooRexx-host file inherits its category: where the Rexx file translates ooRexx, the JS file translates the same translation.

Rule for new files

  1. A file written from behaviour, documentation or design of its own: the Apache header (template below).
  2. A file that translates or copies any ooRexx code or text, even a small, well-delimited part: the CPL header for the whole file, naming the ooRexx files it derives from, and a line in ../NOTICE under "Files under the Common Public License 1.0", with the same origin. Tell the owner.
  3. A JS port of a CPL Rexx file is CPL if it ports the CPL part; a JS port of only the own parts of a CPL file is Apache (e.g. ../js/bifs-stream.mjs, the stream part of ../RVM.BIFs.cls).
  4. A generated file whose content comes from ooRexx gets the CPL header from its generator, never by hand; the generator itself stays Apache.
  5. Text from a third party that is not ooRexx goes into NOTICE under "Third-party texts", with its licence.
  6. Output that the RVM prints because ooRexx prints it (a banner, a message) goes into NOTICE under "Output reproduced from ooRexx".

Apache header (Rexx comment box; JS files use the same box, shell files the same lines as # comments):

/* This file is part of the RVM, the Rexx Virtual Machine                     */
/* [See https://rexx.epbcn.com/rexx-parser/]                                  */
/*                                                                            */
/* Copyright (c) 2026 Josep Maria Blasco <josep.maria.blasco@epbcn.com>       */
/*                                                                            */
/* License: Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0)  */

CPL header (as in ../RVM.HostEmu.cls):

/* This file is part of the RVM, the Rexx Virtual Machine                     */
/* [See https://rexx.epbcn.com/rexx-parser/]                                  */
/*                                                                            */
/* This file is derived from the ooRexx interpreter: hostemu (hostemu.cpp,    */
/* cmdparse.ypp, cmdparse.cpp). It is therefore distributed under the Common  */
/* Public License v1.0, not under the Apache License 2.0 that covers the      */
/* rest of the RVM (see NOTICE).                                              */
/*                                                                            */
/* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved.             */
/* Copyright (c) 2005-2026 Rexx Language Association. All rights reserved.    */
/* Copyright (c) 2026 Josep Maria Blasco <josep.maria.blasco@epbcn.com>       */
/*                                                                            */
/* This program and the accompanying materials are made available under the   */
/* terms of the Common Public License v1.0 which accompanies this             */
/* distribution. A copy is also available at the following address:           */
/* https://www.oorexx.org/license.html                                        */

The licence block follows the file's description, inside the title box (see maintaining). In files with a long description it is far from the top (as in RVM.BIFs.cls, RVM.Commands.cls and rvm.rex): search for License: or Common Public License rather than looking only at the first lines. Markdown files (js/README.md, smoke/README.md, tests/README.md) carry a short Apache footer instead; doc/README.md's footer covers every chapter of doc/.

Generators that write the CPL header

Generator (Apache) Writes Header in the output
../makeprelude.rex CoreClasses.orx ../prelude.orx CoreClasses.orx's own prolog is kept, and with it ooRexx's copyright and licence box (IBM, RexxLA, CPL, plus the BSD-style redistribution conditions ooRexx's .orx files carry), with two lines added by MarkBox (below). prelude-rvm.orx is appended with its own CPL header.
makeprelude.rex StreamClasses.orx streams ../prelude-streams.orx The prolog is blanked, but the leading copyright box of StreamClasses.orx is kept (header = streams), with the same two lines.
rvm -l (the compiler's cache) prelude.orx.rcode, prelude-streams.orx.rcode None: the R-code format has no comments (R-code). Covered by NOTICE.
../js/genprelude.rex ../js/rvm-prelude.mjs, ../js/rvm-prelude-streams.mjs CPLHeader: a box naming the file, its source .orx and the CPL; IBM, RexxLA and JMB copyright lines; the CPL paragraph; DO NOT EDIT DIRECTLY.
../js/gendata.rex ../js/rvm-data.mjs CPLHeader (a copy of the same routine), naming the error texts (ooRexx's ERRORTEXT) as the reason.

rvm-data.mjs also contains BIF_INFO, the argument signatures of the built-in functions, taken from the Parser's BIFs.cls (Apache, same author); the file is CPL as a whole because of the messages. The two copies of CPLHeader (in genprelude.rex and gendata.rex) must be kept identical by hand. Regenerating any of these files keeps its header; editing the header in an output is lost at the next generation.

The copyright years in the ooRexx boxes kept by makeprelude.rex are those of the ooRexx source they were cut from (prelude.orx: RexxLA 2005-2026; prelude-streams.orx: RexxLA 2005-2024). After the RexxLA line, MarkBox adds Modifications Copyright (c) 2026 Josep Maria Blasco and "Derived from ooRexx's CoreClasses.orx (StreamClasses.orx) and modified for the RVM."; to keep every later line at its number, it takes out as many blank lines of the box. The generated .mjs files carry their own CPL header.

Output reproduced from ooRexx

To behave as ooRexx does, the RVM prints some texts that ooRexx prints; NOTICE records them:

  • the banner of rxmath's MathLoadFuncs, with its line "Copyright (c) 2005-2021 Rexx Language Association." (in ../RVM.RxMath.cls and ../js/rxmath.mjs);
  • hostemu's parse error message, hostemu: bad PLIST, token "syntax error".

The error message texts are not in this list because they are not reproduced output but copied tables, and the files that hold them are CPL.

Third-party texts: glibc

../js/rexxutil.mjs (STRERROR, used by SysGetErrorText, errno 0-133) and ../js/hostfile-node.mjs (ERRNO_TEXT, the errtext of a failed file operation) contain the texts of the system error numbers as the GNU C Library's strerror gives them, so that the JavaScript RVM reports errors as ooRexx does on Linux. glibc is under the LGPL 2.1 or later; NOTICE attributes them under "Third-party texts". The ooRexx host does not contain them: it takes the texts from the running system (SysGetErrorText calls the host's REXXUTIL; streams get them from ooRexx's .Stream).

js/rexxutil.mjs also reads glibc message catalogs (the catopen/catgets file format, for SysGetMessage) and implements fnmatch semantics for SysFileTree; both are written from the documented behaviour and contain no glibc text, and NOTICE does not mention them.

Per-file table

Columns: Header is the licence the file's own header (or footer) states; Expected is what NOTICE and the rules above give; Derived from is the ooRexx source named in the header (or, for an Apache file, what it is related to without being derived). A = Apache 2.0, C = CPL 1.0, — = no licence statement. A row marked ⚠ is part of the open question.

ooRexx host and shared files

File Header Expected Derived from (ooRexx)
NOTICE — — (the licence statement itself)
LICENSE A (the text) A — (the Apache License 2.0, literal)
LICENSE-CPL C (the text) C ooRexx CPLv1.0.txt, literal
rvm (launcher) A A —
rvm.cmd (launcher, Windows) A A —
rvm.rex A A —
RVM.Compiler.cls A A —
RVM.Machine.cls A A — (imitates outputs of RexxActivation, Activity; not their code)
RVM.BaseContext.cls C C CompoundVariableTable.cpp, ParseTarget.cpp (RexxTarget); execution-state behaviour
RVM.Objects.cls C C RexxBehaviour, MethodDictionary, ClassClass.cpp; the classes of ooRexx, method by method
RVM.Number.cls C C NumberStringMath.cpp, NumberStringMath2.cpp, NumberStringClass.cpp, IntegerClass.cpp
RVM.BIFs.cls C C NumberStringClass.cpp (FORMAT), RexxDateTime.cpp (DATE/TIME), BuiltinFunctions.cpp (RANDOM), rexxmsg.xml (message texts)
RVM.Stream.cls C C StreamNative.cpp, StreamCommandParser.cpp
RVM.Commands.cls A A —
RVM.Host.cls A A — (RVM.HostFile uses ooRexx's .Stream)
RVM.RexxUtil.cls C C RexxUtilCommon.cpp, StemClass.cpp (SysStemSort)
RVM.RxMath.cls A A — (calls the host's rxmath; prints rxmath.cpp's banner)
RVM.RxRegExp.cls A A — (calls the host's rxregexp) ⚠
RVM.RxSock.cls C C rxsock.cpp, rxsockfn.cpp, rxsock.h ⚠
RVM.HostEmu.cls C C hostemu.cpp (GrxHost), cmdparse.ypp, cmdparse.cpp
makeprelude.rex A A — (generator)
prelude.orx C (ooRexx box) C CoreClasses.orx (cut) + prelude-rvm.orx
prelude-streams.orx C (ooRexx box) C StreamClasses.orx (cut)
prelude-rvm.orx C C ArrayClass.cpp (merge sort)
prelude.orx.rcode — (by NOTICE) C generated from prelude.orx
prelude-streams.orx.rcode — (by NOTICE) C generated from prelude-streams.orx
rxqueue/rxqueue.rex C C rxqueue.cpp
rxqueue/rxqueue (launcher) A A —
smoke/smoke.rex A A —
smoke/timeout.mjs A A —
smoke/README.md A (footer) A —
smoke/smoke-select.py A A —
smoke/cases/*.rex (148), *.cls (4) — (by NOTICE) A — (the RVM's own test programs)
smoke/cases/*.out, *.err, *.rc (148 each) — (by NOTICE) A, with ooRexx's texts (C) output of native ooRexx (*.err holds ooRexx's error texts)
smoke/cases/*.live (4) — — empty marker files
tests/ scripts (check.sh, env.sh, */*.sh, fuzz/*.rex, *.py) A A —
tests/README.md A (footer) A —
tests/*/cases/ programs (*.rex, *.REX, *.cls, inputs) — (by NOTICE) A — (the RVM's own test programs)
tests/e2e/cases/*.expected, *.expected-err — (by NOTICE) A, with ooRexx's texts (C) expected output where the RVM differs on purpose; quotes ooRexx's error texts
tests/ootest/*.tsv — (by NOTICE) A — (names the groups and tests of ooRexx's test suite)
doc/*.md (this documentation) A (doc/README.md footer; NOTICE) A — (describes ooRexx internals and quotes its messages)

JavaScript host (js/)

File Header Expected Derived from (ooRexx)
js/rvm (launcher) A A —
js/rvm.cmd (launcher, Windows) A A —
js/rvm.mjs A A —
js/runner.mjs A A —
js/rvm-browser.mjs A A —
js/compiler.mjs A A —
js/machine.mjs A A —
js/rcode.mjs A A —
js/errors.mjs A A —
js/files.mjs A A —
js/libraries.mjs A A —
js/bifs.mjs A A —
js/bifs-stream.mjs A A — (ports the own, stream part of RVM.BIFs.cls)
js/host-node.mjs A A —
js/host-browser.mjs A A —
js/sockets-node.mjs A A — (plumbing to the worker) ⚠
js/context.mjs C C CompoundVariableTable.cpp, ParseTarget.cpp (RexxTarget)
js/objects.mjs C C RexxBehaviour, MethodDictionary, ClassClass.cpp; ArrayClass.cpp, ListContents.cpp, QueueClass.cpp, HashContents.cpp, getStringHash (StringClass.hpp)
js/number.mjs C C as RVM.Number.cls
js/bifcore.mjs C C rexxmsg.xml (message texts)
js/bifs-number.mjs C C NumberStringClass.cpp (FORMAT)
js/bifs-system.mjs C C RexxDateTime.cpp, BuiltinFunctions.cpp (RANDOM)
js/streams.mjs C C StreamNative.cpp, StreamCommandParser.cpp
js/hostfile-node.mjs C C StreamNative.cpp, SysFile.cpp, SysFileSystem.cpp; + glibc texts
js/rexxutil.mjs C C RexxUtilCommon.cpp, StemClass.cpp, StringUtil.cpp, SysFileSystem.cpp, SysFile.cpp; + glibc texts
js/rxmath.mjs C C rxmath.cpp, NumberStringClass.cpp (formatting of doubles)
js/rxregexp.mjs C C rxregexp.cpp, automaton.cpp, dblqueue.cpp ⚠
js/rxsock.mjs C C rxsock.cpp, rxsockfn.cpp, rxsock.h
js/sockets-worker.mjs C C rxsock.cpp, rxsockfn.cpp
js/hostemu.mjs C C hostemu.cpp, cmdparse.ypp, cmdparse.cpp
js/rvm-prelude.mjs C (generated) C CoreClasses.orx via prelude.orx
js/rvm-prelude-streams.mjs C (generated) C StreamClasses.orx via prelude-streams.orx
js/rvm-data.mjs C (generated) C ooRexx ERRORTEXT; also the Parser's BIF_INFO (Apache source) ⚠
js/genprelude.rex A A — (generator; writes CPL)
js/gendata.rex A A — (generator; writes CPL)
js/README.md A (footer) A —
js/rxqueue/rxqueue (launcher) A A —

Every file whose header states the CPL appears in NOTICE's list, and every file in that list states the CPL in its header, except the two .rcode files, which cannot. No file's header contradicts NOTICE.

Design notes

  • Whole files, not parts. A file with a ported part is CPL as a whole. The alternative, moving each ported part (the stem tree, ParseTarget, Behaviour, FORMAT/DATE/RANDOM, the collections of js/objects.mjs...) into a CPL file of its own so that the rest stays Apache, was judged not worth a mechanical refactor of both hosts and a full test run, and would break the one-to-one correspondence between Rexx and JS files (source map).
  • The streams are CPL. Their model (a file with one offset, sticky EOF, errno) is the RVM's own, but the methods of Stream follow StreamNative.cpp closely (states, DESCRIPTION texts, the parsing of STREAM commands, the order of errors). Where it was doubtful, the CPL was chosen.
  • Ported, not merely imitated. The CPL is applied where the goal was to reproduce an algorithm exactly, so that results agree bit for bit (the decimal window of DIGITS+1, the order of hash buckets, the comparisons of a merge sort, the LCG of RANDOM). Matching outputs without following the algorithm (error numbers and their order, trace formats) does not count.
  • Generators write the header. A hand-added header on a generated file would vanish at the next regeneration; the header lives in the generator.
  • NOTICE is the single list. Headers say what each file derives from; NOTICE lists all of them in one place, with the reproduced outputs and the third-party texts, because a distribution (rvm.zip) must state its licences in one place.
  • The JavaScript glibc tables exist because Node offers no strerror; the ooRexx host asks its system and has none.

Known gaps

  • The R-code format has no comment or licence line, so the two .rcode preludes carry no licence statement of their own; NOTICE lists them as CPL.

Classification of the borderline files

These follow the rules above; they are recorded because the line is drawn by the extent of the ported code, not by the subject:

  • rxregexp and rxsock on the ooRexx host. RVM.RxRegExp.cls is Apache: it calls the host's rxregexp, and its argument checks and errors are written to match the native's. RVM.RxSock.cls is CPL: it does the argument, stem and variable handling as rxsockfn.cpp does, and calls the host's rxsock for the sockets. js/rxregexp.mjs, which reimplements the automaton, is CPL.
  • Sockets on Node. js/sockets-node.mjs (the synchronous bridge to the worker) is Apache; js/sockets-worker.mjs, which implements rxsock's C side, is CPL.
  • js/rvm-data.mjs is CPL as a whole because of ooRexx's messages, although BIF_INFO comes from the Parser's Apache BIFs.cls (same author).
  • Reproduced outputs. The rxmath banner (with RexxLA's copyright line) and hostemu's message are printed by Apache and CPL files alike; NOTICE records them under "Output reproduced from ooRexx".
  • glibc. The strerror tables are attributed in NOTICE (LGPL 2.1 or later); the headers of js/rexxutil.mjs and js/hostfile-node.mjs mention glibc in comments, and NOTICE is the licence statement.

Open questions

For the owner and the Rexx Language Association to decide; nothing here is a recommendation.

  1. Review by RexxLA. The classification (which files are CPL, the borderline files above, the treatment of ooRexx's texts in the expected outputs of the tests and in this documentation) has not been reviewed by RexxLA.