3 ms·
I blame fervent fanboyism of any particular hardware or software for leading us to such levels of distraction. The article mentioned something dear to my heart
by zackmorris 12y ago
I blame fervent fanboyism of any particular hardware or software for leading us to such levels of distraction. The article mentioned something dear to my heart that I want to expand upon because I think it’s at the core of what’s preventing real progress not just in computer science but in the way computers elevate humanity. One of my biggest dreams is to see a reconciliation between message passing languages like Smalltalk/HyperTalk and functional languages like Lisp. They are more similar than they may seem.
For example functional languages eschew the use of variables but I think that has set back their adoption because variables merely attach human readability to logic (like comments). Seeing a big blob of functions is great for brevity but disastrous for long term maintenance. A compiler can trivially treat variables (especially immutable ones) like macros and transform them back into the same syntax tree that pure functional code generates. To say that another way: why don’t functional paradigms suggest that we break long blocks of code into shorter blocks with variables? They seem to be discouraging human instinct when there is no cost in encouraging it.
Also if we take a step back and see that the elimination of globals gets us most of the way to functional programming, then the main thing left is the notion of time due to externalities like input/output. Imagine for a moment working in a lisp environment using REPL. When you type some code and hit enter, how is that fundamentally different than a monad? Well, it potentially triggers the entire syntax tree to be reevaluated which is actually more expensive than handling input with a monad. But metaphorically it’s similar - we can just think of monads as places where the logic can’t proceed because it’s missing a piece of the puzzle. If we were using functional programming properly and assumed that we had a near-infinite number of cores and flops, we’d quickly see that monads are the bottleneck.
We should be able to translate between global-less Smalltalk message handing and Lisp monads, and let the compiler optimize away any monads that don’t depend on external state. To me, that suggests that working at a level below human-readable/imperative is generally a waste of time. We should be able to select any code block and use a dropdown menu to select the language we want it presented in. I remember the first time this hit me and I asked myself if it was possible to write something in HyperTalk/Smalltalk/C (or any other imperative language) and covert that to Lisp with these conventions. The answer to me is pretty self-evidently yes. Going the other direction from Lisp to an imperative language is even easier.
A ramification of this is that if you converted a C loop that uses immutable variables and no globals to Lisp, it would be evaluated into the most minimal logic possible because analysis would reveal that (for example) the elements being iterated over have no side effects between one another. In other words, the compiler would independently parallelize the loop and derive something analogous to map/reduce. Why are we doing that by hand? Surely there has to be a better reason than brevity but I struggle to find one.
When it’s all said and done, I think the arbitrary distinctions we’ve made between computer languages are relevant to education and worker productivity, but in the end are fantasy. I would have thought by now that we would have dropped the pretense. If computers worked the way I had imagined they would by this point in history, a tablet would have at least 1000 cores (or drop the notion of cores entirely and go with functional hardware), the compiler/runtime would consider the latency between it and the other devices around it in the mesh and adapt accordingly, all processes from the kernel to userland services to executables and threads would just be functions with the minimum permissions necessary to do their jobs, and most importantly usage would be reversed so that users would write macros through the use of human language rather than try to figure out how to do a task by hand from a locked down sandbox. All this code would be shared out to the world through some kind of hybrid Git/BitTorrent so that the solution for how to perform some declarative programming task would almost always already exist. And all of that would be constantly evolving with genetic algorithms and other software agents.
The tablet may as well not exist, because with the world’s computing power at your fingertips, why is your dumb terminal any better than another except for eye candy? It’s reminiscent of idol worship. Kind of gives me the heebie jeebies actually. And tragically moves us further away from technoliteracy with each passing moment.