The MASM Forum

General => The Soap Box => Topic started by: jj2007 on February 21, 2023, 09:12:56 PM

Title: Which programming language has the most interesting "backstory"?
Post by: jj2007 on February 21, 2023, 09:12:56 PM
Quote
IMHO, it’s BASIC that has the most interesting backstory. (https://www.quora.com/Which-programming-language-has-the-most-interesting-backstory/answer/Richard-H-Schwartz)

You see, back in 1963 when computers were huge and excruciatingly expensive, when programming was something that only Very Serious People did (in FORTRAN, COBOL, ALGOL, or assembly language), and when just getting access to a computer at all was something reserved for Big Businesses, Big Defense and Space Projects, and Big Research University Professors and their Grad Students… Two mathematics professors at a small liberal arts college in northern New Hampshire had a wild and crazy idea:

What if we got some grant money and built a computer system with a language that Every Single Undergraduate at our school could learn to program?

And amazingly, John Kemeny and Tom Kurtz got that grant.

The professors, John G. Kemeny and Thomas Kurtz, designed a simple programming language, which they called Beginners’ All-purpose Symbolic Instruction Code, or BASIC, and together with a team of undergraduate programmers, they built a time-sharing operating system and a compiler for the language. Yes, a compiler, not an interpreter. It was never an interpreter up at Dartmouth College.

They built a curriculum that became mandatory for all students in freshman-year math classes, developing four or five small programs aimed at illustrating concepts from their classes and helping them understand how computers could be used. They also developed lots of fun terminal-oriented games, chat systems, email, and text formatting programs, and an interactive statistical analysis suite that anybody could use. (I worked on that suite when it was already mature, around 1980, and it pushed the language up to its limits so far that I ended up writing BASIC code that wrote, compiled, and ran PL/I code to do the job and bring the results back into BASIC.)

It was a good little language for teaching absolute beginners to write simple programs for their homework assignments, and over the next 20 years they extended it into a much better programming language with support for more modern control structures, subroutines and functions, and built-in matrix manipulation and graphics capabilities that still managed to maintain the original design philosophy of making it easy to learn. Most people, of course, never saw that much better language.

Kemeny and Kurtz didn’t copyright or patent anything. They were teachers, first and foremost, and they wanted more people to lean how to program — not just at Dartmouth. They were okay with it being put to commercial use, too, as long as it spread. They didn’t seek to develop a standard for BASIC until the 1980s, but by then the language had been copied widely, and almost all other versions were Bad copies.

So just about everybody’s first experience with BASIC was with bad, bastardized implementations of a language that had only ever been intended for teaching beginners and exposing undergraduate liberal arts students to the power of what early computers could do. It was really very well suited for that job given the technology of the time, but for a very long time it wasn’t well-suited at all for most of what it was used for outside of academia.

And it lives on today, in VB, which started with the 1980s standard version of the language and added on a whole lot more.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: Vortex on February 22, 2023, 06:15:55 AM
With the evolution of hardware, Basic became much more powerful. Today's Basic dialects gained extra features like object oriented programming, COM support, interoperability with other languages etc. Basic is not anymore a poor language. FreebBASIC , PowerBASIC and PureBasic are some good examples. I wish M$ could maintain and improve the goold old Visual Basic 6.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: jj2007 on February 22, 2023, 06:40:32 AM
Exactly, Erol. But whenever I see Basic mentioned somewhere, they describe it as if it still had line numbers and GOTOs all over the place.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: hutch-- on February 22, 2023, 08:38:58 AM
 :biggrin:

Nothing wrong with line numbers and gotos. Funny enough very few could still write the ancient line numbered basic. I can't find the examples any longer but I used to write small line numbered examples to give Bob Zale some cheek.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: jj2007 on February 22, 2023, 08:47:00 AM
GfaBasic for Atari, around 1988, excerpt from a 370kByte source (my first word processor). No line numbers, of course, but it had exactly one Goto that served to protect an area where I inserted 6,600 bytes of 68000 assembler code. Technically speaking that was a DLL: I called these routines from GfaBasic. For example, text output was very slow, so I wrote a screen driver in assembly, and output became blazing fast. Today, I can still see it when I launch the emulator, which is considerably faster than the 8 MHz original 520ST.

Code: [Select]
        Clr X_ur$,P.m!,P.s_pg!,Vkeep!,Dbf_fc!
        X_ur$=Space$(Sl%)
        Repeat
          Clr I$
          While Len(I$)<F.0% And I%<=Ble%
            Lset X_ur$=L$(I%)
            I$=I$+X_ur$
            Inc I%
          Wend
          Print #1,I$;
        Until I%>Ble%
        Close

The same code in today's most advanced Basic dialect:

Code: [Select]
include \masm32\MasmBasic\MasmBasic.inc
  SetGlobals X_ur$, Pm, Ps_pg, Vkeep, Dbf_fc, I, Sl=9, I$, F0
  Ble equ <ecx>
  Init
  Clr$ X_ur$
  Clr Pm, Ps_pg, Vkeep, Dbf_fc, I
  Dim L$()
  Let X_ur$=Space$(Sl)
  .Repeat
Clr$ I$
.While Len(I$)<F0 && I<=Ble
Lset X_ur$=L$(I)
Let I$=I$+X_ur$
Inc I
.Endw
Print #1, I$
  .Until I>Ble
  Close
EndOfCode



One interesting aspect: There are 592 procedures in this source, e.g. Procedure Ba_g(X%,Y%,Xs%,Ys%,Mode!), but not a single Function like in this example:
Code: [Select]
           f1%=@fac_loop(15)
           PRINT "loop: fac(15) = ";f1%
           '
           FUNCTION fac_loop(f%)
            w=1
            FOR J%=1 TO f%
              MUL w,j%
            NEXT j%
            RETURN w
           ENDFUNC

I was a n00b, I hated reading manuals, and so it never crossed my mind that a subprogram could "return" a result :cool:
Title: Re: Which programming language has the most interesting "backstory"?
Post by: zedd151 on February 22, 2023, 10:45:11 AM
I wish M$ could maintain and improve the goold old Visual Basic 6.
I agree. Years ago one of the first programming languages I toyed around with was Visual Basic 6. Nothing wrong with it, imo. But forget about the DotNet crap they have these days. Not my cup o tea.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: jj2007 on February 22, 2023, 10:57:00 AM
I wish M$ could maintain and improve the goold old Visual Basic 6.
I agree. Years ago one of the first programming languages I toyed around with was Visual Basic 6. Nothing wrong with it, imo. But forget about the DotNet crap they have these days. Not my cup o tea.

VB6 has an incredibly active and competent community (https://www.vbforums.com/activity.php). Sometimes I go there to find answers to Windows-related questions that I can't even find on StackOverflow.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: hutch-- on February 22, 2023, 01:31:01 PM
The old VB 1 had a great interface but its code was truly terrible. The later VB interfaces were just terrible along with the code. Hard to beat a decent dialog editor and you can write REAL CODE[tm] to go with it.  :tongue:

Few before PB were worth using, I did work in GFA basic for Windows but they never adapted to 32 bit Windows.

I stil use PB as its a decent binary compiler, the UI version does API based code really well, the console version is fun for grunt stuff with no API code at all (unless you want it) and with a combination of its intrinscs and assembler, you can get some decent pace out of it.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: Shintaro on February 22, 2023, 02:00:27 PM
I'm actually trying to find the appropriate book/course to teach my kids (12 and 13 year olds) VisualBasic.
In my view it is the best choice for a first programming language.

It's proving to be harder than I thought to find good material.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: hutch-- on February 22, 2023, 03:52:34 PM
Just be careful that you don't lock them into that UI framework, a simple dialect of basic does not carry the theory of nested structures that VB is based on. All the old ones are gone and don't work on 32 bit Windows but it might be worth the effort to find a simple compiler that is free of VB assumptions.

It has been my experience over the years that VB origin people rarely ever make the change to other languages.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: daydreamer on February 22, 2023, 06:44:08 PM
Line numbered basic could cause spaghetti code,new subroutine needed somewhere and put it in 1000-2000
But on the other hand when you ran code thru debugger memory addresses look like line numbered computer language after you compiled both line numbered or no line numbered basic
So none line numbered basic, same kind of abstraction like HLL's vs assembler
Old VB needed a. Dll installed to run, similar to cpp runtime need to be installed to run vc
Title: Re: Which programming language has the most interesting "backstory"?
Post by: jj2007 on February 22, 2023, 08:15:20 PM
I did work in GFA basic for Windows but they never adapted to 32 bit Windows.

They did, actually (https://gb32.proboards.com/posts/recent), but the "adaption" was no longer compatible with any of the old sources. That's why I started MasmBasic.
Title: Re: Which programming language has the most interesting "backstory"?
Post by: hutch-- on February 22, 2023, 08:55:52 PM
 :biggrin:

> Line numbered basic could cause spaghetti code

The people who said this have never seen it and don't know how to write it. I learnt line number basic in the early 1980s with a Microsoft floppy disk that ran on a z80 computer. It was a bit slow and tedious to write and early 8088 IBM PCs could write it directly from the BIOS.

MS-DOS 5 had QB, a basic compiler emulator which ran OK but it did not need line numbers. QB45 was a reasonable DOS compiler and with MASM libraries, could put the boot up the arse of most at the time. Its main irritation was MODEL MEDIUM BASIC.