Live data from Hacker News

The Applesoft Compiler (TASC): We have the source code, in a sense

devblogs.microsoft.com

21–30 of 32 posts

Re: The Applesoft Compiler (TASC): We have the source code, in a sense

#21
post #18
post #12

Earlier quoted context omitted.

You’d have thought the author would have kept a lookup table of the full variable names. Maybe they did, but that was lost.

I searched but I couldn't find out who this author is/was. Lines like " The author of TASC was very proud of this optimization. " makes me think that Raymond Chen is the author, is this right?

Back of the manual states: Microsoft TASC was developed by James Peck and Michael T Howard

Re: The Applesoft Compiler (TASC): We have the source code, in a sense

#22
post #21
post #18

Earlier quoted context omitted.

I searched but I couldn't find out who this author is/was. Lines like " The author of TASC was very proud of this optimization. " makes me think that Raymond Chen is the author, is this right?

Back of the manual states: Microsoft TASC was developed by James Peck and Michael T Howard

The post states that it was developed by a single guy though.

Re: The Applesoft Compiler (TASC): We have the source code, in a sense

#23
post #2

I’m confused about deleting comments and renaming variables unless TASC itself written in Applesoft. Which seems crazy. > As the author added features, he kept hitting the Apple ][‘s 48KB RAM limit There was a language card that could replace the upper 16KB of ROM with RAM, but of course, you’d still need to have the interpreter somewhere. I’ve never heard of TASC before, but Beagle Bros also had an AppleSoft compile…

> All three passes were written largely in Applesoft Wouldn't this explain it? But it seems odd that they wouldn't at least save a LUT relating the shortened and expanded variable name.

> But it seems odd that they wouldn't at least save a LUT relating the shortened and expanded variable name.

BASIC implementations based on Microsoft BASIC store tokenized program lines. A keyword takes 1 byte. Comments, variable names, spaces between tokens, etc take up memory on a character-by-character basis.

I didn't use Apple BASIC, but I spent too much time on various flavors of Commodore BASIC which shared this heritage. Changing a variable from "ACCUMULATOR" to "AC" to "A" saved memory and made the program run faster. The problem of not being able to make sense of your own program after was very real.

Re: The Applesoft Compiler (TASC): We have the source code, in a sense

#24
post #23

Earlier quoted context omitted.

> All three passes were written largely in Applesoft Wouldn't this explain it? But it seems odd that they wouldn't at least save a LUT relating the shortened and expanded variable name.

> But it seems odd that they wouldn't at least save a LUT relating the shortened and expanded variable name. BASIC implementations based on Microsoft BASIC store tokenized program lines. A keyword takes 1 byte. Comments, variable names, spaces between tokens, etc take up memory on a character-by-character basis. I didn't use Apple BASIC, but I spent too much time on various flavors of Commodore BASIC which shared thi…

There was a weird thing in IBM BASICA (which apparently became GW-BASIC) where runtime writes to a pointer to a program variable could corrupt your program listing itself. I think this had to do with variable contents actually being stored inside the source code somehow? Do you know any more about this, or does anyone else remember this?

Re: The Applesoft Compiler (TASC): We have the source code, in a sense

#25
post #19

On a side note, early Microsoft’s business strategy seems to be licensing half-baked software written by independent programmers and then making a product out of it.

To my knowledge, Applesoft BASIC would have been written by Microsoft with some modifications done by Apple. On top of that, it is likely that TASC made calls directly to the BASIC ROM. Reimplementing bits of BASIC would have used already scarce RAM. Licensing probably made the most sense in this case since little (if any) of the original BASIC code would have been of value and it offered the developer the opportunity to sell their software without publishing it themselves or maintaining the software if they found someone to publish it.

Re: The Applesoft Compiler (TASC): We have the source code, in a sense

#26
post #13

The article doesn't ever explicitly say so, but Chen expects the reader to understand from his words that TASC was written in Applesoft BASIC ! Further, TASC's coverage of BASIC keywords is almost entirely complete, going by chapter 7 of the manual. Any given Applesoft program has a very high chance of successfully compiling out of the box, and the very few differences with the interpreted language can be easily work…

> The article doesn't ever explicitly say so, but Chen expects the reader to understand from his words that TASC was written in Applesoft BASIC!

It's part of the manual quote at the top of the article, 2nd paragraph of the quote (5th of the article):

> All three passes were written largely in Applesoft, and TASC was used to compile itself.

Re: The Applesoft Compiler (TASC): We have the source code, in a sense

#27
post #22
post #21

Earlier quoted context omitted.

Back of the manual states: Microsoft TASC was developed by James Peck and Michael T Howard

The post states that it was developed by a single guy though.

It's possible someone else worked on it later.

Re: The Applesoft Compiler (TASC): We have the source code, in a sense

#28
post #19

On a side note, early Microsoft’s business strategy seems to be licensing half-baked software written by independent programmers and then making a product out of it.

They did that for years, just not as much these days. Visual Basic was an outside product/demo developed by Alan Cooper. The infamous Visual Source Safe [0] was originally sold by One Tree Software in Raleigh (the word "Visual" was added by Microsoft)

[0] Microsoft's own source control product that it replaced was Microsoft Delta. Believe it or not, Source Safe was a major improvement over Delta.

Re: The Applesoft Compiler (TASC): We have the source code, in a sense

#30
A tangential story about renaming variables to save memory...

Back in the early 2000s, I worked at EA on Madden Football. I was working on a project to replace the old system Madden used for the game's UI (HUD, menu screens, etc.) with a new one based on Flash. A very smart engineer out of EAC in Vancouver wrote a custom ActionScript bytecode VM that could run on consoles and I was integrating it into Madden's game engine.

I was a lowly tools and UI engineer. In EA's culture back then, that placed me near the bottom just above QA on the prestige totem pole. One of the lead engineers on Madden wanted to talk to me about how much memory the new UI system was using.

I explained that part of it was that we needed RAM for all the variable names. He looked at me like I was an absolute idiot and condescendingly explained that compilers for programming languages don't keep the name of the variable around. The name is just used to identify a storage location and you only need memory at runtime for the value. He may or may not have hinted that this was something I was expected to understand if I ever wanted to become a senior engineer like he was.

So I sat down at his computer and tapped out this bit of ActionScript and ran it in our VM:

    var someVariable = "its value";
    var some = "some";
    var variable = "Variable";
    trace(eval(some + variable)); // Prints "its value".
Here, it's dynamically computing a string, which is then used used to look up the value of a local variable by that computed string name. In order for this to work, every variable name must be kept around in memory.

The look of confusion and anger on his face was priceless.

(You might rightly wonder why in the hell EA picked a dynamically-typed scripting language with eval() that required keeping variable names around in memory for consoles that were incredibly resource constrained. The answer was that they struggled to hire UI artists who were willing to use the previous weird proprietary tools. They figured if they moved to Flash, they could hire Flash artists. Also, it meant they didn't have to maintain a custom UI editing tool.)

Post reply on HN