← System overview

EXECUTION / PROFESSIONAL

Java

Run MV BASIC programs and subroutines as Java using a three-stage strategy selected for each item.

01 / SELECTION

The simplest correct form wins.

Programs and subroutines use the same selection pipeline. RightMV classifies the MV BASIC source, generates a candidate, compiles it, and promotes the first candidate that preserves the item's flow.

  1. 01
    STRUCTUREDOrdinary Java control flow

    Direct translation is preferred when labels, branches and subroutine flow can be expressed as normal Java methods, loops, conditionals and returns. If the candidate compiles cleanly, it becomes the executable class.

  2. 02
    ENHANCEDJava plus ASM GOTO/GOSUB flow

    When ordinary structure is insufficient, the translator emits flow markers. After Java compilation, ASM replaces those markers with real JVM labels, branches, GOSUB continuations and return dispatch. The result is still a normal JVM class.

  3. 03
    EMULATEDState-machine fallback

    If neither earlier candidate can be promoted, RightMV emits a program-counter state machine. It is the widest compatibility layer for irregular legacy flow and is selected only when the simpler forms cannot represent the item safely.

02 / WHAT GETS RUN

One Java method, three internal shapes.

MV BASIC PROGRAM or SUBROUTINE

        ├─ STRUCTURED compiles? ── yes → run class

        ├─ ENHANCED + ASM works? ─ yes → run class

        └─ EMULATED state machine ─────  → run class

03 / .ENV CONTROLS

Selection is observable and configurable.

These environment properties control whether Java translation participates, whether Enhanced flow is available, where Java sits in the runtime order, and how individual items can be excluded.

javaRun what already exists.

The Java provider looks for a compiled class that is already available for the program or subroutine. If it finds one, it loads and runs it. It does not translate MV BASIC and declines the item when no class is available.

translatorTry to create the class.

The Translator provider takes the MV BASIC source through Structured, Enhanced and then Emulated generation. It compiles and promotes the first valid candidate. If all three fail, execution continues to the next configured method.

PropertyTypical valueEffect
MVDB_TRANSLATED_BASIC_ENABLEDfalseAllows missing catalogued BASIC items to be translated and compiled into Java.
MVDB_TRANSLATED_BASIC_BYTECODE_FLOW_ENABLEDtrueAllows the Enhanced candidate and its ASM bytecode-flow transformation.
MVDB_EXECUTION_ORDERjava,translator,mvb,sourceSets provider priority. java only runs an available compiled class; translator tries to create one; MVB and Source remain later fallbacks.
MVDB_NO_JAVAemptyComma-separated deny list for Java by item, file/item, account/file/item or account.file.item.
MVDB_TRANSLATION_FAILURE_CACHE_SIZE1024Bounds the source-hash failure cache so repeatedly failing items are not retranslated on every call.
MVDB_LOG_JAVAoffEnables Java execution and translation diagnostics in the configured logs.