Hacker News new | past | comments | ask | show | jobs | submit login

This seems fascinating. Can you share a more detailed description?

Like, what kind of data compression algo you chose at that time and what were the choices?

How did the techniques you developed at that time helped you later and what significance/standing they have in today's programming world?

How did your spell checker turn out in terms of performance and memory?

Were there better implementations around at that time? Which one was widely accepted as the best one?

Thanks in advance!




Happy to. I was 15 at the time, so I had limited knowledge of algorithms. So, I invented my own :)

IIRC I packed each character into 6 bits, using the first 26 values for A-Z, and the rest of the values for the common 2-3 grams that I found in the back of a dictionary in the local library. I had some other scheme for building words from stem + suffixes (eg flood, flooded).

What I learned the most from that experience was mostly around reverse-engineering and perseverance. I had to figure out what the 1541 drive did by disassembling its ROM and following the boot sequence. When comparing it to a 2040 drive (a older dual drive variant that was much more expensive - something like $2500 in 1981 dollars) I knew quite a bit about the sector interleave spacing - the disk could do sustained 2 sector reads per revolution. So I knew there was room for improvement if I could just get the transfer rate between the disk and the C-64 to go faster. I did that by improving how it transferred bits down the wire. To cut costs, Commodore had a serial interface vs. the parallel IEEE-488 interface used in the 2040 / Commodore PETs of the previous generation. They had a super inefficient algorithm where they did a handshake for every bit that went down the wire. This was due to the VIC chip in the C-64 stealing cycles from the 6510 CPU whenever it needed to read from shared RAM. Since they weren't clever enough to figure out when the VIC chip would steal cycles they did a handshake for every bit.

I improved this by asynchronously transferring 2 bits at a time using the clock and the data lines for ~3 bytes. I could read a register on the VIC chip that would tell me what scan line was being processed and from that I could tell when the VIC chip would steal the bus. Also on the vertical flyback I would be able to transfer bits with impunity.

This speed boost made it possible for me to hit the interleave on the disk and get the transfer back up to ~25Kbps.

These were pretty low level hacks (that worked quite well) to get things to go fast. Not sure how any of that transfers to the things we do today. One thing's for sure, I don't think I'll ever understand a modern computer as well as I understood those computers of my childhood.

The spell checker was completely IO bound. The 1541 stored ~170KB of data. The words on disk were sorted and I generated a unique sorted list of words in memory. It was, at the time the fastest spell checker for the Commodore 64, it was packaged with a popular word processor of the time called WordPro 64. Most of the other spell checkers had much smaller dictionaries and took a LONG time to read the disk. I could read 170KB in something like 70s, which, using my data transfer improvements was 5x faster than any other spell checker at the time. I'm pretty sure I had more words in my dictionary too. But things are a bit fuzzy - that was nearly 30 years ago!




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

Search: