MIPS syntax highlighting

There aren't a lot of IDEs for MIPS assembly (shocking, right?) I made an xml for gtksourceview to do syntax highlighting for MAL; you can find it on github. This will work for any editor which allows gtksourceview (e.g. gedit).

You will need to move it to the appropriate folder, probably /usr/share/gtksourceview-2.0/language-specs.

The Problems of Philosophy - The Value of Philosophy

Russell ends with a brief chapter on how philosophy helps one to find truth etc. etc. I will take a different tact.

We saw that it is fruitful to only talk about the abstraction layer. I say that I have a collection of things, what you should take from that is not any insight into what the things in themselves are, but rather that this collection has a size, things can be added to or removed from it, etc.

Now, when I have my collection, you know that it has a size, but you don't know how that size is calculated. Maybe I keep a running count as things are added and removed, or maybe I count the number of objects in my collection every time you ask. Furthermore, you don't know anything else besides the fact that it is a collection, and you don't need to - you can iterate over a list of people as easily as over a list of rocks.

The fundamental question in ethics is, then, what things do you have to implement before we can say that you have moral worth? Must you have basic reasoning skills, addition and so forth? Then many children and television networks have no moral status. Do you just need human DNA? Then not only is abortion immoral, but the loss of skin cells is a tragedy.

Polymath Jeremy Bentham gave a great example of separation of concerns when he said: "The question is not, 'Can they reason?' nor, 'Can they talk?' but rather, 'Can they suffer?'" You may implement any number of interfaces: you can read, talk, reason etc. - this is irrelevant to the ethicist. If I am writing an ethics evaluator, all I need to know is whether you can suffer.

//Incorrect
public EthicsEvaluator(WhiteHumanMale H) { }

//Correct
public EthicsEvaluator(ISufferable H) { }

Bentham used this separation of concerns to argue for the rights of children, women and the abolition of slavery, among other things. When someone would object that women or slaves weren't as smart as white men he could respond, "So what?" As long as a slave was feeling pain from his slavery, then the slavery was immoral.

Peter Singer used the concept of interfaces to argue that some non-humans have moral status. He argued that there is no criterion which all humans, and only humans, have. Therefore, either some humans must not have moral status, or some non-humans must have moral status.

For example, you can argue that only humans have the ability for higher mathematics, such as calculus. This may be true, but young children and the mentally handicapped (much less those in a coma) don't have the ability to do higher math; thus any interface requiring an ability to do calculus would leave them out in the cold. Given that we are against killing children willy-nilly, the ability to do math must not be part of the interface. This can be repeated with any of the "higher" reasoning skills, until we are forced with the conclusion that many animals (at least most vertebrates) have moral status.

This argument has been very successful (Wikipedia says "there is little criticism against the argument although it was first put forward in the third century AD."); you can't throw a stone in a philosophy department without hitting a vegan.

An interface for ethical personhood (i.e. the criteria for a being to have moral status) was developed by Mary Anne Warren. Her requirements are the following:

The being must have some subset of the following:
1. Consciousness (capacity to feel pain)
2. Reasoning (ability to solve new problems)
3. Self-motivated activity (not motivated solely through genetics)
4. The capacity to communicate messages on indefinitely many concepts
5. The presence of self-concepts and self-awareness

She argued that foetuses cannot be said to have any of these things, and therefore abortion cannot be immoral. We know that many animals can count, dolphins, pigs and magpies can recognize themselves in the mirror while young humans can't[1], and many animals like pigs can solve problems like opening a box to get food. Accepting Warren's criteria then would require us to give fewer rights to certain humans than we currently do, and more rights to non-humans than we do now.

Which interface we accept has great impact on how we live our lives; thus, the question of "Where's the WSDL?" while seemingly esoteric, is of utmost importance.

The Problems of Philosophy - Epistemology

This corresponds to the second section of Russell's book, or approximately chapters 5 - 14.

Those who have dabbled with machine-learning are familiar with bayesian inference - essentially, if X and Y are found to occur together, then X and Y are probably related. The fact that I have 10k spam emails and 0 real emails with "v14gr4" in the subject probably indicates that the next email with "v14gr4" in the subject is also spam.

But what if it turns out that I really am friends with the prince of Nigeria, and he really does want to give me forty million dollars in exchange for letting him use my bank account?

In order for us to evaluate this possibility, we need to know the probability distribution. There are far more people who pretend to be the prince of Nigeria than there actually are princes of Nigeria (there are, in fact, no princes of Nigeria). Therefore, we can make a pretty good guess that any email claiming to be from a prince is a scam. But how frequently are there chairs masquerading as rocks?

We might argue:
1. Things tend to look like what they are
2. This looks like a chair
3. Therefore this probably is a chair

But premise (1) here is unsupported - we have no idea how frequently things tend to look like what they are.

What we do instead is to talk about the abstraction layer - the interface of the chair, if you will (abstraction layers are referred to as universals in philosophy). We change our argument to state:

1. If something looks like a chair, then it probably implements ISittable
2. This looks like a chair
3. Therefore it probably implements ISittable

I can then sit on it. We now avoid the question of what the chair actually is in a noumenal sense, but instead ask about the phenomenon (i.e. the public API vs. the private implementation). Perhaps when I sit on what I think is a chair it is really a rock, but as long as it's a comfy rock, who cares?

This is the pragmatist's resolution to our ontological problem - perhaps when I ask for a quicksort you really do a mergesort, but the important part is that you implement ISorter. So problem solved, right? Unfortunately, we have now traded in one problem for another.

I claim that all chairs implement the ISittable interface. We are left with some questions:
  1. What is an interface?
  2. Where does an interface live?
  3. How does one implement an interface?
  4. Are certain interfaces more "real" than others?
In short: where's the WSDL?

One of the most fundamental interfaces is Collection. Java specifies the following:

public interface Collection extends Iterable {
int size();
Iterator iterator();
// etc..
}

I have one stone, then I add another stone. I now have a collection of stones. But who implemented the interface? I can see that size() = 2, and I can iterate through the stones; does this mean that I implemented the interface? But then why is it that anyone else who looks at this collection will also see that size() = 2? Is there some repository of interface implementations which we all have access to? Furthermore, why is it that not only does one stone plus one stone equals two stones, but one planet plus one planet equals two planets and so far up (and down) the scale?

There are certain propositions like "x == x" which seem to never be violated. In Java, all classes inherit from object - is there an analogous requirement for interfaces that they must implement these "a priori" assumptions? If so, how do we determine which assumptions are always true, which are sometimes true, and which are never true?

There are three basic answers to these questions:
  1. Interfaces are real. They exist in some realm of interfaces which we have access to through unspecified means. This is known as realism.
  2. Interfaces don't exist. It is only through human stupidity that we think they do. This is known as nominalism.
  3. Interfaces exist, but only as ideas. This is known as idealism.

The Problems of Philosophy - Ontology

In this post, I hope to give an overview of the first section of Russell's "The Problems of Philosophy" with a view towards programming. Keep in mind that this book is about problems, rather than solutions. This post contains a summary of the first four chapters or so.

"Is there any knowledge in the world which is so certain no reasonable man could doubt it?" Consider the following:

public List QuickSort(List list){
return MergeSort(list);
}

We can make the statement "It appears to me that the method performs a quicksort" as this is what the declaration claims to do. However, the method actually performs a merge sort. Thus, we can see that the statement "It appears to me that X is true" does not imply "X is true". In addition, we can see the division between the public signature (sometimes called the "phenomenon" or "qualia") versus the private implementation (the "noumenon" or "thing-in-itself").

The fundamental question of the first chapter is: "Given that I may only know the public signature, how can I find the actual implementation?" The initial response is to say that the public signature is the "reality", but as we saw, we can claim to be doing a quicksort when we're really doing a merge sort. Both run in log n time, and both are stable. There is no public-facing difference between the two.

The pragmatist's response is: perhaps it is doing a quicksort and perhaps a merge, but it gets us the correct answer and that is as good as the "truth." This response feels unsatisfactory; maybe for all practical purposes quicksort and merge sort are the same, but we didn't ask "What is true for all practical purposes?" we asked, "What is true?" It appears there should be some fact of the matter as to what kind of sort it is doing, even if this truth is unobtainable to us.

The unobtainability of Truth with a capital T leads some to reject the question altogether - there simply is no fact of the matter as to whether it is doing a quicksort or a merge sort, all that is true is that we recieve the impression of it sorting. These impressions are not results of what it actually does, the impressions are what it actually does. This too feels unsatisfying.

Russell defines "Idealism" as "The doctrine that whatever exists, or at any rate whatever can be known to exist, must be in some sense mental." Consider the quicksort: we generate a pivot, move stuff to the left and right, then recurse. The pivot, "left," "right" etc. are all ideas - this method takes one idea (the list) applies some other ideas (pivots, recursion etc.) and returns yet another idea (a sorted list). At no point is the inclusion of matter necessary in this, and Occam's razor tells us to discard unnecessary hypotheses. The materialist can respond that matter works equally well here: there are some electrons moving around, they move around in some different ways and then we're done - the inclusion of "ideas" is unnecessary.

Russell concludes here that, while one cannot "prove" the existence of a private implementation, it seems incredibly likely to exist given, for example, the fact that it still has effects even while you aren't looking at it.