Popular Posts

Thursday, October 9, 2014

About Variable Database Files


The cyBOSS language [a modern-day 'classic' BASIC] provides file I/O support for: text files, binary files, traditional random access files (aka TRAPs), and unique variable database files.



 A variable database file (aka a "VBASE" file) is like a container ship, which is loaded with a number of individual shipping containers.  Each individual container within a VBASE file contains a fixed amount of data storage space.

Any combination and number of the following types of variables may be stored into [and retrieved out of] a single VBASE container:

  • INTEGER global-prefixed variables
  • FLOATing point global-prefixed variables
  • STRING global-prefixed variables
  • INTEGER ARRAY global-prefixed variables
  • FLOATing point ARRAY global-prefixed variables
  • STRING ARRAY global-prefixed variables

HOW IT WORKS:  When any variable is stored into a container by any application program, the name of the variable is saved together with the data held by the variable.  This data may later be retrieved by one or more application program(s) by simply loading the variable from the container.

To make it easy to load or save large groups of global variables in a single command, groups of variables may be organized using global prefixes.  The following two pages from the cyBOSS Technical Reference Manual explain how to use global prefixes with VBASE files:



































Saturday, October 4, 2014

55 Years of History: BASIC Interpreters vs. BASIC Compilers

By design, BASIC interpreters are slow and generally not intended for anything more than introductory programming classes.  In stark contrast, high-end BASIC compilers, such as cyBOSS, are suitable for a wide-range of uses, including: custom business software, marketable canned application software, and industrial robotic software.  The remainder of this article discusses, in-depth, the 55 year history of the BASIC computer programming language.


The rise of BASIC programming popularity 

Commencing with the dawn of the personal computer era, (around 1978), BASIC grew into a very popular programming language among students, hobbyists, and enthusiasts.  Primarily because the BASIC language was easy-to-learn and fun-to-use. But, also because it came packaged with nearly all the affordable personal computers during the 1980s.

Unfortunately, these popular computer systems came with poorly performing BASIC interpreters. As young programming students entered the professional workforce they began shunning BASIC due to its lack of power. However a few die-hard professionals remained loyal to 'classic' BASIC syntax and created their own BASIC compilers which often delivered more power than COBOL, FORTRAN, and other high-level languages.  The tech shakeout of the early 1990s, forced most computer hardware companies out-of-business leaving just Apple and IBM architecture standing in the personal computer market. Thus, this shakeout cause many BASIC compiler implementations to go the way of the dinosaur when the hardware platforms they were designed to operate on were no longer being manufactured and sold.



Interpreters vs. Compilers
(An In-Depth Technical Analysis)

A computer's CPU can only execute instructions written in machine code.  The below book titled, "Programming the 8086/ 8088" by James W. Coffron is ISBN #0-89588-120-9, copyright 1983.

This book contains a list of all the machine code (Assembly Language) for the Intel CPU 8086 chip, and 8088 chip.  [Note: These are the CPU chip used in the original IBM PC line.  As Intel upgraded these CPUs into the x286, and x386 chips; by necessity Intel made upgrades downward compatible meaning that the newer chips would execute machine code written for the 8086/8088 base.] 



Below is a picture of page 264 of this book, which contains a list of programming languages showing the relative power of various languages. Remember, this book was published in 1983, back when CPUs ran at speeds in the low megahertz; compared to modern-day CPUs which run in the gigahertz, thousands of times faster.  Therefore, the 'POWER OF THE LANGUAGE' chart which lists BASIC at the bottom of the HIGH-LEVEL languages, did so because during this era BASIC compilers were not yet in wide spread use.  And, compiled language implementations are far more powerful than interpreted language implementations; for reasons covered below.
   



What is an Interpreted Language?

Since a computer's CPU can only execute machine code, program instructions written in other languages must be translated into machine code.  Generally, a BASIC interpreter reads and translates instructions line-by-line.  After each line is translated, the resulting machine code is executed.  As a result of wasting CPU time on this continuous and unending translation, all interpreted languages have very lackluster performance compared to compiled languages.

The above 8086 Assembly code gets 'assembled' into the hexadecimal machine code shown to the left of the line numbers. For example: On line #1869, the assembly instruction 'CLI' which stands for Clear Interrupt Enable Flag gets assembled into a single byte of hexdata '0xFA'; and this byte is assembled into the code segment at offset 0xE85A.   [Note: The above picture is from page A-26 of the IBM Technical Reference Manual #6025005 (revised April, 1983). 

Most of the 'classic' BASIC languages used by millions of people during the 20th century were implementations of BASIC interpreters; including: AppleSoft BASIC, Radio Shack's TRS-80 BASIC, Microsoft's BASICA [for IBM-PC] and GW-BASIC [for IBM PC clones], Commodore 64 BASIC, Atari BASIC, and Texas Instruments TI-BASIC.

If that wasn't bad enough, all of these interpreted BASIC languages were further weaken as a result of the following conditions: (i) they executed on very weak hardware systems [by modern-day standards], (ii) they had relatively few commands and functions, and (iii) they simply were not designed or intended to be used for serious application development.  As a result, these 'classic' BASIC languages were shunned by professional programmers casting an unjust stigma on BASIC in general.



What is a Compiled Language?

A compiler translates the entire program into a separate file, known as an object file.   This object file can either be machine code or P-code.  Machine code is directly executable by the CPU; whereas P-code is an intermediate binary language which is executed by a runtime program.

Complied languages offer superior performance over interpreted languages; because they don't waste time on the translation during a program's execution.

Microsoft's QuickBASIC was very popular during the 20th century because it offered a leap in raw performance over nearly all other BASIC languages of the day.



What is the best compiled BASIC available today?

Google the words, "BASIC programming language" and you'll be bombarded with several BASIC implementations to choose from.  However, wisdom dictates steering clear of all products that lack well written and fully documented technical reference manuals.  You don't want to be the unfortunate programmer who invests hundreds to thousands of hours working on a new application program-- only to get stumped with a glitch that you can't fix do to poor compiler documentation.

Unfortunately, because most BASIC implementations are buggy and poorly documented, there are very few quality products remaining on the table to pick from. The best 'classic' BASIC compiler available for the Windows operating system is the cyBOSS language.  It works on Windows XP, Windows Vista, Windows 7, and Windows 8.1  (although it works best on Windows XP and 7) . 

The cyBOSS compiler is embedded into the cyBOSS Runtime Platform, published by GSPH, LLC, d/b/a cyBOSS platforms.  It contains a very well written and in-depth technical reference manual. The cyBOSS Application Developer indexes all 1300+ commands and functions and displays pages of the manual at the click of a mouse.   For more info, visit: www.cyboss.org

When and How Did Personal Computers Enter the Picture?

"In 1975, two young Harvard students named Bill Gates and Paul Allen heard that the first personal computer was in development."[1]   Bill Gates wrote a BASIC implementation which ran in 4K of memory for the Altair computer by MITS corp.






I purchased this USING QUICKBASIC 4 book back in 1989 from Micro-Center for twenty dollars[2]. 

Clearly, the book is very worn out.  It was heavily used during the development of several custom business software programs developed during the mid 1990s.  These programs ran under MS-DOS 6.2 and were so stable that they were used by multiple business entities from 1996 to 2009.



Footnotes:
[1] an excerpt from page 11 of the Using QuickBASIC 4 book by QUE, ISBN 0-88022-378-2.

[2] Copyright materials posted in this blog under the "Fair Use Doctrine" of USC Title 17.