Remix.run Logo
csomar 4 days ago

It is not more complex. It is a complex problem and raising exceptions is akin to just giving up (vs. properly handling and reporting the errors).

nromiun 4 days ago | parent [-]

That is akin to saying using a GC is giving up on safe memory allocation, and the borrow checker is the only solution to a complex problem. Exceptions are handled gracefully in real world projects as well, otherwise Python, Java etc would have died a long time ago.

tcfhgj 4 days ago | parent | next [-]

Maybe you are not giving that up, but you are giving up doing memory management "properly", i.e. use more memory and CPU time than necessary for convenience.

nromiun 4 days ago | parent [-]

Like writing only in assembly is "proper" programming? Using more memory and CPU time than necessary for convenience?

tcfhgj 4 days ago | parent [-]

systems programming languages compile right down to machine code

nromiun 4 days ago | parent [-]

Both borrow checker and GC use malloc/free internally as well. According to you there is no difference between the two.

tcfhgj 4 days ago | parent [-]

yes, there is: GC will not use stack allocation and it will add another layer of memory management resulting in significant memory overhead (runtime overhead)

csullivannet 4 days ago | parent | prev [-]

Maybe this is my Golang dev leaking, but I intuitively thought that `try: / except:` in Python is essentially the same thing as `if err != nil`, just my IDE doesn't scream at me if I don't catch them.