Timeline for Why do variable names in BASIC need type suffixes?
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 29, 2021 at 12:38 | comment | added | Willis Blackburn | Okay, so maybe it would have been enough to just standardize the core language features. But why bother when everyone had pretty much settled on Microsoft BASIC. Apple, Commodore, Tandy, and IBM licensed Microsoft BASIC, and it was available for the Atari too, so if you wanted a standard BASIC, that was it. | |
Sep 29, 2021 at 12:34 | comment | added | Willis Blackburn |
But trying to standardize BASIC on 8-bit microcomputers was a futile effort. Microcomputer designers had to fit an entire BASIC in 8K, and they were never going to agree on what features should be in or out. For example Atari BASIC has a SOUND statement that basically pokes directly into the sound-control registers of the POKEY chip. But that statement would have been too simplistic for the Commodore 64 and its SID chip, and too sophisticated for the Apple II, which only had 1-bit sound. So how to standardize that?
|
|
Sep 29, 2021 at 12:32 | comment | added | Willis Blackburn | @another-dave Fair enough. You'd get some support from the designers of Dartmouth BASIC, who tried to challenge Microsoft's dominance over microcomputer BASIC with a language called True BASIC. | |
Sep 29, 2021 at 0:21 | comment | added | dave | I say the guys that designed it get to have the real version. | |
Sep 28, 2021 at 23:19 | comment | added | Willis Blackburn | @another-dave I think you're assigning too much meaning to the term BASIC. Dartmouth BASIC is Dartmouth BASIC, Microsoft BASIC is Microsoft BASIC, etc. They're related but not the same. Nobody at the time was representing that the language was portable. It's similar to Unix family tree. Neither Linux nor macOS is AT&T Unix but so what? There are a lot of similarities and a lot of what we know about one carries over to the others, so they're all Unixes without specifically being AT&T Unix. | |
Sep 28, 2021 at 22:55 | comment | added | dave | re I disagree with the answers saying that Dartmouth BASIC worked a certain way - sure, you could implement FORTRAN and call it BASIC. But names have to mean something else it is madness. So the question is, at what point do we say that if it's not like existing BASICs, it's not actually BASIC? | |
Sep 28, 2021 at 22:51 | comment | added | Willis Blackburn | Thanks @BenCrowell. I also noticed that many BASICs will promote integers to reals. I didn't have much luck with concatenating strings with "+". It's interesting that TRS-80 BASIC can do that. But in each of these cases I think that the need to promote an integer to a real, or to truncate a real to an integer, or to concatenate rather than add, can be determined at the time the line is parsed. BASIC can include this information in the tokenized/compiled program and avoid working it out at runtime. But this only works if each variable has a known static type, thus the suffixes. | |
Sep 28, 2021 at 16:03 | comment | added | user4766 | @user3840170: Shell dates to 1971, and one of the other answers says the first versions of basic with strings were 1968. So they were close contemporaries, and the idea of using these sigils as a way of avoiding explicit type declarations was clearly in the air at the time. Perl is of course much later, and was basically shell on steroids. | |
Sep 28, 2021 at 15:35 | comment | added | user3840170 | I don’t think Unix shell and Perl existed when this design decision in BASIC was made. | |
Sep 28, 2021 at 15:33 | history | edited | user3840170 | CC BY-SA 4.0 |
spelling fixes
|
Sep 28, 2021 at 15:24 | history | edited | user4766 | CC BY-SA 4.0 |
added 747 characters in body
|
Sep 28, 2021 at 15:19 | history | answered | user4766 | CC BY-SA 4.0 |