it's terrible advice for actual programmers though because often 0 is a sentinel value with special meaning for systems that you don't have control over (sometimes because of pre-digital conventions that shouldn't be lightly fucked with).
This is usually done by PL's that want to avoid crashes at all costs, but "turning crashes into subtle logic errors" seems like a really bad idea.
"As mentioned before, this is not a post about what’s practically a good idea. All I’m arguing is that mathematically, we can extend division in this way without leading to a contradiction. Programming languages are different from mathematical formalisms, and should be different. I prefer that 1/0 is an error, because I’m not using my program to prove theories."
Please do yourself a favor and actually read it.
Besides, 0 as a sentinental value on disk or on the wire is fine, but once you have values in a programming language, use option types. This is not 1980s anymore, you don't need to use 0 or -1 or 0xffff to express something special which sooner or later just falls on your feet.
I read the article. As someone who was a math major I get why it's "fine". But nowhere in the article does hillel explain WHY it's bad for a real pl. (And defenders of e.g. pony gleam point to this article too to say it's okay. It's not.) I am adding context.
> This is not 1980s anymore, you don't need to use 0 or -1 or 0xffff to express something special which sooner or later just falls on your feet.
No. You missed the whole "real world systems". E.g. like stock trading, where zero stock trades are tombstones.
Ah, that's apprecitated. Indeed, he didn't provide that "why" and tbf that wasn't the point of the article. But thanks for adding that context.
> You missed the whole "real world systems". E.g. like stock trading, where zero stock trades are tombstones.
Hm I don't think I missed that. This counts as "on the wire". Externally, there are surely good reasons for that representation, though I'd argue that internally it's better to represent this in the type system instead of special casing 0 everywhere which can be forgotten and then you get your (potential) division-by-0 issues. Avoiding them by construction is even better than failing explicitly (which I agree is in turn still better than silently returning 0).
you dont have control over it. if you emit a zero stock trade your broker's account (a system outside of your control) it might get zeroed instead of having "no shares bought". this could happen for example if you periodically buy a quantity of shares based on some average of some measurement and zero measurements got taken over the time window. and you can't make that "irrepresentable in the type system" if you didn't know that in advance. did you know that it is a convention that zero stock trades were tombstones?
or imagine your are building something that flies a plane and airspeed is measured as an average of some measurements, and the instrument flakes over your sampling interval. all of a sudden your system thinks you are at a stop. erroring is better because no further instructions based on incorrect data will propagate and shit in the pool.
1/0=0 does not immediately make you stop and think well wait a second, and it could even be hidden behind an function like avg(...)
if you want a nocrash division that's fine but it shouldn't be "/"
Be careful, this will force your defaults over system defaults possibly overriding compliance or security settings. There are a few places I noticed where well-placed malware could hop in etc.
It’s not bad software, it’s also not mature. I’m currently on a phone and on vacation so this is the extent of my review. Maybe I’ll circle back around with some PRs next week
i feel like there ought to be a meaningfully large market for a "trusted" company where part of the brand identity is being able to form sentences that do not include the token "ai", especially with e.g. microsoft's recent excesses in this direction, but what do i know about the alleged realities of running a tech company in $YEAR
> There is also a reasoning version, which might be a bit amusing in an interactive voice chat if it pronounces the thinking tokens while working through to a final answer.
last i checked (months ago) claude used to do this
one solution that appeals to me (and which i have myself used in online spaces where i don't speak the language) is to write in a language you can speak and let people translate it themselves however they wish
i don't think it is likely to catch on, though, outside of culturally multilingual environments
i imagine the real answer is that the edits are local because that's how diffusion works; it's not like it's turning the input into "five-legged dog" and then generating a five-legged dog in shoes from scratch
(discussion: https://news.ycombinator.com/item?id=17736046)