Hacker News new | past | comments | ask | show | jobs | submit login
What happened to the source code for The AppleSoft Compiler? (youtube.com)
41 points by olvy0 on Oct 14, 2023 | hide | past | favorite | 9 comments



Here's a transcript:

"The Apple II computer had a floting-point interpreter known as AppleSoft BASIC, which Microsoft wrote. Microsoft also wrote a compiler for AppleSoft BASIC known as TASC, The AppleSoft Compiler, a really creative name.

The person who wrote The AppleSoft Compiler was a student, and came and wrote it while at Microsoft, spent the summer working on it, didn't quite finish, and had to go back to school, but that's fine. The next summer, he came back out ready to continue and pick up the project where he left off, except he didn't remember how any of it worked.

The problem was that The AppleSoft Compiler was itself written in AppleSoft so it was a self-hosting compiler. It was used to compile itself but the Apple II only had 48 kilobytes of memory, or 64 kilobytes if you added the language card, but AppleSoft didn't know how to use it so let's just call it 48.

In order to get the program to fit, he had to delete all the comments, and he had to shorten the names of all the variables to one or two characters where the most variables only had one letter names and that made it very hard for him to figure out what all these variables meant and how the program worked.

Somehow, he managed to figure it all out in time to at least finish the project and so the Microsoft, The AppleSoft Compiler, TASC, did eventually ship although nobody really understands how it works anymore."


Here's the related blog post[1], and a previous thread here.[2] You can try out TASC online[3], after you read the manual[4], of course.

You can ^C out of the online image, and do a catalog of the disk. I supposed someone with Apple ][ knowledge could extract the executables, and reverse engineer it from there.

[1] https://devblogs.microsoft.com/oldnewthing/20220419-00/?p=10...

[2] https://news.ycombinator.com/item?id=31138214

[3] https://archive.org/details/101_TASC_Compiler

[4] https://mirrors.apple2.org.za/ftp.apple.asimov.net/documenta...


This blog post by Raymond Chen contains more details than this short YouTube video:

https://devblogs.microsoft.com/oldnewthing/20220419-00/?p=10...


With hindsight he should have left the comments/variable names and written a preprocessor to remove before compiling.


Absolutely but if he was relatively inexperienced, which is somewhat likely for a college student, he may have fallen victim to believing that he'd remember it all when he came back to it. Afterall, it's all fresh in his mind and all makes sense when he's making the decision to strip all of that out instead of adding the preprocessing step. After getting burnt a time or two, one learns to ignore the current state of mind and realize things will be very different a year later.


TASC was written in AppleSoft. And AppleSoft was an interpreted language, no compiler. Variable names were stored uncompressed, so shorter names took up less space.


Preprocess and then execute the processed code then I guess


I still have my complete copy of TASC ( manual, disk and box) I purchased for about $300 back in about 1982 ....


Cool — it's a good reminder that system constraints can affect far more than performance. Also, I remember using that compiler — it really only made a difference, we found in our testing (YMMV), if the program was heavy on calculations; most other programs we ran through it felt a little faster, but not by much.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: