Skip to content

Latest commit

 

History

History
218 lines (186 loc) · 10.9 KB

File metadata and controls

218 lines (186 loc) · 10.9 KB

Dartmouth BASIC Profiles

elderheim treats Dartmouth BASIC as the first concrete BASIC family, not as a single generic language. Profile support is manual-backed: editions with local or primary manuals can become active release targets, while editions without primary sources stay reserved.

CLI Profiles

Known Dartmouth selector names:

  • dartmouth-basic-1
  • dartmouth-basic-2
  • cardbasic
  • dartmouth-basic-3
  • dartmouth-basic-4
  • dartmouth-basic-5
  • dartmouth-basic-6
  • sbasic
  • dartmouth-basic-7
  • dartmouth-basic-ansi

dartmouth-basic-8 is accepted as an alias for dartmouth-basic-ansi. Reserved selectors may exist before full compatibility is implemented, but they must fail clearly until their implementation release stop. Release notes must identify which profiles are actually complete.

basic is only a temporary compatibility alias for dartmouth-basic-1 during early 0.x development. Documentation and tests should use the explicit Dartmouth profile names.

Release Boundary

Each implemented profile must be tested as its own compatibility target. Later profiles may reuse earlier parser, semantic, runtime, and codegen machinery internally, but an earlier profile must reject later-only features instead of accepting them silently.

The first stable release should complete the Dartmouth profiles backed by the local manuals already available: First Edition, October 1964 / Second Edition with CARDBASIC, and Fourth Edition. Missing Dartmouth profiles should not block 1.0.0; they can be added later when primary manuals are found.

Known Profile Line

Profile Historical target Source status Release status
dartmouth-basic-1 1964 First Edition Local manual available Completed 0.50.0 checkpoint
dartmouth-basic-2 1964 Second Edition Local October 1964 manual available as planning source Active, target 0.60.0
cardbasic 1964 card-oriented profile Local October 1964 manual includes CARDBASIC section Active, target 0.60.0
dartmouth-basic-3 1965/1966 Third Edition Missing primary source Reserved
dartmouth-basic-4 1968 Fourth Edition manual Local manual and text export available Active, target 0.70.0
dartmouth-basic-5 1969/1970 Fifth Edition line Missing primary source Reserved
dartmouth-basic-6 1971 Sixth Edition Missing primary source Reserved
sbasic 1975 Structured BASIC Missing primary source Reserved
dartmouth-basic-7 1979/1980 Seventh Edition Missing primary source Reserved
dartmouth-basic-ansi 1982 Eighth Edition / ANSI-oriented profile Missing Dartmouth-specific source Reserved

Historical dates and exact feature boundaries must be confirmed against primary manuals before each profile is marked complete. Secondary summaries are useful for planning, but release claims need manual-backed fixtures.

The 1.0.0 support set is fixed to dartmouth-basic-1, dartmouth-basic-2, cardbasic, and dartmouth-basic-4. Reserved Dartmouth profiles remain useful future work, but they should not be added to the first stable release unless the project explicitly changes the release boundary.

First Edition Current Boundary

The 0.50.0 checkpoint implemented dartmouth-basic-1 from the local May 1964 manual scan plus Dartmouth's own command-summary page for the early statement set. The current in-tree implementation covers this First Edition boundary:

  • instruction numbers from 1 through 99999, with numbered source lines compiled in ascending instruction-number order;
  • every executable statement must have a numeric instruction number, and an instruction number cannot stand alone without a statement;
  • First Edition variable names: one letter or one letter followed by one digit;
  • FOR / NEXT loop variables are restricted to a single letter;
  • numeric literals with at most 9 mantissa digits, optional decimal point, and optional E exponent notation;
  • LET, implicit assignment, PRINT, GOTO / GO TO, IF ... THEN GOTO / IF ... THEN GO TO, FOR / NEXT, READ / DATA, DEF FN, GOSUB / RETURN, DIM, REM, STOP, and END;
  • one- and two-dimensional numeric arrays with zero-based default subscripts;
  • comma and semicolon PRINT separators, including 15-character comma zones and trailing separators that continue output on the same line;
  • a final END instruction with no later instructions after it;
  • numeric literals, unary minus, +, -, *, /, exponentiation, numeric comparisons, parentheses, and single-argument numeric function calls;
  • exponentiation follows First Edition |A|^B semantics;
  • generated executables return nonzero on runtime READ exhaustion and runtime division by zero;
  • built-in numeric functions SIN, COS, TAN, ATN, EXP, LOG, SQR, ABS, INT, and RND; INT truncates toward zero.
  • READ requires at least one later numeric DATA statement in the program.

dartmouth-basic-1 must reject later-profile features until a manual-backed boundary says otherwise. In the current implementation, string variables are intentionally rejected for First Edition. String literals remain accepted for PRINT labels.

The available local First Edition scan covers the beginner/Part I material and mentions vector/matrix variables plus RND and INT as Part II topics, but the Part II pages are not present in that file. Dartmouth's command summary and the October 1964 statement summary support DIM and array syntax, so scalar numeric arrays are active for dartmouth-basic-1. Matrix behavior remains out of scope until a primary source-backed profile requires it.

Current Local References

  • /home/eldryoth/Work/test/basicmanuals/first edition may 1964.pdf
    • Image-only 14-page facsimile of the first Dartmouth BASIC instruction manual, first issued May 1964.
  • /home/eldryoth/Work/test/basicmanuals/second edition october 1964.pdf
    • Searchable 64-page Dartmouth College Computation Center BASIC manual, October 1964.
    • This is the current local source for the October 1964 / Second Edition planning boundary and includes CARDBASIC.
  • /home/eldryoth/Work/test/basicmanuals/196801_BASIC_4th_Edition_text.pdf
    • Searchable PDF for BASIC Fourth Edition, Dartmouth College Computation Center, 1 January 1968.
  • /home/eldryoth/Work/test/basicmanuals/BASIC_4th_Edition_Jan68_djvu.txt
    • Searchable Archive.org full-text export for BASIC Fourth Edition, Dartmouth College Computation Center, 1 January 1968.
    • This is the current planning source for dartmouth-basic-4.
  • /home/eldryoth/Work/test/basicmanuals/fullbasic-ansi_x3.113-1987.pdf
    • ANSI X3.113-1987 / FIPS PUB 68-2 Full BASIC standard.
    • Useful for Standard BASIC comparison, but not a Dartmouth edition manual.
  • /home/eldryoth/Work/test/basicmanuals/ecma-116_1st_edition_june_1986.pdf
    • ECMA-116 BASIC standard, June 1986.
    • Useful for Standard BASIC comparison, but not a Dartmouth edition manual.
  • https://www.dartmouth.edu/basicfifty/commands.html
    • Dartmouth BASIC fiftieth-anniversary command summary for the early statement set.

See Dartmouth BASIC Source Inventory for source status and extracted implementation notes.

Second Edition And CARDBASIC Planning Boundary

The local October 1964 manual is the current primary planning source for the Second Edition boundary and includes a CARDBASIC section. It does not title itself "Second Edition", so 0.60.0 should use this cautious boundary until more edition-labeled primary evidence is found:

  • dartmouth-basic-2 must confirm October 1964 differences against fixtures, especially semicolon packing and any array-bound wording that differs from the active zero-based interactive array behavior. The active 0.60.0 implementation includes three-character semicolon packing.
  • cardbasic keeps card-workflow behavior separate from the interactive profile, must keep its own array-bound rules, and adds numerical matrix MAT commands. The active 0.60.0 implementation uses one-based array bounds and supports PAGE, MAT READ, MAT PRINT, matrix copy, matrix addition, matrix subtraction, matrix multiplication, transpose, inverse, scalar multiply, and MAT initializers ZER, CON, and IDN for actual dimensions inside a larger preceding DIM. One-dimensional vector-form MAT works as a manual-backed column vector for READ, PRINT, ZER, CON, copy, addition, subtraction, and scalar multiply; MAT PRINT displays those vectors across a row. Mixed column-vector/matrix multiplication and transpose between column vectors and one-row matrices have executable coverage. Post-END data decks parse as numbers without a DATA keyword. A final manual audit is still needed before the profile is called complete.
  • CARDBASIC size limits are enforced from the October 1964 manual: vectors and lists may have at most 1000 components, matrix/table dimensions may not exceed 500, and all vectors/matrices together may not exceed 4000 components.
  • CARDBASIC card-deck syntax supports single-quoted strings and relational mnemonics EQU, LSS, GRT, LQU, GQU, and NQU.
  • CARDBASIC formula-driven actual MAT dimensions, such as MAT READ A(M,M) after DIM A(20,20), work for MAT READ, MAT ZER, MAT CON, and MAT IDN, and propagate through MAT PRINT, matrix copy, addition, subtraction, multiplication, transpose, inverse, and scalar multiply. A final manual audit is still needed before the profile is called complete.
  • Both profiles need explicit fixtures proving they do not accidentally accept each other's profile-specific behavior.

ANSI-Oriented Profile Warning

dartmouth-basic-ansi is reserved for the Dartmouth Eighth Edition / ANSI-oriented Dartmouth profile. ANSI X3.113-1987 and ECMA-116 are useful standards references, but they do not by themselves define Dartmouth Eighth Edition compatibility. If the project later implements the standards directly, that work should use separate dialects such as ansi-basic, ecma-basic-1, and ecma-basic-2.

Early Dartmouth Statement Set

The October 1964 manual summarizes these statements:

  • LET
  • READ
  • DATA
  • PRINT
  • GOTO / GO TO
  • IF ... THEN
  • FOR
  • NEXT
  • END
  • STOP
  • DEF
  • GOSUB
  • RETURN
  • DIM
  • REM

INPUT and RESTORE were not found in that October 1964 statement summary. They should be added only to the profiles whose manuals document them.

Implementation Rules

  • Profile selection belongs in the AST and CLI, not only in documentation.
  • Parser and semantic validation must receive the selected profile.
  • Unsupported later-profile syntax must fail closed for earlier profiles.
  • Compatibility fixtures should be grouped by profile under a clear test path.
  • Security reviews should name the exact profile surface being released.
  • Release notes should avoid saying "BASIC support" when the release supports only a specific Dartmouth profile subset.