Hacker News new | past | comments | ask | show | jobs | submit login

Panics _can_ sometimes conceptually share the same implementation as exceptions, but given that their usage is not the same, and the fact that the ecosystem doesn't use panics as exceptions, it's a bit of stretch saying they're "functionally" the same.

A bit like saying trains and chairs are functionally the same since they both can have wheels; when there's the crucial difference that chairs don't go choo-choo.




> given that their usage is not the same, and the fact that the ecosystem doesn't use panics as exceptions, it's a bit of stretch saying they're "functionally" the same.

No, these don’t matter. Every langage with exceptions uses them differently, that doesn’t make Python’s no-exceptions and Java’s exceptions.

Regardless of how it’s used, it either is or is not an exceptions system. That’s what “functionally” means.

For instance Go’s panics are an exceptions system, you can always recover() and handle the exception during its unwinding.

> A bit like saying trains and chairs are functionally the same since they both can have wheels

No, it’s like saying an HSR and an ore train are functionally similar, because both are trains even though they’re used differently, in different contexts, and with different performance profiles.


You are arguing on technicalities. By your logic signals are also exceptions, and so is poking a screwdriver into the RAM port. Makes no sense.


On hw level, memory access errors and hardware malfunctions are often called exceptions. For example, on x86 the MCE architecture does this.


Windows exceptions are the equivalent of UNIX signals.

On hardware level exceptions are a synonym for traps.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: