Live data from Hacker News

For mathematicians, = does not mean equality

jeremykun.com

51–60 of 206 posts

Re: For mathematicians, = does not mean equality

#51

When I learnt programming, i was confused by x=x+1; After I understood what it really meant, I wondered why they didn’t use some other symbol to capture this semantic. Say something like x <- x+1 ; Which implies assignment rather than equality - That way this would be unambiguous and I feel is more clear. I now guess the choice of using ‘=‘ was probably an attempt at making a (compromised) choice given the limited sy…

Go write a couple hundred lines of R (please don't actually do this R is atrocious imo) and then you'll understand why '=' is used instead of '<-' - because it's a pain in the ass, even with hotkeys

Re: For mathematicians, = does not mean equality

#52

When I learnt programming, i was confused by x=x+1; After I understood what it really meant, I wondered why they didn’t use some other symbol to capture this semantic. Say something like x <- x+1 ; Which implies assignment rather than equality - That way this would be unambiguous and I feel is more clear. I now guess the choice of using ‘=‘ was probably an attempt at making a (compromised) choice given the limited sy…

Some languages made slightly better design choices, just not the ones that became super popular!

https://en.wikipedia.org/wiki/Assignment_(computer_science)#...

Re: For mathematicians, = does not mean equality

#54
post #51

When I learnt programming, i was confused by x=x+1; After I understood what it really meant, I wondered why they didn’t use some other symbol to capture this semantic. Say something like x <- x+1 ; Which implies assignment rather than equality - That way this would be unambiguous and I feel is more clear. I now guess the choice of using ‘=‘ was probably an attempt at making a (compromised) choice given the limited sy…

Go write a couple hundred lines of R (please don't actually do this R is atrocious imo) and then you'll understand why '=' is used instead of '<-' - because it's a pain in the ass, even with hotkeys

R has = as well which has been working equivalently for me so far. Any caveats?

Re: For mathematicians, = does not mean equality

#55
post #51

When I learnt programming, i was confused by x=x+1; After I understood what it really meant, I wondered why they didn’t use some other symbol to capture this semantic. Say something like x <- x+1 ; Which implies assignment rather than equality - That way this would be unambiguous and I feel is more clear. I now guess the choice of using ‘=‘ was probably an attempt at making a (compromised) choice given the limited sy…

Go write a couple hundred lines of R (please don't actually do this R is atrocious imo) and then you'll understand why '=' is used instead of '<-' - because it's a pain in the ass, even with hotkeys

Hey, hey, hey! R IDEs give plenty of options which utterly mitigate such alleged difficulties:

https://stackoverflow.com/questions/1741820/what-are-the-dif...

Re: For mathematicians, = does not mean equality

#56
Some more food for thought on the meaning of =, from Girard's "Proofs and Types" [0]:

> There is a standard procedure for multiplication, which yields for the inputs 27 and 37 the result 999. What can we say about that? A first attempt is to say that we have an equality "27 x 37 = 999". This equality makes sense in the mainstream of mathematics by saying that the two sides denote the same integer [...] but it misses the essential point: There is a finite computation process which shows that the denotations are equal.

> [...] if the two things we have were the same then we would never feel the need to state their equality. Concretely we ask a question, 27 x 37, and get an answer, 999. The two expressions have different senses and we must do something (make a proof or a calculation, or at least look in an encyclopedia) to show that these two senses have the same denotation.

[0]: http://www.paultaylor.eu/stable/prot.pdf

Re: For mathematicians, = does not mean equality

#57
post #6

This. It's even more obvious in linear algebra where mathematicians routinely start with the premise "Ax = b", even if there is no solution x that would satisfy the equation exactly.

The supposition in instances like these is one expressing a notion of equivalence, whether or not an equality results in a contradiction doesnt mean that the meaning of the symbol has changed.

Re: For mathematicians, = does not mean equality

#58

When I learnt programming, i was confused by x=x+1; After I understood what it really meant, I wondered why they didn’t use some other symbol to capture this semantic. Say something like x <- x+1 ; Which implies assignment rather than equality - That way this would be unambiguous and I feel is more clear. I now guess the choice of using ‘=‘ was probably an attempt at making a (compromised) choice given the limited sy…

this is exactly how R syntax works

Re: For mathematicians, = does not mean equality

#59
post #38
post #26

Earlier quoted context omitted.

>> If mutation is so great, why do mathematicians use recursion so much? > Huh? Huh? The deal here is surely that induction and other recursive approaches are conducive to being reasoned about in traditional mathematical contexts (e.g. taking a walk). Mutation is impossible to keep track of, mentally. Though others' mileage will vary on that.

For the record the "Huh? Huh?" is a quote from the article.

OK. Downvotes happily accepted; but I think we all operate in "peephole" mode now; the cost of tracing sources back to the original is significant.

There is no karma to be had from complaining about HN's software, and yet it is so very inadequate.

Re: For mathematicians, = does not mean equality

#60

When I learnt programming, i was confused by x=x+1; After I understood what it really meant, I wondered why they didn’t use some other symbol to capture this semantic. Say something like x <- x+1 ; Which implies assignment rather than equality - That way this would be unambiguous and I feel is more clear. I now guess the choice of using ‘=‘ was probably an attempt at making a (compromised) choice given the limited sy…

Similar notation is already used for mappings in general albeit from left to right with the bar arrow, and obscures one of the necessary characteristics of recursive functions, which is a mapping to the natural numbers.

Edit: Misunderstood, thought you were talking about math, not programming languages.

Post reply on HN