27 Commits
Author SHA1 Message Date
Eremey Valetov ff7babdec9 Harden runtime and notebook integration and publish documentation
Verify and publish documentation / test (macos-latest) (push) Canceled after 0s
Verify and publish documentation / test (ubuntu-latest) (push) Canceled after 0s
Verify and publish documentation / docs (push) Canceled after 0s
Verify and publish documentation / deploy (push) Canceled after 0s
Validate physical cards and CLI arguments, guard live DO cells, and share
word encoding and checked numeric conversion. Preserve media on failed runs
and bound notebook input, output, execution time and process cleanup.

Clarify fixed-form editor support and compatibility evidence, add executable
quick-start examples, and gate GitHub Pages on Linux/macOS and strict docs CI.
2026-11-21 15:13:01 -05:00
Eremey Valetov 9039f0a1ec Preserve FORTRAN media across runs and inspect execution
Add a scripted statement monitor with pure watches, checkpoints and native
word/card/device views. Persist typed tapes, marks, cursors and drums in a
validated portable bundle; export explicit ASCII records for BASIC.

Cover output-path protection, failed debug/media I/O, source edits during
pauses, dialect equivalence, corruption and real cross-runtime exchange.
2026-11-20 20:58:58 -05:00
Eremey Valetov 821f68aabb Reproduce measured 704 results and link SAP subprograms
Match the original compiler corpus with corrected FAD signs, decimal
conversion and independently formulated 704 library algorithms. Remove
all seven old output allowances and add a 150-value library grid. Keep
original SINF register context, compiler ordering and native i704
counterexamples explicit rather than claiming full equivalence.

Use a physical word store for descending arrays, persistent ascending
Hollerith literals and raw integer words. Add a bounded computational
BSS/SAP bridge with an independent assembler, original-loader witnesses
and a subroutine object compiled from our own source. Reject unsupported
machine behaviour, invalid decks, name collisions and incorrect returns.

Record the joint FORTRAN/GW-BASIC debug and media design and update the
five-item roadmap. Debug controls and persistent media remain planned.

Validation: 446 language checks, 26 bridge tests, 18 oracle harness tests,
26 strict original comparisons, ASan/UBSan checks, kernel smoke tests,
22 editor tests and warning-free Sphinx build. Fable completed independent
reviews; Grok and Argon implementation reviews timed out. Historical IBM
source and system binaries remain outside the tree.
2026-11-20 20:02:36 -05:00
Eremey Valetov b3c6ec25db Preserve PRINT layout and Hollerith words with expanded oracle evidence
Retain the physical control column and buffer printer ink for overprinting.
Pack CALL literals into 36-bit BCD, blank-pad the final word and append the
all-ones terminator. Keep raw words through binary I/O for either dummy mode.

Expand the original-compiler corpus to carriage motion, numerical boundaries,
library routines, Hollerith memory and the CHM inversion. Preserve native
emulator disagreements and exact fingerprints of the remaining numerical
mismatches; strict comparison continues to fail them.
2026-11-20 18:49:35 -05:00
Eremey Valetov 5409a067cf Transmit a bare array name in the inverse of natural order.
C28-6003 printed pages 26 and 34 send the last element first under
FORTRAN I, and FORTRAN II uses that manual. An implied DO stays in
the order written. FORTRAN 0 stays column-major. A round trip of the
same bare name still restores the array.
2026-11-15 06:50:11 -05:00
Eremey Valetov d2e885e136 Reject a non-executable opening of a DO, and show a bare PAUSE or STOP as 0.
C28-6003 printed page 23 says the first statement in the range of a DO must not be non-executable. FORMAT and FREQUENCY remain in the statement list. DIMENSION and EQUIVALENCE are dropped, and under --std=2 so is COMMON, so the DO records them. The check applies under --std=1 and --std=2, after a backwards range has already been rejected. A FORMAT or FREQUENCY that ends the range still uses the existing diagnostic. A labeled DIMENSION, EQUIVALENCE, or COMMON used as the terminal is dropped, so that error is a missing statement number. COMMON under --std=1 is still not in FORTRAN I. FORTRAN 0 does not apply the rule. The 1956 PAUSE and STOP sections take an omitted n to be 0, and the message now shows that 0.
2026-11-14 20:29:28 -05:00
Eremey Valetov eb7f19542d Reject a store of a captured DO cell, and keep PAUSE numbers in 15 bits.
EQUIVALENCE, COMMON, and a dummy can write an index without naming it. The cell is the one the DO captured, so a statement-function temporary of the same name is not that store, and a scalar extended by an EQUIVALENCE subscript still is when the name writes that cell. A digit 8 or 9 is not octal even when the value is also past 77777.
2026-11-14 16:00:56 -05:00
Eremey Valetov 27ca66f96f Require a stored function result, a used argument, and a path of control.
C28-6000-2 printed pages 19-20 put the function name on the left of an
arithmetic formula. The 1956 reference, printed page 17, states a
statement-function argument only when that variable appears in the
expression. The sequencing summary on printed page 24 requires a path
of control to every executable statement except the first.

FORTRAN 0 is not checked, because a variable GO TO names its target
at run time. A DO reaches every statement in its range, and an
unreachable transfer is not reported, so the table fixtures and the
extended range keep the diagnoses they already had.
2026-11-14 13:15:59 -05:00
Eremey Valetov 869affcbb3 Reject a subprogram name in DIMENSION, and supply a missing END.
C28-6000-2 printed pages 17 and 18 forbid the SUBROUTINE or FUNCTION
name in a DIMENSION statement in that subprogram, and in a program
that calls the subroutine or uses the function. A subscript of an
array with that name is not a use. A parenthesized reference that is
not a subscript is a use, even when the argument count differs.
The same pages require the caller's DIMENSION extents to match the
dummy. A shorter portion is an indexing parameter, not a smaller
DIMENSION.

Printed page 22 says one program compiled without an END card is
END(2,2,2,2,2). A stack of programs still needs END between them.
2026-11-14 12:07:08 -05:00
Eremey Valetov e73da8ce3c Accept the printed statement-function name and the subscript addend.
A statement function is 4 to 7 characters ending in F, and fixed-point
only when the name begins with X. A variable may not be a used function
with that F removed. Under FORTRAN I and II, the part of a subscript
before the addend must lie in the dimension.
2026-11-14 11:06:31 -05:00
Eremey Valetov fbd23d45bd Place relative-constant definitions and reorder fixed-point multiplication.
C28-6003 pages 47 and 48 restrict where a relative constant may be
defined inside an input list. The check is --std=1 only. An
unparenthesised fixed-point multiply and divide is computed by
dividing the first factor first, under --std=1 and --std=2. A chain
or a list the checker cannot hold is an error, rather than a silent
left-to-right result.
2026-11-14 09:51:43 -05:00
Eremey Valetov b8cf84acfa Accept a three-subscript binary list the 1956 skeletons exclude.
C28-6003 printed page 45 says a list those indexing rules exclude
would also work, so the three skeletons on printed pages 46 and 47
stay sufficient conditions. The restriction at the top of printed
page 47 is enforced under --std=1: a READ TAPE or WRITE TAPE
subscript that uses a relative constant or an index governed by
variable indexing parameters may appear only in the first element,
and one of its subscripts must be the index of that element's first
parenthesis. --std=2 and --std=0 do not apply it.
2026-11-14 06:59:51 -05:00
Eremey Valetov 065016a010 Accept a binary list the 1956 timing rule excludes, and enforce the FORTRAN II translator tables.
C28-6003 printed page 50 gives SUBDEF, COMMON, HOLARG, NONEXC, and TSTOPS for FORTRAN II only. HOLARG is per program. The other four are compilation totals, which is why 900 and 600 can be reached. C28-6000-2 prints no ceilings for tables 1-22, so those figures stay on --std=1. The 288-microsecond inequality is a sufficient condition, and the manual says a list it excludes would also work.
2026-11-13 20:29:22 -05:00
Eremey Valetov 8171749435 Accept FORTRAN 0 formula numbers to 99999 and xx as a power, and enforce the FORTRAN I translator tables.
Printed page 10 of the 1954 report allows a formula number below 100000. Columns 1-5 already hold five digits, so --std=0 takes 1..99999. FORTRAN I and II stay below 32768. A fixed-point cell still cannot hold a GO TO n target above 32767. Printed page 4 writes exponentiation as xx, and blanks are insignificant, so an unspaced axxb is a power under --std=0. ** remains in every dialect. A single x is not multiplication.

C28-6003 printed pages 49-50 set tables 1-22. --std=1 rejects a program that exceeds those bounds. The ALPHA ceiling in use is the printed 8K figure, 139. The 4K figure, 43, is not selected. Subscript combinations omit the last dimension, as printed page 45 states. Tables 23-27 stay off this mode, and --std=2 does not inherit the FORTRAN I sizes. Grouping parentheses stay nested. A blank does not split a FREQUENCY number. A numbered DIMENSION, EQUIVALENCE, or statement function still counts toward TEIFNO.
2026-11-13 19:41:42 -05:00
Eremey Valetov 80c8d09015 Accept the 1954 relative-constant, frequency, and variable GO TO forms.
RELATIVE CONSTANTS marks fixed-point names for the printed page 8
subscript rule. FREQUENCY is parsed as the three estimates and ignored,
so results stay the same. GO TO n jumps to the formula number stored
in a fixed-point variable. FORTRAN I and II still reject the first and
the third, and they still accept any FREQUENCY tail.
2026-11-13 18:13:51 -05:00
Eremey Valetov 0aea7d4812 Accept RELABEL in the 1954 subset.
The report cycles one dimension so the subscript that is not 1
becomes the new first element. A later reference, including a name
that shares those words, sees the moved values. FORTRAN I and II
still reject the statement.
2026-11-13 17:09:52 -05:00
Eremey Valetov dd7caf89f6 Accept the 1954 tape and drum formulas, and check an assigned GO TO.
FORTRAN 0 now parses the parenthesized tape and drum statements.
Both tape spellings share one binary record. A drum address is 1..2048
and a transfer may not pass the last word. The read walks the list
once, so a bound stored earlier in that list is the bound that applies.
Section K follows the labeled example rather than the words "opposite"
and "last", which reject it.

An assigned GO TO inside a DO, under FORTRAN I and II, must aim at one
part of the nest or entirely outside it. The local i704 tree still has
no FORTRAN listing.
2026-11-12 16:21:15 -05:00
Eremey Valetov 720f65ad81 Accept the 1954 EQUIVALENCE sentence and subscript expression.
The 10 November 1954 report shares bare names from the first word and allows a three-term subscript, including one product of two subscripts and one level of subscripted subscript. The later offset form and the seven FORTRAN I subscript forms stay in place for FORTRAN I and II. A DO parameter stays on those seven forms, including a zero addend. The type-1 and type-2 condition is the programmer's rule and is not diagnosed. The relative-constant requirement is not checked, because RELATIVE CONSTANTS is still rejected.

The local i704 tree still has no FORTRAN II system tape.
2026-11-12 12:40:41 -05:00
Eremey Valetov e356e79338 Retype a mixed FORTRAN 0 assignment from the left-hand name.
Sections 8.C and 8.D convert each leaf to the left-hand mode and keep a fixed exponent after ** in floating arithmetic. A compound fixed exponent stays mixed outside an assignment, and a subscript is not part of that conversion. A sequence list on PRINT, READ, and PUNCH follows the printed order, with the first clause varying least often, and a constant is allowed only on output. FORTRAN I and II still reject a mixed expression. A later search the same day still found no FORTRAN system tape.
2026-11-12 10:59:27 -05:00
Eremey Valetov 981c437709 Take a FORTRAN 0 DO bound from a subscript.
C28-6000-2 gives a subprogram argument no storage rule in COMMON or EQUIVALENCE, so the compiler names that gap instead of saying it is not implemented. Printed page 11 allows a DO parameter to be a subscript or a subscript expression. This mode keeps the seven FORTRAN I forms, takes the value on entry, and leaves FORTRAN I and II on an unsigned constant or a plain fixed-point variable. A leading minus is rejected. A form such as J-2 can still evaluate to a negative step.
2026-11-12 08:46:46 -05:00
Eremey Valetov fb4fe45026 Step a FORTRAN 0 DO that names itself, and lock the raw store.
A control formula inside a FORTRAN 0 DO that names that DO steps the
index. FORTRAN I and II drop the frame and start again at the initial
value, even when an inner frame's extended range contains the DO
statement. An arithmetic store of a raw word writes the normalized
value: the fixed word 12 read into a real becomes zero, and a cell
that was not stored still writes 12. A bare WRITE is rejected, because
neither manual defines one.
2026-11-12 05:43:04 -05:00
Eremey Valetov 7688495eff Accept the 1956 extended DO range, and add the editor.
Printed page 21 lets control leave a nest and return to the same
part. --std=1 and --std=2 keep the index live on that path. A jump
that stays inside an outer DO is still a transfer into a DO, and
--std=0 rejects every entry. The VS Code extension highlights a
fixed-form card and runs the open file. There is still no i704
FORTRAN listing.
2026-11-11 20:46:58 -05:00
Eremey Valetov fbf23cd8c9 Run a statement function, and keep a Hollerith CALL argument.
C28-6003 chapter 3 is an arithmetic statement function, not a
FUNCTION subprogram. The dummy is a temporary cell, so the call
does not overwrite a variable of the same name. A Hollerith
argument stays as characters. The dummy reads as a defined zero
word, because this runtime does not pack a 704 BCD word. A dummy
in COMMON or EQUIVALENCE is still rejected. There is still no
i704 FORTRAN listing.
2026-11-11 19:36:50 -05:00
Eremey Valetov 94eccc5f44 Accept a FORTRAN 0 subset so the 1954 report can run.
--std=0 takes the three-number DO, the relational IF, and list
PRINT, READ, and PUNCH, and rejects the later statements. The
deviations from the Lee copy are written down with the printed
page. A one-statement DO now repeats that statement. There is
still no i704 FORTRAN listing.
2026-11-11 09:33:50 -05:00
Eremey Valetov aa187f384d Reject the FORTRAN II statements when the dialect is FORTRAN I.
C28-6003 lists 32 statements and marks the subroutine tables as
FORTRAN II only. --std=1 now compiles the subset the manual describes
and names CALL, RETURN, SUBROUTINE, FUNCTION, COMMON, and END(...)
as absent from FORTRAN I. A bare END still closes the one program.
Statement functions stay unimplemented, because chapter 3 defines them.
The 2026-11-11 search of i704 still found no system tape, so there is
still no FORTRAN DO / IF / FORMAT listing. Expected files remain this
runtime's stdout.
2026-11-11 07:07:09 -05:00
Eremey Valetov 104dfe29ec Run tape and drum I/O in memory, and record the missing system tape.
The 1956 statements now move BCD and binary records for the whole
program. A format that runs out of fields reads the next record, and a
slash only finishes the record in hand. A binary word read into a real
name is written back as the same word. A SHARE tape image is still on
the network and was not booted here, so there is still no FORTRAN
DO / IF / FORMAT listing. Expected files remain this runtime's stdout.
2026-11-10 18:33:04 -05:00
Eremey Valetov 2b0ad2344c Record 704 floating point, EQUIVALENCE, and the i704 examines.
The subset can now run the C28 common reorder and real arithmetic from
form 24-6661-2. Machine examines are saved. A FORTRAN listing still
needs a system tape, so the expected files stay this runtime's stdout.
A real exponent counts as an integer only when it is exact, and a READ
exponent that does not fit is not wrapped into a small power.
2026-11-10 15:51:31 -05:00