Neal Stephenson's 4th novel (After The Big U, Zodiac, and Snow Crash). A semi-sequel of sorts to Snow Crash – at least, it could be – it's more about nanotechnology. The full title is The Diamond Age, or A Young Lady's Illustrated Primer – the book itself isn't an Illustrated Primer, but one does factor heavily into it. A young girl comes across a book made of nanites that gives her all sorts of lessons in computer science, mathematics and logic in the guise of a story about herself.
There's also an undersea sex-cult!
It's been a while since I've read this one, but I remember that like a lot of Stephenson's work, it's got a good introduction, but not a great ending. (Though, it's a decent ending – it's not like the crapfest that was the ending to Cryptonomicon.) I remember it being about tied with Snow Crash for me; maybe Snow Crash was a little bit better, though. Dug this one, though.