Question: There are a lot of retro-computers with BASIC as an integral part of the operating system. The IBM 5100 was one of the first computers with a separate memory space for BASIC, followed by the Commodore PET, Apple II and TRS-80.

But why was BASIC built into their operating systems, using memory? From [this memory map](http://sta.c64.org/cbm64mem.html), the Commodore 64 had memory completely reserved for BASIC. There were computers, like the Altair 8800, that provided BASIC as software that could be loaded into memory when necessary, and these computers both worked and sold well.

So why was BASIC built into so many computers' operating systems?

Answer: 
Having BASIC available for the machine was a selling point so early adopters wouldn't have to wait for software to become available--they could write what they need themselves, and they wouldn't need to learn machine language to do it.

> 
> [Bill] Gates [believed](https://en.wikipedia.org/wiki/Altair_BASIC#Origin_and_development) that, by providing a BASIC interpreter for
>  the new [MITS Altair] computer, they could make it more attractive to
>  hobbyists.
> 
> 
>
During the late 1970s and early 1980s, ROM was cheaper than RAM. The amount of useful work that can be accomplished with a BASIC program that occupies a certain amount of RAM will be often greater than the amount that could be accomplished with the same quantity of machine code, so a computer with 16K of ROM and 8K of RAM could be more useful than one with 2K of ROM and 16K of RAM, even though the latter computer would cost more.

Further, editing a BASIC program "in place" is much more efficient than trying to do likewise with a machine-language program. In-place editing of machine code is possible, but for the most part generating efficient machine code requires creating a text file and passing it through an assembler. This in turn generally entails a long slow process every time one wants to modify the code and test it again. By contrast, in-place editing of a BASIC program is easy, and for many kinds of programs cutting the edit-build-test cycle from five minutes to five seconds is a huge benefit which vastly outweighs the difference in execution speed.

The need for BASIC largely disappeared when RAM got cheap enough that platforms like Turbo Pascal could allow the editor, compiler, source code, executable, and data to all be kept in memory simultaneously. Basic's primary benefit was the ability to keep everything in RAM, and once such ability became available in a compiled language there was no longer a reason to tolerate the slowness or semantic limitations of interpreted BASIC.