Return to “Technical”

Post

Are function and data the same thing?

#1
I thought I'd start this one off, based on the quote from Friday's dev Log, viewtopic.php?f=12&t=2544#p39769

I'd answer immediately with "no", but that's not the whole story. You can have an abstract thing, which might have a value, but context determines whether it is just data, an effect, or the subject of operations.

Take a 'phase operator' from math and group theory. You can have two scalar values, A and B, which represent phase values. A and B can be seen as absolute phase, say a value in the range 2pi..+2pi. If you then define B as a phase operator, such that C = A + B, or more conventionally, BA => C, then B is used as a relative operator on A.

So data can be a function if it has context. Object oriented design is careful to distinguish these (nouns/properties, verbs/methods, and so on - indeed, linguistics is helpful in identifying such contexts).

For systems with implicit functionality, which I think Limit Theory aims for whenever possible, you'd find instantiated data within an object, along with pointers to the relevant actions (or to generic logic that decides what actions apply, given available data or situational context), or even more abstractedly, a pointer to a type/class, which contains these things.

In programming terms, it is possible to create an environment where an object is supplied as a parameter, and it be interpreted as a noun or a verb depending on the context of the function called. Shouldn't be a problem with some basic, but not too specific, OO type/class bindings.

In Limit Theory, this kind of approach would be useful for AI behaviours, and cascading instructions to the lowest level, particularly when objects can return values that help with assessing suitability of the asset for any given goal, and aggregating these back into exclusive or combined use of assets as solutions. Better still would be adding in costs and micro-goals alongside the returned 'potential effectiveness', which can be used as waypoints to achieving solutions.

I think that's deep enough for my first post. Disclosure: I'm a programmer, sometimes of games. Loving the approach Josh is taking here.
Post

Re: Are function and data the same thing?

#2
j5v wrote:So data can be a function if it has context. Object oriented design is careful to distinguish these (nouns/properties, verbs/methods, and so on - indeed, linguistics is helpful in identifying such contexts).
That's the basic tenant of functional programming, functions and data are the same thing.
http://www.youtube.com/watch?v=ZhuHCtR3xq8 This is about monads but it also explains functional programming basics.
woops, my bad, everything & anything actually means specific and conformed
Post

Re: Are function and data the same thing?

#3
This is one of those questions that's fun because it has meaning in multiple modes, which suggests that grokking one mode might help reveal insights to other modes.

1. Regular Old Programming: Code and data are usually treated separately -- code is the verb, and data are the objects. Mixing the two is considered a Bad Thing because the complexity instantly goes way up, making it much harder to understand whether a given program will do what it's "supposed to do." Self-modifying code was occasionally done back in the day of assembly language when processor cycles were more precious than code maintainability.

2. AI Programming: A LISP hacker would read the above and just shake his head sadly, certain that code and data are the same thing, nor could it be any other way. A computing language incapable of writing expressions that operate on themselves is incapable of expressing truly interesting statements and behaviors. You could fake that with some code vs. data language, but only as a hack.

3. The Mind-Body Problem, Duality, and Sapience: It's possible to read both the prior viewpoints as two ways of understanding existential dualism: is your mind distinct from your body, where consciousness is a distinct emergent effect of a complex brain (code operates on data)? Or are our minds and bodies an inseparable whole, existing in their unique form only because each acts on the other (code IS data)?

Much of Douglas Hofstadter's Gödel, Escher, Bach was specifically about what can emerge when you have a symbol-manipulating system that has the property of being able to operate on itself. The instant such a capability is part of a system, a couple of things happen. One is that the expressiveness of that system becomes enormous -- you no longer know the limits of what that system can say. (Debugging LISP programs of any serious depth is a descent into madness.)

And the other (per Kurt Gödel) is that the output of a sufficiently complex self-modifying system must be inconsistent -- that is, it becomes possible to express paradoxes: statements that contradict each other. What such a system "knows" becomes impossible to express consistently.

So where you stand on code and data comes down to the question of what you want from code and data. If you're writing a program that needs to be deterministically reliable, you're safer with dualism that keeps data as an object with zero capability to be a verb. If you want to be surprised, maybe sometimes not in a good way, but maybe sometimes in an awesome way, then a path to unexpected emergent expressions is through a self-modifying holism in which data is code.

Sometimes programmers are philosophers, too. :)
Post

Re: Are function and data the same thing?

#4
Flatfingers wrote: 3. The Mind-Body Problem, Duality, and Sapience: It's possible to read both the prior viewpoints as two ways of understanding existential dualism: is your mind distinct from your body, where consciousness is a distinct emergent effect of a complex brain (code operates on data)? Or are our minds and bodies an inseparable whole, existing in their unique form only because each acts on the other (code IS data)?
The "Problem" part of the mind-body duality you express here is that there doesn't seem to be a way for this mind, as a distinct emergent effect, to *affect* the body. It becomes an epiphenomenon, and consciousness is suddenly much less interesting.

In any event, I think you're sort of mixing dualities. Usually, people compare the mind/body duality to the software/hardware duality. Code and data are more analogous to reason and memory, or reason and sensory input.
Much of Douglas Hofstadter's Gödel, Escher, Bach ...
One of my favorite books. :D
Sometimes programmers are philosophers, too. :)
Indeed, they are. And vice versa.

Online Now

Users browsing this forum: No registered users and 1 guest

cron