Earlier quoted context omitted.
It's funny how stuff that got put together quickly like GW-BASIC and JavaScript got so much success because of luck and popular appeal. It's like music. The best music has never been in the top of the charts. The best movies have never won Oscars. This is pop computing.
It wasn’t luck or popular appeal, it was like they say in real estate: “location, location, location.” JavaScript came bundled with every Web browser, and GW-BASIC came bundled with every IBM PC clone. A language that everybody in the world already has a copy of is going to get a lot of use, whether it’s good or not.
The original source code of Microsoft GW-BASIC from 1983
251–260 of 272 posts
Re: The original source code of Microsoft GW-BASIC from 1983
#252Earlier quoted context omitted.
Am actually totally digging JS DOS, the emscripten build of the DOSBox emulator. The performance is phenomenal in the browser, including vsync. Here is an example (CPU intensive) of multiple 64k demos running simultaneously on a single web page ;) https://js-dos.com/6.22/64k/index.html
8 FPS on MacBook2019 and Chrome...
Re: The original source code of Microsoft GW-BASIC from 1983
#253The funny thing about this announcement is that a week ago I just found my old QBASIC textbook that I learned how to program with back in 1998. QBASIC was my very first programming language; I was a nine year old kid who loved computers and would read anything computer-related that was available, including my mom's textbooks (she was returning to college at the time and took some courses on computing and applications…
I also started with QBasic (with no internet connection). Built a small choose your own adventure. Then I wanted to build a "password program" that would ask for a password before you could get "into the computer". I heard somewhere (schooljard) that you can put so called exe files into a file called autoexec.bat and they would start first. Alas QBasic could not build these magical files. I wnt to a store that had co…
My favorite program for autoexec just had an infinite loop until you hit Ctrl+C.
Re: The original source code of Microsoft GW-BASIC from 1983
#254GWBasic was good resource to get into programming world during my teenage. Now I want to teach coding to my 10 years old son. Will you still recommend GWBASIC/Quick basic or Python or other languages for kids?
Python itself is great because it has all the right batteries included. It's easy to get started - you don't need to explain "import" or functions to write a basic hello world type app with console input and output. Then you can gradually build it up from there, introducing turtle graphics, databases (SQLite), and finally GUI (Tk) - all of which are present in the standard library.
And Thonny, well - it's self-explanatory once you see it: https://www.youtube.com/watch?v=nwIgxrXP-X4
Re: The original source code of Microsoft GW-BASIC from 1983
#255My mom's IBM 8088 had GW-BASIC built into its BIOS. You could turn on the computer and go straight into it without having any storage medium present.
Interesting. Was that the original IBM PC? I thought it needed DOS for some reason. I've always thought that using BASIC as the default command line was really weird... Like on an Apple II or TRS-80. You could type in a command to load something from a disk or run a program, or type a line number to start programming. How did that make sense to anyone?? To my 11yo self, it was confusing and I've never changed my mind…
Re: The original source code of Microsoft GW-BASIC from 1983
#256Earlier quoted context omitted.
Mentioned it in another reply, you'd probably want to start with the MASM and LINK from the MS-DOS 2.0 release. https://github.com/microsoft/MS-DOS/tree/master/v2.0/bin
Unfortunately, I can't get MS-DOS 2.0 to run in DOSBOX ("Invalid COMMAND.COM") and running MASM.EXE directly gives me some really interesting errors (looks like it's reading uninitialized memory). I think you're on to something here, though!
Re: The original source code of Microsoft GW-BASIC from 1983
#257Earlier quoted context omitted.
x = x + (x :D No If needed. Atari Basic would allow crazy things like: 10 Goto ((x Goes to either line 50 or 150, depending on the comparison result being 1, or 0) Or... Goto (100*x) Faster On goto with no checking, lol. Bill Gates was not involved with the original Atari Basic. That could be purchased on a cartridge for running MS Basic programs.
Did Atari BASIC use 1 for TRUE? Most BASICs used -1 (i.e. all bits 1), because this allowed the same operators to work for both bitwise and Boolean logic, in the absence of a dedicated Boolean data type.
Yes, it used 0 and 1. And it did not contain bitwise ops. Those were quite the surprise!
My first efforts were in Applesoft. Computers at school. Got an Atari machine and programmed the crap out of it. Wrote my own assembler, a few games, etc...
Then I got an Apple and finding them in Applesoft was a nice surprise! Prior to that, I thought they were an assembly only thing.
The trade off in the Atari basic was doing things mathematically was pretty easy and it generally, but not always, was faster.
A few of us wrote fairly complex programs with basically no if statements. Kind of a fun way to think about things back then.
I much prefer -1 and 0 and the bit ops, frankly. Internally, I remembered this kind of thing as "really fucking true" as in every bit better signal, or it's false!
Re: The original source code of Microsoft GW-BASIC from 1983
#258Earlier quoted context omitted.
My first attempt at coding was with a Java Programming For Dummies book around the Java 1.1 era, using applets. That was a terrible choice for 12 year old non-native english speaking me, and I never got too far. Somehow I ended up trying QBASIC a couple of years later and programming suddenly became a lot easier and fun. I especially loved that you could easily switch to graphics mode and just start drawing pixels an…
Alas, that easy graphics programming environment - so critical to my early engagement with programming as well -is nowhere to be found. Even in the Python ecosystem, nothing approaches the simplicity of "SCREEN 12" and immediately being able to use POINT, LINE, CIRCLE etc.
#!/usr/bin/python
from pygame import *
pantalla = display.set_mode((0, 0), FULLSCREEN)
draw.rect(pantalla, 128, (50, 100, 200, 400))
display.flip()
time.delay(2000)
That's from https://github.com/kragen/pyconar-talk/blob/master/helloneg1.... There are some more examples in that directory. They use PyGame, though, which isn't installed by default like POINT.By default Python comes with Tkinter, though, which lets you do this:
from tkinter import * # or Tkinter in Python 2
w = Tk()
button(w, text="Not OK", command=w.destroy).pack()
That's a fuckload more than you can do graphically in GW-BASIC.For graphics, though, you're better off in JS and DHTML. In http://canonical.org/~kragen/sw/dev3/tweetfract.html I have an HTML canvas which renders a fractal if you click on it, in 140 bytes:
1&&(d(x,y,k),d(x,y+=k,k),d(x+k,y,k))
}d(0,0,150)">
Moreover, if you put that on the web, you can link anyone in the world to it, and they can run it just by clicking the link. And you don't have to start that complicated; this works too: DO NOT CLICK ME
You don't even need a server; you can put that into the address bar of your browser as data:text/html,DO NOT CLICK ME.LÖVE2D comes with a bunch of simple examples, like https://github.com/love2d-community/LOVE-Example-Browser/blo...:
-- Example: Loading an Image and displaying it
--[[Description:
Load an image using love.graphics.newImage(image_path)
Draw it using love.graphics.draw
]]
function love.load()
image = love.graphics.newImage("assets/love-ball.png")
end
function love.draw()
love.graphics.draw(image, 400, 300)
end
LÖVE is programmable in Lua, like Minetest and WoW, and it gives you rotatable, alpha-composited 2-D sprites with collision detection and particle systems.But Proce55ing is the paragon of this stuff. http://sketchpad.cc/, which uses processing.js, starts you off with this:
// Pressing Control-R will render this sketch.
int i = 0;
void setup() { // this is run once.
// set the background color
background(255);
// canvas size (Integers only, please.)
size(300, 300);
// smooth edges
smooth();
// limit the number of frames per second
frameRate(30);
// set the width of the line.
strokeWeight(12);
}
void draw() { // this is run repeatedly.
// set the color
stroke(random(50), random(255), random(255), 100);
// draw the line
line(i, 0, random(0, width), height);
// move over a pixel
if (i
That just fucking blows away anything I ever created in years of messing with GW-BASIC. And sketchpad.cc lets you edit your code in real time with someone else, and also save a link to the sketch you've made so that anyone else can see it. Still, I translated it to Python for my talk about this stuff at PyCon Ar (https://github.com/kragen/pyconar-talk/blob/master/hello1.py): #!/usr/bin/python
from pygame import *
from random import randrange
pantalla = display.set_mode((0, 0), FULLSCREEN)
ww, hh = pantalla.get_size()
color = Color(64, 64, 192)
for xx in range(0, ww, 5):
h, s, v, a = color.hsva
color.hsva = xx * 270 / ww, s, v, a # cambiar hue
draw.line(pantalla, # surface
color,
(xx, 20), # punto de inicio
(randrange(ww), hh - 20), # punto de terminar
10) # ancho de rayo
display.flip() # para mostrar
Maybe the biggest environment for this kind of thing nowadays is Roblox, which has a couple of million people writing games in Lua in a 3-D world. It's not free software, but neither was GW-BASIC at the time.Eat me, GW-BASIC.
Re: The original source code of Microsoft GW-BASIC from 1983
#259Now, a few software engineering observations (these are to my future self, not to Microsoft):
1) This is extremely minor, but it would have been nice if the main file (which I'm guessing is GWMAIN.ASM?) had been pointed to in the documentation. Reason: We're not in a language that has a default main file by custom, i.e., C's 'main.c'. But again, extremely minor...
2) This code is great, I mean, absolutely great for someone to learn x86 programming IF they have the prerequisite understanding about how memory is segmented in those early computers (including segment registers, etc.)... Reason: Very few basic x86 instructions are used, relative to the entire x86 instruction set...
3) It seems that the assembler which was being used at the time had a limitation of 6 characters per symbol. This kind of sucks a little bit for the readability of those symbols (but note that the code makes up for this with liberal commenting, which is great!), and of course, with a little bit of effort, you can mentally parse what most of these mean.
4) I would have liked to see some kind of document (although, since it's 38 years "after-the-fact", after this program was being written, I certainly don't expect one! ) which, at a high level, would describe the main data structure being used to hold the lines of basic code (I'm guessing this would be a linked list of sorts), in what source file that data structure lives, and how it is evaluated when a BASIC program is run...
Basically, give me the high-level view of the system.
The code itself represents the low-level implementation details of that high-level "as simple as possible but not simpler", view...
But again, those things are minor, relatively speaking, and they only amount to "notes to self" in my future software engineering efforts...
Anyway, thanks again to Microsoft for this great important contribution to computer history!!!
Re: The original source code of Microsoft GW-BASIC from 1983
#260Earlier quoted context omitted.
Did Atari BASIC use 1 for TRUE? Most BASICs used -1 (i.e. all bits 1), because this allowed the same operators to work for both bitwise and Boolean logic, in the absence of a dedicated Boolean data type.
https://atariwiki.org/wiki/Wiki.jsp?page=Boolean%20Logic%20i... Yes, it used 0 and 1. And it did not contain bitwise ops. Those were quite the surprise! My first efforts were in Applesoft. Computers at school. Got an Atari machine and programmed the crap out of it. Wrote my own assembler, a few games, etc... Then I got an Apple and finding them in Applesoft was a nice surprise! Prior to that, I thought they were an a…
On the other hand, one thing that BASIC still has to this day (in VBA) that no other language I can think of does, is bitwise equivalence (EQV) and implication (IMP) operators. Furthermore, since VBA has a Boolean data type, these operators are also available for Booleans; implication comes in handy sometimes.