4 ms·
> My opinion: Humans are good at thinking sequentially, imperatively. It's more basic than that. The underlying CPU is unabashedly sequential and imperative.
by ThrowawayR2 9y ago
> My opinion: Humans are good at thinking sequentially, imperatively.
It's more basic than that. The underlying CPU is unabashedly sequential and imperative. It even uses (shock, horror) bare GOTOs, i.e. conditional and unconditional jump instructions.
These other models might be more mathematically elegant in some abstract sense, sure, but I'd rather work with the underlying hardware than fight against it.
- tom_mellior 9y agoIf you think that functional and logic-oriented programming languages "fight against" the hardware, you may have missed a few decades of developments in efficient compilation and interpretation of such languages. Hint: Internally, they use (shock, horror) GOTOs just like other programming languages, to the same effect.
- nickpsecurity 9y agoThe major ones usually target an abstract machine or intermediate language which is implemented in low-level ways. Those abstract or intermediate languages help the logic and function oriented languages compile easier. I'd love to see them go straight from high-level Haskel or Prolog to LLVM bytecode with LLVM's optimizations handling the rest. That would be interesting in light of your comment. Instead, the intermediate, abstract forms remain out of utility or necessity.
- tom_mellior 9y agoLLVM bitcode is too low-level for many of the optimizations, such as deforestation and similar optimizations of functional programs. It is useful for later, low-level things, and there is a good LLVM backend for GHC. At the same time, LLVM is too high-level for some other things, such as Prolog's particular brands of stack unwinding and indirect jumps on backtracking.
- nickpsecurity 9y agoThe first was expected. The second on Prolog optimizations was interesting.
- brians 9y agoIs that the interface you'd like to offer others? I love Prolog and its cousin datalog for authentication systems. It makes them extensible, offers user-comprehensible delegation semantics---of course I'm likely to implement that in something else.