Ask HN: Works of fiction that have inspired you to solve programming problems?
Often times, programmers turn to music to get their brain ready for coding. Have you ever felt the same kind of inspiration after reading works of fiction by certain authors?
In other words, I wonder if the structure, language, composition etc in a novel might "open up" the reader's brain in a similar way that e.g. musical works by Bach or Philip Glass seem to get some coders "in the zone".
(
14 comments
| 27 points
| on HN
)
Also, I'm going to list these from 1 to 2, but the first is an order of magnitude better then the second, so think of them on an inverse log scale.
1. David Foster Wallace's short story "The Awakening of My Interest in Annular Systems". DFW is a brilliant writer in general, but his writings on math and logic have always been so unique and powerful to me. This one is my favorite. There's this combination of melancholy, and mathematical precision that was one of the first times I started to think about the beauty of analysis, and in particular, abstracting n-dimensional geometric space.
2. Peter Watt's novel "Blindsight". Blindsight has a very different mathematical feel to it, compared to DFW's stories. It's almost the opposite. Very sloppy (stylistically, not in terms of accuracy), filled with jargon, and always slightly outside the limits of my comprehension, (actually a lot of times just plain outside the limits of my comprehension). But that layer of overwhelming, rapid-fire technical description ends up creating this very interesting, frenetic, cyberpunk/dystopian aesthetic, as the plot builds momentum.
Honorable Mentions/Other stuff:
- Watt's "Echopraxia" (sequel to Blindsight)
- Neal Stephenson's "Anathem"
- Arthur C. Clarke "Rendesvous with Rama"
- Greg Egan's "Permutation city" and "Diaspora"
Art/Architecture:
- Philip Beesley's Hylozoic Soil installations (my advisor in uni!)
- All of Junya Ishigami's installations/architecture.
- All of Rafael Moneo's buildings & writings.
I have occasionally wondered about writing a programming language optimised for spoken word; not just the basics of trying to avoid sigils and punctuation, and of course significant whitespace, but also trying to make it possible to write code that has "metre" and rhyme to it.
I found an interesting recent discussion on Lambda the Ultimate about human cognition, coding, and programming language syntax:
http://lambda-the-ultimate.org/node/5614
The MIT neuroscience research that this LtU thread refers to was also discussed on HN:
https://news.ycombinator.com/item?id=25434854
And another HN thread on perceiving code vs written word:
https://news.ycombinator.com/item?id=7091495
Perl can be close to this, and Larry Wall was fond of this aspect of the language, but it's also one of the most sigil-infested languages that isn't APL. APL itself stands proudly at the other end of the spectrum, for pure mathematicians.
Lisp has the problem that brackets aren't readily pronouncable and deeply-nested clauses aren't idiomatic English. Although I have noticed that programmers are far more likely to speak English with nested clauses than non-programmers.
Forth relies too heavily on the stack for my taste; ideally for me languages specify the variables they operate on by name, although an English-like language could clearly use "it" in the way that Perl uses "$_".
Rebol, like LOGO, is clearly Lisp with square brackets. Tcl is another candidate in this area that I have a soft spot for, but its reliance on string operations means it needs escape characters a lot.
Ironically I think the closest may be COBOL and its predecessor, Grace Hopper's FLOW-MATIC. These languages "correctly" end statements with a full stop "." rather than the unnatural semicolon ";" or the invisible newline. The problem is that COBOL pre-dates structured programming and object orientation by a long way. I don't think attempting to adapt them directly would be a good idea, but building something with some of the same principles might work.
- The Machine Stops, E.M. Forster
- Erewhon, Samuel Butler
- The Alchemist, Paulo Coelho
The styles and formats are completely different. The only common thing I can think of is that there's this invisible guiding force in all of them, whether it's good or bad. The Machine Stops is a dystopia about technology in absence of a soulful humanity. Erewhon is wild. Truly wild. It has to be a genre all its own, something akin to Darwinian technopunk. The Alchemist is probably one of those novels you could riff on with a yoga instructor and have a good conversation :joy:. It's classical magical surrealism, but it's a good story about a person's lifetime journey. Nothing deep, but it's wholesome.
Edit: also will add A Canticle for Leibowitz by Walter Miller Jr., and Titus Groan by Mervyn Peake.
There's a cool programming project already based on this short story that I've enjoyed exploring: see https://libraryofbabel.info/
And looks like there's a link to the story on archive.org: https://archive.org/details/TheLibraryOfBabel/
I wonder how would reading this kind of stuff actually stimulate our brain, as compared to solving coding or maths puzzles.
E.g. the book linked above, Perec's "Life: A User's Manual", was "heartly recommended" by Don Knuth [2].
1: https://en.wikipedia.org/wiki/Life:_A_User%27s_Manual
2: https://www-cs-faculty.stanford.edu/~knuth/retd.html
.. maybe I likes the verbosity?
Asteroids are an existential threat. Verbosity is a style that some people enjoy.