r/transprogrammer • • Jul 20 '24

Implementing exceptions

Just wanna know if anyone knows a more time-efficient way of implementing exceptions in a language than this or sees any issues with this design :3

(I know this flow chart sucks, sry)

handlethrow would exist separately for each try-catch clause

(obv this will only work for x86 but smth similar should work for all major architectures)

15 Upvotes

25 comments sorted by

View all comments

Show parent comment

1

u/definitelynotagirl99 Jul 22 '24

Certainly a docstring can be used with the first example, but LSPs don't consider docstrings when type-checking your code.

in the case of C+=2 the compiler acts as the LSP so this wont be an issue.