News for hackers. Stuff that matters.

phizy

Re:Why I Prefer Functional Programming on Monday November 02, 2020 @07:51PM (#24975198)
You can do better, then. Read nendroids latest reply to me, and help them understand that it's the "use of statements" that makes a language imperative, not the "modification of state."

I won't be responding, and they seem to think they're quite the expert in this sort of thing.

Re:The surprising psychology behind being rich on Monday November 02, 2020 @06:13PM (#24974578)
That is absurd. You could work yourself to death scrubbing dishes and it will never match the returns of inheriting a fortune from your parents. You do not live in a world where wealth is meritocratically distributed.
Re:Why I Prefer Functional Programming on Monday November 02, 2020 @04:56PM (#24973909)
>What variable or data was mutated within haskell?

The stdout buffer.

Just because mutation isn't explicit doesn't mean it isn't there. Programming languages are not syntax devoid of meaning: they have semantics. What happens at runtime is part of what a programming language does. (Arguably, that is the most important part of what they do.)

>What this means is that imperative primitives must exist for any programming to work.

That's completely untrue. Imperative languages can be implemented as a subset of functional ones[1] and vice versa. Again, they're just different models. No language can do anything if it isn't implemented in a machine. A machine isn't "imperative"[2], it's a pile of atoms that do what atoms do, without paradigm or instruction. You absolutely could implement a pure functional assembly language. The reason nobody has, is because it doesn't matter: any Turing complete language can be used to implement any other language[3].

Try to implement `volatile` in C without using another language. Does that mean C fails to model real hardware? No, because it has `volatile` to get volatile semantics! Just like Haskell has IO to get I/O side-effects. Or ST to get mutation semantics.

> Use your algebra to make it work. You'll find it's impossible.

Don't assert it, Prove it. Show me one computable function that cannot be computed using boolean algebra.

[1] https://www.microsoft.com/en-us/research/wp-content/uploads/... [3] https://en.wikipedia.org/wiki/Lisp_machine [2] https://en.wikipedia.org/wiki/Turing_completeness

What's the difference? Let me quote them directly:

"Oh, you're one of THOSE people." (What people?)

"Trump is not being impeached." (Simple to verify, not up for debate.)

"Biden is not Trump's opponent." (Didn't need to be questioned, but apparently it's also up for debate?)

"There is no truth." (Then what are we talking about?)

"You can't trust CNN." (But anyone with a YouTube account and a webcam is trustworthy.)

"Vindman is from Ukraine, so we don't know what his loyalties are." (You can't tell how trustworthy a person is based on where they were born. Textbook racism.)

"Watch the DOJ." (My spy van is in the shop and I lack a desire to confirm your biases.)

"I love you." (You can't cross a bridge after you've just burned it to the ground.)

The fact is, a person can only form correct beliefs if they test those beliefs in the crucible of reality. Sitting on the couch in some shit-smelling hoarder's hovel living off of your retirement is not a recipe for finding the truth.

Beliefs must have consequences, and as a consequence of their beliefs, they won't be seeing me alive again. It's really the least I can do. I'm not interested in playing a stooge for them to gleefully fling their ignorance at.

Re:Why I Prefer Functional Programming on Monday November 02, 2020 @02:12PM (#24971851)
You said FP "breaks down" when handling mutability, and you attributed that to some vague sense in which "mathematics" is the cause of it.

I have no bias for FP. I just don't understand what you're getting at.

>the purity of haskell does not remove the necessity of mutating data in that database.

That's great, because the purity of Haskell does not inhibit mutability. It just constrains it to lie within some mutable context.

>Modelling mutation with purity does not eliminate the problem it only moves the problem to another location.

Location? What is a location? It's like you're saying you can't truly add 3 + 3, because someone still has to add 1s under the hood. It's just a different model of the same problem.

Honestly, it sounds to me like you've never used the language, and your criticisms come off a bit like standing on an aircraft carrier shouting about how iron boats will never float.

Re:Why I Prefer Functional Programming on Monday November 02, 2020 @01:35PM (#24971413)
Mathematicians have no trouble modeling change. There are many ways to do so. Some are algebraic, some are not. There is nothing wrong with modelling mutability using immutable structures: that is how you probably think about history, after all.

Either way, it is unclear what you're actually trying to say. Haskell has methods for modelling change of state through pure objects, but you're talking about that as though it were an inherently flawed or invalid approach, rather than one of many equally valid approaches to modelling state transformations.

Re:Why I Prefer Functional Programming on Monday November 02, 2020 @12:23PM (#24970567)
>Not all aspects of programming can be described by math.

This is completely untrue. You may not be familiar with the math, but that doesn't mean it doesn't exist. If you can model something well enough to understand it, then you can model it mathematically. There really isn't any domain of knowledge that math is unsuitable for, excepting if you don't know any relevant math to do.

Re:Why I Prefer Functional Programming on Monday November 02, 2020 @12:13PM (#24970452)
The primary difference between computer science and mathematics proper is an overt concern for performance. Mathematical elegance and computational efficiency are not the same thing.

Haskell is a pretty awesome language, but it doesn't make it easy to incrementally optimize programs.

Re:Intent to stop using 'null' in my JS code on Monday November 02, 2020 @11:00AM (#24969507)
Not that I'm disagreeing with you in any way, but it's worth recognizing that imperative languages typically do pattern matching and type constraining in a declarative manner. So one could make an argument that what you're saying is only true because imperative languages are not forbidden from employing FP. If a language uses declarative constructs, then it's not a wholly imperative language.
I've disowned by family for their willingness to reject common and simple facts, their hostile attitude, their repeated willingness to denigrate all I stand for, and an utter lack of self-awareness. I'll let you guess who they vote for, because I can't be bothered to care.
>However, when someone responds in a way that says they are willing to at least consider an opposing view, I will have a conversation.

But what if they don't want a conversation? What if they want a "silent majority" that they will then claim to represent? What if they interpret a lack of resistance as evidence of support?

You may not be changing people's minds outright, but you do have some impact on the strength of their convictions, and their sense of how broadly held they are.

Re:Is Rust web yet? on Friday October 30, 2020 @02:09PM (#24945166)
Would you rather have an expert in Rust doing web programming in Rust, or a novice in JS doing web programming in JS?

The best language to use is the one you know how to use best. If you know all languages equally well that you're free to choose the ideal language for every project, then sure, that's the way to go.

There's always been people who believe in nonsense. Most people, throughout most of history have. The meaning of "post-truth" today is that people in power are no longer being asked to justify what they do on the basis of fact. (It doesn't mean that facts don't exist or that they don't matter, I just found it off-putting that you'd try to suggest that.)

Allow me to paraphrase a concept from Tolkien: evil doesn't win because it's a superior force, it wins because it convinces you that it's already won. "Look over there, evil wins. Look here, evil already won. Evil always wins, that's the way it has always been. You can't fight it so give up."

You can't win by spreading evil's messages, even sarcastically. You win by being a superior force and never giving up. People's credibility should actually suffer when they do or say things that are incredible, and people who appeal to us with facts and compassion should be rewarded.

That's a disingenuous narrative. Truth can ultimately be verified independent of belief. That's what makes it true.

If your idea if truth is such that it can be dictated by political will, then you don't understand what makes truth special. It is special almost wholly due to its resilience to narrative, and it is incredibly bold or stupid to try to discount it through those means.

How the hell is a 10% survival rate "not optimism?" Try a trillionth of a percent. It makes an astronomical time difference.
>In 40 generations of space colonization, that's 40 times 30,000 times however long it takes to rebuild the capability on each colony.

Assuming each generation survives. Stop making that assumption, and see how many ways there are for you to reach a similarly empty universe.

>It's not optimism; its simple observation of what we have already on Earth in existing life forms.

I wish you'd observe that none of Earth's lifeforms have colonies on other planets. Goldfish didn't colonize other worlds, is that then a strong argument that Goldfish don't exist?

What you're saying makes no sense: just because animals can colonize a single planet over many generations does not mean they will be able to colonize an entire galaxy in even less time.

A decade out of date? It'll take you 30,000 years to reach the nearest star at the rate of the fastest moving object ever constructed by man. If anything any of us are talking about are able to be out-of-date in a mere decade, the whole premise of this discussion is flawed beyond measure.

All of the resiliency that you've seen in life is due to the fact that the environments to which we're adapted are uniform. Oceans everywhere are nontoxic and water. Air everywhere is mostly clean and breathable. There is no example of life being resilient under conditions as varied as other planets. We are only able to adapt within the confines of our clean-room Earth. We can't even adapt to the bottom of the ocean or Antarctica.

Optimism isn't going to overcome 6 orders of magnitude of error.

It's not a powerful argument for 'we must be alone', because it's an equally powerful argument for 'space colonization is nearly impossible.' You're saying things are "certainly possible" but you don't have a shred of evidence to support that belief. It's more likely that you're vastly underestimating the cost of maintaining a life-supporting ecosystem independent of the benefits of a billions of years of evolutionary adaptation.
Re:The Remarkable Number 1/89 (2004) on Thursday October 29, 2020 @12:27PM (#24932236)
It is a paradox. It assumes you have a definition of uninteresting number such that you can select the least uninteresting number, and then retroactively defines that number to be interesting by brand new criteria, which contradicts that you would have ever selected it in the first place. Thus the axioms invoked are mutually contradictory: the axioms that allow you to identify the least uninteresting number, and the axioms you invoke to declare it interesting are in conflict.
Re:The Need for Touch on Tuesday October 27, 2020 @03:11PM (#24910718)
I'm not going to explain to you how fame and media attention are exceptional. It should be obvious to anyone who doesn't have their head up their ass.

I guess if you want to claim that the behaviors of heads of state and professionally trained millionaire athletes is indicative of the experiences of your typical American male, you can suffer the credibility loss that such a claim entails.

So you take no responsibility for spreading misinformation if the prior source is not corrected? Sounds like you're acting in bad faith then.

You can win an internet argument anywhere, but if that's all you want to achieve here, then maybe stop trying to debate physics.

Re:The Need for Touch on Tuesday October 27, 2020 @10:46AM (#24907916)
If your go-to examples of male touch are reserved for brief celebratory gestures and "inappropriate" touching, then it would seem you're not effectively making the point you're attempting to make. Neither of these examples indicate that touching is normal, common, or considered appropriate.

Why did you think they would? Do you often find truth by generalizing from exceptions?

Re:Hannah Arendt: Reflections on Violence (1969) on Tuesday October 20, 2020 @01:38PM (#24840201)
It seems pretty clear to me that the ideal (for those who don't want to be authoritarians) has always been to offer as many opportunities to evade violence as possible. If someone is violating the law, ask them to correct it. If they fail there, help them correct it. If they fail there (or insist), penalize them with inconveniences or fees. If they still fail, 'force' starts to enter the picture, but it should always come with a consideration of need. A person should have to burn through a lot of their credibility and good will before society starts forcing their hand.
There is no "point of view of a photon." Photons do not have frames of reference.

So you are completely incorrect insofar as what you are saying is physically nonsense.