When I was a high school freshman about 17 years ago (yuk), I wrote a complicated self-modifying program in HyperCard. I wanted to write a program that could understand human sentences and reply accordingly, and figured that self-modifying code would be the best way to go about that. Of course it never quite succeeded, but the program was stable and could run for a very long time, and gradually improve. Debugging it was a real adventure.
There was a way to add 'external resources' to HyperCard stacks, and then call them from HyperTalk. I can't remember what they were called now, but there were 'functions' and 'procedures' I think. With those, you could get color working, or do really almost anything on a Mac, all from HyperCard.
They were compiled bits of code, so naturally my interest shifted towards making those instead. I wanted to try writing my own, instead of browsing eWorld and the nascent AOL for stuff written by that Peter what's-his-name.
Somewhere I was told that they were written in Pascal, so I got my hands on a copy of THINK Pascal, and started playing with that. It came with a really wonderful hyperlinked library of the MacOS toolbox. From there, to C, to assembly, and on and on.
I still have a real soft spot in my heart for HyperCard. If there were a modern equivalent, it would be perfect for teaching programming to beginners.
EDIT: I have an idea. If anybody happens to have an old pile of HyperTalk laying around, please email me. Address is in my profile.