Live data from Hacker News

How Unix spell ran in 64kb RAM

blog.codingconfessions.com

11–20 of 53 posts

Re: How Unix spell ran in 64kb RAM

#12
You can write an external memory spell checker with a tiny amount of RAM: something like

   - sort the words in the document
   - eliminate unique words (they sort together)
   - merge the sorted words with the sorted dictionary and keep only the missing words
I saw this in BASIC in Creative Computing and got it working in on my TRS-80 Color Computer which had much less than 32k of available RAM, so that was the first thing I thought when I saw the headline.

Now this blew people away when it came out

https://winworldpc.com/product/turbo-lightning/1x

it had a compressed dictionary that would fit together with the other programs you were running on a PC and spell check as you typed; there was a 640k limit for the PC but it could only use a fraction of that so as not to interfere and in the early days of the PC you couldn't actually afford to fill it out.

Re: How Unix spell ran in 64kb RAM

#15

How about 39kB for a video game with physics, dynamic graphics, two music tracks, sound effects, online high scores, and built-in instructions? https://news.ycombinator.com/item?id=38372936

Not the same when the machines in question are not on the same level...

Re: How Unix spell ran in 64kb RAM

#16

You can write an external memory spell checker with a tiny amount of RAM: something like - sort the words in the document - eliminate unique words (they sort together) - merge the sorted words with the sorted dictionary and keep only the missing words I saw this in BASIC in Creative Computing and got it working in on my TRS-80 Color Computer which had much less than 32k of available RAM, so that was the first thing I…

Link seems to be broken.

Re: How Unix spell ran in 64kb RAM

#17
For perspective, in 1983 or so, Grammatik on CP/M ran in under 64k and did "grammar checking" (spell checking, plus a bunch of expert system rules) on an 8-bit system. (It sticks in my memory because of the time spent poking at the really interesting part: that it was so compact because it was in Forth, and there was enough of an outer interpreter in the product that with a little hex editing you could just use it as a Forth interpreter - with a very specialized set of functions preloaded :-)

Re: How Unix spell ran in 64kb RAM

#18

How about 39kB for a video game with physics, dynamic graphics, two music tracks, sound effects, online high scores, and built-in instructions? https://news.ycombinator.com/item?id=38372936

Sizecoding is a thing. .kkrieger is a rather famous 96kB FPS game. There is even an entire demoparty called Lovebyte that is dedicated to it, the biggest category is 1k, but all demoscene events I can think of have a sizecoding competition of some kind.

And it is a completely different thing. In general, it is more about procedural generation and tricks then good packing. Runtime packers are used, like crinkler and kkrunchy, but actually they use a lot of RAM, like hundreds of MB, which is a bit surprising considering that the decompressed executable is in the tens of kB. But that's because they use very powerful but slow compression algorithms.

Sizecoding usually doesn't care about RAM, unless the platform requires it, the only think that matters is the size of the executable file and its data. For that 39kB Playdate game, I guess that's the same idea. The Playdate has 16MB of RAM, I bet the game took full advantage of it.

Re: How Unix spell ran in 64kb RAM

#19
One of the things that got me intrigued by Unix was an early 1980s(ish) Byte article which walked through building a (trivial example, not the "real" one) spell checker out of a split/sort/comm pipeline, something like 7 commands? 8-bit PCs didn't have anything like that, and yet it didn't look like it needed that much sophistication...

Re: How Unix spell ran in 64kb RAM

#20
post #5

Marginally related... has anyone ever ported the "typo" program to modern C?

For reference, https://github.com/robpike/typo/blob/master/unix/typo.c

Also for reference, for those who aren't familiar with typo and don't want to read the C source code listed above (side-comment: citing the comment-free source code 'for reference' is hilarious. Thank you for the laugh :) )

https://github.com/robpike/typo/blob/master/typo.png

Post reply on HN