Code and Data are One

Posted by Daniel Lyons Mon, 05 May 2008 12:09:00 GMT

There is a general desire to keep code and data separate, but they are indivisible.

We use migrations in Rails to manage changes to the database, but some data is invariably essential to the proper working of the application. The database schema itself is data. As your understanding of the dataset of the application changes so does the database schema; data affecting data.

The code itself is utterly meaningless except as transformations to the data. Even esoteric languages like Haskell, J and Forth which do their best to avoid naming the data work only by computing with it. Nothing else happens other than examining and modifying data. Thus, much data is inline in the code: initial values, special values, error values.

Sometimes it feels like there is a hard distinction between data and code, but even then, it is an illusion. On the processor, there are just bytes; there’s no difference between moving bytes from your code into the registers to examine them or moving data from a file into registers to execute them. It’s all just bytes moving from point A to point B.

The source code itself is probably the most obsessively well-managed data on the planet. Nobody uses version control for anything else.

Consider TeX. Is it a document (data) or a transformation (program)? Both. Restricting your output to DVI or PDF is no different from restricting your output to plain text. You can perform arbitrary computation with TeX. And this is of course necessary to make a well-crafted document: code is needed to compute how to style the data properly.

On the web we try very hard to maintain a separation of “content” and “presentation,” but the CSS is served by the same web server that sends out the HTML. More and more people are using the same template systems to generate their CSS as to generate their HTML: CSS isn’t enough on its own. Of course it isn’t, no amount of built-in functionality can ever replace arbitrary code (until you become Turing-complete or close to it). Even then, you use inline styles and generate not particularly flexible HTML interfaces.

There is no real distinction between content and presentation either. These things are all the same. Data. Or code.

Be aware of the illusion you operate under for the sake of good style.

Tags ,  | 1 comment

Philosophical Cryptotypes

Posted by Daniel Lyons Fri, 09 Nov 2007 10:10:00 GMT

Whorf introduces a concept he calls cryptotypes in talking about language. I don’t remember his exact examples, except that it has to do with when you can use “up” to strengthen a verb. You can stir it up but not swing it up or pour it up, etc. You can break it up or smack it up but you can’t explode it up. What’s the rule? It’s a big hairy complicated cryptotype.

I noticed a good one the other day. The official rules of a four way stop have to do with when you arrive and taking turns clockwise. As Jim Loy points out, in reality, it’s a big cryptotype. There is this supposition that if the oncoming driver is moving, you can go too. That doesn’t come from the law (it seems to come from common sense). Turning left is complex, because you have to enter the lane with your blinker on or you’ll fuck everything up, but you have almost no room at many 4-way stops. If you’re turning right, you have to stop and make sure you’re not going to hit anyone, but often, you can stop and then keep going. This is all messy and intimidating to the new driver, who is trying to adhere to the law but instead confusing and screwing everything up for other drivers.

A religious cryptotype I’ve been thinking about recently is the “G-d will reveal everything to us in Heaven” motif. Where did that come from? It’s a Jewish principle that anything which doesn’t affect halacha not be settled in Talmud, so to some extent I’m welcome to believe whatever I want, but where did this idea come from? I don’t see any precedent for it in Torah. Maybe it’s there but it must be fairly vague. None of the afterlife teachings are very firm in Judaism. But I’m also unaware of a Christian source for this belief. Yet most of my Christian friends take it for granted (as I do) that G-d will show us his cards in the hereafter.

It’s important for philosophers like myself to believe that G-d wants believers to be thinkers. As I said before, by voluntarily restricting his actions to those that can be reasoned about effectively, G-d is giving us the gift of reason. G-d certainly doesn’t need either to restrict his omnipotence or to use abstraction to help deal with the magnitude of the universe as we do. Would G-d would give us such a gift, especially with a corresponding hunger which can never be sated? I don’t have the answer.

Tags ,  | 1 comment

G-d and Reasoning

Posted by Daniel Lyons Tue, 11 Sep 2007 05:38:00 GMT

One thing Michael and I often discuss theologically is G-d’s perspective of the world. I have a particular thought about His reasoning which seems unusually lucid right now, so I thought I’d put it down here.

Reason is accepted as a gift of G-d to man in the Catholic and I believe also my own Rabbinic traditions. That we live in a rational universe whose laws can be determined scientifically and which can, to some extent, be understood is also an important given. But does G-d reason as we do?

If we accept that G-d exists outside time then perhaps causality still exists, but without time to give it duration, the effect of reasoning would be instantaneous. Understanding reason as a gift to man, I do not see any reason to assume that G-d also employs reasoning the same way. Indeed, isn’t reasoning mainly the creation of useful abstractions that enable our feeble minds to make observations in general? Without time, but with causality, wouldn’t these derived relationships appear instantaneously to G-d? If G-d can perceive these relationships instantaneously and G-d’s omniscient mind can contain all of everything, then He hardly is in need of abstractions: He understands, instantly, everything. Logic would therefore seem to be a needless crutch to G-d, about as useful as a blind person’s cane to a man who can see.

And in that light, it seems that G-d would have no need to deal with us categorically. In fact He would by necessity deal with us individually, since there would be nothing to be gained by dealing with us categorically. He has no shortage of time or mental effort, and wastes none in performing the steps of a logical derivation.

All of which brings us back to the notion of a personal G-d, elemental to both Judaism and Christianity. It’s the only kind of G-d there could be. Why would a creator of the universe, outside of time and with no limit on “processing power” opt to be distant or deal with humanity in general instead?

This line of reasoning also helps explain why firm ethical rules are handed down to us to be implemented in practice, but which G-d bends in the biblical narrative. Reason is our tool to approach G-d, not G-d’s limitation to us.

Tags ,  | 2 comments

Nuking Problems

Posted by Daniel Lyons Tue, 31 Oct 2006 05:51:53 GMT

There are really three ways to deal with a problem:

  1. Address the problem with careful action, possibly creating an institution in the process. This is called “dealing.”
  2. Ignore the problem, allowing it to annoy you and consume your time, essentially, permitting it to rule certain corners of your time. Weenies often call this “coping.”
  3. Nuke the problem by making it go away completely. This has no other euphemism, because nobody knows how to address problems apart from action or management.

This month, I have dealt with two problems.

The first was backups. I created an institution to handle the problem: I bought an external hard drive, learned all of the different backup strategies, did various benchmarks. Every week I’ll plug the external hard drive in and run Disk Utility, creating an image from Macintosh HD, in a folder with the appropriate date in the Backup folder on the external disk. When I run out of space, I’ll delete the oldest one. Done and done.

This is my backup institution. It consumed about 10 hours to set up and it will consume about 10 minutes per week for the rest of time. (Of course, the backup itself takes longer, but I can sleep while it does that.)

The second one was spam. I should just be using Spamfire, but the IMAP code never became stable enough for me and I wanted a server-side solution. CRM114 isn’t as good (in my opinion) and it certainly has taken longer to train, but now I have completely server-side spam filtration under my complete control. It’s quite nice, mostly because it’s solved now and I no longer have to tolerate Apple Mail’s worse-than-guessing spam filter. In fact, I have told it to consider the CRM114 header a necessary condition to marking anything as “Junk,” so all it actually does now is put a brown label on the message and not load remote images. Solved.

Now, I have not nuked any of these problems.

To nuke a problem is to make the problem vanish altogether. One of Michael’s friends nuked the problem of deciding what to wear and fashion by deciding to wear nothing but grey sweatpants and sweatshirts. That takes some balls. That’s deinstitutionalization with a vengeance.

I’d like to know how exactly one goes about nuking problems like backup and spam. Probably by deciding not to have any meaningful data. Or carry everything around on USB drives. Use paper mail?

Tags , ,  | 1 comment

Friends

Posted by Daniel Lyons Mon, 04 Sep 2006 07:47:39 GMT

There is a saying that starts with “you can pick your friends.”

It occurred to me today that nothing could be farther from the truth.

The reality is that you can choose to dislike or like some people, to a very limited degree. Your friends are those people who happen to like you back, and your enemies are those people who dislike you. We have very little control over any of this. It seems like the best we can do is to choose to make someone dislike us.

Tags  | 3 comments

Happiness

Posted by Daniel Lyons Mon, 28 Aug 2006 19:24:00 GMT

I wrote this a couple years ago:

I have come to the conclusion that the sensation of happiness has absolutely no correlation to whether or not a person deserves to feel happy, or their life is going well, or any other factor. It just doesn’t seem to be related to the atmospheric or environmental condition of the moment at all.

People come out of a phase of their life steeped in the emotion of that time. Slowly it may leave if the new phase finds them steeped in new, different emotions. It feels false for a while, but slowly that sensation goes away. You always have nostalgia for the previous phase. Maybe you go back even further than that… I’m not sure if it’s a good thing or a bad thing.

When I was leaving high school I was deadly afraid of leaving my clan. When I got to college, I quickly had a new clan which has surpassed my notions of clandom by quite a bit. But I still occasionally feel nostalgic about it, even though it was only borderline-satisfying. But it was a sensation of happiness.

We always look forward to the moment when all the conditions will be met for us to be happy, thinking “I’ll be happy at that moment!” In reality, we have to spend some time in that moment, maybe even leave that moment and come back, before we really are truly happy.

Tags  | no comments