Hacker News new | ask | show | jobs
by q_eng_anon 2496 days ago
Also, say I implement the visitor pattern in some language on a classical machine - aren't there branch instructions being used under the covers anyway?

(the code will probably be more optimized / easier to optimize for the compiler but you get my point)

1 comments

Yes, because the machine language of ordinary CPUs uses a specific model of computation where branch instructions are the only way to effect conditional control transfer. But the idea of conditional control transfer is there in every interesting programming language to allow a program to react to its inputs.