Live data from Hacker News

The original source code of Microsoft GW-BASIC from 1983

devblogs.microsoft.com

271–272 of 272 posts

Re: The original source code of Microsoft GW-BASIC from 1983

#271

Earlier quoted context omitted.

Not sure what you mean by short circuit. I had no idea about those VBA features. Will read about them. Having the bit ops themselves is a very strong feature. My simple assembler would definitely been faster and simpler with them. Graphics, some math, all benefit. People would make little language extensions or callable machine language routines to make the bit ops available. In basics with bit ops, and the -1 as tru…

Short circuiting means not evaluating the right side if the left side is sufficient - so e.g. in (Foo() OR Bar()), if Foo() returns true, it won't even evaluate Bar(). Most modern languages are like that, but BASIC is an exception to this day - even VB.NET still doesn't do short circuiting by default. You need to use special operators, AndAlso/OrElse, to get it. Computing the line number in a GOTO is definitely an ex…

Makes perfect sense. Maybe nobody cares enough about Basic, or figures there are a zillion better performing options? Seems like an optimization like that would have been done at some point

Yeah, the computed goto is odd.

Back in the day, I used it and some conditional math to greatly shorten and improve performance in some programs. My first machine was only 16k. Using the graphics system in any meaningful way cost a lot in terms of program space. So, every dirty trick, including poking new addresses into string variable address pointers to overlap the graphics screen got done.

Absolutely terrible code though. I am sure if I saw some of that code today, I would have a bugger of a time sorting it out.

Post reply on HN