3 ms·
I think it's possible to design such language. My idea is, wrap an expression, then calculate if it's false then automatically try catch.
by revskill 4y ago
I think it's possible to design such language.
My idea is, wrap an expression, then calculate if it's false then automatically try catch.
- yellowapple 4y agoThe "calculate if it's false" is still an "if", though. At the end of the day it's still a conditional jump. The only way I see about avoiding that is by having the language target a "MOV machine" - that is, one where the only possible operation is to move values to/from memory. Conditionals would then work by writing values to predetermined addresses, reading a result from some predetermined address, and writing that result into the instruction pointer. This is cheating, of course (you've only punted the "if"s to the machine itself), and I wouldn't exactly call it "high-level", but it does technically satisfy the criterion of the language itself having no concept of a conditional jump (so long as it remains blissfully unaware of what the addresses it's reading/writing actually mean).