• COBOL compilers (Re: naughty Pascal)

    From Lars Poulsen@lars@beagle-ears.com to alt.folklore.computers on Wed Jan 7 14:11:10 2026
    From Newsgroup: alt.folklore.computers

    On 2026-01-07, Charlie Gibbs <cgibbs@kltpzyxm.invalid> wrote:
    A friend once wrote an 8080 cross-assembler in COBOL.
    It ran rings around Univac's official cross-assembler -
    which was written in FORTRAN.

    So long as it did not include a macro facility, that actually makes
    sense. Assembly code tended to have fixed column layout:
    - labels starting in column 1
    - opcode in column 9
    - operands in column 17

    One input line makes one instruction.

    But trying to parse free-form text and do macro expansions with
    string substitutions ... disaster in COBOL. Hard enough in FORTRAN.

    When I went from academia to a small engineering firm in 1975,
    I was used to writing my documentation in Univac DOC on the
    university's mailframe, and hated having to go through a secretary
    with a typewriter, who did not know the technical subject matter.

    So I wrote a slightly modified re-implementation of DOC in
    RSX-11M Fortran on our PDP-11 systems. That was fun, and my
    colleagues liked it. The documents looked very good when printed
    on a Diablo SpinWriter. A couple of years later, our firm became
    the local representatives of Wang Labs, just as they introduced
    the Wang WPS office systems, and we switched to that.

    I think the magtapes with the source code from back then were
    lost when I changed jobs around 1990. (Actually, the tapes may
    still be in a box somewhere, but I don't know where I'd find
    a tape drive where I could load them to see if they are
    recoverable after 30+ years in garage and mini-storage.)
    --
    Lars Poulsen - an old geek in Santa Barbara, California
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to alt.folklore.computers on Wed Jan 7 20:21:19 2026
    From Newsgroup: alt.folklore.computers

    On Wed, 7 Jan 2026 14:11:10 -0000 (UTC), Lars Poulsen wrote:

    But trying to parse free-form text and do macro expansions with
    string substitutions ... disaster in COBOL. Hard enough in FORTRAN.

    Hard to see the point in an assembler without such features, though.
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Peter Flass@Peter@Iron-Spring.com to alt.folklore.computers on Wed Jan 7 19:16:03 2026
    From Newsgroup: alt.folklore.computers

    On 1/7/26 13:21, Lawrence D’Oliveiro wrote:
    On Wed, 7 Jan 2026 14:11:10 -0000 (UTC), Lars Poulsen wrote:

    But trying to parse free-form text and do macro expansions with
    string substitutions ... disaster in COBOL. Hard enough in FORTRAN.

    Hard to see the point in an assembler without such features, though.

    I did a COBOL program to do string substitutions. The idea was that it
    read a COBOL program written possibly by a blind hacker and substituted variable names with longer, standardized ones.
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to alt.folklore.computers on Thu Jan 8 02:24:36 2026
    From Newsgroup: alt.folklore.computers

    On Wed, 7 Jan 2026 19:16:03 -0700, Peter Flass wrote:

    I did a COBOL program to do string substitutions. The idea was that it
    read a COBOL program written possibly by a blind hacker and substituted variable names with longer, standardized ones.

    Did it understand the rules of IN-scoping?
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From rbowman@bowman@montana.com to alt.folklore.computers on Thu Jan 8 02:24:56 2026
    From Newsgroup: alt.folklore.computers

    On Wed, 7 Jan 2026 20:21:19 -0000 (UTC), Lawrence D’Oliveiro wrote:

    On Wed, 7 Jan 2026 14:11:10 -0000 (UTC), Lars Poulsen wrote:

    But trying to parse free-form text and do macro expansions with string
    substitutions ... disaster in COBOL. Hard enough in FORTRAN.

    Hard to see the point in an assembler without such features, though.

    When the company balked at an expensive MCS-8048 cross assembler for the
    VAX I wrote one that ran on CP/M. There was no point in such features.
    When you're dealing with 2K of EEPROM and 128 bytes of RAM you're close to
    the bone.


    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Peter Flass@Peter@Iron-Spring.com to alt.folklore.computers on Thu Jan 8 07:41:03 2026
    From Newsgroup: alt.folklore.computers

    On 1/7/26 19:24, Lawrence D’Oliveiro wrote:
    On Wed, 7 Jan 2026 19:16:03 -0700, Peter Flass wrote:

    I did a COBOL program to do string substitutions. The idea was that it
    read a COBOL program written possibly by a blind hacker and substituted
    variable names with longer, standardized ones.

    Did it understand the rules of IN-scoping?

    COBOL had no concept of "scope" back then.
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to alt.folklore.computers on Thu Jan 8 20:02:49 2026
    From Newsgroup: alt.folklore.computers

    On Thu, 8 Jan 2026 07:41:03 -0700, Peter Flass wrote:

    On 1/7/26 19:24, Lawrence D’Oliveiro wrote:

    On Wed, 7 Jan 2026 19:16:03 -0700, Peter Flass wrote:

    I did a COBOL program to do string substitutions. The idea was that it
    read a COBOL program written possibly by a blind hacker and substituted
    variable names with longer, standardized ones.

    Did it understand the rules of IN-scoping?

    COBOL had no concept of "scope" back then.

    I was referring to this:

    8.4.1.1 Qualification

    Qualification is used to allow unique reference of user names.
    Qualification is the specification of superordinate names from the
    hierarchy to which a user-defined name belongs. The superordinate
    names are called qualifiers. Identical user-defined names may be
    specified in a source unit; however, uniqueness shall be established
    through qualification for each user- defined name explicitly
    referenced, except as specified in rules 2 through 6. All available
    qualifiers need not be specified so long as uniqueness is established.
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Dan Espen@dan1espen@gmail.com to alt.folklore.computers on Fri Jan 9 14:22:34 2026
    From Newsgroup: alt.folklore.computers

    Lars Poulsen <lars@beagle-ears.com> writes:

    But trying to parse free-form text and do macro expansions with
    string substitutions ... disaster in COBOL. Hard enough in FORTRAN.

    Using "OCCURS DEPENDING ON" COBOL easily processes variable length,
    variably located strings.

    Not much of a disaster IMO.
    --
    Dan Espen
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to alt.folklore.computers on Fri Jan 9 22:12:26 2026
    From Newsgroup: alt.folklore.computers

    On Fri, 09 Jan 2026 14:22:34 -0500, Dan Espen wrote:

    Using "OCCURS DEPENDING ON" COBOL easily processes variable length,
    variably located strings.

    Up to a limit, always, e.g.

    OCCURS [ integer-1 TO ] integer-2 TIMES [ DEPENDING ON data-name-1 ]
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Dan Espen@dan1espen@gmail.com to alt.folklore.computers on Sat Jan 10 12:18:13 2026
    From Newsgroup: alt.folklore.computers

    Lawrence D’Oliveiro <ldo@nz.invalid> writes:

    On Fri, 09 Jan 2026 14:22:34 -0500, Dan Espen wrote:

    Using "OCCURS DEPENDING ON" COBOL easily processes variable length,
    variably located strings.

    Up to a limit, always, e.g.

    OCCURS [ integer-1 TO ] integer-2 TIMES [ DEPENDING ON data-name-1 ]

    Well beyond any reasonable limit.
    DATA-NAME-1 can be the largest number format the compiler supports and INTEGER-2 the max value.
    --
    Dan Espen
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to alt.folklore.computers on Sat Jan 10 20:46:38 2026
    From Newsgroup: alt.folklore.computers

    On Sat, 10 Jan 2026 12:18:13 -0500, Dan Espen wrote:

    Lawrence D’Oliveiro <ldo@nz.invalid> writes:

    On Fri, 09 Jan 2026 14:22:34 -0500, Dan Espen wrote:

    Using "OCCURS DEPENDING ON" COBOL easily processes variable
    length, variably located strings.

    Up to a limit, always, e.g.

    OCCURS [ integer-1 TO ] integer-2 TIMES [ DEPENDING ON data-name-1 ]

    Well beyond any reasonable limit.

    I think you’ll find that the implementation reserves space for the
    maximum specified value. So this is not dynamic allocation, by any
    means.
    --- Synchronet 3.21b-Linux NewsLink 1.2