4 ms·
> Seems like something a language ought to forbid, anyway > What about the rest of my comment? The expression problem? Navigating around the expression proble
by ukj 7y ago
> Seems like something a language ought to forbid, anyway
> What about the rest of my comment? The expression problem?
Navigating around the expression problem is precisely what I am demonstrating. A language ought not [1] decide for me what I am allowed to express or not. I have a healthy disregard for linguistic purism [2].
Expressive power is the ability to say whatever I want to, whenever I want to. That is precisely what a para-consistent logic buys me - expressivity [3].
This is counter-intuitive to most people who have been taught to value consistency above all else (mathematicians, logicians). Non-contradiction is an axiom, not a law - it's a false authority. A man-made deity.
> it's nothing special
I didn't claim it's anything special - I merely claimed that I can say it. I did say it.
If "Haskell can say everything Ruby can" then go ahead and say it in Haskell. I am not saying it's impossible - but I a curious how you might navigate the Turing tarpit [4].
>It's a trick because your first "p" and your second "p" aren't the same "p"
First p and second p? You mean p@time(1) and p@time(2)?
Are 'you' not the same 'you' as the 'you' from 1 second ago, despite the ongoing changes in your body?
Ironically, that is the disconnect between pure functions and reality. Side-effects are the norm, not the exception.
>That getters/setters are an anti-pattern in OOP languages (just ask Alan Kay...)
That's an appeal to authority. Alan Kay doesn't get to make decisions for me. He gets to voice his opinion - I get to evaluate the pros and cons. The choice is always mine.
Like I said - In my problem-space lack of choice/control is an anti-pattern. Humans get the final say - not algorithms.
[1] https://en.wikipedia.org/wiki/Is%E2%80%93ought_problem https://en.wikipedia.org/wiki/Is%E2%80%93ought_problem
[2] https://en.wikipedia.org/wiki/Linguistic_prescription https://en.wikipedia.org/wiki/Linguistic_prescription
[3] https://en.wikipedia.org/wiki/Paraconsistent_logic#Paraconsistent_logics_and_classical_logic https://en.wikipedia.org/wiki/Paraconsistent_logic#Paraconsi...
[4] https://en.wikipedia.org/wiki/Turing_tarpit https://en.wikipedia.org/wiki/Turing_tarpit
- szemet 7y agoAnd what about starting out with something like: data ParaBool = False | True -- | Both - if needed for three valued logic Then implement your operators. Then everything is what it is defined to be. How can this be worse than sneakingly changing semantics of already defined things? In a free world it should be legal to sell copper as gold, call the lies truth, and mix newborns in hospital - and people are just stupid if they want laws against these... ;)
- ukj 7y agoStrawman. You are conflating denotational semantics [1] with operational semantics [2]. In the free world, a pilot is free to recognize that the 'already-defined autopilot' is doing something stupid/dangerous (despite all the green lights) and is able to take control of the system at run-time - he doesn't have the luxury of fixing this bug at compile-time. In a free world people are allowed to "sneakily change their minds" when they see an obvious denotational error. Beware of bugs in the above code; I have only proved it correct, not tried it. --Donald Knuth Type safety is not the same thing as system safety. The latter cannot be formalized - that is why humans are in charge. Not algorithms. Making laws against airplanes crashing is not the same thing as stopping airplanes from crashing. Here is a relevant extract from this paper[3]: "All ambiguity is resolved by actions of practitioners at the sharp end of the system. After an accident, practitioner actions may be regarded as ‘errors’ or ‘violations’ but these evaluations are heavily biased by hindsight and ignore the other driving forces, especially production pressure. " [1] https://en.m.wikipedia.org/wiki/Denotational_semantics https://en.m.wikipedia.org/wiki/Denotational_semantics [2] https://en.wikipedia.org/wiki/Operational_semantics https://en.wikipedia.org/wiki/Operational_semantics [3] https://web.mit.edu/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf https://web.mit.edu/2.75/resources/random/How%20Complex%20Sy...
- the_af 7y ago> Strawman. You are conflating denotational semantics with operational semantics But your trick is neither. The law of non-contradiction refers to the same proposition P in both positions, simultaneously: > "To express the fact that the law is tenseless and to avoid equivocation, sometimes the law is amended to say "contradictory propositions cannot both be true 'at the same time and in the same sense'" [0] Yours isn't "at the same time" because each evaluation of P (which in your case is a programming function with side effects, neither a proposition nor a mathematical function) depends on the other evaluation to cause a side effect. So you're cheating, you haven't expressed anything innovative or outside the realm of other languages (including Haskell), and you haven't broken the law of non-contradiction. [0] https://en.m.wikipedia.org/wiki/Law_of_noncontradiction https://en.m.wikipedia.org/wiki/Law_of_noncontradiction
- the_af 7y agoYou're being disingenous. You are not really breaking the law of non-contradiction. At first I thought you at least had redefined the "not" or "and" operators, but you merely wrote a function which alternates between True and False with each invocation, using global state. You've written "true ^ !false == true", which of course violates no law. Hence: trickery. You're not expressing anything novel. This can be done trivially in Haskell making the global param explicit, and I'm sure with some trickery like the State monad you can even hide this. Maybe the syntax will be less neat, but this is a good thing: "hiding" things like side effects is bad. The expression problem relates to your assertion about adding getters/setters, and judging by your reply it seems you didn't understand this... So you're dismissing Alan Kay with no good reason. Furthermore, getters/setters have nothing to do with either extensibility or expressiveness. Why should I pay attention to your opinion?
- deleted 7y ago[deleted]