Hacker News new | ask | show | jobs
by tremon 1314 days ago
I don't think I agree with that. To me, the imperative vs declarative distinction is about the outside interface, not how the instructions are executed internally.

All code is also imperative, eventually, at the machine code level

But such a reduction is not useful. That's the same as stating that all computers are analog at the electrical level, or that the Internet is a series of tubes at the physical level.

Things like a function called give_me_a_temporary_file()

This seems purely imperative to me. A declarative statement would be (exists temporary_file). But that is a bad example anyway, as I struggle to find a good use case for why the end state of an instruction set would be the existence of a temporary file. If your goal is to perform subsequent steps with that temporary file, you're working with an imperative interface regardless of how you write it down.