BASIC is that one language that has garnered such bad rap. Edgar Dijkstra and others have famously claimed that a person reared on BASIC was forever damned by the experience. By that reasoning, a baby who dribbles food can never learn table manners, and the old timer who was adept with analog oscilloscopes will be eternally baffled by the new world of the DSO. BASIC got a lot of people into software development. Some shouldn't have gotten involved in that, of course; for others, it seduced them into a career in professional software engineering.
My first programming experiences were not with BASIC. I learned FORTRAN in high school and then moved on to Univac 1108 assembly language before picking up APL, LITHP, and many other languages, including (eventually) BASIC. FORTRAN and assembler suffer from the same lack of structure as the original Dartmouth BASIC, so one would think these languages would also be accused of being injurious to a developer's development. And what could be a bigger blot on the software world than APL?
My first exposure to BASIC was around 1975, when we bought a couple of Altair 8800s. These arguably jump started the personal computer revolution, though they came into being long before the word "PC" existed. Thousands of serious developers and hobbyists bought the machines, often with a paper tape of Bill Gates' BASIC interpreter. It was very liberating to use an interpreter, rather than going through the incredibly painful process of compiling or assembling code. Even today, every little change requires a tedious recompilation. In the 1970s, there were no hard disks on micros; even floppies were expensive and rare. Recompiling to paper tape or cassette decks ate enormous blocks of time. With BASIC, one could type in a line of code and then "RUN". The edit/test cycle took seconds.
BASIC was the lingua franca of the eight-bit computer world. All the machines sold in the late 1970s and early 1980s supported it, and in many cases, it was built into the ROM chips. Often there was no OS; the machine booted to a BASIC interpreter. Even the vaunted IBM PC originally had the language in ROM.
Embedded development in the early days was almost always in assembly language, and I suspect there wasn't a manager on the planet who was happy about the low productivity it entailed and the completely cryptic end product that only a pony-tailed engineer who never came in before noon could understand. A lot of people were looking for alternatives. A few C compilers (e.g., MANX C) were available in the early 1980s, but it was not a popular language among eight-bit developers.
Everyone was doing it
Everyone knew BASIC, so in 1983, I wrote a BASIC compiler (not interpreter) targeted at embedded applications. It was interactive and felt exactly like an interpreter; one entered code with line numbers. "RUN" compiled and started executing the code in less than a second. The compiler generated very tight code and even had built-in multitasking support. It ran under CP/M on 8080 and Z80 systems and comprised about 30,000 lines of assembly language. Multitasking meant all generated code and libraries had to be reentrant, so I hired a college kid to write a reentrant and position-independent floating point package -- quite an accomplishment, given the 8080's architecture.
Surprisingly, it took off. Orders showed up and then steamrolled in. It was startling to find checks from people I didn't know in the daily mail. I was working out of a bedroom in the house, but I couldn't handle the order fulfillment, so my wife quit her job to help. Eventually, we moved into the basement, because the upper two floors were filled with manuals, boxes, floppy disks, and (eventually) employees. Later we rented space in an R&D park and set up more professional offices.
IBM stunned the market when it introduced its PC. I bought one outfitted with everything -- two floppy disks, 128 KB of RAM, etc. -- which cost $7,000. Customers were asking for a PC version of the compiler, so I purchased a Z80 to 8088 assembly translator, which created awful, nasty code because the instruction sets were so dissimilar, and, of course, all the code generation was incompatible. In a hectic couple of months, I recoded it in 8088 assembly. If you had anything for a PC then, it sold, and our BASIC profited from that frenzy. It didn't hurt that Jerry Pournelle was an early advocate who featured it in Byte Magazine.
Code generated by the compiler eventually was used at both poles for research instruments, aboard the space shuttle, and even in the nuclear submarine fleet. But embedded C started to gain adherents, and BASIC's demise was evident. The last updates were in 1988, but to this day I still get requests for new versions.
I read an awful lot of code our customers wrote in BASIC. Some was pretty terrible, but a lot was as carefully crafted as anything written in C today, within the constraints of the language, giving lie to the belief that BASIC makes for crummy developers. I'll bet a lot of readers got their start in computers with BASIC but today build world-class code.
What was your experience with BASIC? Do you feel it poisoned your abilities?
用户1365351 2014-10-28 10:10
自做自受 2014-10-17 11:19
故事发生在远古时代,那时的太阳系还十分年轻。就是在那时,一个巨大的行星从外太空进入了太阳系。苏美尔人把这个入侵者叫做尼比鲁——“横穿的行星”;他在巴比伦语中被称为马杜克。当太阳系外面的其他行星掠过马杜克的时候,它的运行轨道受到影响后开始发生偏离,并与太阳系的另外一棵老行星——一颗叫提亚马特的行星——的轨道相冲突。当两颗行星接近时,马杜克的卫星把提亚马特撕成了两半。下面的那部分被撞碎成了碎屑,从而形成了许多彗星和小行星带——即在木星和火星之间运行的行星带,提亚马特的上部加上它主要的卫星一起,则进入了一个新的轨道运行,就是地球和月亮。
呵呵,后面人类起源的故事就来了......
如果这次马杜克再来,会是什么故事呢?
用户1602177 2014-10-17 10:31
用户1748284 2014-10-17 09:48
用户1406868 2014-5-16 20:18
You are right. BASIC was very simple and good. Moreover, HP Basic was even more powerful and was offered on their HP9836 series of computers which were of the TRS80 (Tandy Radio Shack) times. HP basic had very powerful string commands (using which we could implement slate arithmetic for unlimited precision and do series computations for Pi and e for hundreds of decimals, calculate factorials of large numbers and print the result with all d igits) and graphic commands (for Mandelbrot Graphics). Also Europe and part of Asia had enjoyed Sinclair Basic, which also was Z80 based. Wish it gets a fresh lease of life and continues with Lego type of systems.
This question to the author: By any chance were you writing any articles to Radio Electronics Mag during Don Lancasters column time? I rememer to have seen a similar name. Please respond to me on cherukupallir@yahoo.com.
C.Rama Murthy