Remix.run Logo
hgoel 3 hours ago

I think it's about if there's a possibility of it being zero. Of course there's no way to tell at compile time that a value will definitely be zero.

So, in pseudocode

int div(int a, int b): return a / b;

Would probably be a compile time error, but

int div(int a, int b): return b == 0 ? ERR : (a /b);

Would not, or at least that's what I'd expect.

rdevilla 2 hours ago | parent | next [-]

> Of course there's no way to tell at compile time that a value will definitely be zero.

Yes there is. Dependently typed languages like Idris can inspect terms at the value-level during compile time. Rather, instead of proving that the divisor will be zero, you must instead statically prove that the divisor cannot be zero; otherwise the code will not typecheck.

hyperhello an hour ago | parent [-]

Okay,

int integer_division(int a, int b) { if (b!=0) return a/b; raise(SIGFPE); }

Great.

rdevilla an hour ago | parent [-]

You don't appear to understand the difference between runtime and static analysis/compile time, or term-level and type-level.

hyperhello an hour ago | parent [-]

Great! Explain it to us while I read to my kid!

rdevilla an hour ago | parent | next [-]

Don't get mad because you're too lazy to even ask the AI. You are first to be replaced in the workforce.

Or maybe it's over your head and you should just stick to reading children's fiction after all. Want some colouring books too?

hyperhello 9 minutes ago | parent [-]

Yes! We can always use more books and toys here!

cjbgkagh an hour ago | parent | prev [-]

The ‘let me google that for you’ is set to be replaced with ‘let me ask ChatGPT for you’.

still_grokking 2 hours ago | parent | prev [-]

Or it's just some AI brain fart…

The whole things looks vibe-coded, and vibe-designed.