Showing posts from 2016

Righteous predators

I have come up with a word. Righteous predators.

OK. It's two words. But the world is full of them.

Righteous predators are the opposite of sexual predators; but perhaps equally harmful.

Whereas sexual predators harm with physical abuse; by forcing sex on someone who doesn't want it; righteous predators harm with psychological and legal abuse, against people who violate their "morals". These violations are perpetrated, not to help anyone; but to achieve a sense of righteous gratification.

For example, you got raped, and are now pregnant? The righteous predator will prevent you from seeking an abortion.

Do you need to abort because the fetus is going to have a birth defect, and is not going to survive? The righteous predator will make you look at pictures of aborted fetuses, and force you into a formal burial.

If you are 13, and you're propositioned by someone who's 35, you are a victim of sexual predation. But if you're 13; and your first time is with som…

The $20 billion puppy, and "The buck stops with you"

On further reflection of the $20 billion puppy, I realize I subscribe to a "The buck stops here" principle. Which is to say, a person is not responsible to seek out and eliminate all suffering. But when a person can stop wrongdoing in a decision that's in front of them, the person is responsible.

The law takes a similar point of view. If someone offered you $20 billion to torture and murder an orphan, and you did it, you're going to prison. It does not matter if you spent all of it to save millions of orphans elsewhere. Your responsibility is to stop the buck when the decision is in front of you.

When you realize that something is an important principle, it becomes increasingly hard to justify ever violating it. It's not your duty to seek out and stop all suffering. But if you integrate the principle that, when a buck is being passed, it must stop somewhere; and that it must stop with you; then violating this principle comes at the cost of integrity. Even if no o…

Rationalists and control fetishists

Let's talk about sadism.

Sadism is an expression of service-to-self. Service-to-self is a spiritual and philosophical orientation whose fundamental trait is that only one's own subjective experience matters. The conscious experience of other persons and creatures is not perceived to be a thing. Instead, such other creatures are perceived to be phenomena, which are judged in good shape if they serve the individual's self; and are in need of control and coercion when they fail to serve properly.

Sadism, in particular, is the enjoyment of the practical application of the methods of control and coercion, whose purpose is to obliterate the individuality of the other-self. The ultimate goal is to force the other-self to accept that it is only an object in the mind of the sadist. The sadist believes he or she is all that exists. Their pleasure is in taming you so that you too accept that they are everything. The climax of this experience for them may involve destroying you physic…

Is the internet ready for DMARC with p=reject?


DMARC is an email policy that builds on DKIM and SPF to provide a way for email senders to declare: "All email from this domain comes from this set of servers (SPF), and is signed using these public keys (DKIM)."

It's nice and well that we are finally able to do that, but DMARC comes with 3 modes of operation: p=reject, p=quarantine, and p=none. These modes suggest what a recipient should do if an incoming email doesn't match the sender domain's DMARC criteria, either due to signature failure (DKIM) or incorrect sending server (SPF). The default mode, p=none, boils down to "do whatever, maybe this helps you guess if the email is spam". The mode p=quarantine treats the email as spam, and p=reject is supposed to cause the message to be rejected at the point of ESMTP delivery.

Well, I tried p=reject, and it kinda works. Mostly. Except in the following situations:
If you send to any mailing lists from your domain. Your messages may be DKIM signed, but wh…

Lock-step refactoring

This may seem obvious, but I am biased to avoid saying things that are obvious to me, and then things don't get said that are worth saying.

A nice thing about statically typed languages, like C++, is how you can use the compiler to help refactor.

Code often needs to be refactored. If it is not, it gets harder to fix issues and implement new features. When this happens, the temptation arises to throw the code away and write new code, but this is almost always a mistake. The correct process is to refactor code that works, to disentangle anything that needs disentangling, so that improvement becomes easier.

When there is existing code you can use, you should only ever write new code if you're willing to go through the entire years-long process of how it needs to work, and why it needs to work that way. Otherwise, use existing code, and keep improving it.

Refactoring is scary. It is scary because you have this hairy code, and you're concerned that any change you make to it wil…

Loyalty to group vs. principle

Principles, nearly by definition, are rules that when they are adhered to, lead to good results. Group loyalty, then – loyalty to specific preferred people over principle – necessarily produces worse results. The two are not the same, so to maintain loyalty to a group, one must depart from principle.

Countries differ on the ubiquity of group loyalty over principle. Prosperous countries tend to be more loyal to principle; shittier countries tend to have more loyalty to groups. It takes a prosperous environment to be able to afford to be loyal to principle, but loyalty to principle also makes a prosperous country. In comparison, people in shitty places feel like they need to be loyal to their families and local groups, but it's also the group loyalty – and lack of principle – that makes those places shitty.

You can find shitty subcultures where group loyalty dominates even in prosperous countries. Compare inner city ghettoes with the "snitches get stitches" mentality. Or t…

Limitations of single-payer health care

The US runs a degenerate health care system, with abhorrent symptoms that are too many to enumerate. I offer a small tasting sample:
Drug companies that lobby to ban older inhalers whose patents are running out, so they can continue selling new patented ones at high markup.Drug companies that lobby Congress to create demand for a product, then jack up prices to $609 per unit to deliver $1 worth of a drug.Private insurance companies created as an accident of history, lobbying to perpetuate a system that routinely denies health care to people who most need it. Before the Affordable Care Act, they would deny coverage to people who they knew would be a net loss. Now, they offer poor people plans costing $1,000 per month, where they don't even cover anything under $5,000.Health insurers may engage in shady practices. Just one, now deleted comment:
[Insurance company] had my parents sign a bunch of stuff that absolved them from paying for my burn unit bills just days after [I] was burnt. …

Why software patents are counter-productive

I've said this before, but I need to keep saying it until the US patent system is reformed. This may mean forever, if necessary.

The existence of patents for software is not okay. There may be a so-so argument for patents where things cost $1 billion each to develop. Even there, publicly funded research could deliver solutions that focus on more real problems, and help more lives.

But there is no argument for things where the cost of development is cheaper than defending a patent, or even filing for one. For software, there is no reason to have patents. It's a pure intellectual land-grab.

Software that takes years to develop will not be founded on a single idea. It will rest on tens of thousands of ideas.

Each individual idea in a software product is low value on its own. The value is in building software that combines the ideas, and then maintaining that software to respond to users' needs. Most of the value of software development is in this process.

All software is prot…

Fear: An account of terror on top of a coal stack; by Franc Bider

[This story is by my dad, about his experience in the 1970s as a student in Kranj, Slovenia. What follows is my translation of the original Slovenian, performed July 29-30, 2016, blatantly without permission. The original must have been written, in its current telling, in the weeks before this. I added footnotes and the subtitle.]

If I try to describe it very precisely: I was squatting up there, all the way up there, on a pile of coal. With my head wrapped in spiderwebs that dangled from the sooty ceiling. In agony, I huddled into the dark corner, away, away from the meshed narrow window that shone its betraying light. My heart was pounding so hard I could hear it. It made an echo. And slowly sliding down the stairs to the cellar was Mrs. Fani...

I had never been so afraid in my life. Not before, nor after.

Oto proclaimed he would never live in that death chamber. By this, he meant the seven by ten feet of gross square footage, the worm-eaten nightstand by the tired bed, with that tal…

Code generation bug with new optimizer in Visual Studio 2015 Update 3

When I saw that Visual Studio 2015 Update 3 includes a brand new optimizer, my first thought was: yikes, I wonder how well this is tested. It can't be very mature code.

Well – it isn't. The following reproduces a code generation bug involving the optimizer and a lambda that captures local variables by reference:

#include <iostream>#include <cstring>#include <conio.h>#include <windows.h>usingnamespacestd;#define If(EXPR, T, A, B) \(([&]()-> T {if(EXPR) return (A); return (B);})())void Report(size_t x,size_t a,size_t b){cout<< x <<endl;if(x == a && x > b)cout<<"OK, result is strlen(argv[0])"<<endl;elseif(x == b && x > a)cout<<"OK, result is strlen(argv[1])"<<endl;elsecout<<"Error - result is garbage"<<endl;}intmain(int argc,char** argv){if(argc <2)cout<<"Enter anything as first parameter"<<endl<<"If compiled with cl…

The barren rockscape and the Garden of the Mind

Xara woke up one day, back when she didn't yet know she was a gardener. She thought her garden was a field, and she didn't much tend to it. So the field had some flowers in it – those that were hardy enough to grow; and it also had a lot of weeds. She liked to take walks in her field, enjoying the flowers she found. She ignored the ugly weeds, and cursed at the nasty ones that scratched her.

The weeds pestered her a bit, the nasty ones even more so. She thought that she should tend the field, from time to time, but the task seemed so much harder than the problem. She tried to pluck a weed here and there, but almost as soon as she did that, it seemed another one popped up. And the nasty ones, oh boy. They were easier to avoid.

This day though, she would find something different. In the corner of her field, she found a new flower. It was more beautiful than anything she'd seen, with vivid blossoms and mesmerizing leaves. She had seen plenty of decent enough flowers; but they…

The benefit of some kind of authority

There are well-meaning people who like to question everything, who go around with ideas like:

"Hey, why should Government Guy be able to do things others can't? The very concept of government is oppression. Why do we need authority? Anarchy is freedom!"

Government exists (1) to serve as a mechanism of coordination, and (2) to prevent arising of a worse, more oppressive authority.

Authority, in general, is emergent. Wherever there isn't authority, one will arise. Not because people want to be oppressed, but because (1) coordination services are needed, and (2) there is no authority in place to prevent another from taking power with force.

In this sense, a situation without authority is in disequilibrium, whereas a situation with authority is in a local equilibrium.

Situations that are truly without authority are hard to maintain, and hard to get work done in. For an example, consider how long it took someone to invent Bitcoin, the first authority-less currency (or more…

On the desirable properties of a programming language

For the past 15 years, I've wanted to create a programming language. It is easy enough to do so, if one just wants to create something. But I've wanted to create something that improves in some substantial way on what already exists, and stands the test of time.

10 years ago, I created Flow. Flow is not widely known, but it's the asynchronous architecture that underpins Bitvise SSH Server and SSH Client. It's a message-passing architecture based on small, Erlang-like processes, implemented using fibers in C++. One of the main purposes of Flow was to make it easier to reason about a complex, asynchronous application, and I do believe it succeeded to an extent. Its grander motivation was to make it trivial to write complex applications that scale effortlessly to any number of parallel processors.

I believe that Flow would meet this second goal, but its ability to do so is yet untested. We do not actually need the type of scaling Flow would provide in our software. We use…

"Hello world" in LLVM IR language without CRT

The LLVM Language Reference Manual has a "Hello world" example that uses the C run-time library.

I wanted a bare-bones example, using only the Win32 API, without a CRT dependency. Here it is:
  @.str = private unnamed_addr constant [13 x i8] c"Hello world\0A\00" declare i64 @GetStdHandle(i32) nounwind declare i32 @WriteFile(i64, i8* nocapture, i32, i32* nocapture, i8*) nounwind define i32 @Entry() { %hwStr = getelementptr [13 x i8]* @.str, i64 0, i64 0 %handle = call i64 @GetStdHandle(i32 -11) %bytes = alloca i32 call i32 @WriteFile(i64 %handle, i8* %hwStr, i32 12, i32* %bytes, i8* null) ret i32 2 }Compile and link steps:
  llc -filetype=obj hw.ll link hw.obj kernel32.lib /entry:Entry /subsystem:consoleThe resulting executable has 2,560 bytes, prints "Hello world", and returns exit code 2.

My main observation is that the language is clumsy. It's meant to be read by humans, but in most cases, generated automatically:
No syn…

Over-education and free college

I agree with most of Sanders' policies, much more than any other candidate. However, I cringe somewhat about his views on education, which seem only kinda half right. Sanders wants to give everyone free access to college, which would be better than what we have now. But...

What he doesn't say (or realize?) is – over-education should be discouraged, because it's competition for a positional good. Hanson and Caplan have had a good conversation about this over the years.

Compared to early employment, college is ineffective at conveying useful skills. It's a competition between individuals about who's going to be "better educated". In this competition, the nation can't do better as a whole by throwing more resources into it. You just get a lot of college graduates who then make for reluctant baristas, many having to settle for something "below" their degree.

The current college loans are unambiguously bad. They drive up the cost of participating…

Libertarian confusions

Since I gave up on libertarianism, I have struggled to explain concisely why it doesn't work to people who still buy into it. This is an attempt to do so.

Incompatibility with desirable outcomes
Bluntly – libertarianism is a delusion that unconditional property rights can be had at the same time as some non-dystopian social outcome.

More specifically – we cannot have all three of the following:
Unconditional property rights.Freedom of reproduction.Equality of opportunity. (Not of outcome!)You can have any two of those, but not all three. The combinations that work are:
Unconditional property rights + freedom of reproduction: poor people give birth to more poor people, who do not have equality of opportunity and live and die in squalor.Unconditional property rights + equality of opportunity: this combination has not been seriously attempted, but it means sterilizing poor people so they can't have children who would have unequal opportunity.Freedom of reproduction + equality of opp…

The Louis Vuitton theory of happy marriage

Consider this:
Louis Vuitton bags are correlated with being rich.Therefore, to become rich, purchase Louis Vuitton bags.Does this seem silly?

Yet, people propose that we should aim to be monogamous, and stick with one partner; not because we want to be monogamous, and have found someone we want to commit to; but because monogamy is correlated with happiness.

Imagine three couples:
Couple A are both mentally healthy, and are a good match. Because they are a good match, they do not seek other partners. They live together happily, and for a long time.Couple B are both mentally healthy, but are not a good match. Because they are not a good match, they divorce. They each find new partners, and become happy.In couple C, one is mentally healthy, the other isn't. Because of this, the relationship suffers. Eventually, they divorce. The mentally healthy partner finds a good match, and becomes happy. The other goes through several relationships before getting help, and then finds happiness.Con…

CamelCase vs. underscore_case

If the STL could be designed again, I wish it would have chosen CamelCase instead of underscore_case.

Since STL uses underscore_case, we're stuck with two unattractive stylistic choices:
Use underscore_case in our programs, and suffer its drawbacks.Use CamelCase in our programs, and suffer the inconsistency with STL.A couple years ago, I tried to get over my distaste for underscore_case, and wrote a small library of 6,500 lines in that style. I thought I'd convert. Instead, I now want to burn underscore_case with fire.

Which person in their right mind decides to sacrifice 26 out of 63 perfectly useful symbols, and pretend they don't exist? Did this person spill Coke on the Shift key of their keyboard, or something?

If you allow uppercase – like normal people who aren't shooting themselves in the foot – you can do this:
    struct Thing { int thing; }; Thing thing;How do you do this with underscore_case? You don't. Both things have to be named differently.


Against signed integer types

It is often mentioned that Google's guidelines call to always use signed integers, and avoid unsigned.

One could argue, if I were as smart as Sergey Brin or Larry Page, I'd be as rich as they are. This may be true. But we tend to succeed for the few things we get very right, and despite the many things we don't. I'm pretty sure this one is the latter.

The preference for signed integers opens opportunities for a whole panoply of unnecessary bugs. It's a mistake of the same order as nullable pointers. You almost never need negative values, but now you need to check for them always. Signed overflow is even undefined behavior, when unsigned overflow is not.

I have gone the opposite route, and always use unsigned types. I find a signed type is not needed 99% of the time. I would further argue that most uses of negative values are hacks, and potential containment and security issues. It overloads a variable with potential meanings that the variable should not have.