Software Development

Correcting The Future

Predictions for Different Styles of Programming

I've done predictions before, but never about each kind of programming style. I'm not going to explain the specifics of why I think these things are true as I've written about them countless times already. I'll just state my predictions and we'll see where I stand.

Imperative Programming

First up is imperative programming. As long as the von Neumann architecture is around, imperative programming is here to stay. Languages like C aren't going anywhere and I doubt they ever will in the next 100 years. The reason for this is simple. It's too easy to put multiple instructions on a single processing unit. The only time we'll see imperative programming go away completely is if we get to the point where each computing unit can only execute ONE instruction (though it can execute it over and over again). Every computing unit can have a different instruction though.

Object Oriented Programming

This is a tough one. It's something that came about because the people who invented it had no clue what was going on. I could design you a better system in an OO style, but at this point, this would be futile. There's already an established industry and community that is unwilling to change. Object oriented techniques will always be around as well although in the future, you will only find them in locked down technologies that do not change. OOP is a request based system. So anything that is locked down like appliances, remote control, phones, ATM and any other devices where there's a fixed set of exposed functionality that you can request an action and get a result back. This will be around forever because it's been around forever in the past even before computers. This kind of functionality is not prone to building larger systems though. You need another kind of system for that. OOP will be used for fixed functionality systems only.

Functional Programming

Functional Programming could very well die out sooner than later. If the von Neumann architecture goes, so does functional. Functional is nothing more than a restricted set of von Neumann principles. Functional cannot do messaging, so all that's left is algorithms. If you want to produce monolithic algorithms, functional is a good bet. But its limitations will prove to be too much of a burden in the very near future. Functional cannot work in a distributed environment other than delegation, so there's an entire set of functionality that is lacking in functional programming. Already, functional is being warped into something else with features like lazy lists, monads, arrows and the like. These are all imperative and data flow techniques wrapped in functional clothing. If functional programming continues down this path, it will lose any distinctiveness as imperative languages are already adopting functional programming techniques.

I predict that when multi cores and distributed computing becomes more commonplace, this will really hurt functional programming because of its monolithic style. Delegation will prove to be insufficient. However, I do predict an initial enthusiasm for delegation. Unfortunately for functional enthusiasts, this will be short lived as certain types of software are impossible in functional programming. As this becomes more commonplace, the enthusiasm for functional will turn to resentment when the 'promise' is broken.

Data Flow Programming

This is already picking up steam. This is the style that is exactly like that of the Internet. The Internet is not going anywhere any time soon. You can keep adding to the Internet at any location (barring any protocols like IPv4). All other programming styles can be simulated or done as is on a data flow network. However, all other programming styles cannot do data flow programming. Oddly enough, imperative programming can be used to enable data flow programming. In fact, this feature was also used for storing state in Object Oriented programming.

Data Flow is the only fully distributed architecture that exists today and the only one that has true messaging as part of its nature. OOP has requests, not messages. Functional has just that, functions. And without side-effects, messaging is impossible. Imperative is the only one that can leave data behind for something else to pick it up. This is the critical feature needed for messaging. To pass things along without any requirement of it coming back.

I predict that data flow programming will take over all other paradigms. It's already happening. Data Flow can exist on its own or it can use any other paradigm to accomplish any portion of the work. No other architecture can claim to work so well with other paradigms.

Conclusion

I don't see any paradigm going away 100%, not anytime soon anyways. But I do see a shift in popularity. Some think that functional is becoming more popular, but I see data flow as the one that is gaining the most steam. Also, the Internet and the multi-core crisis are perfectly suited for data flow. All three architectures are identical. The other paradigms will hit a brick wall while data flow will flourish under this new environment. Personally, I can't wait. For the next five years, I'll have to wade through the bogus momentum gained by functional programming. Then things will start to turn around big time towards data flow programming.

Some may think that I have a biased view towards data flow programming. If true, it's only because the facts indicate that it's so much superior to everything else and because the Internet style architecture is not going anywhere. No matter what way you look at it, if you have something that can work over the Internet naturally with millions or infinite number of nodes at once, then you have software that can execute anywhere.

So next five years, functional will grow. Its techniques will start appearing in other languages as well. After six years, functional will start showing its true weaknesses. Then data flow will pick up through necessity because it'll be the only thing usable for a certain class of problems. In the distant future, processing cores will consist of single computable units. It'll do one and only one thing (although every one can do something different). The interconnections will be configurable. This will be the end of the von Neumann architecture. And it's already heading that way with AMD saying they will include custom processing units along with general purpose ones. The arrow only points in one direction. So disagree all you want with everything I've said, but I'm going with the flow. In six to ten year's time, I'll be way ahead of the wave. Not by my doing. But because I watched where the trends are going.

Can there be an architecture that supersedes data flow? Sure. I certainly hope so. But if it exists, we haven't seen it yet. Maybe something like quantum computing could do it. The cool thing is that data flow can adapt to this too until the transition is complete. This is where I want to be at. I want to deal with powerful architectures that do not limit what is possible.

Delegation Versus Distributed Computing (and Why Functional Sucks)Properties of Distributed Computing (And Proof Why Functional Fails)

Comments

Unregistered user Wednesday, April 18, 2007 2:36:25 AM

hughw writes: Erlang is pretty darn functional yet "does messaging" excellently.

Vorlath Wednesday, April 18, 2007 6:26:29 AM

Well, the messaging part is not a functional feature. It's a data flow feature if the linking of processes is done outside the process that sends the message and it's imperative if the process decides where to send the message. Again, this shows how data flow concepts are making a surge.

Unregistered user Wednesday, April 18, 2007 6:30:35 AM

copied from http://www.cincomsmalltalk.com/blog/blogView writes: Condensed Nonsense April 17, 2007 21:24:01 EDT I always thought this guy didn't get OOP, and this post just proves that point. Comments A nut job [ Michael Lucas-Smith] April 17, 2007 23:58:07 EDT Comment by Michael Lucas-Smith What an absolute nutjob. I think he barely gets OO - but take a read of what he wrote about Functional programming. Good god? Where did he learn this stuff??

Vorlath Wednesday, April 18, 2007 7:06:05 AM

Thanks for the notice whomever you are...

But James Robertson? Seriously? Might as well be Micheal Jackson talking about computers. Ah hee hee. What a complete waste of my time. And that other guy? Ad hominem attacks? WTF? YAWN! Nothing even the least bit clever. Zero entertainment value. I think MJ would have been a little entertaining at least. I'm sure he could sort the men from the boys. For James sake, it's a good thing MJ isn't actually here.

Vladasvladas Wednesday, April 18, 2007 8:21:26 AM

I've just posted a great phrase about corporate religions into RTAP group

By the way, I think there is one more programming style/model and now I'm in the process of writing a veeery white paper on that. It's close to data-flow style, but I daresay it's not exactly. It's more like a parallel and distributed computing based on some data-flow concepts.

When it'll be ready I publish it in my blog.

Unregistered user Wednesday, April 18, 2007 11:14:38 AM

jRave writes: At least try to learn something about the topics you will try to discuss before doing so. Now you appear as a teenager, who heard a little bit about "Data Flow Programming" and even heard the term "quantum computer", but knows sh*t about it and more so about the rest (oop, functional programming, message-passing). Just blubbering happily, trying to appear as that you get it. IMHO you don't. Before discarding something (technology, language etc.) try to at least understand it, so you can benefit from it even if you will never use it). Conclusion: If you are trying to appear like a Bill Gates type of a visionary (ie. Father of Internet, TCP/IP and even The Inventor Of One & Zero), you are right on.

Unregistered user Wednesday, April 18, 2007 12:21:43 PM

Anonymous writes: Perhaps I am a bit confused, but could you be so kind to explain in which sense "OOP has requests, not messages" in more detail? Not only because 'message' is a term originally invented in the OO-context ...

Vladasvladas Wednesday, April 18, 2007 1:07:32 PM

Perhaps I am a bit confused, but could you be so kind to explain in which sense "OOP has requests, not messages" in more detail? Not only because 'message' is a term originally invented in the OO-context ...



All misunderstandings begin from undefined terminology...

The "message" in Vorlath's meaning means "any data or code sent to other location (local or remote) which provides 'side effect' and with no return or even acknowlegment to the caller. The result then can be parsed by any other party."

Does any of mainstream paradigms (imperative, OOP, functional) provides such facility in consistence with that paradigm? Nope. You must, at least, have to use multithreading in order to do so. And that has nothing to do with that particular paradigm.

The closest approach in this area is AJAX (Asinchronous JavaScript), and even this has nothing to do with JavaScript as OOP language. It's only a matter of JavaScript implementation. Classic OOP doesn't have this feature. Even if it is implemented, it's against classic OO paradigm, and implemented using very specific internal techinques.



I don't expect you understand me. (c) Linus Torvalds.

Unregistered user Wednesday, April 18, 2007 4:29:23 PM

Weave Jester writes: "any data or code sent to other location (local or remote) which provides 'side effect' and with no return or even acknowlegment to the caller. The result then can be parsed by any other party." If there's no acknowledgement, how does the sending node know whether a message has been received or lost in transit?

Vladasvladas Wednesday, April 18, 2007 7:15:07 PM

If there's no acknowledgement, how does the sending node know whether a message has been received or lost in transit?



I'm sorry, but that was already discussed in previous blog posts. It is about establishing transactional protocols.

Unregistered user Wednesday, April 18, 2007 8:29:24 PM

Anonymous writes: Uh .... you do not know a damn thing about Object Oriented Programming. If you did, you wouldn't have made such asinine statements. Locked down technologies that do not change? Fixed set of exposed functionality? What kind of nonsense is that? At least do some reading before throwing around terms you don't understand, and pretending that you do.

Unregistered user Wednesday, April 18, 2007 8:31:56 PM

Weave Jester writes: Okay, so a message is not atomic, in the sense there must be a lower protocol to carry it along. In order to send a message from A to B, you need a bidirectional communications channel. At a minimum, something like this: A: Send me your next message B: > A: Message acknowledged A: Send me your next message B: > A: End of messages acknowledged Obviously we can add extra bits to it to handle transactions and so forth, but essentially, this concept of data flow programming is based upon a lower bidirectional protocol. Am I correct, or have I erred?

Vladasvladas Wednesday, April 18, 2007 9:42:05 PM

Ok. That's a discussion inside foreign blog...

Do you know something about UDP protocol? Yes, it is built upon IP, which is bidirectional. But that's only a carrier.

Unidirectional protocol example:

1. Begin transaction
2. Message 1
3. Message 2
3. ...
4. Message N.
5. End of transaction. Total number of messages: N

In similar way TCP window error correction protocol acts.

The context of an application, written in data-flow way is very similar to
legacy database applications. So, that all intecommunications inside an application produce database-like (and so - highly transactional) system.

Have you ever had done some intermediate (unrelated to database) calculations using a database system? It was quite a common practice in not so distant past (and sometimes in present).

Therefore, you can treat the context of data-flow application as a persistent database (in memory and/or disk space) with changing its data and state using unidirectional transactional messaging. And, yes, you must have rollback and retry features in such systems.

Uff. I'm probably explaining all this in too complicated way. If so - sorry for that.

Vladasvladas Wednesday, April 18, 2007 9:43:39 PM

Sorry - please read: s/TCP/UDP

Unregistered user Wednesday, April 18, 2007 10:39:47 PM

Weave Jester writes: Why build this transactional protocol on UDP rather than TCP? UDP is generally only useful for lossy protocols, and a distributed programming environment would need some guarantee of integrity. A transactional protocol would be able to guarantee that integrity, but would be considerably less efficient than TCP; it would take anything up to n! times longer to deliver messages, where n is the average transaction size. On average, I'd expect it to be a lot less than that, but still significantly less efficient than TCP. This is because UDP makes no guarantees about the order packets are received in. If I sent the following packets as a single transaction: A B C D E F Then they might arrive as: C D E A B F Or: B C A F Or any other permutation. So for a transaction consisting of 6 packets, there are 6! or 720 possible ways the packets can be received. If the only way we have to guarantee integrity is to discard the entire transaction, then we might have to go through 719 different failed transactions - more, if we get the same faulty transaction twice! TCP, on the other hand, guarantees that packets will always arrive sequentially. It does this by numbering the packets in a stream, so that we might get: A B C D E F Or: A B C But order is always guaranteed. Out of order packets are stored in a buffer until they can be sequentially arranged. Generally speaking, UDP is only used in real time systems. These systems number their packets to, but are able to skip over missing packets so long as order is preserved. These systems are ordered, but not sequential like TCP. e.g.: A B C F However, any transactional system that has rollback capabilities is not going to be real time, so why not build the transactional system on top of TCP? Is there some other reason for preferring UDP of which I am unaware?

Vorlath Wednesday, April 18, 2007 10:43:25 PM

[/B]jRave:[/B] Before dismissing something, perhaps you should read up on them. I have nothing to prove to anyone. I understand these topics better than most (even the so-called greats). If you wish to discuss anything, I'm right here. Let's talk shop if you think I'm wrong. I can tell you right now that I can support and prove everything that I say. Of course, this blog entry is about predictions. So these predictions may not turn out exactly as stated. However, I can defend all the arguments and the facts on which they are based.

Anonymous:

"Not only because 'message' is a term originally invented in the OO-context ..."

No, a message predates computers. A message is anything that can be sent to another party. For example, when you send a letter in the mail, there is no awknowledgment that it was received unless you specifically request that information.

Weave Jester:

"If there's no acknowledgement, how does the sending node know whether a message has been received or lost in transit?"

You're being self-contradictory if you're saying a message must have acknowledgement.

By your definition:
Message = info + ack

Substituting your definition of a 'message' in what you said:

"If there's no acknowledgement, how does the sending node know whether information & acknowledgment has been received or lost in transit?"

Do you see why your question makes no sense. You're using two definitions for your message. And if the message doesn't need to be both info + ack, then you've answered your own question that a message can be info alone without ack. What you do is use another infomation packet (aka message) for the ack. In fact, because of the above, it's impossible for a message to be both information & ack because I've just shown a proof by contradiction.

So what you're actually talking about is a protocol that can be built from several messages. Look at TCP. It sends several packets (messages) to handle this. But UDP has no such requirement, so there's a real world example of messaging without ack.

Anonymous #2:

"Uh .... you do not know a damn thing about Object Oriented Programming. If you did, you wouldn't have made such asinine statements. Locked down technologies that do not change? Fixed set of exposed functionality? What kind of nonsense is that? At least do some reading before throwing around terms you don't understand, and pretending that you do."

I never pretend. I understand and can defend everything I say. If OO is so great, then why is maintenance so difficult. These aren't my words. So if you disagree, then you have the entire computing industry up against you, never mind anything I could ever say. BTW, why do you think interfaces exist in OO? Also, how does one discover what functionality an object has in order to use it? Your questions indicate that you have no clue.

Weave Jester:

"In order to send a message from A to B, you need a bidirectional communications channel."

No, you don't. If you did, communication would actually be impossible because it would imply that BOTH sides would need to activate at the exact same time. We know this is impossible as it would require prior synchronisation, but this sync would require its own communication. No, this is ridiculous. So if BOTH sides activating at the exact same time isn't a requirement, then it means that it's OK for one side to activate before the other which means you don't need bidirectional since there is only one side active.

I just refuted your statement. I hope this is clear. Sending a message does not have to be reliable. Otherwise, nothing would ever get done. Another example is SETI listening for alien messages. There is no way we can respond, so how can we listen for messages if it's impossible without bidirectional communication? UDP? Sending a letter by regular mail? Leaving a note? The list goes on and on.


Everyone:

There's a difference between a message and a protocol. A protocol is built with the use of many messages. Not the other way around. OOP, functional and many other programming techniques have warped this notion so much that people, as seen in the above comments, believe some crazy notions about how information is transferred. One person even said OO invented the 'message'. HAHA. I mean, c'mon. There are serious misconceptions going around and all I'm doing lately is dispelling these things. It's no wonder we are 30 years behind the times.


Look, to anyone commenting who thinks I don't know what I'm talking about, please try to make some sense. I've been around for over a year on this blog and I wouldn't still be here if I was as wrong as some people claim. The 'greats' don't even have anything on me as I understand things they do (or did) not. Just because you've been brainwashed or taught certain things in school or University doesn't mean you are right. In fact, most of the stuff they teach you there is wrong. I know. I've been to University and they don't teach you 90% of the fundamentals. The rest is superficial properties that needs to be taken on faith. Do many of you even know it's possible to write software without functions or any execution point at all?

OOP and functional programming CANNOT do messaging, ok? It's a no brainer. It's not something that's been hidden from people or any big secret. So, if you haven't heard this before, do not blame me for your ignorance. I have nothing to do with that. All this is common knowledge. There's nothing new here. Now, OOP is built on top of imperative programming, so you can manually code up something that can do messaging for you. But there's nothing in the language itself that supports messaging. If you're going to comment on this, please make sure you have your facts straight.

Vorlath Wednesday, April 18, 2007 10:49:59 PM

Weave Jester:

TCP is a protocol that support reliable messaging. But TCP itself is NOT a message. It's a protocol that handles messages. It's not rocket science.

All the stuff you talk about are extra features not necessary for sending information. Reordering, reliable transmission, retransmissions, all that stuff are not necessary for sending a message. Are they beneficial? Sure. But they're part of the protocol, not the message itself.

If you don't understand this, there's nothing anyone can do to explain it. It's common knowledge. Look at how TCP/IP is implemented. There are several packets (messages) exchanged to enable the protocol. But each individual packet IS a message. The collection of these messages is a protocol.

It's not about preference. It's about terminology. A protocol is NOT a message. You're using the wrong terminology.

Vorlath Wednesday, April 18, 2007 10:52:11 PM

Weave Jester:

"Why build this transactional protocol on UDP rather than TCP?"

No one said this. Where would you get such an idea?

Unregistered user Thursday, April 19, 2007 12:34:11 AM

Anonymous writes: > I've been around for over a year on this blog and I wouldn't still be here if I was as wrong as some people claim. Yes, because evidence shows us that cranks and crackpots are never around for long. Well... I mean... If you ignore all the cranks and crackpots that have been around a long time, anyway. Btw, you may want to read up on the phrase "ad hominem".

Unregistered user Thursday, April 19, 2007 12:43:35 AM

Weave Jester writes: "No, you don't. If you did, communication would actually be impossible because it would imply that BOTH sides would need to activate at the exact same time." Uh... I think you misunderstand what I mean by a "bidirectional communications channel", Vorlath. I'm speaking from a low level perspective, so if I send a "message" from A to B: message A ---------> B Then underneath this, at some low level protocol, there's going to be something like this: info A ---------> B To avoid confusion, let's call these "packets". So a unidirectional message is based upon a pair of bidirectional communications (the "info" and "ack" packets) at a lower level. Now it's true that we could just listen, or send, and do away with packets to check integrity. But if we're sending data across a lossy channel, we can forget about being able to data integrity efficiently (I guess one could send the same message hundreds of times, but that's not a very effective solution!) Also, just to make it clear, whilst you believe that functional programming cannot do messaging, there are many people, myself included, that believe you are wrong. In fact, there's a considerable number of people that see functional messaging systems as the best way to achieve mass parallel computing. Again, I include myself. Now, it's possible that you are correct and that all these people, including myself, are wrong. I find it unlikely that this is the case, but then I wouldn't be arguing my case if I thought I was incorrect. However, it's usually polite, in a reasoned debate, to argue one's point without resulting to emotional arguments and ad hominem attacks. Merely saying "functional programming CANNOT do messaging" is no more or less convincing than me saying the opposite. Likewise, claiming that a person who disagrees with you is lying is not usually an effective way to successfully argue ones point. Now that I've said that, one might wonder why I believe functional programming can achieve distributed messaging systems. There are two reasons for this: 1. It is my belief that the full history of any messaging network can be accurately stored by data-structures consisting of sets of tuples. 2. It is possible to evaluate such a structure on the fly without changing any previously evaluated data. To show you what I mean by the second point, consider the definition of a list in a typical functional language: List a = a : (List a) | Empty This is a recursive definition for a list of type 'a', where 'a' can be any type. We can use this to define a list of 5 numbers: 1 : 2 : 3 : 4 : 5 : Empty For those familiar with C, this might look familiar to null-terminated strings. Unlike C strings, however, lists don't necessarily have to have a terminating point. Now let's consider the following list definition: odds = f 1 where f x = x : f (x + 2) This is a recursive definition that defines a sequence of numbers. How might we go about finding the first three numbers of this sequence? Well, we start with: f 1 And we can substitute the definition of f like so: 1 : f (1 + 2) Again, substituting for f: 1 : 3 : f (3 + 2) 1 : 3 : 5 : f (5 + 2) Here we can stop. We don't need to go any further, because we already have the first three numbers of the sequence. This hopefully demonstrates five things: 1. Lists can be evaluated sequentially. 2. Lists don't necessarily have an end. 3. It's often not necessary to evaluate the whole list in order to get an answer. 4. It's often not necessary to know the length of list in order to get an answer. 5. We haven't changed any values in the list throughout our evaluation. Number 5 should be obvious in this case, as the sequence of odd numbers is constant. You're not going to find an extra odd number - this sequence is fixed in stone. We can do the same thing for prime numbers. With odd numbers, there are no surprises; the nth digit is (2n - 1). But with primes, there's no easy way of figuring out the nth prime without figuring out all the previous ones. Thus, we can add a sixth rule: 6. It's often not necessary, and sometimes not possible, to know what every value in the list is. Now consider a list of a different sort; the 5 keys I just typed: 't' : 'y' : 'p' : 'e' : 'd' : Empty Note this list does have a terminator, and again it's a fixed and constant. I can't go back in time and change the keys I typed just then; history is fixed. But what if you didn't immediately have all the keys to hand? What if I was reading out the key history over the phone, really, really slowly, and your boss wanted to know what the first two keys were? Since you're smart and in a hurry, you don't wait for me to finish; by the time I've started on the 'p', you're already telling your boss that the first two letters are 't' and 'y'. "Thanks for telling me the keys you typed five minutes ago," you say. "Five minutes ago?" comes the reply, "I thought you wanted the keys I was typing whilst you called me!" Suddenly, what you thought was a fixed, historical list of keys, was actually a list of keys in the present. But now that it's once more in the past, it's still a fixed list. In other words, a list can not represent a sequence of keys that exists in the past, but also a list of keys that exist in the present and future. So if functional programming can describe the history of a messaging network, then it can describe the present and future of the network as well. You'll have to wait until the messaging system has finished before you can evaluate all the messages that were sent, but you can evaluate in increments; the same way you could tell your boss that the first two letters were 't' and 'p', even though I hadn't yet got around to typing the ending 'd'. And that's how functional programming can handle messaging.

Vorlath Thursday, April 19, 2007 2:36:56 AM

You don't believe a packet is a message? I'm saying functional can't handle packets and neither can OOP, but here again, you're changing the terminology. A message is and always has been information that moves from point A to point B. A packet has the requirements to be a message.


"Then underneath this, at some low level protocol, there's going to be something like this:"

Yeah, exactly. It's a protocol, not a message. You said it yourself.

"So a unidirectional message is based upon a pair of bidirectional communications (the "info" and "ack" packets) at a lower level."

This is your definition, not anyone else's. A unidirectional message implies one way (as in 'uni' meaning 'one'). So your ack packet cannot be part of your definition since it's a second ('two' aka not 'uni') packet. It's no longer unidirectional. The rest of your argument falls apart because it's based on this incorrect view.

But I'm feeling extremely good today, so I'll continue.

"Also, just to make it clear, whilst you believe that functional programming cannot do messaging, there are many people, myself included, that believe you are wrong. In fact, there's a considerable number of people that see functional messaging systems as the best way to achieve mass parallel computing. Again, I include myself."

That's fine, except you forget that it's not *my* claim. It's a law of physics. The designers of TCP/IP and the Internet understood this. So argue with them if you wish, but I'd rather go with established and proven notions. I mean, this is as basic as you can get.

edit: I missed the last sentence. Functional can only do delegation. Wishful thinking that functional can do distributed computing doesn't make it so. You're in for a HUGE disapointment. And if it could, where have you all been the past 20 years? Where is this great technology? It's nowhere to be seen. Twenty years. How do you explain that? What are you all waiting for?

"Merely saying "functional programming CANNOT do messaging" is no more or less convincing than me saying the opposite."

I did not say that by itself. I've grown tired of repeating myself and others ignoring facts. I've explained this concept on numerous occasions.

"Likewise, claiming that a person who disagrees with you is lying is not usually an effective way to successfully argue ones point."

Fair enough, but really, you have changed definitions more times than Liz Taylor changes husbands. I can only assume you're pulling my leg. There's no way you can believe everything you say when it's so contradicting.

"1. Lists can be evaluated sequentially.
2. Lists don't necessarily have an end.
3. It's often not necessary to evaluate the whole list in order to get an answer.
4. It's often not necessary to know the length of list in order to get an answer.
5. We haven't changed any values in the list throughout our evaluation."

#1 ok
#2 No. You would run out of memory. Items not evaluated do not exist.
#3 See, this is why #2 is not true.
#4 actually, you do. You may not need to count them physically, but you need to have some mechanism for storing each one which constitutes a mechanism for getting the number of items.
#5 Fancy footwork. If you evaluated them, then the list changed. This is what functional says how state changes occur.

"6. It's often not necessary, and sometimes not possible, to know what every value in the list is."

In other words, you can't evaluate everything like NP-complete problems. Sure.

"So if functional programming can describe the history of a messaging network, then it can describe the present and future of the network as well."

No. That's ridiculous. Pass that list to a function twice and you'll get different results. No waiting allowed. Waiting requires mutable state to get out of the waiting state (aka imperative programming).

"You'll have to wait until the messaging system has finished before you can evaluate all the messages that were sent, but you can evaluate in increments; the same way you could tell your boss that the first two letters were 't' and 'p', even though I hadn't yet got around to typing the ending 'd'."

Sorry, but your list is changing on the fly. If I look at item 3 before it was typed, it would not exist. You have mutable state here. You cannot wait for it. How do you know when it arrives? Something must change from going to a waiting state to a non waiting state? What caused this? It's mutable state. This is imperative programming. You've described this a million time. I've asked you before, Why do you think I can't see right through this?

Again, you're trying to convince yourself of these notions so that you can be at peace. You MUST know what you say isn't true. Can you see why this is a lie. There's nothing here even remotely believable. You said yourself it waits!!! That's the very definition of mutable state! You keep describing imperative programming. Please show me a functional concept that handles messaging. I've already agreed that imperative can do messaging. But passing this off as functional programming is deceitful. Not to me, but to yourself.

All I've heard is that so-called functional languages can do messaging by using imperative programming. I'm fine with that. I've been saying this all along. But it's not functional programming.

Unregistered user Thursday, April 19, 2007 6:35:03 AM

Anonymous writes: Thank you for clarifying your definition of 'message'. If I've understood you right than your term is independent from things like the transport layer or media and such, it's just what to send, not how. Acknowledgement, ensured order and transactions can be built uppon messages and are not part of the concept itself. ... ? @invention of 'message': I thought in the domain of programming it should be obvious that letters, calls and so on cannot be meant. Of course my statement can still be wrong, but I've tried to say that I cannot remember the usage of 'message' in sense of _a definition_ in programming before OO. If not I am interested in an example of "prior art". ;)

Vorlath Thursday, April 19, 2007 7:12:15 AM

I'm very flexible with the definition of a message. The only requirement I hold is that information is transferred. From this, you can build other features. Ack would be another message. Reordering is simply manipulation of recived messages. All these things are protocols. Protocols are higher level. That's what OO messages are. That's what functional evaluations are. They all use multiple messages (packets of information). None of them can use a single message. So they can't do messaging in its basic form.

About the term... Oh, you mean a prior use in programming. I can't really say if there was such a use, though I know hardware has signals. But you should read up Alan Kay's initial thoughts on coining the term OO. He envisioned cells that could send and receive commands. This is what a message SHOULD have been. This is the accepted concept of a message in the real world. But that's not what happened. What happened is that messages got coupled with the response from that command. If Alan Kay could have resisted this urge and used messages as they were used in the past, then things would have been drastically different. Unfortunately, I doubt even Alan Kay knows what happened. I bet he still thinks his 'messages' are normal. In fact, many are wondering why OO doesn't work well for distributed applications if OO supports messages. Well, I've just told you why.

So your prior art was very short lived. In programming, if the term is incorrectly used, it should be corrected. To be fair, it is composed of two messages. So that's why some would say it still qualifies. I don't because there are some things that an OO message cannot do as explained previously.

Also, I should clear up that because OO is built on top of imperative, it has the ability to use messages a la real world definition. There's just nothing in the concept of OO that supports it. In fact, it can't unless you go the data flow route. This is what Alan Kay ALMOST had on his hands when he designed OO. Man, history got a good kick in the arse on that one.

As for computers, the first message was used at UCLA on October 29, 1969. Unfortunately, OOP was designed before this in the same decade with an alternate definition. Even today, you often see the response part of the OO message omitted from its definition. That's rather revealing in itself.

Vladasvladas Thursday, April 19, 2007 7:43:10 AM

Why build this transactional protocol on UDP rather than TCP? ...



In short - I need it (unidirectional) for a new computational model. And Vorlath needs.

Unregistered user Thursday, April 19, 2007 12:50:45 PM

Weave Jester writes: "That's fine, except you forget that it's not *my* claim. It's a law of physics." Ah yes, Newton's little known fourth law: distributed messaging systems under functional programming are impossible. Sarcasm aside, it's not a law of physics. This is merely a debate as to whether a programming language based on the principles of lambda calculus (i.e. functional programming) can handle a distributed messaging system. It's my assertion that not only can it do so, but that it rather well suited to the task. However, when I speak of a distributed message system, I'm talking about one with some guarantee of integrity. You seem to be suggesting a message system where the messages themselves are lossy, which I guess is a valid place to start from, but I personally don't see the point. My apologies if I've misunderstood, but you're not being very clear in your description. A functional programming language is very well suited to a messaging system where the "messages" themselves are guaranteed to be always arrive, and arrive in the exact same order they were sent so long as the system is operational. A lossy messaging system would be considerably more complicated to define in a functional language, though I'm not sure why you'd particularly want to. There aren't many benefits to lossy distributed computing that I can think of. "No. You would run out of memory. Items not evaluated do not exist." Mathematicians and functional programmers alike would disagree with you. Just because I do not know what the 1342th prime number is, does not mean it does not exist, or that it is not a constant value. "No. That's ridiculous. Pass that list to a function twice and you'll get different results." No, you won't. "No waiting allowed. Waiting requires mutable state to get out of the waiting state (aka imperative programming)." Electronic circuitry that waits for a certain event or time has been around far longer than imperative programming. In any case, it doesn't matter what system a functional program is executed under, so long as the functional environment itself adheres to a specific set of rules. You've yet to provide a valid proof as to why this set of rules is not internally consistent. Further, if we ban waiting, then even the simplest of calculations becomes impossible. Even the act of adding to numbers together takes time, so if you're going not allow a function to wait for the return value from another, then you're pretty much screwed from the get-go.

Vorlath Saturday, April 21, 2007 10:40:22 PM

"This is merely a debate as to whether a programming language based on the principles of lambda calculus (i.e. functional programming) can handle a distributed messaging system.

It's my assertion that not only can it do so, but that it rather well suited to the task."

Nothing so far would indicate so. I've actually proven that it can't be done in functional programming using the concept of work. It is a law of physics. Distributed computing requires physical separation, otherwise it is not distributed. So your sarcasm is not well founded.

"However, when I speak of a distributed message system, I'm talking about one with some guarantee of integrity."

This is not a requirement. In fact, you can never be certain that a message arrives even with 'reliable' protocols.

http://www.artima.com/weblogs/viewpost.jsp?thread=57224

"... and arrive in the exact same order they were sent so long as the system is operational."

In some cases, this is not a requirement. What do you then? Your protocol would unecessarilly wait for no good reason and waste processing time because your protocol is forced to use features you do not want. This is exactly what I'm saying functional has. It has features that are actually detrimental to distributed computing, moreso than the above feature.

"You seem to be suggesting a message system where the messages themselves are lossy, which I guess is a valid place to start from, but I personally don't see the point."

Everything can be built from this. It's strange seeing someone who supports functional programming be against composability. Again, the contradictions continue. You can't have reliable messages anyhow. If you assume this, then your software does not take this into account and then what do you do?

"Mathematicians and functional programmers alike would disagree with you."

After all this time, do you think I care? I'm saying they are wrong and I'm showing you why. Yet, you cling to these people as if they should know better. Bring these people here and let's talk shop.

"Just because I do not know what the 1342th prime number is, does not mean it does not exist, or that it is not a constant value."

Sure it does. It means that you do not have its value. If I have two cars, I can't go around saying that my third car exists if I don't actually own one. I can potentially go buy one, but it doesn't change the fact that at that particular point in time, this third car does not exist. There's a reason potential and kinetic energy are different. They're interchangable, but a process must occur to enable that. What's your process in FP? Evaluations? Right. So there you go. If it existed, you wouldn't need the evaluation.

"Electronic circuitry that waits for a certain event or time has been around far longer than imperative programming."

So you're saying this is functional programming? Again with the contradictions.

"In any case, it doesn't matter what system a functional program is executed under, so long as the functional environment itself adheres to a specific set of rules."

Everything under the Sun is OK according to you. You use imperative when you feel like it with monads and call that functional. You wait for external trigger (obviously a side-effect), yet you say it's perfectly acceptable within functional programming. According to what you say, it's impossible to pinpoint what functional programming is. Even the boundary where state changes are allowed change. Apparently, it's ok outside the software, but not ok outside the function. How does that work? It's self-contradictory.

Let me posit this scenario. If the overall system that enables your software to execute is also functional, then isn't the outside of your software now suddenly INSIDE the overall functional software? Of course it is. So this is a proof that allowing external state changes is contradictory to the notion of functional programming if no side-effects are allowed. Allowing external changes breaks the rules of functional programming for the overall system. QED. This is why I've always said that the boundary you chose for 'external' is ridiculous. It's completely arbitrary and contradictory. It's up to you how you will reconciliate these anomalies.

"You've yet to provide a valid proof as to why this set of rules is not internally consistent."

I just did above as I've done many times over. You just ignore them as if I didn't. Again, you are not being honest to yourself or to others.

"Further, if we ban waiting, then even the simplest of calculations becomes impossible. Even the act of adding to numbers together takes time, so if you're going not allow a function to wait for the return value from another, then you're pretty much screwed from the get-go."

HAHAHA! Now, you're backtracking. I was talking about waiting on side-effects and you know it. Besides, if a function is computing something, then your software is active, not in the waiting state.

Unregistered user Sunday, April 22, 2007 3:44:43 AM

Weave Jester writes: "I've actually proven that it can't be done in functional programming using the concept of work. It is a law of physics." You keep using that phrase. I don't think it means what you think it means. Physical laws don't enter into this. And whilst you used analogies of work to make your point, all it is is an analogy. It is not proof. Lambda calculus is a fixed set of rules. To prove that a programming language based on these principles cannot send messages involves firstly quantifying the set of rules used by a message-passing system, and then demonstrating that these rules are incompatible laid out by lambda calculus. Vigorous hand waving is not an effective substitute. "This is not a requirement. In fact, you can never be certain that a message arrives even with 'reliable' protocols." I suggest you find out the difference between integrity and reliability. Regarding my assertion that just because I do not know the 1342th prime number, that does not mean it does not exist: "Sure it does. It means that you do not have its value." Not having it's value, and not existing, are two different things. Indeed, there are a number of simple proofs that demonstrate that the set of prime numbers cannot be finite; therefore there must be a 1342th prime number. So I can prove it exists even if I do know what it is. Merely because I do not know it's value, does not mean I can't prove that it does have one. "So you're saying this is functional programming? Again with the contradictions." The flow of electricity through a conductor is no more functional than it is imperative. Imperative systems, like functional ones, are self-contained environments that adhere to a fixed set of rules. They affect the outside world because their changes in their internal state generate side effects. For instance, the effect of changing a particular portion of memory may result in an image on a monitor. This type of side effect differs from the computer science definition, which is concerned about a more abstract and limited change in state within the confines of the rules defined by the system of interest. "You use imperative when you feel like it with monads and call that functional." Maybe that's because it is functional. As I've pointed out before, a monad is nothing but a type class that implements a standard set of functions. "According to what you say, it's impossible to pinpoint what functional programming is. Even the boundary where state changes are allowed change. Apparently, it's ok outside the software, but not ok outside the function. How does that work? It's self-contradictory." I've given an exact definition of what pure functional programming is, so that should be clear enough. The boundary is black and white, but where the limits are depend on the environment. For instance, if every function in my application wrote a log to a file, like a debugging trace, then at first glance this would not create any impurities, as it doesn't affect the input and output mappings of the functions. But what if the file they wrote to was a fifo pipe to an application that rewrote the OSes memory in such a way that the functional programming environment was altered? Then it would affect state change. However, I don't know of any pure functional language that does this. All the languages I've seen wrap all I/O transactions in a state change structure that acts as a gatekeeper to ensure their purity. They steer well clear of the potential dangers I outline. "I just did above as I've done many times over. You just ignore them as if I didn't. Again, you are not being honest to yourself or to others." Not at all. Your proofs because they are not proofs at all, merely strongly worded arguments. Repeatedly claiming that they consist proofs do not actually make them that. "Let me posit this scenario. If the overall system that enables your software to execute is also functional, then isn't the outside of your software now suddenly INSIDE the overall functional software? Of course it is. So this is a proof that allowing external state changes is contradictory to the notion of functional programming if no side-effects are allowed. Allowing external changes breaks the rules of functional programming for the overall system. QED." This is an example of an argument that claims it is a proof, but is nothing of the sort. If the inner functional program produces side effects in the outer functional system, all that says is that the outer system is not a pure functional system. It proves nothing about the purity (or lack thereof) of the inner program. Nor does it prove you cannot have a pure functional program running in a pure functional system. In fact, your argument proves absolutely nothing at all. "HAHAHA! Now, you're backtracking. I was talking about waiting on side-effects and you know it. Besides, if a function is computing something, then your software is active, not in the waiting state." What's the difference? From the standpoint of the calling function it amounts to the same thing; whether you're calculating a billion digits of pi or asking the user to press a key, there's still going to be a delay of an indeterminate amount of time. What happens outside of the functional environment is irrelevant, so long as the environment itself adheres to a fixed set of rules.

Vorlath Sunday, April 22, 2007 6:21:29 AM

"Physical laws don't enter into this."

Of course it does. Physical separation is a requirement of distributed computing. It's not an analogy. It's a physical reality.

"Lambda calculus is a fixed set of rules. To prove that a programming language based on these principles cannot send messages involves firstly quantifying the set of rules used by a message-passing system, and then demonstrating that these rules are incompatible laid out by lambda calculus. Vigorous hand waving is not an effective substitute."

I did all that. Just because I use plain English doesn't make it any less valid.

But if you wish.

Say you have two functions:

f(x) = g(x)

After evaluating g(x), call it y, this result will take the place of g(x). You end up with:

f(x) = y

So all of x, y and g(x) have to be in the same physical location as the function f relatively speaking. If they are in the same location, then they cannot be physically separated as required by distributed computing.

The only thing that can be at a different location is the part between g(x) being converted to y. That part need not be local and this is why delegation is possible.

Do you want something more technical? This is so mindboggingly simple to me that I can't believe anyone would want something more involved than this.

"I suggest you find out the difference between integrity and reliability."

I'm trying to tell you that both are features that can be built on top of basic messages.

"So I can prove it exists even if I do know what it is. Merely because I do not know it's value, does not mean I can't prove that it does have one."

Wow, way to confuse yourself. When ones says a list or a value exists (as it appears you are saying it), one usually talks figuratively. Just like when I say the playoff finals of hockey consists of two teams. But right now, those finals do not exist. As teams get eliminated, I can more readily predict and narrow who it will be. I can even tell you that Buffalo and Ottawa will NOT both be in the finals. But until we get there, we cannot say that either finalist exists. Because they don't. It hasn't been determined yet. See, you're using the viewpoint that if Buffalo ends up in the finals, then they existed all along even if we could not tell beforehand. Well, no. The criterion is Buffalo as a finalist. That combination did not exist until the end. For your example of a prime number, all the numbers DO exist. But until we can determine which one is the Xth prime, then it doesn't exist in our computer. We know there will be one if we look long and hard enough. We can predict some of its features. This is what you seem to be talking about. But that's a far cry from it actually existing in our hands or in our computer.

"The flow of electricity through a conductor is no more functional than it is imperative."

Well, actually it's closer to being imperative because imperative can take an input from one device and send it on to another device. Also, flow of electricity through a conductor is definitely not functional in any way, shape or form. Even so, what's the point of your comment? I was saying you can't use hardware to support that it's ok for functional to wait on external inputs because hardware is not functional in nature.

"Maybe that's because it is functional. As I've pointed out before, a monad is nothing but a type class that implements a standard set of functions."

But it has mutable state with external side-effects. This is contrary to what functional programming claims to be.

About state change boundaries,
"The boundary is black and white, but where the limits are depend on the environment."

You can't make such an arbitrary distinction. I proved why you can't and you've ignored my proof yet again just because it's in plain English. If function f executes your software g, then f is your external environment. If you allow external state change to g occuring in f, then f has local mutable state not allowed by functional programming. This is as simple as it gets.

Your claims of hand waving are baseless. If you ignore my proofs, then what is your purpose here? I show you exactly why things are the way they are and you turn your head and claim I'm doing some handwaving. Why do you do this?

"Not at all. Your proofs because they are not proofs at all, merely strongly worded arguments. Repeatedly claiming that they consist proofs do not actually make them that."

So just because it's written in English, you don't accept my proofs? C'mon, that's just asinine. Of course what I'm stating are proofs. I don't need to use special notations for them to be so. Besides, they are so simple that requiring some other notation is trite. Basically, you're saying my arguments are valid, but you're ignoring them because then your arguments would fall flat.

"If the inner functional program produces side effects in the outer functional system, all that says is that the outer system is not a pure functional system."

EXACTLY!!!!! Thus functional programming CANNOT BE THIS EXTERNAL OUTER SYSTEM if you use monads. You said it yourself. So functional programming cannot exist by itself as I've said all along and your use of monads is dubious.

"It proves nothing about the purity (or lack thereof) of the inner program. "

No need. My purpose was to show how the entire system cannot be functional if you use monads. But it does show exactly what you say it doesn't. It shows that if the external system isn't functional, then the inner program is what is causing it not to be pure. By induction (through nesting), or by construction, the inner program cannot be pure either as it's been established that mutable state has occured.

"Nor does it prove you cannot have a pure functional program running in a pure functional system."

Actually, it does. If you use monads, then the entire system cannot be functional. If you don't use monads, then you cannot do I/O. And if you cannot do I/O, where does the original input for your software come from? What does the I/O to pass to your software if you cannot use monads? Nothing. It's not possible.

"In fact, your argument proves absolutely nothing at all."

It proves everything. You're just willfully ignoring it. That's your choice.

About waiting on external state changes,
"What's the difference? From the standpoint of the calling function it amounts to the same thing; whether you're calculating a billion digits of pi or asking the user to press a key, there's still going to be a delay of an indeterminate amount of time."

Don't try and change the topic. You know full well that I was talking about waiting on external state change. The difference is that one is mutable state not allowed by functional programming, and that the other is state transformation by a function allowed by functional programming.

Unregistered user Sunday, April 22, 2007 4:47:30 PM

Weave Jester writes: "So all of x, y and g(x) have to be in the same physical location as the function f relatively speaking." Not necessarily, because you could embed a distributed computing layer beneath the functional one, such that the AST is spread across multiple machines, and it's not necessary to know the entire AST to evaluate specific branches. But even if we didn't use such a system (and there are valid reasons not to): "The only thing that can be at a different location is the part between g(x) being converted to y. That part need not be local and this is why delegation is possible." Delegation is no different from two way message passing when combined with a recursive data type. Consider the following code: f x = x : f (x + 1) g (x : y : xs) = x * y : g xs How might we evaluate (g (f 1))? g (f 1) g (1 : f 2) g (1 : 2 : f 3) 1 * 2 : g (f 3) 2 : g (3 : f 4) 2 : g (3 : 4 : f 5) 2 : 3 * 4 : g (f 5) 2 : 12 : g (5 : f 6) ... But what if we delegated the evaluation of (f 1) to another machine? We'd first need some protocol to facilitate it. Let's use the "eval" command to indicate that the calling function g wishes to evaluate f: f g 1 : f 2 f g ----------> main 2 : f 3 2 : g (f 3) ... Note that the middle two evaluations do not return to main. This is because for the distributed environment in our example, the list is our unit of delegation, so only evaluations of lists spark a delegation. Now, in this case, the message network to facilitate this distribution is merely a chain. But a more complex program would might assume a tree form, with some tasks being done in parallel. Okay, so we can have chains and trees, but is that it? Not necessarily, as we could have two functions that call the same base function, giving us cycle, and we could have multiple "main"s, giving us multiple roots: .- b -. .- main1 a : : d : '- c -: :- e - main2 '---' main1 = d (b a) (c a) main2 = e (d (b a) (c a)) (c a) In fact, any network can be represented this way. So delegation is no different from arbitrary network of data streams. "For your example of a prime number, all the numbers DO exist. But until we can determine which one is the Xth prime, then it doesn't exist in our computer. We know there will be one if we look long and hard enough. We can predict some of its features. This is what you seem to be talking about. But that's a far cry from it actually existing in our hands or in our computer." You say we can predict some of its features. This is exactly my point; we don't necessarily need to evaluate a value or function fully if we can get an answer by only evaluating up to a certain point. For instance: f x = x : f (x + 1) oneToTen = take 10 (f 1) If we were to fully evaluate (f 1), the answer would never come, because (f 1) is an endless list. But because we're only taking the first ten values, we can stop after just ten cycles. "So just because it's written in English, you don't accept my proofs?" Is this a deliberate straw-man? I don't accept your 'proofs' simply because they are not proofs. I don't care what language they're written in, so long as it's understandable. "EXACTLY!!!!! Thus functional programming CANNOT BE THIS EXTERNAL OUTER SYSTEM if you use monads. You said it yourself. So functional programming cannot exist by itself as I've said all along and your use of monads is dubious." Before you try to prove anything about monads, might I suggest you first find out what they are? Your proof doesn't work, as monads are not what you think they are. Let me make it clear: monads are not in any way necessary for functional I/O. I'll give you a concrete example. Here's a piece of functional I/O without monads: main state1 = let state2 = print state1 "Hello" print state2 "World" And here is it rewritten to use monads: main state = state >> print "Hello" >> print "World" There's nothing you can do with monads that you couldn't potentially do the long way around. They just make for less typing. "Don't try and change the topic. You know full well that I was talking about waiting on external state change. The difference is that one is mutable state not allowed by functional programming, and that the other is state transformation by a function allowed by functional programming." I'm not changing the topic, and yes, I know you're talking about external state change. What I'm saying is that the difference you describe only exists outside of the functional environment, and therefore is irrelevant. For instance, consider the type signature of a list that contains the all the words contained in a novel: [String] Now consider the type signature of an in-progress transcript of an conversation (assuming nothing is struck from the record): [String] See? There isn't any difference to how the function is perceived inside the environment. What happens outside, so long as it doesn't affect the rules inside, is irrelevant.

Unregistered user Sunday, April 22, 2007 10:02:46 PM

Nate writes: ""So all of x, y and g(x) have to be in the same physical location as the function f relatively speaking." Not necessarily, because you could embed a distributed computing layer beneath the functional one, such that the AST is spread across multiple machines, and it's not necessary to know the entire AST to evaluate specific branches." Thanks, that's basically what I've been trying to say (and the idea around which my pet thought-experiment system revolves): an abstract graph of computational-entity nodes means a 'reduction' node does not need to be located on the same system as the function that computes it. We don't need to 'substitute' or 'return' a value in-place to a stack, which would imply two-directional question/response communication as a primitive - we can split our function/reduction pair across a communication link and we get one-way messaging while still within a lambda paradigm. As far as I can tell. "But even if we didn't use such a system (and there are valid reasons not to):" I'm interested to know those reasons. A large amount of the reason why I hang out here on this blog is that so few people are talking about dataflow and massive (instruction-level) parallelism at all, and it's such an obvious and appealing idea to me. Ever since I first met Occam around my high school years I thought 'this is the way of the future' and wondered why it's been taking so long.

Unregistered user Sunday, April 22, 2007 11:26:29 PM

Weave Jester writes: "Thanks, that's basically what I've been trying to say (and the idea around which my pet thought-experiment system revolves): an abstract graph of computational-entity nodes means a 'reduction' node does not need to be located on the same system as the function that computes it." Nate, might I ask what you mean by a "reduction node"? "we can split our function/reduction pair across a communication link and we get one-way messaging while still within a lambda paradigm" In terms of one-way versus two-way, I'm not clear why everyone's making a big deal out of it. I can't think of any layer 2 protocol that is unidirectional, so you'll always be passing data back and forth even if you're using UDP. "I'm interested to know those reasons." They're essentially all practical. Distributing a program across numerous physical machines generates overhead in terms of ensuring information integrity, latency, bandwidth and so forth. Distributing at the processor level is limited by how many CPU cores you have available (i.e dividing a program into 32 isn't going to be any more efficient than dividing into 8 if you only have 8 cores). The architecture of current computing devices isn't suited for mass parallelism at the instruction layer. That's not to say it can't be useful, merely that it isn't very efficient with current hardware.

Unregistered user Monday, April 23, 2007 3:06:30 AM

Nate writes: "Nate, might I ask what you mean by a "reduction node"?" Possibly I have the wrong terminology - untyped lambda calculus makes my head spin a little, so I'm not sure if beta-reduction is precisely the process I'm thinking of - but what I mean is the mathematical entity which is a pair of (application-of-function == reduction) where 'reduction' is the simplest form of the output or result of the function. (As opposed to, eg, returning the function itself, or wrapped in another function, which would strictly speaking be a legitimate equation, but wouldn't be a reduction). "Distributing a program across numerous physical machines generates overhead in terms of ensuring information integrity, latency, bandwidth and so forth. Distributing at the processor level is limited by how many CPU cores you have available (i.e dividing a program into 32 isn't going to be any more efficient than dividing into 8 if you only have 8 cores). The architecture of current computing devices isn't suited for mass parallelism at the instruction layer." That seems to be the core of the historical argument against instruction-level parallelism to me, and while I don't disagree, it seems to be assuming that the main reason we'd want it is raw performance. Which seems a bit shortsighted. The architecture of 1970s computing devices didn't seem suited for Lisp either, and yet off-the-shelf hardware outperformed dedicated Lisp machines by the early 1990s. What I'm interested in is seeing if there are any cognitive benefits for the programmer in removing all concept of sequential execution, as well as if it would make it much easier for a compiler to optimise for an appropriate amount of parallelism. Kind of a computing Sapir-Whorf experiment. That it seems to be so hard to talk about it (and that the usual responses are either 'Haskell does that already, don't waste your/our time' or 'we tried that and it was too slow') suggests that there may indeed be a bit of a mental blind spot here. (Except for the 'reactive functional' people, who seem apropos:) http://www.haskell.org/yale/papers/haskellworkshop01/index.html "Fruit is a new graphical user interface library for Haskell based on a formal model of user interfaces. The model identifies signals (continuous time-varying values) and signal transformers (pure functions mapping signals to signals) as core abstractions, and defines GUIs compositionally as signal transformers. In this paper, we describe why we think a formal denotational model of user interfaces is useful, present our model and prototype library implementation, and show some example programs that demonstrate novel features of our library." Which gives me a sort of 'finally! someone gets it!' reaction, as opposed to the constant grinding-of-teeth when I look at the Byzantine complexity of current GUI libraries.

Vorlath Monday, April 23, 2007 1:19:22 PM

Weave Jester:

"I'm not changing the topic, and yes, I know you're talking about external state change. What I'm saying is that the difference you describe only exists outside of the functional environment, and therefore is irrelevant." - Weave Jester

You cannot say the external environment is irrelevant because it makes your system inconsistant. Functional is useless if you chose to stick by this notion. If you continue to say this, then you've proven my point that functional has side-effects. Arbitrary boundaries. So I chose external environment to check for side-effects. I can chose this because it's arbitrary.

"Delegation is no different from two way message passing when combined with a recursive data type. Consider the following code:"

Yay, you know that delegation involves two way messages. Everything afterwards just proves my point even more. You just refuse to see the onsequences of this. I'm trying to show you WHY functional cannot handle distributed computing OTHER THAN delegation. Showing me how it can do delegation is rather pointless.

"Note that the middle two evaluations do not return to main. "

Of course they do. The last line goes back to main afterwards. BTW, delegation can be nested as you've shown. Like I said, this is all pointless. We all agree on delegation.

About your monads, you're being defensive again and trying to make as if you didn't use monads for I/O. I don't care what they do. I just care about mutable state in the external environment. You say it doesn't matter. If you chose to accept that view, then so be it. It's called imperative programming. Just because you turn your head and ignore it doesn't make that mutable state go away. It's still there no matter what.

Nate:

"we can split our function/reduction pair across a communication link and we get one-way messaging while still within a lambda paradigm. As far as I can tell." - Nate

Not unless you use imperative programming along the way. I don't see any other way to leave data on a machine without causing a side-effect unless you accept WJ's notion that the external environment doesn't matter. But that implies that this external environment cannot be functional. This effectively ends the dicussion.

Note that you can uncouple certain functions to be one-way, but because it remains within the functional environment, it doesn't amount to much as it only enables delegation of a containing function meaning that there will eventually be another one-way communication in the other direction eventually, thus cancelling everything out.

"A large amount of the reason why I hang out here on this blog is that so few people are talking about dataflow and massive (instruction-level) parallelism at all, and it's such an obvious and appealing idea to me. Ever since I first met Occam around my high school years I thought 'this is the way of the future' and wondered why it's been taking so long."

After trying, rather unsuccessfully, to explain these concepts, I've narrowed it to several reasons why it's taking so long. I'm not impressed by these reasons... meaning that I wish it weren't so.

1. Programmers believe too many incorrect or improperly defined notions.
2. The effects of execution are not well understood.
3. Too much assumption that anything new will fail (no silver bullet).

Functions are an example of #1. On the surface, a function looks like it takes an input and produces an output. But the way it's used has extra requirements that aren't part of the official definition. So when a different way of processing comes out, people have a difficult time understanding why it's different because they assume that input and outputs are all that's there.

The execution point is something that no one really studies. There should be a course on it in University or College, but there is not. Some people still believe that there is no execution in functional programming. It just happens to be coupled with data. Because they are never separate, you never see execution alone. But it is there as shown by tail call elimination.

#3 should be obvious. People dismiss things right away because they think that the greats of computer science could not have missed anything. This is not true. In fact, they understood very little about the implications of the execution point as seen by the very long time it took for control structures to show up.


Weave Jester:

"In terms of one-way versus two-way, I'm not clear why everyone's making a big deal out of it."

Because one of them (one-way) makes distributed computing possible and the other (two-way) does not. It's the key to everything. I've been trying to show you why, but apparently I've failed miserably.

"The architecture of current computing devices isn't suited for mass parallelism at the instruction layer."

That's not the point though. It's about new hardware that is coming out and will become the norm. In 6 years, 32 cores will be the minimum you can purchase. A few years after that and you're into so many cores that there's no way you can manually split up your software anymore. What I'm working on can handle this. If I thought functional could handle it, I wouldn't bother. Realise that as we got more nodes, the less functionality will be available on them. Eventually, they will only support one operation. At this point, you're dealing with instruction level parallelism and my software in Project V will continue to work just fine. I don't have the same optimism with other types of software development.

Unregistered user Monday, April 23, 2007 4:29:45 PM

Weave Jester writes: In reply to Nate: "That seems to be the core of the historical argument against instruction-level parallelism to me, and while I don't disagree, it seems to be assuming that the main reason we'd want it is raw performance." Oh, don't get the wrong idea. My point wasn't so much that mass-distributed programming is not useful, merely that there are both advantages and disadvantages to the approach. Personally, this is why I prefer a declarative approach. Ideally, one should be able write a section of code, and have the VM work out an optimal way of distributing it, perhaps with some manner of run-time profiler. "Which gives me a sort of 'finally! someone gets it!' reaction, as opposed to the constant grinding-of-teeth when I look at the Byzantine complexity of current GUI libraries." Thanks for the link to that. I must admit GUI libraries could be better, and constructing a formal basis for them seems like a very big step in the right direction. In reply to Vorlath: "You cannot say the external environment is irrelevant because it makes your system inconsistant. Functional is useless if you chose to stick by this notion. If you continue to say this, then you've proven my point that functional has side-effects. Arbitrary boundaries." I don't see why you keep insisting its an arbitrary boundary. For any formal system, the boundary is defined by the rules the system adheres to. In other words, if a system defines a set of rules that prevents an entity X from being inside the system, then by definition it must be outside the system. Thus, the boundary of a formal system is its rule base. Secondly, I'm not saying that an external environment makes the system inconsistent. A system is inconsistent if one rule contradicts another. Lambda calculus is a consistent system. "Of course they do. The last line goes back to main afterwards. BTW, delegation can be nested as you've shown. Like I said, this is all pointless. We all agree on delegation." Okay, so we agree that delegation can be used to create any distributed bidirectional network. But that covers just about everything, no? The next bit addresses Nate, but since it references me: "Not unless you use imperative programming along the way. I don't see any other way to leave data on a machine without causing a side-effect unless you accept WJ's notion that the external environment doesn't matter. But that implies that this external environment cannot be functional." Imperative programming is a method of describing computation as a series of statements that change a program's state. The thing is, this is just a theoretical model; it doesn't correspond to any physical phenomenon. In order to get to a point where we can use imperative programming, we must first create some device that can interpret imperative commands. The rules that govern the behaviour of electrons are far from being anything like imperative. There's no equivalent to a statement, no fixed global state; in short, the external environment is in no way imperative either. So yes, once you work your way up to the hardware layer, the external environment is not functional, but nor is it imperative. Imperative and functional programming are just abstract models we use to give instructions to computers that produce some manner of electronic reaction. "That's not the point though. It's about new hardware that is coming out and will become the norm. In 6 years, 32 cores will be the minimum you can purchase." I'd be surprised if 32 cores was the minimum in just 6 years. That would imply a much larger average, and most current software does not lend itself to being parallelised easily. I can't see hardware forging on ahead that far; to some degree, hardware advancement is limited by what software is available. For instance, look how slowly 64 bit architectures are taking hold, or look at how long the x86 processor architecture has been around. "Realise that as we got more nodes, the less functionality will be available on them. Eventually, they will only support one operation." What makes you so certain this will be the case? Trends are not necessarily asymptotic, and it could be that an architecture with small multi-operation cores will be more efficient than an architecture with single-operation cores. "At this point, you're dealing with instruction level parallelism and my software in Project V will continue to work just fine. I don't have the same optimism with other types of software development." That's fair enough. I'm not sure it's necessarily the only model that will work, but it's probably a safe bet if you're aiming for mass parallelism on the scale you describe.

Unregistered user Tuesday, April 24, 2007 10:47:09 AM

Nate writes: (Vorlath) "Not unless you use imperative programming along the way. I don't see any other way to leave data on a machine without causing a side-effect unless you accept WJ's notion that the external environment doesn't matter." Hmm. The system I'm thinking of has no 'forcibly send to remote system overwriting its current value' primitive (because that would have functional side-effects) but it does have a 'read value from remote system' (which I think is parallelism-safe - that way, every value has a unique address, and can be read from multiple components but only 'written' or created by one - meaning it can be copied or cached with safety. A property very similar if not identical to that of pure functions. Even mutable values I think would work as long as all 'copy-of' links to them are active and receive the new value whenever it changes.) With that plus a 'match' mechanism and a buffering construct I think I can construct a messaging system as powerful as general purpose internetworking - and the network I end up with then I think is very very similar if not isomorphic to Kahn Process Networks (something I only discovered yesterday on Wikipedia, hooray). I would be interested to know more about KPNs and whether they are in fact isomorphic to pure functions, and if there are any current programming languages implementing them. Also how they compare to Petri nets, Communicating Serial Processes, Pi-Calculus, and Actors (which all seem very superficially similar parallel models but seem to have subtly different properties which make them awkward to compare directly). My brain is kind of orbiting around this model, though what I'm really thinking of is more like Carl Hewitt's 'Scientific Community Metaphor' / 'Ether' idea, which I don't know if even he's been able to realise yet. What I want is a sort of declarative language based on a web of logical statements - with the VERY important RDF-like property of being able to bundle up sets of statements as first-class entities and attribute them as utterances or hypothesis of other entities, so as to avoid the trap of a poor confused databot believing everything it reads on the Net equally - but that runs on a very simple runtime engine so I can implement it for building adventure games. Yes, adventure games. I really did stumble into a pit of deep CS theory purely looking for a way to write games easier. But in my defense, I argue that adventure games are in fact living fossils of the heady early days of Artificial Intelligence research, and that trying to understand them really *does* require acquiring a working knowlege of SHRDLU, Planner, MacLisp, and pretty much everything else that came from the MIT AI Lab in the 1970s. At first glance, you'd think any off-the-shelf object oriented language like Java, Python or Ruby would work well for writing them. But you'd be wrong. Adventure games need a very odd combination of object-like simulation, declarative logic, natural language processing, and domain-specific-language metaprogramming. It's a mixture not often found in mainstream applications and it challenges most languages. They trivially resemble OO systems, but they have lots of singleton objects that need to be defined declaratively in a source file. The definitions of these objects typically involves lots of redundant and annoying retyping which really needs a macro-type system to make at all programmer-friendly. The objects at first glance look like they decompose into class hierarchies, but since they represent objects in a fantasy story world that don't have to obey common senses (and are more fun when they don't), in fact they are extremely apt to do weird things like change their class at runtime - living examples of the 'circle and ellipse problem'. And since they represent objects in a story that can be saved, restored and undo-ed at will, you can't just use system objects for them - you need some kind of multi-level transactional ability built into the fabric of the runtime environment. And then as a final quirk, the social structure of the adventure game programming community means that games are often developed by multiple authors - because writing the huge sets of 'common sense' rules is hard, but then any story world which *only* lives by the 'common sense' rules is boring. So, all the base-level rules describing a world need to be reified in the language and environment as objects themselves - and they need to be able to be manipulated either at compile or early runtime. You need the ability for one software library to refer to another and say 'This library requires libraries X and Y, but overrides rules P, Q and R'. Hardly *any* current languages even think this is a good thing, let alone allow you to express it. Oh, and of course you want interesting 'characters' in a game too - so you really, really DO need a lot of advanced AI abilities. You need the ability for a character to make plans, look at the state of the world, understand and reason about the *rules* which make up the world (and, most especially, form *faulty* hypotheses based on incomplete and inferred knowledge about the state of the world - because otherwise they'd just know everything the system knew, and that would be cheating, and you'd have both no game and no 'flavour'). And then having produced a game file, you need to be able to store and distribute it in a standardised manner, as easy as playing a Flash or HTML file - and that pretty much means you need a virtual machine, and one that can be implemented dead easily on portable devices with a small memory footprint, but also scaled up to desktop systems and beyond. And it has to be fully sandboxed so you can't write any viruses in it, because it will be used by non-computer-literate users - so you can't just produce a system binary or use the runtime format of any existing general-purpose language unless it has some kind of very strict sandboxing feature built in. (And it needs a fully portable UI model, but we'll leave that one aside because it's hard). Declarative logic-based systems seem to show the most promise, but there's sad dearth of general-purpose logic languages with domain-specific metaprogramming abilities at the moment. Hence why I go questing for windmills. Or why I started. But once I found out that I'd discovered a sort of bizarre mental dead-zone at the heart of current programming paradigms, I got intrigued as to just *why* the current paradigms fail for adventure games (which theoretically should be the kind of application where OO shines, since OO was invented for simulations) - and why for the most part, they don't even realise that they're failing - and what other applications, such as business modelling, they're failing for.

Unregistered user Tuesday, April 24, 2007 11:06:47 AM

Nate writes: In other words, I'm getting more and more resigned to the fact that probably what I want is Common Lisp (no surprise given that Zork was written in MDL, a Lisp variant, and SHRDLU and Planner were in MacLisp, Common Lisp's ancestor). Metaprogramming and macros, check. Flexible OO system, check. (Are there even any other languages that *try* to provide both OO and macros?) Domain specific languages, check. Natural language programming and logic programming as bolt-ons on the top, check. Except finding a Common Lisp environment that a) runs on Windows Mobile or PalmOS and b) has a standardised binary format with security sandboxing and c) has up-to-date GUI libraries for OSX, Linux and Windows (or has even *heard* of the idea of interfacing with platform GUI libraries).... is problematic, to say the least.

Unregistered user Tuesday, April 24, 2007 4:34:26 PM

Weave Jester writes: Funnily enough, Nate, I'm working on a small text adventure game in Haskell, purely for learning purposes. I wanted to see how well Haskell could create a program that in other languages would require a very OO approach. The game is extremely simple, so it doesn't run into any of the problems you describe, but so far Haskell is holding up very well, despite having no concept of an 'object'. I wonder how Haskell would handle the problems you describe. Grammar parsing would be right up Haskell's street, but as for everything else, I'm uncertain how well Haskell would cope. It would be an interesting experiment to try out some ideas and see just how flexible (or inflexible) Haskell is in this area. Haskell 98 has no OO system to speak of, and doesn't have macros or dynamic types, so at first glance it seems a poor fit. But perhaps it's more capable than a quick overview would suggest. I'll try adding in some more complex behaviour to it, and see how I get on :) Regarding your point about Lisp and compatibility, have you checked out any of the Lisp/Scheme variants written for the JVM or .NET CLI? http://sisc-scheme.org/ - Scheme interpreter on Java http://www.lsharp.org/ - Lisp-like language on .NET http://www.gnu.org/software/kawa/ - Scheme compiler and general language framework for Java

Vorlath Wednesday, April 25, 2007 4:51:28 AM

Weave Jester:

"Okay, so we agree that delegation can be used to create any distributed bidirectional network.

But that covers just about everything, no?"

No. I've been saying all along that functional can do delegation. But it's not the full class of distributed problems. This is what I've been talking about this whole time. It's too bad you only got this now after all this time. My apologies. I never know which one of the concepts I find second nature are more obscure for others.

"Imperative programming is a method of describing computation as a series of statements that change a program's state. The thing is, this is just a theoretical model; it doesn't correspond to any physical phenomenon."

What? Are you serious? Imperative came about because hardware costs were high, so they only put one of each component in the computer. You access the ones you want with opcodes. By sequencing the correct activation of components, you can recreate any hardware layout. That sequencing is what we know as imperative programming. It also follows well from how humans do thing with lists (like shopping lists and TODO lists). "It doesn't correspond to any physical phenomenon"???? Wow! Really? Could you elaborate? I'm really interested in hearing all about this.

"So yes, once you work your way up to the hardware layer, the external environment is not functional, but nor is it imperative."

Huh? I thought you would say that you need a machine that works sequentially in order for imperative to work (as I thought you were hinting before). But to say this? Here's the reality. Imperative comes from the hardware layer. That's where it was born. Even if it was thought up before, the machine would have made this a requirement anyways because hardware components cost too much at the time.

"I'd be surprised if 32 cores was the minimum in just 6 years. That would imply a much larger average, and most current software does not lend itself to being parallelised easily. I can't see hardware forging on ahead that far;"

That's why I'm the futurist. Moore's Law has held so far and if it is to continue holding, there will be 32 cores (low end or minimum) in 6 years. We're already at 2 or 4 right now. Three more doublings and we're there. They happen at 18 month intervals, so that makes 4.5 years. Another year and a half after that for another doubling and I'll be surprised to see anything below 16 cores available in new computers. I still stick by my 32 core prediction though. We'll be at 64 for sure at that time.

"...to some degree, hardware advancement is limited by what software is available. For instance, look how slowly 64 bit architectures are taking hold, or look at how long the x86 processor architecture has been around."

No, this isn't how it works other than in gaming. Games require better hardware. But for the common PC, hardware manufacturers never wait for software. They can't. The 386 came out in 1986. 32 bit software didn't become common until much later, yet the 386 did take hold. But we still had backwards compatibility. This time around, we won't have that luxury for ALL the processing power. This is why many are claiming that there'll be a software crisis. The current hardware per processing node just isn't getting faster as much as it used to.

"What makes you so certain this will be the case? Trends are not necessarily asymptotic, and it could be that an architecture with small multi-operation cores will be more efficient than an architecture with single-operation cores."

I'm so sure because of a little factor called MONEY. Simpler is cheaper. If a node only has one instruction, then it's super cheap. Single operations will always be cheaper than multi-operation cores because there's no execution unit. Plus, it can be used in nanotechnology that can combine and create computing devices at any given time and location. This is a hot ticket. Especially in medecine. I'm sure other uses will become known once people realise that this technology is possible.


Nate:

I'm a huge fan of adventure games. One thing I've found interesting is how you can combine items to produce a new one. Or how one can be applied to another in order to enhance it or modify it in some way. There's a lot of transmutting. Also, a lot of the environment changes too. Describing these changes, I've found to be oddly similar to compiler construction as far as types are concerned. Yet, types rarely change in static languages. Or if they do, there's a conversion process and always the same mechanisms.

Anyways, what I'm saying as that classification of both real objects (not the OO kind), and of actions or combinations thereof are difficult to represent. In Project V, I've talked to you about the type system before. It will have a classification system and a way to change or even include an item in multiple classifications at once. Anything that requires a certain classification can be used by any object that has that classification. This operation likewise has certain properties that it takes this classification as an input. The operation itself can likewise be in a classification of its own. So you can mix and match a lot of different operations together. As well, each object can have local properties for each classification it is in, with possibly appropriate defaults according to the object in question.

Anyways, I think you can see the advantages just in those features listed here. Can an object be picked up? Check the classification (I gotta come up with a shorter word). Is the object actually in your inventory? Inventory is a classification too. Backpack would be an object that contains the Inventory classification within it. That sort of thing. Is that useful to you? I have the need for easier manipulation of these sort of things for components. So that's why these features are there. Oh, you can set up things like mutually exclusive classifications. I'm just making this up, but it shows what you can do. If you store an item in another mutually exclusive classification, you can set it up to automatically remove it from the other.

These are some of the features I will have for my version of templates. Actually classifications are templates. Haha, there's a shorter word for them.

These features have very little to do with parralel computing. There are a LOT of dependencies here and is mostly used for manipulating the environment (which could be your adventure game's virtual environment) rather than the logic of the software (ie. what your game is supposed to do). I just find the ability to manipulate templates like a regular data item to be quite powerful.

What I really want is that after you get the prototype for your adventure game going, as you're walking around, you can edit the environment using the visual editor that comes with Project V.

"And since they represent objects in a story that can be saved, restored and undo-ed at will, you can't just use system objects for them - you need some kind of multi-level transactional ability built into the fabric of the runtime environment."

I have checkpoint components that are applied on another layer to your software (like transparencies). The checkpoints save everything incoming until it reaches the outgoing checkpoint. You can have many and control them any which way you desire. This is used across networks because you can never guarantee that something is transmitted, so although the checkpoint is on another computer, Project V takes care of the details for you.

Templates (classifications) can be of use here too. Your checkpoints can respond only to certain templates or in special ways for each one. This is on another layer, so you have the freedom to do what you want without messing up the main logic of your software. Templates can also have certain events attached to them like autosave and anything else you can think of.

"So, all the base-level rules describing a world need to be reified in the language and environment as objects themselves - and they need to be able to be manipulated either at compile or early runtime."

You can subclass (in a manner of speaking) templates or anything else in Project V. This means you can override the base class. In effect, you can use this to override the base rules. Since this subclass is also a template, you can change the 'type' of the rules at any time to use your overriden rules. You can also trigger it as to when and where it should revert. Runtime and compile time... it's all the same to me.

"You need the ability for one software library to refer to another and say 'This library requires libraries X and Y, but overrides rules P, Q and R'. Hardly *any* current languages even think this is a good thing, let alone allow you to express it."

In Project V, requiring libraries X and Y is simply a regular type definition. Overriding rules is just subclassing, but not regular subclassing. It's more like another layer (or type) that is applied temporarilly on top and takes over certain parts for that time. I need this to be able to ship components (requires X and Y) and I need it for versioning (overriding) as I need the original version to keep working as is for older code. So it seems you can use this for what you want as well.

I haven't looked into it, but I'm amazed that this would not be thought as a good thing. I need it. So that ends any argument from me or by me. I must implement it if what I'm doing is going to work. Doesn't matter what anyone could possibly say against it.

"You need the ability for a character to make plans, look at the state of the world, understand and reason about the *rules* which make up the world (and, most especially, form *faulty* hypotheses based on incomplete and inferred knowledge..."

I have a system in place to ask questions about categories and properties. Sometimes, it's impossible to know for sure. For example, over a distributed network, you never know if you have the most up to date component. A new one can come up at any time. So I have to set up rules that within a certain amount of time based on previous release dates, what is the likelihood of there being a new version out and if the IDE should go out and check. You don't wanna be checking all the time because that wastes bandwidth for no good reason. This requires manual setup, but the system can report "I don't know" or you can make it report "76.5% percentile that there is a new version out". You can likewise link different things together to monitor the correlation. If package X comes out, there is a 95% probability that package Y is also out. Stuff like that. So you know why I need this part. Perhaps this will be useful to you too. For example, checking a new version would be the incorrect thing to do. A character in a game could likewise end up with incorrect assumptions, but perhaps be correct a lot of the time. It can also evolve over time and notice correlations on its own if you enable this. Takes more processing power and resources though.

"And then having produced a game file, you need to be able to store and distribute it in a standardised manner, as easy as playing a Flash or HTML file"

I've talked about this before. Not sure how easy it will be for the initial setup. For Project V, you'll need to get at least the minimum required code. Maybe a browser plugin. After that, it's very simple. You can also allow only certain components so that nothing devious can be done. I'm writing all this to be fully portable and I'm working on the GUI now. The GUI will eventually work with SDL on Linux. I'm hoping that later on, 3D interfaces will also be available. Native GUI's will likewise be available.

"and why for the most part, they don't even realise that they're failing"

I've mentioned my guesses before. But for me, I'm writing Project V because there are things I simply cannot do in other languages. Not whith the level of ease I'm talking about. I'm really focusing on having editors for components. So you can visually pick and chose settings or have components set themselves up with the least amount of effort on your part. In game, or in development, editing is part of this. Being able to connect different tools into the IDE is something I really want. Your game has 3D models? The editor is your favourite 3D app... but using it in-development. Want to link in some external data? Just connect it to the IDE and link it where it's supposed to go with the ability to modify the input with components. You can have different panels for different tasks such as editing, 3D object design, outputs from certain components for testing, chat, etc.

Everything can be done with distributed computing, but where you don't deal with that side of it directly unless you want to.

"In other words, I'm getting more and more resigned to the fact that probably what I want is Common Lisp"

Is that air I hear seeping out?

Luckily, if you ever change your mind, Project V can use anything that's out there. Even Lisp.

But if you need something now, Project V isn't going to be released at least for another 3 months as I'm trying to gather some funds for it. My attention is needed elsewhere for the next month at least as I have another project I must complete. Hopefully, we can get the final bit of funding for that one too. Anyone want to double their money? Let me know. No joke either. We start construction as soon as the work permit comes back and is approved. Any little bit helps. Contact me for details.

Ok, I've plugged Project V and my construction project. I think that's a good day.

Unregistered user Wednesday, April 25, 2007 1:57:23 PM

Weave Jester writes: "No. I've been saying all along that functional can do delegation. But it's not the full class of distributed problems. This is what I've been talking about this whole time. It's too bad you only got this now after all this time. My apologies. I never know which one of the concepts I find second nature are more obscure for others." Then why not provide an example of a network of information flow that cannot be represented by a bidirectional "pull" graph? "It also follows well from how humans do thing with lists (like shopping lists and TODO lists). "It doesn't correspond to any physical phenomenon"???? Wow! Really? Could you elaborate? I'm really interested in hearing all about this." Certainly I can elaborate. The functionality of most modern hardware is based upon the physics of electromagnetism and its flow through conductive and semi-conductive mediums. This does not naturally adhere to the model of imperative programming. In order to turn this into a system that can interpret imperative commands, a lot of work needs to be done. We first need to turn an analogue waveform into something that can represent discrete data; then we need to design components that can produce waveforms that correspond to logical compositions; once we've done this we can setup feedback loops that can represent state; then we can combine gates together to produce simple mathematical operations; once we have this we can construct an addressing system; then we need some way of ordering a sequence of discrete pieces information; then some form of a addressing table; an instruction stack... and so forth. So a hell of a lot of work goes into building up a system that can handle even the simplest imperative programs. Electromagnetism itself no more follows imperative rules than liquids, gasses, gravity, or any other physical effect. All programming takes place in a simulated environment that corresponds to some abstract model; outside of this, a phrase like "printf" has no meaning. Or, to put it another way, at the lowest layer, computers are analogue and continuous, but at the software layer, they are digital and discrete. An example of an external system that clearly follows a different set of rules to an internal one. "Moore's Law has held so far and if it is to continue holding, there will be 32 cores (low end or minimum) in 6 years. We're already at 2 or 4 right now. Three more doublings and we're there. They happen at 18 month intervals, so that makes 4.5 years." Moore's law merely says that the number of transistors we can fit on a piece of silicon doubles every 18 months. Doubling the number of transistors does not necessarily imply a doubling of cores. Now, I could see consoles, or servers being sold with 32 or more cores, and I could see high-end PCs being available with 32 cores, but I'm not sure that would be a minimum. I'd personally predict the minimum would be one, possibly two cores, based on the principle that processor lines tend to last a few years, and you can still buy machines as new today, that were based on chips that came out six years ago. "I'm so sure because of a little factor called MONEY. Simpler is cheaper. If a node only has one instruction, then it's super cheap. Single operations will always be cheaper than multi-operation cores because there's no execution unit." What if there is extra overhead associated with communication between nodes? "Luckily, if you ever change your mind, Project V can use anything that's out there. Even Lisp." Regardless of our differences in opinion, I'd like to see how it turns out when it's finished.

Unregistered user Thursday, April 26, 2007 2:21:51 AM

Nate writes: (Weave Jester) "Funnily enough, Nate, I'm working on a small text adventure game in Haskell, purely for learning purposes. I wanted to see how well Haskell could create a program that in other languages would require a very OO approach. The game is extremely simple, so it doesn't run into any of the problems you describe, but so far Haskell is holding up very well, despite having no concept of an 'object'." Having no defined OO framework I think is actually a bonus in this context, since most OO frameworks start from assumptions that don't hold for adventures. (They need to be prototype rather than class-based, for a start, and with a minimum of syntax. Lua is the best I've seen so far.) I'm interested in seeing what you come up with. Maybe I should try learning Haskell again - the 'Gentle Introduction' is anything but. Haven't seen SISC, it looks like it might be fun. I've played around a bit with LispMe on Palm, but it is somewhat indiosyncratic (and introduced me to the wonderful world of Scheme incompatibility). (Vorlath) "In Project V, I've talked to you about the type system before. It will have a classification system and a way to change or even include an item in multiple classifications at once. Anything that requires a certain classification can be used by any object that has that classification." Sounds similar to multiple inheritance, which is at least a better start than single inheritance, though what I really want is full predicate calculus. Which is to say: I don't want a language with a restricted non-Turing-complete sublanguage for making limited 'type' assertions - I want to use the full power of a single declarative language to parse and make statements about other arbitrary pieces of code written in that language, with no Chinese walls in between. 'Types' are only a tiny subset of the kinds of assertions and manipulations my system needs to be able to make - for instance, I need to be able to write a compiler for a natural language which will compile down to a set of logic-language assertions, a linker/pruner which will take sets of those assertions and remove contradictions, a runtime inference engine, and then any number of run-time algorithms for NPC agents which can examine, reason about the structure of the world, and generate their own marked-up views of reality. Most of these kinds of transformations are not amenable to simple characterisation as 'typing' but would be representable as sets of assertions. IE, I want to create a system of the power of Inform 7 (www.inform-fiction.org) but without hard-coding so much language design into the compiler and IDE. I want to expose an equivalent to the entire I7 compiler as a library, and I want the sort of interesting things an I7 source file can express available at runtime to NPC agents. ("John believes that the location of the red ball is Mary's backpack", for instance. Or "John is a dinosaur standing on the white table in the Volcano Room. Seeing is a relationship that follows the following rules (defined in modules A, B and C).... What is the list of items that John can currently see?")

Vorlath Saturday, April 28, 2007 1:11:58 PM

Weave Jester:

"Then why not provide an example of a network of information flow that cannot be represented by a bidirectional "pull" graph?"

Email. P2P. Chat.

"Moore's law merely says that the number of transistors we can fit on a piece of silicon doubles every 18 months. Doubling the number of transistors does not necessarily imply a doubling of cores."

Maybe not. But do you think that doubling cores is easier, or harder, than doubling the number of transistors on the same piece of silicon?

"What if there is extra overhead associated with communication between nodes?"

Communication will have to be dealt with anyways no matter what we use. If you need a specific task to complete right away, then sure, you can have custom hardware just for that. But there will come a time when the communication overhead will be so minor that it just won't matter anymore. The extreme parallel nature of this will compensate for any overhead.

You've perhaps heard that doubling the number of cores cannot double the speed of your software. This is not true. It can actually get MORE than twice as fast because of something called the cache and/or registers. If you look at latencies for level 2 cache and RAM, it can get quite slow. We've already seen in the past how doubling the number of registers (or doubling the size of each register) can achieve more than twice the speed. Project V will enable this exponential speedup of multiple cores whenever possible.

"Regardless of our differences in opinion, I'd like to see how it turns out when it's finished."

Frankly, I know we both see the same things. I just don't think your way of defining them are realistic. But hey, you probably think the same thing about me.

About Project V, I wanna see how it turns out too. haha. I'm currently working on my construction project to get some money so that I can pay expenses to continue work on Project V. This will allow me to set up my business for Project V and have a source of income whenever I need it through either business. Regardless of what happens, this summer is gonna rock. I'm positive Project V will see the light of day soon enough.

Vorlath Saturday, April 28, 2007 1:58:39 PM

Nate:

"Sounds similar to multiple inheritance"

Maybe. Inherintance only allows a direct overriding of another entity's properties. Categories (or classifications) are groupings where you can build any kind of software network to determine what entities are within it. You can request info from a category or you can ask an entity what properties it holds in relation to any categories. Although both can be manipulated at runtime, inheritance is non-destructive (overlaps new properties that can be reverted) whereas categories are changed for good. You still have 'undo', but you must request it. It's not automatic as it is with inheritance because inheritance can revert to a base type automatically if using external networks that only work with that.

Oddly enough, categories can inherit from other categories or be in another category itself.

"Which is to say: I don't want a language with a restricted non-Turing-complete sublanguage for making limited 'type' assertions"

Well, the way it works is that there are predefined components that specify what classification each type or value is in. So you can register any component you wish to make this assertion. You can also register this in any way you wish by building a software network to handle it. Not only is it Turing complete, but it's also fully distributed.

Things like Inform 7 can be built within Project V as a panel. Panels can be run as independant applications if you wish, but having the tools of the IDE can be beneficial as you can customise what features you want. Panels are used to provide different interfaces for the same software network. BTW, I don't find Inform 7 too impressive. Maybe I just don't get it.

I think perhaps you don't understand how Project V is meant to work. Project V's IDE is integrated into your application. In current IDE's, you build an app and your IDE remains separate. OTOH, Project V IS your application. You just add what you want and ship the parts you need for your application. The way you add functionality is by expanding the IDE because one panel is your default output screen. So if you want a compiler and there's one available that you like, then you can use that component. You can use that component as stand-alone if you wish. In that case, none of the IDE features will be used except for the output panel. Every part of Project V is replacable too. So you can pick and chose what you like. Every application is a customization of Project V itself (leaving the original Project V intact for the IDE of course, but that runs on another full screen panel). Separate panels can be different user's screens. Tons of stuff you can do... and because there's no difference between Project V and your application, you can develop, test and play in a distributed fashion too. Remember, ALL 100% of Project V will eventually be components. There will be nothing that is hidden or not under your total control. Eventually, there will be people using Project V completely with components that I don't know about and looks completely different for uses I cannot imagine. This is because Project V IS all apps, just customized. It's like the chicken and the egg. I provide the entire chicken so that you can make your own creation and throw out what you don't need.

I'm baffled that today's IDE's come with graphics and neat tools, but you can't use them all. Why is that? In Project V, all of its power is available to you.

Unregistered user Saturday, April 28, 2007 6:29:03 PM

Weave Jester writes: "Email. P2P. Chat." Chat seems the most interesting, so what would be the functional equivalent of that? aliceMain = bobStream >>= return . lines >>= mapM_ print bobMain = aliceStream >>= return . lines >>= mapM_ print Anything typed by Bob will be sent to the byte stream of "bobStream", which is split into lines and printed to Alice's screen. Likewise, anything typed by Alice will be printed on Bob's screen. The network traffic for such an arrangement might look like: Alice: Requesting next message. Bob : Message "Hello Alice". Requesting next message. Alice: Requesting next message. Bob : Message "How are you?". Alice: Message "I'm fine". Requesting next message. Bob : Requesting next message. Alice: Message "Got to go, bye". Bob : Message "Okay". Requesting next message. Alice: End of messages. Requesting next message. Bob : End of messages. Note that each client must explicitly request the next message from the other. This mirrors the evaluation sequence one normally sees in lists. "Maybe not. But do you think that doubling cores is easier, or harder, than doubling the number of transistors on the same piece of silicon?" I'd say it might be harder, otherwise we'd have seen more multiple core machines before now. However, I'm not a chip designer :) "Frankly, I know we both see the same things. I just don't think your way of defining them are realistic. But hey, you probably think the same thing about me." Yeah, but even if we never agree, debating a particular point is an interesting and informative mental exercise, as one gets pushed toward avenues of thought that might not have been reached alone. And for me at least, I've had to think about a lot of things that I had not considered before :)

Unregistered user Saturday, April 28, 2007 6:29:04 PM

Weave Jester writes: "Email. P2P. Chat." Chat seems the most interesting, so what would be the functional equivalent of that? aliceMain = bobStream >>= return . lines >>= mapM_ print bobMain = aliceStream >>= return . lines >>= mapM_ print Anything typed by Bob will be sent to the byte stream of "bobStream", which is split into lines and printed to Alice's screen. Likewise, anything typed by Alice will be printed on Bob's screen. The network traffic for such an arrangement might look like: Alice: Requesting next message. Bob : Message "Hello Alice". Requesting next message. Alice: Requesting next message. Bob : Message "How are you?". Alice: Message "I'm fine". Requesting next message. Bob : Requesting next message. Alice: Message "Got to go, bye". Bob : Message "Okay". Requesting next message. Alice: End of messages. Requesting next message. Bob : End of messages. Note that each client must explicitly request the next message from the other. This mirrors the evaluation sequence one normally sees in lists. "Maybe not. But do you think that doubling cores is easier, or harder, than doubling the number of transistors on the same piece of silicon?" I'd say it might be harder, otherwise we'd have seen more multiple core machines before now. However, I'm not a chip designer :) "Frankly, I know we both see the same things. I just don't think your way of defining them are realistic. But hey, you probably think the same thing about me." Yeah, but even if we never agree, debating a particular point is an interesting and informative mental exercise, as one gets pushed toward avenues of thought that might not have been reached alone. And for me at least, I've had to think about a lot of things that I had not considered before :)

Unregistered user Saturday, April 28, 2007 6:30:36 PM

Weave Jester writes: D'oh! Double clicked the 'submit' button by accident - Sorry!

Unregistered user Monday, April 30, 2007 4:24:00 AM

Nate writes: (Vorlath) "Categories (or classifications) are groupings where you can build any kind of software network to determine what entities are within it. You can request info from a category or you can ask an entity what properties it holds in relation to any categories." Intriguing. So something like a predicate class? "BTW, I don't find Inform 7 too impressive. Maybe I just don't get it." You don't find parsing a natural-language logic/rule-based source file, and compilation down to machine code for a 1970s-era VM that has a maximum of 64KB RAM, impressive? Seems like quite a feat of programming to me. Natural language has been considered either impossible or a dead end for a while now; that's what I love/hate about I7. A sort of over-engineered steampunk grandeur. If you're just looking at the GUI, though, you're probably missing a lot. "Project V's IDE is integrated into your application. In current IDE's, you build an app and your IDE remains separate. OTOH, Project V IS your application. You just add what you want and ship the parts you need for your application." Ah, the Smalltalk approach. I hope you provide a way to strip out the IDE and GUI components for production; I don't want to have to ship an entire GUI framework for a webserver. (Weave Jester) ""Maybe not. But do you think that doubling cores is easier, or harder, than doubling the number of transistors on the same piece of silicon?" I'd say it might be harder, otherwise we'd have seen more multiple core machines before now." I don't see that that follows. There's supply and there's demand. Seems to me it might well be easier for chip makers to ship multiple cores rather than put huge effort into single-thread acceleration; but they have to ship what the market wants, and even now the market doesn't really want cores, it wants speed and not having to modify existing code to support multithreading, which is Insanely Hard. It puts up with cores as a consolation prize because that's all the chip makers have left to give them; like low-grade oil from declining wells, it's better than nothing. Viz the grumbles from PS3 coders about how evil the Cell is to work with. All those cores! Not a proper computer at all! (Maybe there's other technical reasons, but that's my impression.)

Vorlath Thursday, May 3, 2007 4:49:26 PM

Weave Jester:

"printed to Alice's screen"

side-effect. Not functional.

Nate:
"So something like a predicate class?"

I was not aware of the term predicate or its common usage. I do know that templates in C++ can do this and was looking at it earlier last week. I did not see the name predicate though. Are there more examples of this?

To answer your question, the answer is yes from what I saw. In Project V, a type is like any other piece of data. You can apply any transformation you wish to it. Keep in mind that a type definition is able to reconstruct its structure (if not its values). So the type of a type is NOT a generic super class (like Class in Java). Each type actually has a meaning.

"If you're just looking at the GUI, though, you're probably missing a lot."

That's what I figured too. To me, it just looked like a glorified rules based engine. These are tough to get right, but that's all it looked like to me. I'm not denigrating the work they've done. I can't imagine the work they had to do.

"Ah, the Smalltalk approach. I hope you provide a way to strip out the IDE and GUI components for production; I don't want to have to ship an entire GUI framework for a webserver."

It's not really the SmallTalk approach, though there are definite similarities. 100% of Project V is replacable or removable (not so with SmallTalk). Any part you do not use is removed from your application. This is for standalone apps. For me, I have a much bigger vision that all software is part of one global super connected software. So software running on a computer is just a small part of that global image. And Project V is the catalyst that will enable this. There's no need to use Project V at all if you can communicate with this global system. And injecting custom communication systems is very much possible. So the Project V IDE is more like a system monitering device that allows you to make changes to this global interconnected software. Project V will take parts of itself and inject itself in order to produce these changes, often leaving parts of itself behind to be used by the global software. Any code, or programming technique can likewise be used in this system. There is nothing that cannot be taken advantage of. In fact, no part of Project V need be used at all. I just need a starting point. Anyways, that's just what I see in the future. The web and all that crap is really minor compared to what I envision.

If this were to come out and shown to work on any kind of distributed networks, I think there are some in the computing industry that would be none too happy as there's been a concerted effort in the past 20-30 years to lock people into proprietary systems. Even the OSS community still has no standard intercommunication protocol for software.

Unregistered user Sunday, May 6, 2007 1:30:18 AM

Weave Jester writes: "side-effect. Not functional." Not a side-effect. The function doesn't affect anything on it's own; it just returns a value. What happens to this value after it is returned is none of the functional program's business.

Vorlath Sunday, May 6, 2007 3:44:30 PM

"What happens to this value after it is returned is none of the functional program's business."

I've said a million times that you can't use that argument. I've shown why you can't use it time and again.

Write a comment

New comments have been disabled for this post.

June 2012
S M T W T F S
May 2012July 2012
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30