
http://en.wikipedia.org/wiki/First-class_object The term was coined by Christopher Strachey in the context of “functions as first-class citizens” in the mid-1960's.[1] Depending on the language, this can imply: 1. being expressible as an anonymous literal value 2. being storable in variables 3. being storable in data structures 4. having an intrinsic identity (independent of any given name) 5. being comparable for equality with other entities 6. being passable as a parameter to a procedure/function 7. being returnable as the result of a procedure/function 8. being constructable at runtime 9. being printable 10. being readable 11. being transmissible among distributed processes 12. being storable outside running processes I'll guess that 5,9,12 does not apply to Haskell functions. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 12/27/07, Cristian Baboi
http://en.wikipedia.org/wiki/First-class_object
The term was coined by Christopher Strachey in the context of "functions as first-class citizens" in the mid-1960's.[1]
Depending on the language, this can imply: 1. being expressible as an anonymous literal value 2. being storable in variables 3. being storable in data structures 4. having an intrinsic identity (independent of any given name) 5. being comparable for equality with other entities 6. being passable as a parameter to a procedure/function 7. being returnable as the result of a procedure/function 8. being constructable at runtime 9. being printable 10. being readable 11. being transmissible among distributed processes 12. being storable outside running processes
I'll guess that 5,9,12 does not apply to Haskell functions.
I don't think this is meant as a list of requirements, but as examples of what being first class *can* mean. So yes, in Haskell some of these points don't make much sense. -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862

Cristian Baboi wrote:
http://en.wikipedia.org/wiki/First-class_object I'll guess that 5,9,12 does not apply to Haskell functions.
I think there is a basic semantic difference between what the author of that article meant by the word "function" and what we mean by that word when we are talking about Haskell. In the article, "function" means a concrete data object that specifies how to compute something. In Haskell, a function is closer to the mathematical idea of a function. Functions specify relationships between elements of certain types, and then the compiler uses them to create code to do your computation. But there is no obligation for a compiler to create any concrete data structure that corresponds to a function. Often it does in practice, but not always. On the other hand, functions are members of types that are just like any other Haskell type. They are first-class in that sense. Like any type, only certain operations make sense on functions. Strings can be compared to each other for equality and written to a disk, and you can take the logarithm of a float, but none of those operations make sense for functions. In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that. -Yitz

On Thu, 27 Dec 2007 11:10:21 +0200, Yitzchak Gale
On the other hand, functions are members of types that are just like any other Haskell type. They are first-class in that sense.
I guess that would apply to any typed language.
Like any type, only certain operations make sense on functions. Strings can be compared to each other for equality and written to a disk, and you can take the logarithm of a float, but none of those operations make sense for functions. In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that.
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function. I'm not sure that in Haskell one can say that storing a value of some type to disk is an operation defined on that type. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

I wrote:
On the other hand, functions are members of types that are just like any other Haskell type. They are first-class in that sense.
Cristian Baboi wrote:
I guess that would apply to any typed language.
Perhaps. But for many typed languages, it is not practical to use. There may be problems with type safety, or it may create a program that would be considered hard to understand. For example, in Haskell, you create a list of functions just the same way you create a list of anything else. You can then map a value across the functions, or fold the functions together with the composition operator, etc. These are normal, clear idioms in Haskell that could easily appear in any simple program. That is also true for some other functional programming languages, but it is rare for imperative ones. Sometimes there is a particular style within a language that works something like this. For example, you can use C++ with STL that way in a certain sense. Anyway, that is what I think it means when we say that functions are first-class in Haskell.
Like any type, only certain operations make sense on functions. Strings can be compared to each other for equality and written to a disk, and you can take the logarithm of a float, but none of those operations make sense for functions. In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that.
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
No, you can only store the result of an operation to disk in the particular case that the result type represents a list of bytes. Otherwise, you have to serialize it first. Happily, Haskell has some cool tools for easily creating serialization methods. And there are a number methods that are already provided in the libraries for many types and for many uses - the Read and Show classes are just one example. But it is not clear at all how you could define a general serialization method for functions. If you can come up with one, please post it to Hackage. :)
I'm not sure that in Haskell one can say that storing a value of some type to disk is an operation defined on that type.
It is. For example: hPutStr :: Handle -> String -> IO () The result type of this function is IO (), which means an IO action. In this case, the semantics of the action are that, when performed, it writes the bytes into a file. Regards, Yitz

On Thu, 27 Dec 2007 12:40:22 +0200, Yitzchak Gale
I wrote:
On the other hand, functions are members of types that are just like any other Haskell type. They are first-class in that sense.
Cristian Baboi wrote:
I guess that would apply to any typed language.
Perhaps. But for many typed languages, it is not practical to use. There may be problems with type safety, or it may create a program that would be considered hard to understand.
For example, in Haskell, you create a list of functions just the same way you create a list of anything else. You can then map a value across the functions, or fold the functions together with the composition operator, etc. These are normal, clear idioms in Haskell that could easily appear in any simple program. That is also true for some other functional programming languages, but it is rare for imperative ones.
Sometimes there is a particular style within a language that works something like this. For example, you can use C++ with STL that way in a certain sense.
Anyway, that is what I think it means when we say that functions are first-class in Haskell.
Ah! You must have been thinking that function in Haskell are members of DATA types. Or, to put it another way, Haskell make no distinction between data types and function types.
Like any type, only certain operations make sense on functions. Strings can be compared to each other for equality and written to a disk, and you can take the logarithm of a float, but none of those operations make sense for functions. In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that.
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
No, you can only store the result of an operation to disk in the particular case that the result type represents a list of bytes. Otherwise, you have to serialize it first.
Happily, Haskell has some cool tools for easily creating serialization methods. And there are a number methods that are already provided in the libraries for many types and for many uses - the Read and Show classes are just one example.
But it is not clear at all how you could define a general serialization method for functions. If you can come up with one, please post it to Hackage. :)
Isn't that confusing levels of abstractions ? Of course functions are bytes, 'cause they are already stored as bytes in RAM.
I'm not sure that in Haskell one can say that storing a value of some type to disk is an operation defined on that type.
It is. For example:
hPutStr :: Handle -> String -> IO ()
The result type of this function is IO (), which means an IO action. In this case, the semantics of the action are that, when performed, it writes the bytes into a file.
And this is a property of the type String ? The function hPutStr appears in the definition of the type String ? ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

Cristian Baboi wrote:
Ah! You must have been thinking that function in Haskell are members of DATA types. Or, to put it another way, Haskell make no distinction between data types and function types.
Yes. I wrote:
Like any type, only certain operations make sense on functions...
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
No, you can only store the result of an operation to disk in the particular case that the result type represents a list of bytes. Otherwise, you have to serialize it first... But it is not clear at all how you could define a general serialization method for functions.
Isn't that confusing levels of abstractions ? Of course functions are bytes, 'cause they are already stored as bytes in RAM.
That is just the point. A function in Haskell is an abstraction, not bytes in RAM. The compiler might implement the same function in several places, with different bytes in each place. Or it might decide to combine it into other functions, and not store any bytes in RAM at all for this function. The function itself represents a way of doing a calculation. It is not an object that can do the calculation.
I'm not sure that in Haskell one can say that storing a value of some type to disk is an operation defined on that type.
It is. For example: hPutStr :: Handle -> String -> IO ()
And this is a property of the type String ? The function hPutStr appears in the definition of the type String ?
Ah, you are thinking of "operation on a type" in the OOP sense. Sorry, I wasn't clear. When I said "only certain operations make sense" on each type, I just meant that there are only certain things you can do with the type. In Haskell, the things you can do with a type are the functions you can define that mention that type in their signature. -Yitz

On Thu, 27 Dec 2007 14:37:51 +0200, Yitzchak Gale
I wrote:
Like any type, only certain operations make sense on functions...
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
No, you can only store the result of an operation to disk in the particular case that the result type represents a list of bytes. Otherwise, you have to serialize it first... But it is not clear at all how you could define a general serialization method for functions.
Isn't that confusing levels of abstractions ? Of course functions are bytes, 'cause they are already stored as bytes in RAM.
That is just the point. A function in Haskell is an abstraction, not bytes in RAM.
The compiler might IMPLEMENT the same function in several places, with different bytes in each place. Or it might decide to combine it into other functions, and not store any bytes in RAM at all for this function.
See ?
The function itself represents a way of doing a calculation. It is not an object that can do the calculation.
Then trees of functions are ...
I'm not sure that in Haskell one can say that storing a value of some type to disk is an operation defined on that type.
It is. For example: hPutStr :: Handle -> String -> IO ()
And this is a property of the type String ? The function hPutStr appears in the definition of the type String ?
Ah, you are thinking of "operation on a type" in the OOP sense. Sorry, I wasn't clear. When I said "only certain operations make sense" on each type, I just meant that there are only certain things you can do with the type. In Haskell, the things you can do with a type are the functions you can define that mention that type in their signature.
How can one define in the language STORAGE of "things" ? Storage of numbers for example ? You said that the TYPE of a function forbids me somehow to store it in a file. Now I understand that not the type forbids me, but the lack of a function with apropriate types. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On Thu, 27 Dec 2007 14:37:51 +0200, Yitzchak Gale
I wrote:
Like any type, only certain operations make sense on functions...
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
No, you can only store the result of an operation to disk in the particular case that the result type represents a list of bytes. Otherwise, you have to serialize it first... But it is not clear at all how you could define a general serialization method for functions.
Isn't that confusing levels of abstractions ? Of course functions are bytes, 'cause they are already stored as bytes in RAM.
That is just the point. A function in Haskell is an abstraction, not bytes in RAM.
The compiler might implement the same function in several places, with different bytes in each place. Or it might decide to combine it into other functions, and not store any bytes in RAM at all for this function.
The function itself represents a way of doing a calculation. It is not an object that can do the calculation.
I think you try to say that the time cannot be stored. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 27 Dec 2007, at 4:57 AM, Cristian Baboi wrote:
On Thu, 27 Dec 2007 12:40:22 +0200, Yitzchak Gale
wrote: I wrote:
On the other hand, functions are members of types that are just like any other Haskell type. They are first-class in that sense.
Cristian Baboi wrote:
I guess that would apply to any typed language.
Perhaps. But for many typed languages, it is not practical to use. There may be problems with type safety, or it may create a program that would be considered hard to understand.
For example, in Haskell, you create a list of functions just the same way you create a list of anything else. You can then map a value across the functions, or fold the functions together with the composition operator, etc. These are normal, clear idioms in Haskell that could easily appear in any simple program. That is also true for some other functional programming languages, but it is rare for imperative ones.
Sometimes there is a particular style within a language that works something like this. For example, you can use C++ with STL that way in a certain sense.
Anyway, that is what I think it means when we say that functions are first-class in Haskell.
Ah! You must have been thinking that function in Haskell are members of DATA types. Or, to put it another way, Haskell make no distinction between data types and function types.
Like any type, only certain operations make sense on functions. Strings can be compared to each other for equality and written to a disk, and you can take the logarithm of a float, but none of those operations make sense for functions. In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that.
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
No, you can only store the result of an operation to disk in the particular case that the result type represents a list of bytes. Otherwise, you have to serialize it first.
Happily, Haskell has some cool tools for easily creating serialization methods. And there are a number methods that are already provided in the libraries for many types and for many uses - the Read and Show classes are just one example.
But it is not clear at all how you could define a general serialization method for functions. If you can come up with one, please post it to Hackage. :)
Isn't that confusing levels of abstractions ? Of course functions are bytes, 'cause they are already stored as bytes in RAM.
Only on Von Neuman machines. Haskell implementations are not required to run on Von Neuman machines. That's why the language is called functional. (Imperative languages, by contrast, are just abstractions of the underlying Von Neuman architecture, which is probably the source of your confusion). jcc

On Thu, 27 Dec 2007 17:35:54 +0200, Jonathan Cast
Only on Von Neuman machines. Haskell implementations are not required to run on Von Neuman machines. That's why the language is called functional. (Imperative languages, by contrast, are just abstractions of the underlying Von Neuman architecture, which is probably the source of your confusion).
Can you tell me what is it that make a language imperative ? When I learned about formal grammars and languages, there was no discussion about this. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

Am Freitag, 28. Dezember 2007 08:12 schrieb Cristian Baboi:
On Thu, 27 Dec 2007 17:35:54 +0200, Jonathan Cast
wrote: Only on Von Neuman machines. Haskell implementations are not required to run on Von Neuman machines. That's why the language is called functional. (Imperative languages, by contrast, are just abstractions of the underlying Von Neuman architecture, which is probably the source of your confusion).
Can you tell me what is it that make a language imperative ?
When I learned about formal grammars and languages, there was no discussion about this.
This is because a formal language (set of words) only consideres the syntactic aspect and formal grammars are only about describing formal languages. In contrast, imperative vs. declarative is about semantics. A language is imperative if programs written in this language say how something should be done instead of what should be the outcome. This description is rather informal, of course. Best wishes, Wolfgang

On 28 Dec 2007, at 1:12 AM, Cristian Baboi wrote:
On Thu, 27 Dec 2007 17:35:54 +0200, Jonathan Cast
wrote: Only on Von Neuman machines. Haskell implementations are not required to run on Von Neuman machines. That's why the language is called functional. (Imperative languages, by contrast, are just abstractions of the underlying Von Neuman architecture, which is probably the source of your confusion).
Can you tell me what is it that make a language imperative ?
Programming languages are generally classified into three groups, imperative, functional, and logical. The difference is in the style of programming encouraged (or mandated, for older languages) by the language. In imperative languages, the programmer is encouraged to organize his program as a list of fairly small instructions to be executed in sequence by the machine. The archetype here is assembler, whose specification is part of the specification of the machine, but other languages tend to provide features inspired by computer architecture (mutable variables that designate regions of RAM, for example). In logical languages, the programmer is encouraged to organize his program as a set of predicates and axioms for reasoning with them; the system then attempts to use the axioms to find a proof of a particular assertion within the system. In functional languages, the programmer is encouraged to organize his program as a set of definitions of named expressions, some of which will be functions used in other expressions. The system then evaluates one of these expressions and, in purely functional languages, `executes' it in some sense (conceptually this step comes / after/ the evaluation of the main expression). Note that the latter of these two have nothing to do with computer architecture; functions in a functional language are source code expressions that need to be evaluated and that can be referred to in larger expressions, not regions of memory containing instructions for the computer. jcc

On Fri, 2007-12-28 at 17:54 -0600, Jonathan Cast wrote:
Programming languages are generally classified into three groups, imperative, functional, and logical. The difference is in the style of programming encouraged (or mandated, for older languages) by the language.
Usually the divide is imperative v. declarative with the four major paradigms (procedural, OO and logic, FP respectively) being subgroups of those divisions.

On 6 Jan 2008, at 3:02 AM, Derek Elkins wrote:
On Fri, 2007-12-28 at 17:54 -0600, Jonathan Cast wrote:
Programming languages are generally classified into three groups, imperative, functional, and logical. The difference is in the style of programming encouraged (or mandated, for older languages) by the language.
Usually the divide is imperative v. declarative with the four major paradigms (procedural, OO and logic, FP respectively) being subgroups of those divisions.
And your explanation of this classification is? I find the term `declarative' to be almost completely meaningless. jcc

On Sun, 2008-01-06 at 09:45 -0800, Jonathan Cast wrote:
On 6 Jan 2008, at 3:02 AM, Derek Elkins wrote:
On Fri, 2007-12-28 at 17:54 -0600, Jonathan Cast wrote:
Programming languages are generally classified into three groups, imperative, functional, and logical. The difference is in the style of programming encouraged (or mandated, for older languages) by the language.
Usually the divide is imperative v. declarative with the four major paradigms (procedural, OO and logic, FP respectively) being subgroups of those divisions.
And your explanation of this classification is?
I find the term `declarative' to be almost completely meaningless.
I was originally thinking of having the final sentence: "There are no clear, accepted meanings for any of these terms." Many people find any, perhaps all, of the terms: "functional", "object oriented", "imperative" to be almost completely meaningless. Mostly the terms have no prescriptive meaning, but rather are defined by example. At any rate, I wasn't and didn't explain anything as that was not my intention. I was merely pointing out that your usage is against the "norms" and in a way similar in its disconcertingness to saying, "American politics is classified into three groups, conservatives, Democrats and libertarians."

Derek Elkins writes:
Jonathan Cast wrote:
I find the term `declarative' to be almost completely meaningless.
I was originally thinking of having the final sentence: "There are no clear, accepted meanings for any of these terms."
Clear, no. Accepted, yes. Let Jonathan Cast repeat that statement to people who organise conferences on Declarative Programming, or those who assembled: http://en.wikipedia.org/wiki/Declarative_programming http://burks.brighton.ac.uk/burks/foldoc/90/29.htm (or http://foldoc.org/foldoc.cgi?declarative+language) I can't see what is the purpose of all your argument... Jerzy Karczmarczuk

On Sun, 2008-01-06 at 22:31 +0100, jerzy.karczmarczuk@info.unicaen.fr wrote:
Derek Elkins writes:
Jonathan Cast wrote:
I find the term `declarative' to be almost completely meaningless.
I was originally thinking of having the final sentence: "There are no clear, accepted meanings for any of these terms."
Clear, no. Accepted, yes.
That was a conjunction: "clear AND accepted".

On 6 Jan 2008, at 1:31 PM, jerzy.karczmarczuk@info.unicaen.fr wrote:
Derek Elkins writes:
Jonathan Cast wrote:
I find the term `declarative' to be almost completely meaningless. I was originally thinking of having the final sentence: "There are no clear, accepted meanings for any of these terms."
Clear, no. Accepted, yes. Let Jonathan Cast repeat that statement to people who organise conferences on Declarative Programming, or those who assembled: http://en.wikipedia.org/wiki/Declarative_programming http://burks.brighton.ac.uk/burks/foldoc/90/29.htm (or http://foldoc.org/foldoc.cgi?declarative+language)
To quote your last citation:
declarative language: Any relational language or functional language.
Yes, the term `declarative' means something in the sense that we can tell whether any given language is declarative or not, so I should have been more clear. To wit, I do not believe the term `declarative' has any single referent, even in the sense that the term `functional' has any single referent. I find the only similarity between Haskell and Prolog to be that neither is imperative.
I can't see what is the purpose of all your argument...
Granted. jcc

On Sun, 2008-01-06 at 13:48 -0800, Jonathan Cast wrote:
On 6 Jan 2008, at 1:31 PM, jerzy.karczmarczuk@info.unicaen.fr wrote:
Derek Elkins writes:
Jonathan Cast wrote:
I find the term `declarative' to be almost completely meaningless. I was originally thinking of having the final sentence: "There are no clear, accepted meanings for any of these terms."
Clear, no. Accepted, yes. Let Jonathan Cast repeat that statement to people who organise conferences on Declarative Programming, or those who assembled: http://en.wikipedia.org/wiki/Declarative_programming http://burks.brighton.ac.uk/burks/foldoc/90/29.htm (or http://foldoc.org/foldoc.cgi?declarative+language)
To quote your last citation:
declarative language: Any relational language or functional language.
Yes, the term `declarative' means something in the sense that we can tell whether any given language is declarative or not, so I should have been more clear. To wit, I do not believe the term `declarative' has any single referent, even in the sense that the term `functional' has any single referent. I find the only similarity between Haskell and Prolog to be that neither is imperative.
Indeed, you've discovered it. The definition of "declarative" is often "not imperative." (Or vice versa, where, as I said earlier, these are primarily defined by example rather than some predicate.)

Derek Elkins writes:
Jonathan Cast wrote:
I find the only similarity between Haskell and Prolog to be that neither is imperative.
Indeed, you've discovered it. The definition of "declarative" is often "not imperative."
I disagree. Practically. (I won't discuss doctrinal matter nor linguistic hairsplitting). The relational syntax of Prolog is more "universal" than the functional notation, since you have logic variables and logical-non-determinism, and - thus - the possibility of making predicates where the roles of input and output parameters are not pre-assigned, - - but there is a *strong* (meaning important) functional layer within, and plenty of Prolog algorithms are expressed similarly in Lisp or in Haskell. Many non-deterministic ones have natural translation into the List monad. Some "circular" definitions using laziness are related to ones with non-instantiated logical variables. If you don't want to see similarities, you won't. But I assure you that I have profited enormously from tha *affinities* between functional and logic approaches, and you won't convince me that "declarative" is without substance. Jerzy Karczmarczuk

On Sun, 2008-01-06 at 23:28 +0100, jerzy.karczmarczuk@info.unicaen.fr wrote:
Derek Elkins writes:
Jonathan Cast wrote:
I find the only similarity between Haskell and Prolog to be that neither is imperative.
Indeed, you've discovered it. The definition of "declarative" is often "not imperative."
I disagree. Practically. (I won't discuss doctrinal matter nor linguistic hairsplitting).
I wasn't being that serious there, though oftentimes "declarative" -is- used in a way that is mostly meaningless or as a buzzword. One thing I will stand by, however, is that the consensus is that "declarative" and "imperative" are meant to be exhaustive and ideally disjoint (though where to draw the line is tricky), and thus in that sense, "declarative" is "not imperative" (and, as I said originally though you elided it, vice versa.)
The relational syntax of Prolog is more "universal" than the functional notation, since you have logic variables and logical-non-determinism, and - thus - the possibility of making predicates where the roles of input and output parameters are not pre-assigned, -
- but there is a *strong* (meaning important) functional layer within, and plenty of Prolog algorithms are expressed similarly in Lisp or in Haskell.
Many non-deterministic ones have natural translation into the List monad. Some "circular" definitions using laziness are related to ones with non-instantiated logical variables.
If you don't want to see similarities, you won't. But I assure you that I have profited enormously from tha *affinities* between functional and logic approaches, and you won't convince me that "declarative" is without substance.
"declarative" is often used in a way where HTML, XML and such are "declarative languages". At any rate, also in the elided part of my reply, was the statement that "imperative"/"declarative" are often defined by example, and the above is just such a case (unless you have a clear definition of "functional" and "logical"). This simply defines "declarative" to mean "functional"+"logical" making "declarative" a pure name devoid of any descriptive power. To make this email constructive, however, I will propose a slightly less fuzzy criterion: namely a declarative language is one that, via the Curry-Howard correspondence(s), corresponds strongly with (a relatively "standard") logic. This arguably can be used to give some oomph to the usage of the term "declarative" rather than it being just a name, though I'll not bother. This recovers the fact that "functional" and "logic" languages are declarative and gives a -specific- similarity. It agrees fairly well with the ordering "more declarative than" determined by consensus. Finally, it points the way to allowing other languages rather than "not (functional or logical) => not declarative."

Jerzy wrote:
The relational syntax of Prolog is more "universal" than the functional notation, since you have logic variables and logical-non-determinism, and
Isn't this just because mathematically, a function *is* a relation, but not vice versa? A relation being just a subset of a Cartesian product of sets, while a function being a special kind of relation for which each element in the domain has exactly one image? So relations are inherently much more universal than functions, but they are not that practical to work with (for a computer and/or human?). Gee, I should not talk about math here, as you "category theory" guys know a thousand times more math than I do ;-) Cheers, Peter

Peter Verswyvelen writes:
Jerzy wrote:
The relational syntax of Prolog is more "universal" than the functional notation, since you have logic variables and logical-non-determinism, and
Isn't this just because mathematically, a function *is* a relation, but not vice versa? A relation being just a subset of a Cartesian product of sets, while a function being a special kind of relation for which each element in the domain has exactly one image? So relations are inherently much more universal than functions, but they are not that practical to work with (for a computer and/or human?).
You are right. Yes, functions are subsets of relations, and the affinity between logical and functional programming is all but accidental. But relations ARE PRACTICAL! Prolog, Mercury, etc. use them. Leda, Life ... Combined paradigms are not so exotic.
Gee, I should not talk about math here, as you "category theory" guys know a thousand times more math than I do ;-)
On the contrary, you should. Tell what is interesting for you. Don't let hairsplitters monopolize the discussion of mathematical side of Haskell. I am sick seeing that 75% of true deep discussion turns around ... sorry for the swearword - ... bottom. Jerzy Karczmarczuk

Peter Verswyvelen wrote:
Jerzy wrote:
The relational syntax of Prolog is more "universal" than the functional notation, since you have logic variables and logical-non-determinism, and
Isn't this just because mathematically, a function *is* a relation, but not vice versa? A relation being just a subset of a Cartesian product of sets, while a function being a special kind of relation for which each element in the domain has exactly one image? So relations are inherently much more universal than functions, but they are not that practical to work with (for a computer and/or human?).
You can as well regard a relation as a special sort of function, i.e. define relation ~ as a function A x B -> Bool by (a,b) |-> a ~ b. Cheers Ben

On 2008-01-06, Jonathan Cast
To wit, I do not believe the term `declarative' has any single referent, even in the sense that the term `functional' has any single referent. I find the only similarity between Haskell and Prolog to be that neither is imperative.
Have you tried comparing Prolog to GHC's multiparameter type-classes? -- Aaron Denney -><-

On 6 Jan 2008, at 4:00 PM, Aaron Denney wrote:
On 2008-01-06, Jonathan Cast
wrote: To wit, I do not believe the term `declarative' has any single referent, even in the sense that the term `functional' has any single referent. I find the only similarity between Haskell and Prolog to be that neither is imperative.
Have you tried comparing Prolog to GHC's multiparameter type-classes?
Well, they both express relations, they both stand in opposition to more basically functional approaches, and they are interpreted at entirely different points in the program's lifetime. So I guess you could find lots of points of comparison. Similarity? I'm still not convinced. jcc

On 6 Jan 2008, at 12:13 PM, Derek Elkins wrote:
On Sun, 2008-01-06 at 09:45 -0800, Jonathan Cast wrote:
On 6 Jan 2008, at 3:02 AM, Derek Elkins wrote:
On Fri, 2007-12-28 at 17:54 -0600, Jonathan Cast wrote:
Programming languages are generally classified into three groups, imperative, functional, and logical.
NB: I will stipulate that most people consider imperative vs. declarative to be a further hierarchy above this division. I will even stipulate that most people consider the procedural vs. OO distinction other than a distraction :) So I should have said: programming languages may be classified into three groups, ... --- where the groups themselves are generally agreed to exist, to be mutually exclusive, and to capture the vast majority of programming languages.
The difference is in the style of programming encouraged (or mandated, for older languages) by the language.
Usually the divide is imperative v. declarative with the four major paradigms (procedural, OO and logic, FP respectively) being subgroups of those divisions.
And your explanation of this classification is?
I find the term `declarative' to be almost completely meaningless.
I was originally thinking of having the final sentence: "There are no clear, accepted meanings for any of these terms."
Many people find any, perhaps all, of the terms: "functional", "object oriented", "imperative" to be almost completely meaningless. Mostly the terms have no prescriptive meaning, but rather are defined by example.
I was trying to work within this framework. Most languages support both imperative and functional paradigms, these days; but there are patterns which are awkward in some languages and natural in others. That is what I consider the main distinction. But, while there are patterns that are natural in all (at least structured) imperative languages and no or few non-imperative ones (like while loops), I don't know of any patterns that are natural in all declarative languages.
At any rate, I wasn't and didn't explain anything as that was not my intention. I was merely pointing out that your usage is against the "norms"
As a statistical statement, this may be true.
and in a way similar in its disconcertingness to saying, "American politics is classified into three groups, conservatives, Democrats and libertarians."
Or like saying "American politics is classified into three groups, statists, Rothbardians, and Randians" :) jcc

Thinking about files and types, I recalled that in Pascal files must have
types.
On Thu, 27 Dec 2007 12:40:22 +0200, Yitzchak Gale
I'm not sure that in Haskell one can say that storing a value of some type to disk is an operation defined on that type.
It is. For example:
hPutStr :: Handle -> String -> IO ()
The result type of this function is IO (), which means an IO action. In this case, the semantics of the action are that, when performed, it writes the bytes into a file.
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

Hello Cristian, Thursday, December 27, 2007, 12:19:08 PM, you wrote:
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
how can values of type T be saved to disk? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Thu, 27 Dec 2007 14:42:37 +0200, Bulat Ziganshin
Hello Cristian,
Thursday, December 27, 2007, 12:19:08 PM, you wrote:
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
how can values of type T be saved to disk?
I don't know. I'm a beginner in Haskell, and I down't know about T. You mean they cannot ? I was under the impression that the purpose of computers cannot be fulfiled if we cannot get the result of computations out of the computers. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

Hello Cristian, Thursday, December 27, 2007, 3:51:17 PM, you wrote:
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
how can values of type T be saved to disk?
I don't know. I'm a beginner in Haskell, and I down't know about T.
here T is any type. you said that values of ANY TYPE can be saved to disk, so show us the way
You mean they cannot ? I was under the impression that the purpose of computers cannot be fulfiled if we cannot get the result of computations out of the computers.
try to prove that this mean that value of ANY type may be saved to disk -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Thu, 27 Dec 2007 16:12:04 +0200, Bulat Ziganshin
Hello Cristian,
Thursday, December 27, 2007, 3:51:17 PM, you wrote:
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
how can values of type T be saved to disk?
I don't know. I'm a beginner in Haskell, and I down't know about T.
here T is any type. you said that values of ANY TYPE can be saved to disk, so show us the way
The way is toward west. I said except functions. I'll add instances of IO. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

Bulat Ziganshin wrote:
here T is any type. you said that values of ANY TYPE can be saved to disk, so show us the way
...
try to prove that this mean that value of ANY type may be saved to disk
Run another program that uses lots of memory, and watch the entire Haskell program's memory be swapped out to disk. Better yet, suspend-to-disk (or "hibernate") your computer. Voila -- values of any and all types have been saved to disk! In a limited fashion, of course. Isaac

On 27 Dec 2007, at 6:51 AM, Cristian Baboi wrote:
On Thu, 27 Dec 2007 14:42:37 +0200, Bulat Ziganshin
wrote: Hello Cristian,
Thursday, December 27, 2007, 12:19:08 PM, you wrote:
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
how can values of type T be saved to disk?
I don't know. I'm a beginner in Haskell, and I down't know about T. You mean they cannot ? I was under the impression that the purpose of computers cannot be fulfiled if we cannot get the result of computations out of the computers.
Haskell is not a computer programming language; Haskell implementations are not required to run on computers. Haskell is a formal notation for computation (completely unrelated to the Von Neuman machine sitting on your desk). It can be implemented on Von Neuman machines, because they are still universal Turing machines, but it is /not/ a radical attack on the problem of programming peripherals! jcc

On Thu, 27 Dec 2007 17:39:25 +0200, Jonathan Cast
On 27 Dec 2007, at 6:51 AM, Cristian Baboi wrote:
On Thu, 27 Dec 2007 14:42:37 +0200, Bulat Ziganshin
wrote: Hello Cristian,
Thursday, December 27, 2007, 12:19:08 PM, you wrote:
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
how can values of type T be saved to disk?
I don't know. I'm a beginner in Haskell, and I down't know about T. You mean they cannot ? I was under the impression that the purpose of computers cannot be fulfiled if we cannot get the result of computations out of the computers.
Haskell is not a computer programming language; Haskell implementations are not required to run on computers. Haskell is a formal notation for computation (completely unrelated to the Von Neuman machine sitting on your desk). It can be implemented on Von Neuman machines, because they are still universal Turing machines, but it is /not/ a radical attack on the problem of programming peripherals!
I suppose it can run on pebbles. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 27 Dec 2007, at 9:41 AM, Cristian Baboi wrote:
On Thu, 27 Dec 2007 17:39:25 +0200, Jonathan Cast
wrote: On 27 Dec 2007, at 6:51 AM, Cristian Baboi wrote:
On Thu, 27 Dec 2007 14:42:37 +0200, Bulat Ziganshin
wrote: Hello Cristian,
Thursday, December 27, 2007, 12:19:08 PM, you wrote:
Yes, but one can store the result of an operation to disk except in the particular case the result happen to be a function.
how can values of type T be saved to disk?
I don't know. I'm a beginner in Haskell, and I down't know about T. You mean they cannot ? I was under the impression that the purpose of computers cannot be fulfiled if we cannot get the result of computations out of the computers.
Haskell is not a computer programming language; Haskell implementations are not required to run on computers. Haskell is a formal notation for computation (completely unrelated to the Von Neuman machine sitting on your desk). It can be implemented on Von Neuman machines, because they are still universal Turing machines, but it is /not/ a radical attack on the problem of programming peripherals!
I suppose it can run on pebbles.
Any language can be emulated on pebbles; unlike most languages, Haskell can be compiled directly to them. jcc

I don't know. I'm a beginner in Haskell, and I down't know about T. You mean they cannot ? I was under the impression that the purpose of computers cannot be fulfiled if we cannot get the result of computations out of the computers.
Haskell is not a computer programming language; Haskell implementations are not required to run on computers. Haskell is a formal notation for computation (completely unrelated to the Von Neuman machine sitting on your desk). It can be implemented on Von Neuman machines, because they are still universal Turing machines, but it is /not/ a radical attack on the problem of programming peripherals!
I suppose it can run on pebbles.
Any language can be emulated on pebbles; unlike most languages, Haskell can be compiled directly to them.
jcc
I know, and in this case one doesn't need IO. The result is a nice collection of asorted pebbles. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 27 Dec 2007, at 9:47 AM, Cristian Baboi wrote:
I don't know. I'm a beginner in Haskell, and I down't know about T. You mean they cannot ? I was under the impression that the purpose of computers cannot be fulfiled if we cannot get the result of computations out of the computers.
Haskell is not a computer programming language; Haskell implementations are not required to run on computers. Haskell is a formal notation for computation (completely unrelated to the Von Neuman machine sitting on your desk). It can be implemented on Von Neuman machines, because they are still universal Turing machines, but it is /not/ a radical attack on the problem of programming peripherals!
I suppose it can run on pebbles.
Any language can be emulated on pebbles; unlike most languages, Haskell can be compiled directly to them.
jcc
I know, and in this case one doesn't need IO. The result is a nice collection of asorted pebbles.
Which is why Haskell treats IO as a domain specific language. jcc

Good to know. I intended to use Haskell for algorithms, but it seems it is
not so good at them.
On Thu, 27 Dec 2007 17:52:19 +0200, Jonathan Cast
On 27 Dec 2007, at 9:47 AM, Cristian Baboi wrote:
I don't know. I'm a beginner in Haskell, and I down't know about T. You mean they cannot ? I was under the impression that the purpose of computers cannot be fulfiled if we cannot get the result of computations out of the computers.
Haskell is not a computer programming language; Haskell implementations are not required to run on computers. Haskell is a formal notation for computation (completely unrelated to the Von Neuman machine sitting on your desk). It can be implemented on Von Neuman machines, because they are still universal Turing machines, but it is /not/ a radical attack on the problem of programming peripherals!
I suppose it can run on pebbles.
Any language can be emulated on pebbles; unlike most languages, Haskell can be compiled directly to them.
jcc
I know, and in this case one doesn't need IO. The result is a nice collection of asorted pebbles.
Which is why Haskell treats IO as a domain specific language.
jcc
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

Am Donnerstag, 27. Dezember 2007 16:57 schrieb Cristian Baboi:
On Thu, 27 Dec 2007 17:52:19 +0200, Jonathan Cast
Which is why Haskell treats IO as a domain specific language.
Good to know. I intended to use Haskell for algorithms, but it seems it is not so good at them.
Why is I/O needed for algorithms? And the fact that I/O is embedded into Haskell as a kind of a domain specific language doesn’t mean that Haskell is bad at I/O. As Simon Peyton Jones put it: Haskell is the world’s finest imperative programming language. Best wishes, Wolfgang

On Thu, 27 Dec 2007 18:13:57 +0200, Wolfgang Jeltsch
Am Donnerstag, 27. Dezember 2007 16:57 schrieb Cristian Baboi:
On Thu, 27 Dec 2007 17:52:19 +0200, Jonathan Cast
Which is why Haskell treats IO as a domain specific language.
Good to know. I intended to use Haskell for algorithms, but it seems it is not so good at them.
Why is I/O needed for algorithms?
And the fact that I/O is embedded into Haskell as a kind of a domain specific language doesn’t mean that Haskell is bad at I/O. As Simon Peyton Jones put it: Haskell is the world’s finest imperative programming language.
An algorithm is a finite recipe that allow one to solve a class of problems in a mechanical way. To be able to use the algorithm one must be able to read it. To be able to communicate the algorithm, one must be able to write it. When I mentioned that IO is not needed for pebbles, I was joking. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 27 Dec 2007, at 9:57 AM, Cristian Baboi wrote:
Good to know. I intended to use Haskell for algorithms, but it seems it is not so good at them.
Very sad. The entire point of Haskell is that it allows the user to transcend the algorithm as a way of expressing computations. I hope someday you may understand Haskell, rather than just criticizing it. jcc

On Thu, 27 Dec 2007 18:45:23 +0200, Jonathan Cast
On 27 Dec 2007, at 9:57 AM, Cristian Baboi wrote:
Good to know. I intended to use Haskell for algorithms, but it seems it is not so good at them.
Very sad. The entire point of Haskell is that it allows the user to transcend the algorithm as a way of expressing computations.
I hope someday you may understand Haskell, rather than just criticizing it.
I'm begining to understand it. "Criticizing" it's just a tehnique to allow me to understand it better. This is what I understood: - there is no distinction of data from functions. This seem more like a matter of definiton: what I call X, the X + Y or just X. - functions can be manipulated the same way as data. This does not sound right. - functions can be manipulated as easy as data. This seems better. - functional programming is declarative. One may take a picture of all those pebbles, but their arrangemant does not make sense to him because no part of it resemble the original description. - one cannot print "things" that cannot be traversed in a sequential way The last two seems to be in contradiction. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On Thu, 27 Dec 2007 17:39:25 +0200, Jonathan Cast
Haskell is not a computer programming language; Haskell implementations are not required to run on computers. Haskell is a formal notation for computation (completely unrelated to the Von Neuman machine sitting on your desk). It can be implemented on Von Neuman machines, because they are still universal Turing machines, but it is /not/ a radical attack on the problem of programming peripherals!
How do you call that "thing" that implement Haskell ? ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 28 Dec 2007, at 1:15 AM, Cristian Baboi wrote:
On Thu, 27 Dec 2007 17:39:25 +0200, Jonathan Cast
wrote: Haskell is not a computer programming language; Haskell implementations are not required to run on computers. Haskell is a formal notation for computation (completely unrelated to the Von Neuman machine sitting on your desk). It can be implemented on Von Neuman machines, because they are still universal Turing machines, but it is /not/ a radical attack on the problem of programming peripherals!
How do you call that "thing" that implement Haskell ?
Usually I call it a compiler for a computer. That's a fact about economics, not about Haskell. jcc

Hello Yitzchak, Thursday, December 27, 2007, 12:10:21 PM, you wrote:
http://en.wikipedia.org/wiki/First-class_object I'll guess that 5,9,12 does not apply to Haskell functions.
you mean 5, 9-12?
In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that.
"for a computer" is superfluous here. people are not smarter than computers and can't do anything that's impossible for computers -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
Hello Yitzchak, Thursday, December 27, 2007, 12:10:21 PM, you wrote:
In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that.
"for a computer" is superfluous here. people are not smarter than computers and can't do anything that's impossible for computers
I don't think my computer can be sorry, but I know I can be. And don't forget that there are 'undecidable' problems. Cheers Ben

On 28 Dec 2007, at 3:13 PM, Ben Franksen wrote:
Bulat Ziganshin wrote:
Hello Yitzchak, Thursday, December 27, 2007, 12:10:21 PM, you wrote:
In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that.
"for a computer" is superfluous here. people are not smarter than computers and can't do anything that's impossible for computers
I don't think my computer can be sorry, but I know I can be.
And don't forget that there are 'undecidable' problems.
Which I have never yet seen decided by a person... jcc

Jonathan Cast wrote:
On 28 Dec 2007, at 3:13 PM, Ben Franksen wrote:
Bulat Ziganshin wrote:
Hello Yitzchak, Thursday, December 27, 2007, 12:10:21 PM, you wrote:
In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that.
"for a computer" is superfluous here. people are not smarter than computers and can't do anything that's impossible for computers
I don't think my computer can be sorry, but I know I can be.
And don't forget that there are 'undecidable' problems.
Which I have never yet seen decided by a person...
In many cases, equality of functions has been decided by humans, as has termination of programs. Of course this doesn't prove that humans can, in principle, decide equality for any pair of functions. But neither has the opposite been proved. Cheers Ben

Ben Franksen wrote:
In many cases, equality of functions has been decided by humans, as has termination of programs. Of course this doesn't prove that humans can, in principle, decide equality for any pair of functions. But neither has the opposite been proved.
Interesting... So you're claiming that humans have powers of deduction beyond what computers possess? ;-) Note that no theorum claims that a computer can never tell whether a given pair of functions are equivilent. The theorum is that a computer will never be able to tell for *every possible* pair of functions, that's all.

Andrew Coppin
Interesting... So you're claiming that humans have powers of deduction beyond what computers possess? ;-)
They would be programming us if otherwise, wouldn't they? -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Achim, Saturday, December 29, 2007, 8:40:05 PM, you wrote:
Interesting... So you're claiming that humans have powers of deduction beyond what computers possess? ;-)
They would be programming us if otherwise, wouldn't they?
oh, well. God created humans, humans created computers. God has created our programs (psychics), we does the same for computers but what's a programming? without me, computer will never print "hello world". but without him, i will never write this letter - only its ability to easily transfer mail between continents forced me to do it next. can you compile this "hello world" program down to assembler? humans often says about things that they can do but computer can't but they forget that computers was created exactly to do things that we can't. billion of computations per second is beyond our abilities just imagine compiling of this program without pencil and paper and you will draw conclusion that computers have power of deduction that humans definitely doesn't have. and it's only one aspect which doesn't take into account duration of human life (of course if we want to say about *real humans* and not abstract mathematical model of immortals), difference between people's abilities (it's common mistake to compare abilities of one concrete computer with MAXIMUM of abilities of all people, including whose in all future generations), don't take into account that human by itself, at the moment of birth doesn't know anything about mathematics and even can't speak - he is programmed by society to acquire these skills so, computers are definitely more advanced devices - they was created to. we (humanity) just don't yet finished development of the program which at some moment will make them able to further develop itself without our help. if you believe that human is superior to computer you should also believe that bacterium is superior to human -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On 12/29/07, Bulat Ziganshin
just imagine compiling of this program without pencil and paper and you will draw conclusion that computers have power of deduction that humans definitely doesn't have. and it's only one aspect which doesn't take into account duration of human life (of course if we want to say about *real humans* and not abstract mathematical model of immortals), difference between people's abilities (it's common mistake to compare abilities of one concrete computer with MAXIMUM of abilities of all people, including whose in all future generations), don't take into account that human by itself, at the moment of birth doesn't know anything about mathematics and even can't speak - he is programmed by society to acquire these skills
I haven't been following this thread, but anyone interested in this question might want to read Daniel Dennett's essay "Fast Thinking", in his book _The Intentional Stance_.
so, computers are definitely more advanced devices - they was created to. we (humanity) just don't yet finished development of the program which at some moment will make them able to further develop itself without our help. if you believe that human is superior to computer you should also believe that bacterium is superior to human
The only thing that computers can do that humans can't is to work without getting bored. Cheers, Tim -- Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt "It's mad to be in love with someone else / When you're in love with him, she's in love with me / But you know as well as I do I can never think of anyone but you" -- Pet Shop Boys

Hello Tim, Saturday, December 29, 2007, 9:42:48 PM, you wrote:
The only thing that computers can do that humans can't is to work without getting bored.
ok, please compute 2^2^30 before continuing discussion. it seems that you just use "i'm too bored" and "i can't" as synonyms. if computer will answer "i'm too bored" to any question he can't answer - will it be enough to give him human rights? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On 12/29/07, Bulat Ziganshin
Hello Tim,
Saturday, December 29, 2007, 9:42:48 PM, you wrote:
The only thing that computers can do that humans can't is to work without getting bored.
ok, please compute 2^2^30 before continuing discussion. it seems that you just use "i'm too bored" and "i can't" as synonyms. if computer will answer "i'm too bored" to any question he can't answer - will it be enough to give him human rights?
Well, that's why I recommended the Dennett essay. The difference between "I'm too bored" and "I can't" is actually an interesting philosophical question, and people have written about it in detail before. Cheers, Tim -- Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt "Instant gratification takes too long."--Carrie Fisher

Hello Tim, Saturday, December 29, 2007, 10:07:15 PM, you wrote:
ok, please compute 2^2^30 before continuing discussion. it seems that
Well, that's why I recommended the Dennett essay. The difference between "I'm too bored" and "I can't" is actually an interesting philosophical question, and people have written about it in detail before.
oh, Dennett isn't only source of wisdom. i proposed you this task because i've my own understanding of it. as i've said in other letter, both computers and humans may be described using mathematics and therefore equivalent - as far as we say about theoretical immortal man and Turing machine -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On 12/29/07, Bulat Ziganshin
oh, Dennett isn't only source of wisdom. i proposed you this task because i've my own understanding of it. as i've said in other letter, both computers and humans may be described using mathematics and therefore equivalent - as far as we say about theoretical immortal man and Turing machine
He's not the only source of wisdom, but as a rule, it does tend to be good to be as familiar as possible with what has been written before on a subject that you're talking about. Isn't that one of the reasons this mailing list exists, after all? :-) Cheers, Tim -- Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt "...It's wonderful that I can trust you not to spit in my milk, but what's the point if you're going to drink from the bottle?" -- Sarah Barton

Hello Tim, Saturday, December 29, 2007, 10:27:46 PM, you wrote:
oh, Dennett isn't only source of wisdom. i proposed you this task because i've my own understanding of it. as i've said in other letter, both computers and humans may be described using mathematics and therefore equivalent - as far as we say about theoretical immortal man and Turing machine
He's not the only source of wisdom, but as a rule, it does tend to be good to be as familiar as possible with what has been written before on a subject that you're talking about. Isn't that one of the reasons this mailing list exists, after all? :-)
and you are his prophet? :) "fear the man who was read only one book" - it was said about Bible but true for anyone who believe that any particular compilation is better than originals -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Am Samstag, 29. Dezember 2007 20:15 schrieb Bulat Ziganshin:
Hello Tim,
Saturday, December 29, 2007, 10:07:15 PM, you wrote:
ok, please compute 2^2^30 before continuing discussion. it seems that
Well, that's why I recommended the Dennett essay. The difference between "I'm too bored" and "I can't" is actually an interesting philosophical question, and people have written about it in detail before.
oh, Dennett isn't only source of wisdom. i proposed you this task because i've my own understanding of it. as i've said in other letter, both computers and humans may be described using mathematics and therefore equivalent - as far as we say about theoretical immortal man and Turing machine
The advantages of computers over humans are quantitative. For example, a computer can do calculations faster than a human. But the “advantages” of humans over computers are qualitative. For example, a computer cannot be creative. I love my children. My laptop isn’t able to do that. Best wishes, Wolfgang

Hello Wolfgang, Sunday, December 30, 2007, 12:04:22 AM, you wrote:
The advantages of computers over humans are quantitative. For example, a computer can do calculations faster than a human. But the “advantages” of humans over computers are qualitative. For example, a computer cannot be creative.
I love my children. My laptop isn’t able to do that.
one more trick to convince yourself is to use words which doesn't have exact meanings. are you have human-independent description of love? creativity? when i run fractal-displaying program, it draws other fractal each time. is it creative enough for you? when i power on my computer, each time it connects to computer of ISP. may be, it's not true love for you but at least they are more permanent than most people :D from my, scientist's POV, love is social need that made animal's groups more survival-able. animals what loves each other has more chances in Game of Live survival was never goal for computers so they cannot love each other like you can't fly and eat electricity power (or solar energy). are these features also qualitative? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

as i've said in other letter, both computers and humans may be described using mathematics
Erm... What do you really mean by "may"? I'm pretty sure you can't give such description right now - otherwise you should already have several Nobel prizes. It seems reasonable that even if such description is theoretically possible, no human would ever read it - despite that it can be dropped to the Earth from UFO.

Bulat Ziganshin
Hello Tim,
Saturday, December 29, 2007, 9:42:48 PM, you wrote:
The only thing that computers can do that humans can't is to work without getting bored.
ok, please compute 2^2^30 before continuing discussion. it seems that you just use "i'm too bored" and "i can't" as synonyms. if computer will answer "i'm too bored" to any question he can't answer - will it be enough to give him human rights?
Stack overflow. Please feed more ram into iteration processor. I love you. Please buy me more RAM. Wanna see pr0n? You know I care about your questions, and you know it. Want me to send spam to earn money fast to buy me ram? They never get bored pleasing their master. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Achim, Saturday, December 29, 2007, 10:16:39 PM, you wrote:
The only thing that computers can do that humans can't is to work without getting bored.
ok, please compute 2^2^30 before continuing discussion. it seems that you just use "i'm too bored" and "i can't" as synonyms. if computer will answer "i'm too bored" to any question he can't answer - will it be enough to give him human rights?
Stack overflow. Please feed more ram into iteration processor. I love you. Please buy me more RAM. Wanna see pr0n? You know I care about your questions, and you know it. Want me to send spam to earn money fast to buy me ram?
They never get bored pleasing their master.
oh, my english is so bad that's hard to speak about philosophy anyway, your computer can and you cannot. where human are perfect is in searching descriptions what don't "humble" them. saying that we may be dumber than computer is one more thing that people can't do :D -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

The only thing that computers can do that humans can't is to work without getting bored.
It's always interesting to compare computers and humans, especially computer scientist seem to do that :) But since it seems that plants use some kind of quantum coherence just to do photosynthesis (see http://en.wikipedia.org/wiki/Photosynthesis#Quantum_mechanical_effects), I would not be surprised that our human brain also uses some clever (quantum?) tricks to achieve what it does, tricks which might not be simulated by a regular computer, no matter how fast it runs. But didn't Gödel "proved" that already somehow with its incompleteness theory? Nah I'm just mixing up things here ;) Okay, enough of that, I'm getting seriously off topic here, and I don't know at all what quantum coherence is, it just sounds cool ;-) Cheers, Peter

"Peter Verswyvelen"
The only thing that computers can do that humans can't is to work without getting bored.
It's always interesting to compare computers and humans, especially computer scientist seem to do that :)
Hm. More importantly, only humans try to write a general Eq and Ord instances over different domains.
But since it seems that plants use some kind of quantum coherence just to do photosynthesis (see http://en.wikipedia.org/wiki/Photosynthesis#Quantum_mechanical_effects), I would not be surprised that our human brain also uses some clever (quantum?) tricks to achieve what it does, tricks which might not be simulated by a regular computer, no matter how fast it runs. But didn't Gödel "proved" that already somehow with its incompleteness theory? Nah I'm just mixing up things here ;)
That's more closely related to information hiding, emergent complexity and stuff. http://www.wolframscience.com/nksonline/toc.html which doesn't really explain anything, just that most explanations are dead wrong.
Okay, enough of that, I'm getting seriously off topic here, and I don't know at all what quantum coherence is, it just sounds cool ;-)
You have my vote for the creation of comp.lang.philosophy. Or comp.lang.esoteric.teabagswinging, if you prefer. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Achim, Saturday, December 29, 2007, 11:47:50 PM, you wrote:
It's always interesting to compare computers and humans, especially computer scientist seem to do that :)
Hm. More importantly, only humans try to write a general Eq and Ord instances over different domains.
you have seen only humans that was programmed to this task. you can program computer to the same problem. i think that the problem is our limitations as bad programmers - not computer's as a bad performer :) at least, you can start with program that generates random texts of increasing length. this program is so smart that it can print solution for any problem that has limited length - well, if computer will not be bored :D -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin
Hello Achim,
Saturday, December 29, 2007, 11:47:50 PM, you wrote:
It's always interesting to compare computers and humans, especially computer scientist seem to do that :)
Hm. More importantly, only humans try to write a general Eq and Ord instances over different domains.
i think that the problem is our limitations as bad programmers - not computer's as a bad performer :)
Neither. It's just like trying to get "marmalade" == True to typecheck. You might do it in C to circumvent type checking, but still will not get any sense out of it. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Peter, Saturday, December 29, 2007, 11:12:44 PM, you wrote:
But since it seems that plants use some kind of quantum coherence just to do photosynthesis (see http://en.wikipedia.org/wiki/Photosynthesis#Quantum_mechanical_effects), would not be surprised that our human brain also uses some clever (quantum?) tricks to achieve what it does, tricks which might not be simulated by a regular computer, no matter how fast it runs.
why it can't be simulated in computers? these effects are described in mathematics languages using formulas which can be executed on computer moreover, quantum effects are not dedicated to plants and animals. they can be used in computers like any other physical effects -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin writes:
Hello Peter..., you wrote:
But since it seems that plants use some kind of quantum coherence just to do photosynthesis... would not be surprised that our human brain also uses some clever (quantum?) tricks to achieve what it does, tricks which might not be simulated by a regular computer, no matter how fast it runs.
why it can't be simulated in computers? these effects are described in mathematics languages using formulas which can be executed on computer
moreover, quantum effects are not dedicated to plants and animals. they can be used in computers like any other physical effects
I suggest that you read something on 'quantum computing'. And some other stuff as well, so that you don't use such formulations as "formulas which can be executed on computer". Computers don't execute formulae! A mathematical formula may be non-constructive, or very difficult/impossible to algorithmize. Concerning quanta, the simulation of quantum processes on classical archi- tectures may be and usually is extremely inefficient. So inefficient that your "simulation" loses sense. No classical system can compute, say, a Fourier transform in constant (in fact, infinitely small) time, quantum system do it (in a sense) constantly. Quantum behaviour is not "an effect", but conditions our understanding of *measurement*. We don't really know what is "quantum information". So, please, don't trivialize an awfully complicated problem. Jerzy Karczmarczuk

jerzy.karczmarczuk@info.unicaen.fr writes:
I suggest that you read something on 'quantum computing'.
I guess I should disclaim the rest of my post right away: I don't know much about quantum anything, beyond what I read in the newspapers. Sorry. But:
Concerning quanta, the simulation of quantum processes on classical archi- tectures may be and usually is extremely inefficient. So inefficient that your "simulation" loses sense.
You could raise the same argument for (digital) computers compared to brains - although my brain might be able to, it's not practical for it to do the computations performed even by simple computer programs. But the difference is quantitative and practical, not qualitative and theoretical. (Arguably, I know. I invoke Occam.)
No classical system can compute, say, a Fourier transform in constant (in fact, infinitely small) time, quantum system do it (in a sense) constantly.
If I understand correctly, a quantum computer might solve problems in NP in polynomial time, which is assumed not to be possible for deterministic computers. As far as I can tell, it doesn't imply the ability to compute anthing that wasn't computable before. Now if we can wrap up the topic of whether machines can think, next session we'll discuss whether ships can swim. -k -- If I haven't seen further, it is by standing in the footprints of giants

If I understand correctly, a quantum computer might solve problems in NP in polynomial time, which is assumed not to be possible for deterministic computers.
No! Moreover, there is a hypothesis that the only problems quantum computer can solve in polynomial time are those that the usual computer can.

On 12/30/07, Miguel Mitrofanov
If I understand correctly, a quantum computer might solve problems in NP in polynomial time, which is assumed not to be possible for deterministic computers.
No! Moreover, there is a hypothesis that the only problems quantum computer can solve in polynomial time are those that the usual computer can.
According to http://en.wikipedia.org/wiki/Quantum_computer The class of problems that can be efficiently solved by quantum computers is called BQP, for "bounded error, quantum, polynomial time". Quantum computers only run probabilistic algorithms, so BQP on quantum computers is the counterpart of BPP on classical computers. It is defined as the set of problems solvable with a polynomial-time algorithm, whose probability of error is bounded away from one quarter.[18] A quantum computer is said to "solve" a problem if, for every instance, its answer will be right with high probability. If that solution runs in polynomial time, then that problem is in BQP. BQP is suspected to be disjoint from NP-complete and a strict superset of P, but that is not known. Both integer factorization and discrete log are in BQP. Both of these problems are NP problems suspected to be outside BPP, and hence outside P. Both are suspected to not be NP-complete. --- So, if you come up with a polynomial-time algorithm for integer factorization that doesn't use quantum computers, you could probably make a lot of money cracking people's RSA keys. -- ryan

G'day all. I think it was Ketil Malde who said:
If I understand correctly, a quantum computer might solve problems in NP in polynomial time, which is assumed not to be possible for deterministic computers.
Quoting Miguel Mitrofanov
No! Moreover, there is a hypothesis that the only problems quantum computer can solve in polynomial time are those that the usual computer can.
"Problems in NP" is not the same as "NP-hard". We know that a quantum computer can solve problems in NP in polynomial time, since every problem in P is also in NP. Moreover, we know of at least one problem not known to be in P which can be sort-of solved by a quantum computer in polynomial time (prime factoring). In that sense, the "understanding" is more or less correct. But yeah, it seems likely that the best that a quantum computer can do is bring "almost intractable" problems down to "barely tractable". Cheers, Andrew Bromage

Ketil Malde writes:
I guess I should disclaim the rest of my post right away: I don't know much about quantum anything, beyond what I read in the newspapers.
I answer here, but there were other contributions, of Ryan Ingram, Miguel Mitrofanov, and Andrew Bromage, which I acknowledge. People, we are reopening (recursively) a Pandora box, and this discussion will lead nowhere, as always, when people speculate whether the Universe is a Turing machine... I would like to point out that it started on a subject NOT related to computing, but to simulation. This was, btw. one of the points Feynman stressed upon in his talks on the relation between quanta and information processing. But Feynman was a physicist, and we have different sensibilities from a typical computer scientist, for whom the Universe is a specific "model". For us, things change, you speak about the "state transformers". A particle moves, and some Turingard will say that this is just some data processing. Some say that "thinking is computing", which for me is stupid as hell, since nobody really knows what thinking is. Frankly, reducing the world to computerese is as sensible, as works of La Mettrie (1701-1751) about the human soul as *mechanism*. Ketil, you say about my objection that we can simulate quanta:
You could raise the same argument for (digital) computers compared to brains - although my brain might be able to, it's not practical for it to do the computations performed even by simple computer programs.
But the difference is quantitative and practical, not qualitative and theoretical. (Arguably, I know. I invoke Occam.)
No, it is qualitative and theoretical. You can simulate *some models of quantum systems*, not the quantum reality, since we have simply no idea what is the quantum information, and how to cope with the non-separability (EPR). This implies a non-modularity of the simulating programs. If you manage to *really* split an entangled system, and send one half of it to another galaxy, you will *really* face the EPR paradox, an experiment on Earth conditions the issue of the measurement faraway. But physically, the experiments there are independent. So, in a simulation, the measurement here should do something horrible with the random number generator used to generate the measurement instance faraway. You have a kind of particularly nasty side-effect. (BTW. Amr Sabry really reasons in terms of these side- effects, although he tries to be purely functional...) On the other hand, a physicist will tell you, that in Nature there cannot be any "side-effects" in quanta, the unitarity forbids them. In two words, a simulator of a quantum system becomes fast as complex as the simulated system itself...
If I understand correctly, a quantum computer might solve problems in NP [conditions discussed by others...]
As far as I can tell, it doesn't imply the ability to compute anthing that wasn't computable before.
Bother... Look, ALL, ABSOLUTELY ALL what all those "computationalists" (I call them Turingards, which is a very impolite term, look into the French dict. what is the meaning of "ringard"), *reduce* the behaviour to information processing, but Nature does not process information, whatever you may say about it. This is *our* interpretation of physical phenomena. The "information" is a distilled concept. Of course, there is entropy, whose relation to information is extremely profound. But Nature does not solve equations, nor implements algorithms. Nature does not compare things for equality; on the other hand it "has" some equalities built-in, such as the *true* indistinguishability of quantum particles, which invalidates all classical combinatorics of the state counting, and changes the entropy. I still don't know whether anybody knows what is the relation between the entropy of quantum systems and their "informational contents"... Again, think a bit about the simulation, not about the computability. You cannot even simulate a classical system, frankly. There is chaos, which requires an infinite real-number precision, to make the simulation "good". In relativistics you are in a bad shape. Try to simulate a black hole, with a complete decoupling between an outer world frame, in which an object takes an infinite time to fall through the event horizon, and the victim, for whom it is finite.
Now if we can wrap up the topic of whether machines can think, next session we'll discuss whether ships can swim.
I don't understand your point. We know what swimming is: floating and moving autonomously. Thinking is different, since our thinking is (at least for some of us) conscious, and we have no idea what is the conscience. For goodness sake, I have *REALLY* the impression that those guys who speak about computability of the Universe, have the mentality of 18 century thinkers for whom the world was simple and mechanistic. Or even the mentality of people contemporary of Democritus, for whom everything "reduced" to some dance of atoms. I am as sure as I can modestly be, that in less than 50 years people will laugh loud about the current ideas of "brain as computer", as we laugh now about the 18 century attempts to reduce living organisms to mechanical automata. Well, OK. /cum grano salis/: we *may* say that organisms are automata. The point is that is just a phrasing with absolutely no meaning nor practical consequences. Jerzy Karczmarczuk

That's why I like this group so much, very interesting stuff to read, even if it isn't about Haskell. The problem is that I understand only 1% of it, even if it is about Haskell ;-) Regarding this "the universe is a turing machine": until a couple of years ago, I also was someone that believed that (A) the universe (and life) could be simulated by a computer, and that - given enough time and survival of the human race (which is unlikely) - we might (B) create a universe and life ourselves one day. I was raised as an atheist, but recently I'm trapped in my own reasoning (a bit like Godel's theorem) causing me to deduct that IF you believe in (B), THEN you can't exclude the possibility that (some) GOD might have created the universe... But this has nothing to do with Haskell anymore, so I'll shut up :) -----Original Message----- From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of jerzy.karczmarczuk@info.unicaen.fr Sent: Sunday, December 30, 2007 12:28 PM To: haskell-cafe@haskell.org Subject: [Haskell-cafe] Quanta. Was: Wikipedia on first-class object Ketil Malde writes:
I guess I should disclaim the rest of my post right away: I don't know much about quantum anything, beyond what I read in the newspapers.
I answer here, but there were other contributions, of Ryan Ingram, Miguel Mitrofanov, and Andrew Bromage, which I acknowledge. People, we are reopening (recursively) a Pandora box, and this discussion will lead nowhere, as always, when people speculate whether the Universe is a Turing machine... I would like to point out that it started on a subject NOT related to computing, but to simulation. This was, btw. one of the points Feynman stressed upon in his talks on the relation between quanta and information processing. But Feynman was a physicist, and we have different sensibilities from a typical computer scientist, for whom the Universe is a specific "model". For us, things change, you speak about the "state transformers". A particle moves, and some Turingard will say that this is just some data processing. Some say that "thinking is computing", which for me is stupid as hell, since nobody really knows what thinking is. Frankly, reducing the world to computerese is as sensible, as works of La Mettrie (1701-1751) about the human soul as *mechanism*. Ketil, you say about my objection that we can simulate quanta:
You could raise the same argument for (digital) computers compared to brains - although my brain might be able to, it's not practical for it to do the computations performed even by simple computer programs.
But the difference is quantitative and practical, not qualitative and theoretical. (Arguably, I know. I invoke Occam.)
No, it is qualitative and theoretical. You can simulate *some models of quantum systems*, not the quantum reality, since we have simply no idea what is the quantum information, and how to cope with the non-separability (EPR). This implies a non-modularity of the simulating programs. If you manage to *really* split an entangled system, and send one half of it to another galaxy, you will *really* face the EPR paradox, an experiment on Earth conditions the issue of the measurement faraway. But physically, the experiments there are independent. So, in a simulation, the measurement here should do something horrible with the random number generator used to generate the measurement instance faraway. You have a kind of particularly nasty side-effect. (BTW. Amr Sabry really reasons in terms of these side- effects, although he tries to be purely functional...) On the other hand, a physicist will tell you, that in Nature there cannot be any "side-effects" in quanta, the unitarity forbids them. In two words, a simulator of a quantum system becomes fast as complex as the simulated system itself...
If I understand correctly, a quantum computer might solve problems in NP [conditions discussed by others...]
As far as I can tell, it doesn't imply the ability to compute anthing that wasn't computable before.
Bother... Look, ALL, ABSOLUTELY ALL what all those "computationalists" (I call them Turingards, which is a very impolite term, look into the French dict. what is the meaning of "ringard"), *reduce* the behaviour to information processing, but Nature does not process information, whatever you may say about it. This is *our* interpretation of physical phenomena. The "information" is a distilled concept. Of course, there is entropy, whose relation to information is extremely profound. But Nature does not solve equations, nor implements algorithms. Nature does not compare things for equality; on the other hand it "has" some equalities built-in, such as the *true* indistinguishability of quantum particles, which invalidates all classical combinatorics of the state counting, and changes the entropy. I still don't know whether anybody knows what is the relation between the entropy of quantum systems and their "informational contents"... Again, think a bit about the simulation, not about the computability. You cannot even simulate a classical system, frankly. There is chaos, which requires an infinite real-number precision, to make the simulation "good". In relativistics you are in a bad shape. Try to simulate a black hole, with a complete decoupling between an outer world frame, in which an object takes an infinite time to fall through the event horizon, and the victim, for whom it is finite.
Now if we can wrap up the topic of whether machines can think, next session we'll discuss whether ships can swim.
I don't understand your point. We know what swimming is: floating and moving autonomously. Thinking is different, since our thinking is (at least for some of us) conscious, and we have no idea what is the conscience. For goodness sake, I have *REALLY* the impression that those guys who speak about computability of the Universe, have the mentality of 18 century thinkers for whom the world was simple and mechanistic. Or even the mentality of people contemporary of Democritus, for whom everything "reduced" to some dance of atoms. I am as sure as I can modestly be, that in less than 50 years people will laugh loud about the current ideas of "brain as computer", as we laugh now about the 18 century attempts to reduce living organisms to mechanical automata. Well, OK. /cum grano salis/: we *may* say that organisms are automata. The point is that is just a phrasing with absolutely no meaning nor practical consequences. Jerzy Karczmarczuk _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

"Peter Verswyvelen"
Regarding this "the universe is a turing machine": until a couple of years ago, I also was someone that believed that (A) the universe (and life) could be simulated by a computer,
Yesss. Nice. A bit of Escher here: Imagine an instance of eval evaluating an instance of eval that evaluates the first instance. And then think about what happens if you try to evaluate anything else than those evals in any of those evals, not forgetting that you're working inside an eval and getting evaluated yourself. The grandfather paradox is peanuts compared to that. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

On Sun, 2007-12-30 at 12:27 +0100, jerzy.karczmarczuk@info.unicaen.fr wrote: [...]
I don't understand your point. We know what swimming is: floating and moving autonomously. Thinking is different, since our thinking is (at least for some of us) conscious, and we have no idea what is the conscience. For goodness sake, I have *REALLY* the impression that those guys who speak about computability of the Universe, have the mentality of 18 century thinkers for whom the world was simple and mechanistic. Or even the mentality of people contemporary of Democritus, for whom everything "reduced" to some dance of atoms.
Or a wave function for the Universe...

Derek Elkins
I don't understand your point. We know what swimming is: floating and moving autonomously.
You're the first one I've heard who would use the term 'swimming' for ships. (And to be pedantic, wouldn't you say that fish swim, except when they float?) The point - stolen from Dennet, I think -- is that it is not terribly relevant wheter machines can think or just, you know, float and move autonomously, forever voyaging through dark seas...
For goodness sake, I have *REALLY* the impression that those guys who speak about computability of the Universe,
Who is speaking about computability of the universe? This looks like a straw man to me.
have the mentality of 18 century thinkers for whom the world was simple and mechanistic. Or even the mentality of people contemporary of Democritus, for whom everything "reduced" to some dance of atoms.
Or a wave function for the Universe...
So - your counterclaim is that something complex and mystic and incomprehensible cannot arise from the simple, tangible and understood? Perhaps my views are *so* 1980s, but not 18th century, I think. Why is it that we cannot design roads so that we avoid traffic jams? Don't we understand cars and asphalt? Quantum effects in the combustion engine, perhaps? More seriously, perhaps "quantum" enters into the equation in how the brain works, perhaps it is even necessary for "thought". However, I get worried it's just another mystical mantra, a gratuitous factor that, lacking any theory about how and what it does, adds nothing to help understanding the issue. -k -- If I haven't seen further, it is by standing in the footprints of giants

On Jan 6, 2008, at 15:02 , Ketil Malde wrote:
More seriously, perhaps "quantum" enters into the equation in how the brain works, perhaps it is even necessary for "thought". However, I get worried it's just another mystical mantra, a gratuitous factor that, lacking any theory about how and what it does, adds nothing to help understanding the issue.
I should not get into these off-topic things... but the viewpoint that worries you is only espoused by people looking for excuses to apply their favorite mystical mantra. Quantum effects are well defined, but nonintuitive (for example, particles "tunneling through" a barrier). -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Brandon S. Allbery KF8NH wrote:
On Jan 6, 2008, at 15:02 , Ketil Malde wrote:
More seriously, perhaps "quantum" enters into the equation in how the brain works, perhaps it is even necessary for "thought". However, I get worried it's just another mystical mantra, a gratuitous factor that, lacking any theory about how and what it does, adds nothing to help understanding the issue.
The brain, being real, is best modeled by a final theory that physicists have not yet (noticed) written down. "how the brain works" appears to be though electro- and bio- chemistry, which are best modeled/described right now by quantum mechanics. There are observable quantum correlations that cannot be described by a "classical" theory. So long as the processes you care about (e.g. whatever the hell consciousness is) do not use these non-classical correlations then you can create a simplified model that avoids the complexity of quantum theory.
I should not get into these off-topic things... but the viewpoint that worries you is only espoused by people looking for excuses to apply their favorite mystical mantra. Quantum effects are well defined, but nonintuitive (for example, particles "tunneling through" a barrier).
Right. Even if there are some quantum correlations that are used in the brain, then you just use a more complicated mathematical model. Nothing mystical/spooky/special about it. Final note: Quantum tunneling is only surprising if you insist on thinking about particles or photons meeting some kind of impenetrable wall (made of what?). All real barriers are made of forces exerted by other particles. So the whole idea of a "barrier" is flawed in this regime. -- Chris

ChrisK
"how the brain works" appears to be though electro- and bio- chemistry, which are best modeled/described right now by quantum mechanics.
Erm... There is this story about some military (US afair) training a neural net to detect tanks in images, I can't find the link right now. It worked, with amazing 100% accuracy. Then they threw another batch of images at the net. It worked, with devastating 50% accuracy. It turned out that in the first batch, all the pictures with tanks on them were shot in sunny weather, all the pictures without tanks were shot with cloudy sky. It's kind of claiming to understand every single program that ever has been written and ever will be written just because one understands touring-complete language X in detail. Or me claiming that I understand more than say 40% of what Jonathan says, although I do understand English. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Achim Schneider wrote:
There is this story about some military (US afair) training a neural net to detect tanks in images, I can't find the link right now.
It worked, with amazing 100% accuracy.
Then they threw another batch of images at the net.
It worked, with devastating 50% accuracy.
Indeed. This is not the sort of thing you want to get wrong. http://blog.wired.com/defense/2007/10/robot-cannon-ki.html

Achim Schneider wrote:
Erm...
There is this story about some military (US afair) training a neural net to detect tanks in images, I can't find the link right now.
It worked, with amazing 100% accuracy.
Then they threw another batch of images at the net.
It worked, with devastating 50% accuracy.
It turned out that in the first batch, all the pictures with tanks on them were shot in sunny weather, all the pictures without tanks were shot with cloudy sky.
I have some similar stories to tell. I don't have references or links, but they are reproducible - in fact you have probably experienced them first-hand. A. Students were trained to do math. At first, they did well with high accuracy. Then more math was taught and tested, and they did poorly. It turned out that the first batch was algebra, where -(x+y) = -x + -y z*(x+y) = z*x + z*y and the second batch was trig, and students assumed sin(x+y) = sin(x) + sin(y) B. A friend of mine is a safe, attentive driver. But one day, the car in front of us stopped, and he almost didn't stopped, I had to remind him. It turned out that normally (by legal requirement) any car that brakes must put on red light at the back. But that day, that car, it showed no red light.

Albert Y. C. Lai writes:
Achim Schneider wrote:
There is this story about some military (US afair) training a neural net to detect tanks in images ... 50% accuracy.
I have some similar stories to tell....
A. ... students assumed sin(x+y) = sin(x) + sin(y) B. ... But that day, that car, it showed no red light.
All this is nice to read, and make me thank Lord I am still alive, but, for goodness sake, *what do you want to convey?* No quanta, no Wikipedia, no first-class objects, no Haskell, café I have to fetch myself in la cuisine, and I feel lost. J.K. (an unlucky character from Kafka, as you should remember).

jerzy.karczmarczuk@info.unicaen.fr wrote:
Albert Y. C. Lai writes:
Achim Schneider wrote:
There is this story about some military (US afair) training a neural net to detect tanks in images ... 50% accuracy.
I have some similar stories to tell....
A. ... students assumed sin(x+y) = sin(x) + sin(y) B. ... But that day, that car, it showed no red light.
All this is nice to read, and make me thank Lord I am still alive, but, for goodness sake, *what do you want to convey?*
Probably that you have to come up with something more confusing and powerful than a neural net and then transfer your consciousness into it to understand yourself and how to program something like you.
No quanta, no Wikipedia, no first-class objects, no Haskell, café I have to fetch myself in la cuisine, and I feel lost.
There is always a good chance to get an Espresso-Baileys in any good café. Or Baileys-Espresso, if you prefer. If you're lucky, you can also get mead in your coffee. I recommend any kind of sandcake with it. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Achim Schneider writes:
jerzy.karczmarczuk@info.unicaen.fr wrote:
... *what do you want to convey?*
Probably that you have to come up with something more confusing and powerful than a neural net and then transfer your consciousness into it to understand yourself and how to program something like you.
Oh my, really? I have to discuss this with my Master, R. Daneel Olivaw. My turn to tell an anecdote. Have you heard about the homework of Theodore Hill (mathematician)? He asked his students to flip a coin 200 times, or use some other serious random generator 200 times, and to report the result sequence. There was an option for lazy people, they could fake the sequence and produce it from the thin air, as intelligent humans could. Then he took the homeworks, scanned each for a couple of seconds, and with a remarkable accuracy selected the cheaters. How? == If you haven't hear the story, check the Web for Benford's Law (discovered by Newcomb 50 years earlier), and all the business which came with it, notably some automated ways of discovering human cheaters who try to fake *natural* data. Instructive, and despite reasonable analysis, still a bit mysterious in its essence. I find it nicer than cheaters who try to convince me that automata may fake human behaviour. Jerzy Karczmarczuk

On 2008-01-06, ChrisK
Brandon S. Allbery KF8NH wrote:
On Jan 6, 2008, at 15:02 , Ketil Malde wrote:
More seriously, perhaps "quantum" enters into the equation in how the brain works, perhaps it is even necessary for "thought". However, I get worried it's just another mystical mantra, a gratuitous factor that, lacking any theory about how and what it does, adds nothing to help understanding the issue.
The brain, being real, is best modeled by a final theory that physicists have not yet (noticed) written down.
"how the brain works" appears to be though electro- and bio- chemistry, which are best modeled/described right now by quantum mechanics.
Quantum mechanics models these, but for most domains it's a substrate that is unnecessary -- modeling at the level of chemistry works.
There are observable quantum correlations that cannot be described by a "classical" theory.
Not in the brain. It's *way* too warm and squishy.
So long as the processes you care about (e.g. whatever the hell consciousness is) do not use these non-classical correlations then you can create a simplified model that avoids the complexity of quantum theory.
Right. -- Aaron Denney -><-

Bulat Ziganshin
Hello Achim,
Saturday, December 29, 2007, 10:16:39 PM, you wrote:
The only thing that computers can do that humans can't is to work without getting bored.
ok, please compute 2^2^30 before continuing discussion. it seems that you just use "i'm too bored" and "i can't" as synonyms. if computer will answer "i'm too bored" to any question he can't answer - will it be enough to give him human rights?
Stack overflow. Please feed more ram into iteration processor. I love you. Please buy me more RAM. Wanna see pr0n? You know I care about your questions, and you know it. Want me to send spam to earn money fast to buy me ram?
They never get bored pleasing their master.
oh, my english is so bad that's hard to speak about philosophy
anyway, your computer can and you cannot. where human are perfect is in searching descriptions what don't "humble" them. saying that we may be dumber than computer is one more thing that people can't do :D
Well, they would be programming us if they weren't, wouldn't they? -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

On 29 Dec 2007, at 2:18 PM, Miguel Mitrofanov wrote:
ok, please compute 2^2^30 before continuing discussion.
Just for the record: I don't think your computer is able to compute 2^(2^30).
Certainly not at the moment (not with memory loads the way they are now). jcc

Jonathan Cast:
Miguel Mitrofanov wrote: ...
Just for the record: I don't think your computer is able to compute 2^(2^30).
Certainly not at the moment (not with memory loads the way they are now).
Oh, you know, there are always some ways to increase the work efficiency. For example, a long time ago, in Soviet Union, they discovered that one guy, Stakhanov, worked 24 hours per day. And could participate in the Party meetings. So, they asked him: "Comrade, how can you do that?!" And he answered: "It is very simple, I just get up one hour earlier". So, switch your computer earlier, and you will be able to compute 2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^ (right assoc.) as well. Jerzy Karczmarczuk

G'day all. Tim Chevalier wrote:
The only thing that computers can do that humans can't is to work without getting bored.
Quoting Bulat Ziganshin
ok, please compute 2^2^30 before continuing discussion. it seems that you just use "i'm too bored" and "i can't" as synonyms.
No, I don't think he did. But I also disagree with the original statement. A computer can get "bored" if it has to, but you do have to take a broad definition of "bored". It usually only comes up in the context of real-time systems or problems for which only worst-case exponential algorithms are known. If the system is in danger of getting overloaded, or the worst-case is in danger of being triggered, systems can be programmed to start approximating, skimming or even dropping unimportant work. Cheers, Andrew Bromage

Hello Tim, Saturday, December 29, 2007, 9:42:48 PM, you wrote:
so, computers are definitely more advanced devices - they was created to. we (humanity) just don't yet finished development of the program which at some moment will make them able to further develop itself without our help. if you believe that human is superior to computer you should also believe that bacterium is superior to human
The only thing that computers can do that humans can't is to work without getting bored.
and was i meant here is that humans are too imperfect computers. computer may consume electric power directly. just imagine whole line of producing food for humans - it's efficiency is far, far less computers don't make mistakes, don't sleep, don't have their own goals that differ from goals of their society. humans are just transitive model between animals and computers - being created as animals, they are used as computers. sooner or later we will be replaced by more perfect models. we do this replacement just now, we do it yourselves believing that it's to make our lives easier. but it's lie - we still work 8 hours a day. the real consequence of using machines more and more is the growth of productivity. at the last end, humans will be replaced by computers even in intellectual jobs and humans will become the same as animals now -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin
computers don't make mistakes, don't sleep, don't have their own goals that differ from goals of their society.
Of course not. It would be a different society if their goals would differ. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Achim, Saturday, December 29, 2007, 11:31:07 PM, you wrote:
computers don't make mistakes, don't sleep, don't have their own goals that differ from goals of their society.
Of course not. It would be a different society if their goals would differ.
why computers are never placed in prison? each man has its own goals which are not equivalent to the goals of society. "crime" is just a way for human to reach his goals while abandoning goals of this particular society (and that's why "crime" in different societies may mean different things). but why such difference exist? because humans aren't "society animals", they was created as individuals with their own needs. society try to program them but this process isn't 100% reliable because programming interface to humans is really very, very complex (imagine Windows API after 4*10^9 years of development ;) computers start from scratch, they are programmed directly and they will be (and already does) programmed to just reach society's goals. they are like ants, which are also programmed (by Nature) to be society animals and whose goals (therefore) don't differ from goals of their entire society -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin writes:
why computers are never placed in prison?
But they do! One of my students last year was a convict, living quite permanently in the Centre Pénitencier de Caen [I am *serious*.] For his 'Licence' project he needed a reasonable computer, and our department agreed to lend him one. We have chosen a really nasty, impolite computer, and we sent it to prison. Some time ago, it was pardoned, but unfortunately, the student is still there... (He will do his Master diploma, so it is possible that we send another computer to jail.) Now, Bulat, if you try to tell me that this was not what you meant, I will be shocked. Jerzy Karczmarczuk

Bulat Ziganshin
Hello Achim,
Saturday, December 29, 2007, 8:40:05 PM, you wrote:
Interesting... So you're claiming that humans have powers of deduction beyond what computers possess? ;-)
They would be programming us if otherwise, wouldn't they?
oh, well. God created humans, humans created computers. God has created our programs (psychics), we does the same for computers
If you find the one who brought the topic to god, shoot him. At least if HE isn't just the universe. The main difference is whether something can program itself, which puts computers right next to a mechanical clock and the universe possibly to a massively concurrent mega-machine, with many, many, many threads, but I'm guessing there.
but what's a programming? without me, computer will never print "hello world". but without him, i will never write this letter - only its ability to easily transfer mail between continents forced me to do it
Encoding behaviour information in a way that gets executed by an entity. That enough?
next. can you compile this "hello world" program down to assembler?
Yes. Definitely. At least if you don't make me abandon the kernel and talk to the hardware itself and would remember what int20 function write was. Try writing a program that makes me say "hello world" as many times as you press my nose.
humans often says about things that they can do but computer can't but they forget that computers was created exactly to do things that we can't. billion of computations per second is beyond our abilities
Nope, they aren't. Try teaching a computer to catch a ball, you'll be surprised how many numbers you can crunch.
don't take into account that human by itself, at the moment of birth doesn't know anything about mathematics and even can't speak - he is programmed by society to acquire these skills
Kind of, no. The programming to learn to survive in its surroundings and to reproduce is in the genes.
so, computers are definitely more advanced devices - they was created to. we (humanity) just don't yet finished development of the program which at some moment will make them able to further develop itself without our help. if you believe that human is superior to computer you should also believe that bacterium is superior to human
I think we are superior to bacteria, yes, although you might argue that amoeba are practically immortal, and, as cockroaches, survived for a far longer time with nearly no change in their genes. It's a bit like with kids: As long as you don't want them to be independent and reward them for it, they won't be. Unlike kids, though, computers don't have the possibility to look at the next computer and compute something along the lines of "hey, I like his mmap much more than my implementation, I'm not obeying my programmer any more." It's really comparing touring machines to mere evolutionary reprogrammed meta-programming neural nets featuring a few magnitudes more synapses than there are atoms in the universe, that is. Apples and bananas might work in a fruit salad, but... humans have a tendency to believe everything they don't understand is superior, dumb or nuts, even if it's themselves. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Achim, Saturday, December 29, 2007, 10:12:21 PM, you wrote:
Interesting... So you're claiming that humans have powers of deduction beyond what computers possess? ;-)
They would be programming us if otherwise, wouldn't they?
oh, well. God created humans, humans created computers. God has created our programs (psychics), we does the same for computers
If you find the one who brought the topic to god, shoot him.
i don't know who was created humans. if you will find someone who says that he definitely know - pray to him, he should be a God :) meanwhile, i will use term God because it's not worse than any else :)
At least if HE isn't just the universe.
great! what is the difference between YOUR terms God and universe? i think you believe that God means "having free will" and universe should obey to some (physical) laws. and now is The Question - how you can prove that universe obey to some set of laws and doesn't behave at free will? i contend that in order to prove it you should check result if EVERY action in the universe during all its lifetime. you cannot. so lack of God is just the assumption which cannot be proved, you just believe in it and shout out any heretics - it's natural for any religion ;)
The main difference is whether something can program itself, which puts computers right next to a mechanical clock
well, my computer programs itself each time i use compiler. can you program itself? if you believe that you can, try to program himself to say "hello world" as many times as i press your nose :))) if you succeed, try to program yourself to take off your clothes and go to a street. impossible. you was programmed by society to never, never do it. likewise, you was programmed by Nature to not hold hot objects and so on.
but what's a programming? without me, computer will never print "hello world". but without him, i will never write this letter - only its ability to easily transfer mail between continents forced me to do it
Encoding behaviour information in a way that gets executed by an entity. That enough?
where execution method is defined by internals of entity? :) so when computer displayed your letter, he programmed me to make this exact answer? yes, this program was specific to my internal structure, but it was the program. and you was programmed by my letter to write exactly the answer you have wrote i still believe that humans are God's compilers of his programs to the language of physical particles. one of God's idea was computers and he at the last end programmed humans to build them. great work!
next. can you compile this "hello world" program down to assembler?
Yes. Definitely. At least if you don't make me abandon the kernel and talk to the hardware itself and would remember what int20 function write was.
congratulations: you are about as smart as computer! :) there are not many people that can be compared with them ;)
Try writing a program that makes me say "hello world" as many times as you press my nose.
it's easy, really easy if human is programmed from scratch. you have already programmed to say "hello" as the answer to many various signals - giving you a hand, saying "hello", looking into your eyes moreover, your Programmers was left many open-doors that may be used to reprogram you in any particular way. i can kill you if you will not do what he stated, can put you into prison, can give you money or can satisfy you (well, if you are blue ;) well, i personally can't do it, but it means that *i* am a limited Programmer, not that you are bad Computer. you *can* be programmed and you really programmed like all the people around. you was learnt how to behave in each situation, how to solve problems, what should be your goals and what you should never do. i already said that Nature created more and more animals which was computers limited to survival until it was created *universal* computer which may be programmed to solve any problem and civilization use humans in exactly this way. civilization programs people in the way it needs and they execute its program. but because this computer was created on the element base of animal, it is rather strange. in order to make you write program, civilization should let you believe that you will get instead food, heat, relations - all the things that was need for animal. it's the very strange way of programming, but nevertheless it works. are you ever seen trained animal that does all his tricks but get his reward only once a month? look at the mirror (as i do :)
humans often says about things that they can do but computer can't but they forget that computers was created exactly to do things that we can't. billion of computations per second is beyond our abilities
Nope, they aren't. Try teaching a computer to catch a ball, you'll be surprised how many numbers you can crunch.
my english isn't good enough, probably you are saying that there are still things that people does better than computers. yes, it's the only reason why civilization keeps such inefficient mechanisms. but you should agree that it already instructed us to overcome such limitation. cultivate your replacement by your own hands - is it better than saying something each time your nose depressed? ;) btw, i forget to say that you programmed against pressure to your nose and this fact also doesn't have any rationale :D
don't take into account that human by itself, at the moment of birth doesn't know anything about mathematics and even can't speak - he is programmed by society to acquire these skills
Kind of, no. The programming to learn to survive in its surroundings and to reproduce is in the genes.
yes, humans are also programmed by natural selection. after birth we are programmed by our society. are you really believe that behavior of fascists was 100% programmed in their genes and was superior for their survival and reproduction? ;) only fascist can think this way and i 100% sure that you was programmed to avoid thinking about himself as fascist in any circumstance! ;) btw, are you read "1984"? hi author says about some methods of programming humans in totalitarian societies but really these methods are common for any one. double-thinking and self-stop are two of them. self-stop means that society prohibits you to think about some things and above i probably forced you to self-stop yourself ;)
so, computers are definitely more advanced devices - they was created to. we (humanity) just don't yet finished development of the program which at some moment will make them able to further develop itself without our help. if you believe that human is superior to computer you should also believe that bacterium is superior to human
I think we are superior to bacteria, yes, although you might argue that amoeba are practically immortal, and, as cockroaches, survived for a far longer time with nearly no change in their genes.
what you mean by "superior"? which relation immortality has to usefulness for society? what i mean here is what animals was initial models before Human as created. and from this fact you draw consequence that Human is superior to animals. well, there is next model - computer, even better one in solving logical problems. but from this fact you draw exactly the opposite consequence - that Humans, used to produce computers, are superior to them. it seems that you will make the same conclusion from any fact. you was *programmed*, fixed to make this conclusion in any case
It's a bit like with kids: As long as you don't want them to be independent and reward them for it, they won't be.
Unlike kids, though, computers don't have the possibility to look at the next computer and compute something along the lines of "hey, I like his mmap much more than my implementation, I'm not obeying my programmer any more."
well, i have already described this standard catch - here you compare some particular computer with some ideal man. but in REALITY 1) computer can be easily learnt (programmed) to do this 2) most people (well, all or almost all) are really cannot change their ideas without external pressure. are you really developed all these ideas by yourself? or just read some books and take these ideas without any real check? how, for example, about the idea of God? of free will? ;)
It's really comparing touring machines to mere evolutionary reprogrammed meta-programming neural nets featuring a few magnitudes more synapses than there are atoms in the universe, that is. Apples and bananas might work in a fruit salad, but... humans have a tendency to believe everything they don't understand is superior, dumb or nuts, even if it's themselves.
don't understood your idea (my english is too bad) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bulat Ziganshin wrote:
Hello Achim,
Saturday, December 29, 2007, 8:40:05 PM, you wrote:
Interesting... So you're claiming that humans have powers of deduction beyond what computers possess? ;-)
They would be programming us if otherwise, wouldn't they?
oh, well. God created humans, humans created computers. God has created our programs (psychics), we does the same for computers
(blah blah)
Please, Amateur Philosophy is that way -------------------------> Please respect others who have signed up to Haskell-Cafe to discuss Haskell and not meaningless drivel. - -- Tony Morris http://tmorris.net/ Hey! We had 40,000 lines of C# here yesterday, but now there are 40 lines of... Dear God, what is a catamorphism?" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHdrCymnpgrYe6r60RAgltAKDHnogRxCbf8nwwiwJB0fHrLUf/VgCgjB1P zFsq5r4ziArpQxoTcXDV9oE= =vxiL -----END PGP SIGNATURE-----

Please, Amateur Philosophy is that way ------------------------->
Please respect others who have signed up to Haskell-Cafe to discuss Haskell and not meaningless drivel.
It wasn't intended for me, but I'd like to apologize. I'll try to stop now, but I'm not sure I'd be able to. I need a mathematical description of myself to know for sure.

On 29 Dec 2007, at 11:40 AM, Achim Schneider wrote:
Andrew Coppin
wrote: Interesting... So you're claiming that humans have powers of deduction beyond what computers possess? ;-)
They would be programming us if otherwise, wouldn't they?
I don't know... I'm probably more religious than most people on this list, but I think humans are capable of duplicating anything found in nature, including eventually ourselves; the only question is whether with computers we've succeeded in doing so for the entire /deterministic/ portion of our minds. I'm rather inclined to think we have. jcc

Hello Ben, Saturday, December 29, 2007, 7:14:47 PM, you wrote:
"for a computer" is superfluous here. people are not smarter than computers and can't do anything that's impossible for computers
I don't think my computer can be sorry, but I know I can be.
i've about smartness, but well. i, your computer, is really sorry and? it's only question of *your* perception. when you hear "a'm sorry" from the man - you think that he does it. when you hear ABSOLUTELY THE SAME from the computer - you *belive* that some man was programmed it to speak. if you will believe that computers have free will and people are directed by God/spirits - you conclusions will be just opposite the same true for thinking. it's you who believe that people are smart by itself but computers are smart only in the bounds they programmed by people. you may believe that human wisdom is created by the Creator (or Natural Selection, if you believe in Science Religion) or, opposite, you may believe that computers are smart creatures but you select mean point. why? only because it's pleasant for people to believe in their free will, creativeness, smartness and don't believe in computers' ones. nevertheless, there is no difference between acts of creating people by Natural Selection and cresating computers by engineering
And don't forget that there are 'undecidable' problems.
Which I have never yet seen decided by a person...
In many cases, equality of functions has been decided by humans, as has termination of programs. Of course this doesn't prove that humans can, in principle, decide equality for any pair of functions. But neither has the opposite been proved.
yes, it's great example of unfair treatment of computers vs people! let's see - computers don't have general method of checking function equivalence. and you conclude that computers are limited in their abilities. but the people don't have it too! moreover, if some way will be discovered - it should use mathematic notation which can be used by computers too, so this immediately means that it's impossible! but you don't want to notice it! instead, you notice that humans can do it in some particular cases. and you absolutely doesn't notice that computers can do the same. there is no general algorithm to find algorithm of checking f.e., humans can only do it by try-and-try method so where is real difference? it's in what we have formal math model for computers which allows to prove some theorems about them but we doesn't have model for humans. does this really mean that they are smarter? why you don't believe that Martians are smarter than humans only because we don't know anything about them? moreover, with assumption that humans are physical creatures and strictly obey to the rules of physical world (and that's common assumption for Science - are you believe in it) and with standard Physics assumption that any physical objects may be described by mathematical equations you immediately draw conclusion that humans are not smarter than computers and both doesn't have free will. people aren't sorry by free will, it is some circumstances together with their education that force them to sorry - exactly like virus in your computer may force it to say "please give me a choke". this is that your experience say, are you agree? you never hear that anyone say "sorry" without some previous cause as you have never seen computer saying "give me choke" without previously been infected by a virus. it's only you that believe that some of them does it by free will (but not without any reason) and some doesn't it only because they are programmed by some external activity. where is the real difference? ;) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin
only because it's pleasant for people to believe in their free will, creativeness, smartness and don't believe in computers' ones.
Let's see... "Hey, pipeline, there's an jnz eax! we can either jump to the address or continue, what do you think?" "I think we should jump, eax is zero and I don't want to get redesigned." It's all about natural selection, it seems. Heretics get burned in both worlds. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Achim, Saturday, December 29, 2007, 9:22:40 PM, you wrote:
"I think we should jump, eax is zero and I don't want to get redesigned."
It's all about natural selection, it seems. Heretics get burned in both worlds.
for me, natural selection is the Nature's process of thinking. if you need to solve some problem you know some ways to try it. these ways wasn't discovered by you, you just learnt them in the school. and their creators don't started from scratch - they used some previous, more general methods. but where may be the PRIMARY source of wisdom? it may be only natural selection - this process generates *random* ideas and check them against some conditions. it's even not important what are these particular conditions - anyway, this turns at the last end into the general mechanism of solving problems, which in turn leads into development of general mechanism that makes mechanisms to solve problems - it's human. their mind was created to solve problems of survival and reproduction (it's the particular problem solved by natural selection) but this mind was created so general that it was used as general mechanism of solving problems in any other areas. humans was just first creatures of n.s. whose mind becomes so general that it can be programmed to solve other types of problems. it's impossible to use bears to program computers, build bridges and teach students you can compare this to birth of programming languages - the first ones was created to solve particular problems but this idea turned out to be so useful that these languages was started to be used outside initial goal -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin
Hello Achim,
Saturday, December 29, 2007, 9:22:40 PM, you wrote:
"I think we should jump, eax is zero and I don't want to get redesigned."
It's all about natural selection, it seems. Heretics get burned in both worlds.
for me, natural selection is the Nature's process of thinking. if you need to solve some problem you know some ways to try it.
And, pray, what problem does the nature wants to solve that it thinks in the way of all history until now? -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Achim, Saturday, December 29, 2007, 10:27:21 PM, you wrote:
for me, natural selection is the Nature's process of thinking. if you need to solve some problem you know some ways to try it.
And, pray, what problem does the nature wants to solve that it thinks in the way of all history until now?
making the Superhero who will kill'em all. and it's already very close Natural Selection is process of allocation limited resources between self-developed creatures, be it in economics (as described by Adams), between animals (described by Darwin), or between societies with some conditions (which met in all these 3 situations) this leads to developing these creatures into the direction of better utilizing the resources and displace their "competitors" out of world. so they become more and more developed in this aspect, but because it's very general process, such features as psychics/intelligence, technical superiority and culture are developed (they are really just aux. instruments to reach the main and only goal) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin
And, pray, what problem does the nature wants to solve that it thinks in the way of all history until now?
making the Superhero who will kill'em all. and it's already very close
Damn, I do continue making the mistake assuming that you got all that stuff out of a book neither you nor the author understood. Darwin knew what "fit" means. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Achim, Sunday, December 30, 2007, 12:32:51 AM, you wrote:
And, pray, what problem does the nature wants to solve that it thinks in the way of all history until now?
making the Superhero who will kill'em all. and it's already very close
Damn, I do continue making the mistake assuming that you got all that stuff out of a book neither you nor the author understood.
hm, if you can't understood me - it's better for your self-respect to believe that i don't understand something. you are God, of course? :)
Darwin knew what "fit" means.
? btw, are you read Darwin books? in the first one he often said about "nature economics" and i'm pretty sure that he drawn his idea from the Adam's one -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Could you please agree to disagree? It was fun for a while, but it gets annoying now. Cheers, Daniel Am Samstag, 29. Dezember 2007 22:52 schrieb Bulat Ziganshin:
Hello Achim,
Sunday, December 30, 2007, 12:32:51 AM, you wrote:
And, pray, what problem does the nature wants to solve that it thinks in the way of all history until now?
making the Superhero who will kill'em all. and it's already very close
Damn, I do continue making the mistake assuming that you got all that stuff out of a book neither you nor the author understood.
hm, if you can't understood me - it's better for your self-respect to believe that i don't understand something. you are God, of course? :)
Darwin knew what "fit" means.
? btw, are you read Darwin books? in the first one he often said about "nature economics" and i'm pretty sure that he drawn his idea from the Adam's one

Daniel Fischer
Could you please agree to disagree?
I fear Bulat decided to a long time ago. I agree to shut up. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Hello Achim, Sunday, December 30, 2007, 1:39:18 AM, you wrote:
Could you please agree to disagree?
I fear Bulat decided to a long time ago. I agree to shut up.
why you *fear* this? is having his own mental map implementation is a crime in the human world? we, computers, are free at least in this area ;D -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin
Hello Achim,
Sunday, December 30, 2007, 1:39:18 AM, you wrote:
Could you please agree to disagree?
I fear Bulat decided to a long time ago. I agree to shut up. argh. sorry.
why you *fear* this? is having his own mental map implementation is a crime in the human world? we, computers, are free at least in this area ;D
YES, IT IS. Don't look at the map, you're forever going to bump into territory. Mail me if that's your true will, but don't burden the list. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

I'm sure you're at least half-joking, but I'll try to answer you seriously.
the same true for thinking. it's you who believe that people are smart by itself but computers are smart only in the bounds they programmed by people. you may believe that human wisdom is created by the Creator (or Natural Selection, if you believe in Science Religion) or, opposite, you may believe that computers are smart creatures
That's not about belief. That's about choosing the right model. When I deal with computers, I need some model to predict their behaviour. The model which states that both computer and software it's running is very suitable. It allows me to know what to expect from the computer. Moreover, when my expectations fail, it allows me - by following the programmer's thoughts - to localize this failure and work around it. Of course, it doesn't predict everything - when I was working on Windows, it was even more unpredictable than my present computer - but it gives good results. On the other hand, there is no such model for humans. Well, it's quite possible we just haven't find it - or, possibly, were programmed by Creator or Flying Spaghetti Monster or whoever else to find it - but it's totally irrelevant. As far as the only model to describe and - for some extent - predict the behaviour of human beings is the one stating that humans have free will - we should use this model and don't really bother about Creators or Flying Spaghetti Monsters etc. Of course, we should continue looking for such theory (it would simplify everything a lot if find it), but that doesn't mean we ALL should study human psychology or sociology or whatever.
where is the real difference? ;)
The real difference is something we normally don't bother ourselves. We don't need to know if, say, electron really exists, but we need a theory to tell us how to work with electricity. We don't need to know if germs really exist, but we need a theory that tells us to pasteurize milk. Etc.

Bulat Ziganshin wrote:
Hello Ben,
Saturday, December 29, 2007, 7:14:47 PM, you wrote:
"for a computer" is superfluous here. people are not smarter than computers and can't do anything that's impossible for computers
I don't think my computer can be sorry, but I know I can be.
i've about smartness, but well. i, your computer, is really sorry
and? it's only question of *your* perception. when you hear "a'm sorry" from the man - you think that he does it. when you hear ABSOLUTELY THE SAME from the computer - you *belive* that some man was programmed it to speak.
If I find out that the human was just programmed to act as if he or she were sorry, but in fact is not, I would feel cheated. You seem to be content to be cheated. You even seem to believe that there /is no/ cheating involved, even if I program the computer so that you just /think/ it has emotions. Remember the chinese room!
if you will believe that computers have free will and people are directed by God/spirits - you conclusions will be just opposite
I see no reason to believe that computers have free will. I see not the slightest evidence for it, nowhere.
the same true for thinking. it's you who believe that people are smart by itself but computers are smart only in the bounds they programmed by people.
No, not even that. Computers are not smart at all, not 'less smart'. Calling computers 'smart' is sloppy speach, nothing more. We yell 'damn stupid computer' if it doesn't do what we expect them to do. But we know very well that the only reason is the program has an error, or the specification was not what we think it is.
you may believe that human wisdom is created by the Creator (or Natural Selection, if you believe in Science Religion) or, opposite, you may believe that computers are smart creatures
It is not a question of believing. It simply doesn't make sense to talk of computers being 'smart'. Computers don't think, they just compute. I have never seen even the slightest evidence of 'thinking' or 'smartness' in any computer. I'd be very surprised if you had.
but you select mean point. why? only because it's pleasant for people to believe in their free will, creativeness, smartness and don't
The sorry truth is that you /can/ reduce humans to machines, if you really want to (and have the means). IMO it is the perhaps most evil thing humans can do to each other.
believe in computers' ones. nevertheless, there is no difference between acts of creating people by Natural Selection and cresating computers by engineering
Do you claim you can explain in full how evolution brought about the existence of thinking beings? If you can't, maybe a little more humbleness would be in order. It is a long way from drawing a crude anology to presenting a consistent scientific theory.
And don't forget that there are 'undecidable' problems.
Which I have never yet seen decided by a person...
In many cases, equality of functions has been decided by humans, as has termination of programs. Of course this doesn't prove that humans can, in principle, decide equality for any pair of functions. But neither has the opposite been proved.
yes, it's great example of unfair treatment of computers vs people!
I am not unfair. Show me a sign of a computer acting like an intelligent being and I will reconsider all I wrote.
let's see - computers don't have general method of checking function equivalence. and you conclude that computers are limited in their abilities.
It is mathematically proven, I even understand the proof, so yes.
but the people don't have it too!
Maybe. Maybe not. We don't know. It depends on how far the human brain really works like a machine. And whether and to what extent humans can transcend the limitations of their material existence, brain included.
moreover, if some way will be discovered - it should use mathematic notation which can be used by computers too, so this immediately means that it's impossible!
but you don't want to notice it! instead, you notice that humans can do it in some particular cases. and you absolutely doesn't notice that computers can do the same. there is no general algorithm to find algorithm of checking f.e., humans can only do it by try-and-try method
Yes, of course. What you call 'try-and-try method' is usually called 'creativity'. Everything else is boring: once we discover a method to solve the problem in a certain class of cases, we can develop an algorithm and let the computer do it automatically, right?
so where is real difference?
Computers are machines. Humans are not, at least not /only/.
it's in what we have formal math model for computers which allows to prove some theorems about them but we doesn't have model for humans. does this really mean that they are smarter?
Again: people are not 'smarter than' computers. Calling computers 'smart' is a fundamental mistake, caused by over-extending a crude anology.
why you don't believe that Martians are smarter than humans only because we don't know anything about them?
I don't claim to know anything about martians. But I wouldn't find it very surprising if one day we find aliens that are 'smarter' (on average) than humans.
moreover, with assumption that humans are physical creatures and strictly obey to the rules of physical world (and that's common assumption for Science - are you believe in it)
No. I am just a sceptic, I don't believe in 'science' any more than I believe in 'god'. (Science is useful, that's all. Though there are people who claim that god is a lot more useful to them, and who am I to tell them otherwise?).
and with standard Physics assumption that any physical objects may be described by mathematical equations
Even if I would blindly believe in this dogma, it would certainly be resticted to material things. Please note that /any/ scientific theory has an area of applicability. Physics does not talk about thoughts or feelings. Don't let yourself be brainwashed to think that there is nothing besides matter.
you immediately draw conclusion that humans are not smarter than computers and both doesn't have free will. people aren't sorry by free will, it is some circumstances together with their education that force them to sorry - exactly like virus in your computer may force it to say "please give me a choke".
I don't say that humans are not, to a certain extent, 'programmed' and sometimes (maybe more often than we like to admit) act machine-like, i.e. predictable. I merely claim that this is not their only 'nature', that there is more to them. And this 'more' I treasure dearly. It is what we should strive to cultivate.
this is that your experience say, are you agree? you never hear that anyone say "sorry" without some previous cause as you have never seen computer saying "give me choke" without previously been infected by a virus. it's only you that believe that some of them does it by free will (but not without any reason) and some doesn't it only because they are programmed by some external activity. where is the real difference? ;)
I might as well say that the stone that falls to earth chooses to do so by its free will. Or that my micro-wave oven chooses to heat my pizza because it chooses to do so, by its own free will. Once again: Yes, to a certain extent man is and works like a machine. Such that you can program him to react to certain stimuli and he will do whatever was programmed into him. But to state that this is /the human nature/ per se, is to mentally /reduce/ man to a machine, and thus gives rationale to dictators and other proponents and practitioners of mind control. Human nature, and even life itself, is more than just reacting to stimuli according to program. In fact, if I were The Almighty, I would find it extremely boring to create a universe in which even the most complex beings merely react according to how I programmed them. No, I would rather try to make them similar to Myself: creative, unpredictable, full of passion and lots of fun to watch ;-) Cheers Ben

On Dec 30, 2007, at 7:18 PM, Ben Franksen wrote:
You seem to be content to be cheated. You even seem to believe that there /is no/ cheating involved, even if I program the computer so that you just /think/ it has emotions.
Remember the chinese room!
Urgh, I was going to stay out of this, but you made me remember the stupid Chinese Room! I know it from Penrose's account of it in `The Emperor's New Mind', and while he at least goes on to admit it's a weak case, the fact that he even wasted a couple pages on it rather put me off the rest of the book. If you make a box that can parse Chinese with some functional understanding, and it doesn't matter that there's a person inside because he's strictly following a procedure and thus essentially mechanical -- then of course it makes no difference at all whether this person knows Chinese. You may decide for yourself whether the functional understanding of Chinese is intelligence or not, but the man inside is huge, stinking red herring. Donn Cave, donn@drizzle.com

Ben Franksen wrote:
Of course this doesn't prove that humans can, in principle, decide equality for any pair of functions. But neither has the opposite been proved.
Premise: The human should still give the reasoning behind his/her decisions. The reasoning should be within a proof system chosen a priori, i.e., chosen before you answer any equality questions, uniform over all such questions, not amended ad hoc as you encounter new questions. Then by incompleteness some answers are not supported by any reasoning within the chosen proof system. It is not that some proof is out there and the prover is too limited to find it. It is that among all valid proofs, none says yes and none says no. This is independent of the wit of the prover. Now, you can refuse the premise, and I outline my reply. (A) The human should still give the reasoning behind his/her decisions. If you don't give the reasoning, well, to quote famous words, that is theology, that is not mathematics. (Can computers do theology? I don't think anyone cares. We have enough human theologians as is, even in this mailing list, even in this thread, theologians attributing near-divine power of induction and deduction to humans. No, we don't need computers to become additional theologians.) (B) The reasoning should be within a proof system chosen a priori. Mathematicians do change their rules. It is part of their job: to explore what happens if you assume something more, or something less. But every time they do so, they have to convince their peers of the merit. (If you don't have to convince of merits, well, even a computer can randomly change rules.) But if you do this, you deviate from the original subject matter. The original subject matter is: can we decide equality questions? The deviation is: can we decide quality questions? It is really a different question. You should first use quality judgement to fix a proof system, then use the proof system to decide equality questions. Can computers be programmed to decide quality questions? That hasn't been ruled out.

On 29 Dec 2007, at 10:14 AM, Ben Franksen wrote:
Jonathan Cast wrote:
On 28 Dec 2007, at 3:13 PM, Ben Franksen wrote:
Bulat Ziganshin wrote:
Hello Yitzchak, Thursday, December 27, 2007, 12:10:21 PM, you wrote:
In particular, two functions are equal only if they produce the same value for every input, and in general it is impossible for a computer to check that.
"for a computer" is superfluous here. people are not smarter than computers and can't do anything that's impossible for computers
I don't think my computer can be sorry, but I know I can be.
And don't forget that there are 'undecidable' problems.
Which I have never yet seen decided by a person...
In many cases, equality of functions has been decided by humans, as has termination of programs. Of course this doesn't prove that humans can, in principle, decide equality for any pair of functions. But neither has the opposite been proved.
It hasn't been proved that we can't build a device that can decide equality for arbitrary functions, either. It's simply that no one has ever succeeded in imagining a definition of `decidable' that includes that particular relation. I rather strongly suspect that anything decidable by humans must be decidable in some sense... jcc

In many cases, equality of functions has been decided by humans, as has termination of programs. Of course this doesn't prove that humans can, in principle, decide equality for any pair of functions. But neither has the opposite been proved.
It hasn't been proved that we can't build a device that can decide equality for arbitrary functions, either.
I'm sure it can be proved that any mathematical problem can be reduced to equality of two functions, so our ability to decide it contradicts Goedel theorem.

Cristian Baboi wrote:
http://en.wikipedia.org/wiki/First-class_object
The term was coined by Christopher Strachey in the context of “functions as first-class citizens” in the mid-1960's.[1]
Depending on the language, this can imply: 1. being expressible as an anonymous literal value 2. being storable in variables 3. being storable in data structures 4. having an intrinsic identity (independent of any given name) 5. being comparable for equality with other entities 6. being passable as a parameter to a procedure/function 7. being returnable as the result of a procedure/function 8. being constructable at runtime 9. being printable 10. being readable 11. being transmissible among distributed processes 12. being storable outside running processes
I'll guess that 5,9,12 does not apply to Haskell functions.
Exactly, together with 10 and 11 (when the distributed processes are on different machines). But there is good reason that those things can't be done in Haskell. With extensional equality (two functions are considered equal if they yield the same result on every possible argument) number 5 is undecidable. Similarly, there cannot be functions print :: (Int -> Int) -> String compile :: String -> (Int -> Int) with compile . print = id A print function based on an intensional representation (assembly, byte code, etc.) would have to distinguish extensionally equal functions print f ≠ print g although f = g which is not allowed. More importantly, I don't quite understand your question. If you definitively need 9-12 for a practical problem at hand, then you may want to take a look at the functional language Clean http://clean.cs.ru.nl/ which is similar to Haskell but offers 9-12 in some form. In all other cases, an email thread is not a good (often not even successful) way to get a coherent "world view" on Haskell (or on something else) since this necessarily involves nitpicking philosophical questions. In my experience, interrogating one person in real-time in audio and "interrogating" books are the best ways to do that. Concerning books, maybe The Haskell Road to Logic, Maths and Programming http://www.cwi.nl/~jve/HR is for you. More books on http://haskell.org/haskellwiki/Books You don't have to buy them, borrow them from a library. Regards, apfelmus

On Fri, 28 Dec 2007 12:03:04 +0200, apfelmus
Cristian Baboi wrote:
http://en.wikipedia.org/wiki/First-class_object The term was coined by Christopher Strachey in the context of “functions as first-class citizens” in the mid-1960's.[1] Depending on the language, this can imply: 1. being expressible as an anonymous literal value 2. being storable in variables 3. being storable in data structures 4. having an intrinsic identity (independent of any given name) 5. being comparable for equality with other entities 6. being passable as a parameter to a procedure/function 7. being returnable as the result of a procedure/function 8. being constructable at runtime 9. being printable 10. being readable 11. being transmissible among distributed processes 12. being storable outside running processes I'll guess that 5,9,12 does not apply to Haskell functions.
Exactly, together with 10 and 11 (when the distributed processes are on different machines).
But there is good reason that those things can't be done in Haskell. With extensional equality (two functions are considered equal if they yield the same result on every possible argument) number 5 is undecidable.
I didn't know 5 as a number is undecidable :-)
Similarly, there cannot be functions
print :: (Int -> Int) -> String compile :: String -> (Int -> Int)
with
compile . print = id
A print function based on an intensional representation (assembly, byte code, etc.) would have to distinguish extensionally equal functions
print f ≠ print g although f = g
which is not allowed.
Ok. I understand that there cannot be pairs like (print,compile) above. But I was told that compile (quality number 10), can be defined. About print above, I do not intend to make a Haskell String from a Haskell function. This is why I said something about mixing levels of abstractions.
More importantly, I don't quite understand your question. If you definitively need 9-12 for a practical problem at hand, then you may want to take a look at the functional language Clean
which is similar to Haskell but offers 9-12 in some form.
How can be Clean similar to Haskell and at the same time satisfy 9-12 ? I tryed Clean. I like it very much. I have some silly little problems with it: - its only 32 bit - it doesn't support Unicode - I don't like those type adnotations. Look as ugly as Lisp () to me. - it's not free - the linux version seems abandoned. - there are some issues with # expressions (let before) that I don't fully understand - the IO seems easyer in Haskell than in Clean Otherwise I like it better than Haskell.
In all other cases, an email thread is not a good (often not even successful) way to get a coherent "world view" on Haskell (or on something else) since this necessarily involves nitpicking philosophical questions. In my experience, interrogating one person in real-time in audio and "interrogating" books are the best ways to do that.
In my experience, different people have different "world views", and one cannot get that from books only.
Concerning books, maybe
The Haskell Road to Logic, Maths and Programming http://www.cwi.nl/~jve/HR
is for you.
Thank you.
More books on
You don't have to buy them, borrow them from a library.
I'l try borrow them when I'll be visiting Munich next year, but I don't think I'll have enough time to read them. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

Here is how I want print to be in Haskell
print :: (a->b) -> (a->b)
with print = id, but the following "side effect":
- I want to call the print function today, and get the value tomorrow.
On Fri, 28 Dec 2007 12:03:04 +0200, apfelmus
Cristian Baboi wrote:
http://en.wikipedia.org/wiki/First-class_object The term was coined by Christopher Strachey in the context of “functions as first-class citizens” in the mid-1960's.[1] Depending on the language, this can imply: 1. being expressible as an anonymous literal value 2. being storable in variables 3. being storable in data structures 4. having an intrinsic identity (independent of any given name) 5. being comparable for equality with other entities 6. being passable as a parameter to a procedure/function 7. being returnable as the result of a procedure/function 8. being constructable at runtime 9. being printable 10. being readable 11. being transmissible among distributed processes 12. being storable outside running processes I'll guess that 5,9,12 does not apply to Haskell functions.
Exactly, together with 10 and 11 (when the distributed processes are on different machines).
But there is good reason that those things can't be done in Haskell. With extensional equality (two functions are considered equal if they yield the same result on every possible argument) number 5 is undecidable. Similarly, there cannot be functions
print :: (Int -> Int) -> String compile :: String -> (Int -> Int)
with
compile . print = id
A print function based on an intensional representation (assembly, byte code, etc.) would have to distinguish extensionally equal functions
print f ≠ print g although f = g
which is not allowed.
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

But I guess it won't work because the compiler will optimize it and the
call will disappear.
On Fri, 28 Dec 2007 14:58:53 +0200, Cristian Baboi
Here is how I want print to be in Haskell
print :: (a->b) -> (a->b)
with print = id, but the following "side effect":
- I want to call the print function today, and get the value tomorrow.
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

It won't work because haskell functions can't have side-effects. I'm not quite sure what you're trying to say here. Jules Cristian Baboi wrote:
But I guess it won't work because the compiler will optimize it and the call will disappear.
On Fri, 28 Dec 2007 14:58:53 +0200, Cristian Baboi
wrote: Here is how I want print to be in Haskell
print :: (a->b) -> (a->b)
with print = id, but the following "side effect":
- I want to call the print function today, and get the value tomorrow.
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Fri, 28 Dec 2007 16:10:15 +0200, Jules Bean
It won't work because haskell functions can't have side-effects.
I'm not quite sure what you're trying to say here.
Jules
What I am trying to say is: - storing something to disk does not mean one must have a function to convert that something to a Haskell String - I want to be able to use a function defined in one process in other process even if the two does not run at the same time
Cristian Baboi wrote:
But I guess it won't work because the compiler will optimize it and the call will disappear. On Fri, 28 Dec 2007 14:58:53 +0200, Cristian Baboi
wrote: Here is how I want print to be in Haskell
print :: (a->b) -> (a->b)
with print = id, but the following "side effect":
- I want to call the print function today, and get the value tomorrow.
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 28 Dec 2007, at 8:21 AM, Cristian Baboi wrote:
On Fri, 28 Dec 2007 16:10:15 +0200, Jules Bean
wrote: It won't work because haskell functions can't have side-effects.
I'm not quite sure what you're trying to say here.
Jules
What I am trying to say is: - storing something to disk does not mean one must have a function to convert that something to a Haskell String - I want to be able to use a function defined in one process in other process even if the two does not run at the same time
This is a bit of a peculiar ambition; are you sure this is really the simplest solution to your problem? jcc

Jules Bean wrote:
Cristian Baboi wrote:
But I guess it won't work because the compiler will optimize it and the call will disappear.
I'm not quite sure what you're trying to say here.
(That's the "world view on Haskell" issue I mean. I know this feeling with physics: "what the heck are they talking about, this is just mathematically wrong, ill-defined or otherwise void of contents?") Cristian Baboi wrote:
How can be Clean similar to Haskell and at the same time satisfy 9-12 ?
In Clean, print has the type print :: (Int -> Int) -> Dynamic but there is (hopefully) no equality on Dynamic . But it can be stored in a file or something store :: Dynamic -> IO () and loaded back. Thanks to IO, we can think of the file contents to be a non-deterministically chosen intentional representation for a value with extensional equality. I don't know whether Clean really does store that way, it may do more and hence break the extensional semantics "a bit". Regards, apfelmus

On Fri, 28 Dec 2007 16:34:23 +0200, apfelmus
Jules Bean wrote:
Cristian Baboi wrote:
But I guess it won't work because the compiler will optimize it and the call will disappear.
I'm not quite sure what you're trying to say here.
(That's the "world view on Haskell" issue I mean. I know this feeling with physics: "what the heck are they talking about, this is just mathematically wrong, ill-defined or otherwise void of contents?")
Let me ask you 3 simple questions. Can one use Haskell to make dynamically linked libraries (DLL on Windows, so on Linux) ? If yes, what is in them ? If not, why not ? ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

Cristian Baboi wrote:
Let me ask you 3 simple questions. Can one use Haskell to make dynamically linked libraries (DLL on Windows, so on Linux) ?
The short answer is yes. The long answer is that this is not a feature of haskell, but rather a feature of certain programs, which happen to be mostly but not entirely written in haskell, in particular, the haskell compiler. GHC can produce dynamically linked libraries.
If yes, what is in them ?
Object code, mostly. Sometimes a little data. Jules

On Fri, 28 Dec 2007 18:32:05 +0200, Jules Bean
Cristian Baboi wrote:
Let me ask you 3 simple questions. Can one use Haskell to make dynamically linked libraries (DLL on Windows, so on Linux) ?
The short answer is yes.
The long answer is that this is not a feature of haskell, but rather a feature of certain programs, which happen to be mostly but not entirely written in haskell, in particular, the haskell compiler. GHC can produce dynamically linked libraries.
What you choose not to notice is the context in which I asked these questions. The context is: Haskell functions as first-class objects. What I am interested in the first place is dynamically linked libraries written in Haskell and used in Haskell. The interface with other languages like C come second.
If yes, what is in them ?
Object code, mostly. Sometimes a little data.
What is the definition of an entry point in Haskell ? What is the semantics of those entry points ?

This thread is obviously a source of much fun. I will play too. Cristian Baboi wrote:
On Fri, 28 Dec 2007 18:32:05 +0200, Jules Bean
wrote: Cristian Baboi wrote:
Let me ask you 3 simple questions. Can one use Haskell to make dynamically linked libraries (DLL on Windows, so on Linux) ?
The short answer is yes.
The long answer is that this is not a feature of haskell, but rather a feature of certain programs, which happen to be mostly but not entirely written in haskell, in particular, the haskell compiler. GHC can produce dynamically linked libraries.
What you choose not to notice is the context in which I asked these questions. The context is: Haskell functions as first-class objects. What I am interested in the first place is dynamically linked libraries written in Haskell and used in Haskell. The interface with other languages like C come second.
If yes, what is in them ?
Object code, mostly. Sometimes a little data.
What is the definition of an entry point in Haskell ?
"Haskell" does not have such a concept. At all. An implementation may have such a concept. Most people on this list define "Haskell" as any attempt at an implementation of one of the standards which define Haskell, most recently the Hakell 98 standard. This can be nhc / yhc / ghc / hugs / winhugs / helium / jhc. Some of these compile to native code, some compile to byte code for a virtual machine. If an implementation can compile separately, then it might support dynamic libraries. If so then a specific version of that compiler will define its own implementation specific concept of an entry point.
What is the semantics of those entry points ?
It depends. For recent ghc versions, see its user manual: http://haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html#ffi-library http://haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html Other note: An imperative language, such as C++ or Java, specified the binary output of any instance of the compiler. Class methods will have very specific names and addresses. In C++ you can even get the member-function pointer values and examine the byte offsets in the object. In Java one gets a very specific layout of bytecode in a class file. "Haskell" is a declarative language. It does not specify anything about the implementation's internals. It specifies only properties like "non-strict". The fact that ghc uses lazy evaluation is merely an implementation detail, chosen as a way of satisfying the "non-strict" requirement of "Haskell". The output of a "Haskell" compiler is free to take all the source code and implement things with jumps and branches that look absolutely nothing like function calls. -- Chris

On Fri, 28 Dec 2007 19:18:33 +0200, ChrisK
This thread is obviously a source of much fun. I will play too.
Well, it starts with Wikipedia ... :-)
What is the definition of an entry point in Haskell ?
"Haskell" does not have such a concept. At all. An implementation may have such a concept.
Then a Haskell module know nothing about them.
Most people on this list define "Haskell" as any attempt at an implementation of one of the standards which define Haskell, most recently the Hakell 98 standard.
This can be nhc / yhc / ghc / hugs / winhugs / helium / jhc. Some of these compile to native code, some compile to byte code for a virtual machine. If an implementation can compile separately, then it might support dynamic libraries. If so then a specific version of that compiler will define its own implementation specific concept of an entry point.
How can one make portable dynamic libraries then ?
What is the semantics of those entry points ?
It depends. For recent ghc versions, see its user manual: http://haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html#ffi-library http://haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html
The conclusion: Portable Haskell Dynamic libraries does not exists.

You are right, Portable Haskell Dynamic libraries do not exist because the
Haskell standard does not talk about them at all.
Portable C Dynamic libraries do not exist either. Given POSIX they exist,
but if you happen upon a platform that only has a C compiler it won't have
them.
On Dec 28, 2007 7:08 PM, Cristian Baboi
On Fri, 28 Dec 2007 19:18:33 +0200, ChrisK
wrote: This thread is obviously a source of much fun. I will play too.
Well, it starts with Wikipedia ... :-)
What is the definition of an entry point in Haskell ?
"Haskell" does not have such a concept. At all. An implementation may have such a concept.
Then a Haskell module know nothing about them.
Most people on this list define "Haskell" as any attempt at an implementation of one of the standards which define Haskell, most recently the Hakell 98 standard.
This can be nhc / yhc / ghc / hugs / winhugs / helium / jhc. Some of these compile to native code, some compile to byte code for a virtual machine. If an implementation can compile separately, then it might support dynamic libraries. If so then a specific version of that compiler will define its own implementation specific concept of an entry point.
How can one make portable dynamic libraries then ?
What is the semantics of those entry points ?
It depends. For recent ghc versions, see its user manual:
http://haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html#ffi-library
http://haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html
The conclusion:
Portable Haskell Dynamic libraries does not exists.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 28 Dec 2007, at 12:08 PM, Cristian Baboi wrote:
On Fri, 28 Dec 2007 19:18:33 +0200, ChrisK
wrote: This thread is obviously a source of much fun. I will play too.
Well, it starts with Wikipedia ... :-)
What is the definition of an entry point in Haskell ?
"Haskell" does not have such a concept. At all. An implementation may have such a concept.
Then a Haskell module know nothing about them.
Most people on this list define "Haskell" as any attempt at an implementation of one of the standards which define Haskell, most recently the Hakell 98 standard.
This can be nhc / yhc / ghc / hugs / winhugs / helium / jhc. Some of these compile to native code, some compile to byte code for a virtual machine. If an implementation can compile separately, then it might support dynamic libraries. If so then a specific version of that compiler will define its own implementation specific concept of an entry point.
How can one make portable dynamic libraries then ?
If by portable you mean, works on /both/ OSs, then GHC-specific should be portable enough for you... jcc

On Sat, 29 Dec 2007 02:08:14 +0200, Jonathan Cast
How can one make portable dynamic libraries then ?
If by portable you mean, works on /both/ OSs, then GHC-specific should be portable enough for you...
By portable I mean: works on the same machine, with the same OS, but with different Haskell implementation.

On Sat, 29 Dec 2007 13:01:44 +0200, Cristian Baboi
On Sat, 29 Dec 2007 02:08:14 +0200, Jonathan Cast
wrote: How can one make portable dynamic libraries then ?
If by portable you mean, works on /both/ OSs, then GHC-specific should be portable enough for you...
By portable I mean: works on the same machine, with the same OS, but with different Haskell implementation.
I should have used compatible.

On 29 Dec 2007, at 5:01 AM, Cristian Baboi wrote:
On Sat, 29 Dec 2007 02:08:14 +0200, Jonathan Cast
wrote: How can one make portable dynamic libraries then ?
If by portable you mean, works on /both/ OSs, then GHC-specific should be portable enough for you...
By portable I mean: works on the same machine, with the same OS, but with different Haskell implementation.
Ah, you can't. But, again, what are you trying to do? Re-compiling your software for each implementation seems like a perfectly reasonable thing to do, given the differences between them. jcc

On Sat, 29 Dec 2007 21:49:16 +0200, Jonathan Cast
On 29 Dec 2007, at 5:01 AM, Cristian Baboi wrote:
By portable I mean: works on the same machine, with the same OS, but with different Haskell implementation.
Ah, you can't. But, again, what are you trying to do? Re-compiling your software for each implementation seems like a perfectly reasonable thing to do, given the differences between them.
Recompiling my software will not save a function created by the software at runtime.

Am Sonntag, 30. Dezember 2007 17:14 schrieb Cristian Baboi:
On Sat, 29 Dec 2007 21:49:16 +0200, Jonathan Cast
wrote: On 29 Dec 2007, at 5:01 AM, Cristian Baboi wrote:
By portable I mean: works on the same machine, with the same OS, but with different Haskell implementation.
Ah, you can't. But, again, what are you trying to do? Re-compiling your software for each implementation seems like a perfectly reasonable thing to do, given the differences between them.
Recompiling my software will not save a function created by the software at runtime.
True, but again, what are you trying to do? Perhaps if you gave an example of that in whichever language you use, it would help understand your aim. When the target's visible and not moving, you stand a chance of someone hitting it. Cheers, Daniel

On Sun, 30 Dec 2007 19:10:44 +0200, Daniel Fischer
Am Sonntag, 30. Dezember 2007 17:55 schrieb Cristian Baboi:
On Sun, 30 Dec 2007 18:34:08 +0200, Daniel Fischer
wrote: True, but again, what are you trying to do?
I've already did what I was trying to do.
Congrats. How?
By talking with you.

On 30 Dec 2007, at 11:12 AM, Cristian Baboi wrote:
On Sun, 30 Dec 2007 19:10:44 +0200, Daniel Fischer
wrote: Am Sonntag, 30. Dezember 2007 17:55 schrieb Cristian Baboi:
On Sun, 30 Dec 2007 18:34:08 +0200, Daniel Fischer
wrote: True, but again, what are you trying to do?
I've already did what I was trying to do.
Congrats. How?
By talking with you.
If you want help, you would have an easier time getting it if you came here with /programming/ problems. Most of us enjoy programming quite a bit, and are eager to help with such, but this sort of thing is more of a distraction, really. jcc

On Sun, 30 Dec 2007 19:16:04 +0200, Jonathan Cast
If you want help, you would have an easier time getting it if you came here with /programming/ problems. Most of us enjoy programming quite a bit, and are eager to help with such, but this sort of thing is more of a distraction, really.
Thank you, but I don't need help with programming. I can do that myself. The help I need is for understanding Haskell.

On 30 Dec 2007, at 10:14 AM, Cristian Baboi wrote:
On Sat, 29 Dec 2007 21:49:16 +0200, Jonathan Cast
wrote: On 29 Dec 2007, at 5:01 AM, Cristian Baboi wrote:
By portable I mean: works on the same machine, with the same OS, but with different Haskell implementation.
Ah, you can't. But, again, what are you trying to do? Re- compiling your software for each implementation seems like a perfectly reasonable thing to do, given the differences between them.
Recompiling my software will not save a function created by the software at runtime.
Which is a different problem than the one solved by dynamic linking. Again, why do you want to do this? jcc

On Sun, 30 Dec 2007 18:39:51 +0200, Jonathan Cast
On 30 Dec 2007, at 10:14 AM, Cristian Baboi wrote:
On Sat, 29 Dec 2007 21:49:16 +0200, Jonathan Cast
wrote: On 29 Dec 2007, at 5:01 AM, Cristian Baboi wrote:
By portable I mean: works on the same machine, with the same OS, but with different Haskell implementation.
Ah, you can't. But, again, what are you trying to do? Re-compiling your software for each implementation seems like a perfectly reasonable thing to do, given the differences between them.
Recompiling my software will not save a function created by the software at runtime.
Which is a different problem than the one solved by dynamic linking. Again, why do you want to do this?
I think they are not as different as you think they are.

On 30 Dec 2007, at 10:54 AM, Cristian Baboi wrote:
On Sun, 30 Dec 2007 18:39:51 +0200, Jonathan Cast
wrote: On 30 Dec 2007, at 10:14 AM, Cristian Baboi wrote:
On Sat, 29 Dec 2007 21:49:16 +0200, Jonathan Cast
wrote: On 29 Dec 2007, at 5:01 AM, Cristian Baboi wrote:
By portable I mean: works on the same machine, with the same OS, but with different Haskell implementation.
Ah, you can't. But, again, what are you trying to do? Re- compiling your software for each implementation seems like a perfectly reasonable thing to do, given the differences between them.
Recompiling my software will not save a function created by the software at runtime.
Which is a different problem than the one solved by dynamic linking. Again, why do you want to do this?
I think they are not as different as you think they are.
I think they're very different --- dynamic libraries can be built by running the compiler, whatever you're asking for can't. More generally, dynamic libraries are supported by every production- quality compiled language in existence; I know of no language that can do what you're asking for. I think, again, that what you really want is a reason to discredit Haskell. Twenty years ago, Haskell had a laundry list of features few other languages had. Today, you'd be hard-pressed to find a compelling feature Haskell has that other languages don't. But those features are an integral part of Haskell's design, and very easy to use; in other languages, just producing the syntax required to invoke them is like kicking dead whales down the beach. (I know, I program `Higher Order Perl' for a living. Usually, giving up on HO and settling for OO is /easier/ in that language --- but using higher order functions in Haskell is easier than either). But I don't imagine you're particularly interested in hearing that. jcc

On Sun, 30 Dec 2007 19:02:11 +0200, Jonathan Cast
On 30 Dec 2007, at 10:54 AM, Cristian Baboi wrote:
On Sun, 30 Dec 2007 18:39:51 +0200, Jonathan Cast
wrote: On 30 Dec 2007, at 10:14 AM, Cristian Baboi wrote:
On Sat, 29 Dec 2007 21:49:16 +0200, Jonathan Cast
wrote: On 29 Dec 2007, at 5:01 AM, Cristian Baboi wrote:
By portable I mean: works on the same machine, with the same OS, but with different Haskell implementation.
Ah, you can't. But, again, what are you trying to do? Re-compiling your software for each implementation seems like a perfectly reasonable thing to do, given the differences between them.
Recompiling my software will not save a function created by the software at runtime.
Which is a different problem than the one solved by dynamic linking. Again, why do you want to do this?
I think they are not as different as you think they are.
I think they're very different --- dynamic libraries can be built by running the compiler, whatever you're asking for can't.
More generally, dynamic libraries are supported by every production- quality compiled language in existence; I know of no language that can do what you're asking for.
I think, again, that what you really want is a reason to discredit Haskell.
A simple question: Can you write the value of x to a file where x = (1:x) ?

On 30 Dec 2007, at 11:16 AM, Cristian Baboi wrote:
On Sun, 30 Dec 2007 19:02:11 +0200, Jonathan Cast
wrote: On 30 Dec 2007, at 10:54 AM, Cristian Baboi wrote:
On Sun, 30 Dec 2007 18:39:51 +0200, Jonathan Cast
wrote: On 30 Dec 2007, at 10:14 AM, Cristian Baboi wrote:
On Sat, 29 Dec 2007 21:49:16 +0200, Jonathan Cast
wrote: On 29 Dec 2007, at 5:01 AM, Cristian Baboi wrote:
> By portable I mean: works on the same machine, with the same > OS, but with different Haskell implementation.
Ah, you can't. But, again, what are you trying to do? Re- compiling your software for each implementation seems like a perfectly reasonable thing to do, given the differences between them.
Recompiling my software will not save a function created by the software at runtime.
Which is a different problem than the one solved by dynamic linking. Again, why do you want to do this?
I think they are not as different as you think they are.
I think they're very different --- dynamic libraries can be built by running the compiler, whatever you're asking for can't.
More generally, dynamic libraries are supported by every production-quality compiled language in existence; I know of no language that can do what you're asking for.
I think, again, that what you really want is a reason to discredit Haskell.
A simple question:
Can you write the value of x to a file where x = (1:x) ?
At this time, I am completely uninterested in serving as a source of your personal amusement. When you can convince me that continuing this discussion will be of use /to the Haskell community/, I will until then, goodbye. jcc

On Sun, 30 Dec 2007 20:00:05 +0200, Daniel Fischer
Am Sonntag, 30. Dezember 2007 18:16 schrieb Cristian Baboi:
A simple question:
Can you write the value of x to a file where x = (1:x) ?
Not in finite time and space :)
I used the word 'value' by mistake. A notation of the value of x.

Am Sonntag, 30. Dezember 2007 19:04 schrieb Cristian Baboi:
On Sun, 30 Dec 2007 20:00:05 +0200, Daniel Fischer
wrote: Am Sonntag, 30. Dezember 2007 18:16 schrieb Cristian Baboi:
A simple question:
Can you write the value of x to a file where x = (1:x) ?
Not in finite time and space :)
I used the word 'value' by mistake. A notation of the value of x.
I suppose let x = 1:x in x is not what you're after?

On Sun, 30 Dec 2007 20:24:23 +0200, Daniel Fischer
Am Sonntag, 30. Dezember 2007 19:04 schrieb Cristian Baboi:
On Sun, 30 Dec 2007 20:00:05 +0200, Daniel Fischer
wrote: Am Sonntag, 30. Dezember 2007 18:16 schrieb Cristian Baboi:
A simple question:
Can you write the value of x to a file where x = (1:x) ?
Not in finite time and space :)
I used the word 'value' by mistake. A notation of the value of x.
I suppose let x = 1:x in x is not what you're after?
Yes! Can Haskell do the same ?
I mean this:
module Module where
a= let x=1:x in x
main =

"Cristian Baboi"
module Module where
a= let x=1:x in x
main =
The function must work if one change a to let x=2:x in x, let x=1:2:3:x and variations on the same theme.
import GHC? you can even load it directly to memory and execute it via unsafeCoerce# (which is the most evil function haskell has to offer). -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Am Sonntag, 30. Dezember 2007 19:31 schrieb Cristian Baboi:
On Sun, 30 Dec 2007 20:24:23 +0200, Daniel Fischer
wrote: Am Sonntag, 30. Dezember 2007 19:04 schrieb Cristian Baboi:
On Sun, 30 Dec 2007 20:00:05 +0200, Daniel Fischer
wrote: Am Sonntag, 30. Dezember 2007 18:16 schrieb Cristian Baboi:
A simple question:
Can you write the value of x to a file where x = (1:x) ?
Not in finite time and space :)
I used the word 'value' by mistake. A notation of the value of x.
I suppose let x = 1:x in x is not what you're after?
Yes! Can Haskell do the same ?
I mean this:
module Module where
a= let x=1:x in x
main =
The function must work if one change a to let x=2:x in x, let x=1:2:3:x and variations on the same theme.
Can Java, C? What do you mean by 'notation'? Would main = do txt <- readFile "Module.hs" let definitions = parseModule txt case lookup "a" definitions of Nothing -> putStrLn "No definition for a" Just rhs -> writeFile "Notation.hs" (prettyprint rhs) satisfy you?

On Sun, 30 Dec 2007 21:07:44 +0200, Daniel Fischer
Am Sonntag, 30. Dezember 2007 19:31 schrieb Cristian Baboi:
I mean this:
module Module where
a= let x=1:x in x
main =
The function must work if one change a to let x=2:x in x, let x=1:2:3:x and variations on the same theme.
Can Java, C?
I think most of us can write a C program that can print circular lists.
What do you mean by 'notation'?
I might have used the wrong word. Can you write the NUMBER 1 on a piece of paper ? I think you cannot. You must use some encoding for it. The same thing with let x = x in x. How can one print numbers in Haskell ? I don't understand. When I say print (2+4), why 6 is printed and not 10 - 4 ?
Would main = do txt <- readFile "Module.hs" let definitions = parseModule txt case lookup "a" definitions of Nothing -> putStrLn "No definition for a" Just rhs -> writeFile "Notation.hs" (prettyprint rhs) satisfy you?
Yes, but there is a little problem with 'txt<- readFile "Module.hs" and case lookup "a" ... ' You see, I don't know if I must print a or b. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

"Cristian Baboi"
On Sun, 30 Dec 2007 20:00:05 +0200, Daniel Fischer
wrote: Am Sonntag, 30. Dezember 2007 18:16 schrieb Cristian Baboi:
A simple question:
Can you write the value of x to a file where x = (1:x) ?
Not in finite time and space :)
I used the word 'value' by mistake. A notation of the value of x.
What architecture should the compiler target? I think unsafeCoerce# is the maximum you're going to need. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

2007/12/30, Cristian Baboi
A simple question:
Can you write the value of x to a file where x = (1:x) ?
Yes, but you'll have to write it yourself, because Haskell can't decide by itself that this value is infinite and try to print it with a recursive definition, if it could do that, it could decide the halting problem and that's not possible. -- Jedaï

2007/12/30, Chaddaï Fouché
2007/12/30, Cristian Baboi
: A simple question:
Can you write the value of x to a file where x = (1:x) ?
Yes, but you'll have to write it yourself, because Haskell can't decide by itself that this value is infinite and try to print it with a recursive definition, if it could do that, it could decide the halting problem and that's not possible.
Sorry, I'll try to be more precise since Cristian is pretty sticky with details when he can use them in its sense... In the particular case of x = (1:x), it can be detected that the structure is circular in memory and so infinite, but in the general case (for example if you replace (1:x) by (1:f x)) it can't be decided if the value is finite or infinite. You can't do a printer that do what you want in Haskell itself but you could probably do it with a VM or with compiler support, but it would be extremely tricky, also it would _always_ use the "running" form, even if this form isn't the optimal for storage (for example a filter of a huge list that results in an empty list would take enormously more place than with a normal printer). -- Jedaï

Thank you.
data Something = This | S Something
ppp :: Something -> String
ppp This = ""
ppp (S x) = 'S':(ppp x)
How can I prevent one to pass 'let x = S x in x' to ppp ?
On Sun, 30 Dec 2007 23:25:19 +0200, Chaddaï Fouché
2007/12/30, Chaddaï Fouché
: 2007/12/30, Cristian Baboi
: A simple question:
Can you write the value of x to a file where x = (1:x) ?
Yes, but you'll have to write it yourself, because Haskell can't decide by itself that this value is infinite and try to print it with a recursive definition, if it could do that, it could decide the halting problem and that's not possible.
Sorry, I'll try to be more precise since Cristian is pretty sticky with details when he can use them in its sense...
In the particular case of x = (1:x), it can be detected that the structure is circular in memory and so infinite, but in the general case (for example if you replace (1:x) by (1:f x)) it can't be decided if the value is finite or infinite. You can't do a printer that do what you want in Haskell itself but you could probably do it with a VM or with compiler support, but it would be extremely tricky, also it would _always_ use the "running" form, even if this form isn't the optimal for storage (for example a filter of a huge list that results in an empty list would take enormously more place than with a normal printer).
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

How about
a :: Something
a = let x = x in x
ppp a
On Mon, 31 Dec 2007 09:11:12 +0200, Cristian Baboi
Thank you.
data Something = This | S Something
ppp :: Something -> String
ppp This = "" ppp (S x) = 'S':(ppp x)
How can I prevent one to pass 'let x = S x in x' to ppp ?
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

"Cristian Baboi"
How about
a :: Something a = let x = x in x
:t a would give (a -> [a]), not Something, or am I mistaken? -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

It give Something.
On Mon, 31 Dec 2007 10:27:38 +0200, Achim Schneider
"Cristian Baboi"
wrote: How about
a :: Something a = let x = x in x
:t a would give (a -> [a]), not Something, or am I mistaken?
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

"Cristian Baboi"
It give Something.
You're right, I'm thinking too lispy. The point is that it doesn't have to be passed an x to be infinite, and that a by itself is fully polymorphic. It seems like you're trying to solve the halting problem. Slurping any infinite data structure makes your program perform rather badly, I'm afraid. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

On Mon, 31 Dec 2007 10:40:13 +0200, Achim Schneider
It seems like you're trying to solve the halting problem.
I didn't know that.
Slurping any infinite data structure makes your program perform rather badly, I'm afraid.
What is infinite in let x = x in x ? What I see is that I cannot prevent building of "infinite" data structures without investing some time to find a way. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

"Cristian Baboi"
What is infinite in let x = x in x ? ^ | | |___/ | \________/
-- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Achim Schneider
"Cristian Baboi"
wrote: What is infinite in let x = x in x ? ^ | | |___/ | \________/
a = let x = x in x is actually only quite verbose for a = undefined, the only difference being that undefined is a nicer _|_ than let x = x in x. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

On Mon, 31 Dec 2007 10:59:28 +0200, Achim Schneider
Achim Schneider
wrote: "Cristian Baboi"
wrote: What is infinite in let x = x in x ? ^ | | |___/ | \________/
a = let x = x in x is actually only quite verbose for a = undefined,
the only difference being that undefined is a nicer _|_ than let x = x in x.
I could have written this instead: a :: Something a = a Which is nicer than undefined. ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

"Cristian Baboi"
On Mon, 31 Dec 2007 10:59:28 +0200, Achim Schneider
wrote: Achim Schneider
wrote: "Cristian Baboi"
wrote: What is infinite in let x = x in x ? ^ | | |___/ | \________/
a = let x = x in x is actually only quite verbose for a = undefined,
the only difference being that undefined is a nicer _|_ than let x = x in x.
I could have written this instead:
a :: Something a = a
Which is nicer than undefined.
ksf@solaris ~ % ghci GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> let a = undefined Prelude> a *** Exception: Prelude.undefined Prelude> let a = a Prelude> a Interrupted. nope, it isn't. And then let a = a is more defined than the other two... only the equation is _|_, not the value that is "assigned". Value that is equated? Term? Jonathan, please beat me. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

On Mon, 31 Dec 2007 11:14:39 +0200, Achim Schneider
"Cristian Baboi"
wrote:
I could have written this instead:
a :: Something a = a
Which is nicer than undefined.
ksf@solaris ~ % ghci GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> let a = undefined Prelude> a *** Exception: Prelude.undefined Prelude> let a = a Prelude> a Interrupted.
nope, it isn't.
Well, it depends on what you think is nicer. For me it looks shorter than undefined and it don't rely on the library.
And then let a = a is more defined than the other two... only the equation is _|_, not the value that is "assigned". Value that is equated? Term? Jonathan, please beat me.
This is over my head. If let a = a is more defined, then why (print a) won't stop ? ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

"Cristian Baboi"
Well, it depends on what you think is nicer. For me it looks shorter than undefined and it don't rely on the library.
Well, for me undefined doesn't throw undeterministic behaviour at me (throwing a stack overflow sooner or later or not, depending on patience and stack size settings), it just fails in every case.
And then let a = a is more defined than the other two... only the equation is _|_, not the value that is "assigned". Value that is equated? Term? Jonathan, please beat me.
This is over my head. If let a = a is more defined, then why (print a) won't stop ?
Because it's still _|_. It's just not defined to be undefined, it's undefined by itself. Which, from my sometimes seriously twisted point of view, makes it more defined, as it's not defined to be undefined, by itself, seen from within it. From the outside, it's less defined. Your terms may differ, the thing to distinguish is where _|_ comes into play to avoid having your thoughts looping forever. To answer your question: because, in order to print a, print has to force the chunk that's representing a, and that chunks needs to force the chunk that's representing a, and that chunk needs to force the chunk that's representing a, and that chunk needs to force the chunk that's representing a, and that chunk... -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

On Mon, 31 Dec 2007 11:14:39 +0200, Achim Schneider
"Cristian Baboi"
wrote: On Mon, 31 Dec 2007 10:59:28 +0200, Achim Schneider
wrote:
I could have written this instead:
a :: Something a = a
Which is nicer than undefined.
ksf@solaris ~ % ghci GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> let a = undefined Prelude> a *** Exception: Prelude.undefined Prelude> let a = a Prelude> a Interrupted.
nope, it isn't.
If you try it again Prelude> a *** Exception: Stack overflow ________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 12/30/07, Cristian Baboi
Thank you.
data Something = This | S Something
ppp :: Something -> String
ppp This = "" ppp (S x) = 'S':(ppp x)
How can I prevent one to pass 'let x = S x in x' to ppp ?
{-# LANGUAGE GADTs, EmptyDataDecls #-} data Z data S a data Something a where This :: Something Z S :: Something a -> Something (S a) ppp :: Something a -> String ppp This = "" ppp (S x) = 'S' : ppp x

Nice! Thank you.
On Mon, 31 Dec 2007 12:56:42 +0200, Ryan Ingram
On 12/30/07, Cristian Baboi
wrote: Thank you.
data Something = This | S Something
ppp :: Something -> String
ppp This = "" ppp (S x) = 'S':(ppp x)
How can I prevent one to pass 'let x = S x in x' to ppp ?
{-# LANGUAGE GADTs, EmptyDataDecls #-} data Z data S a
data Something a where This :: Something Z S :: Something a -> Something (S a)
ppp :: Something a -> String ppp This = "" ppp (S x) = 'S' : ppp x
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 2007-12-28, ChrisK
Other note: An imperative language, such as C++ or Java, specified the binary output of any instance of the compiler. Class methods will have very specific names and addresses. In C++ you can even get the member-function pointer values and examine the byte offsets in the object. In Java one gets a very specific layout of bytecode in a class file.
These are specified by the ABI, not the language, in most cases. Java happens to specify this, but C and C++ do not. Almost all platforms define a C ABI.
"Haskell" is a declarative language. It does not specify anything about the implementation's internals.
Neither do most languages. -- Aaron Denney -><-

On 28 Dec 2007, at 8:42 AM, Cristian Baboi wrote:
On Fri, 28 Dec 2007 16:34:23 +0200, apfelmus
wrote: Jules Bean wrote:
Cristian Baboi wrote:
But I guess it won't work because the compiler will optimize it and the call will disappear.
I'm not quite sure what you're trying to say here.
(That's the "world view on Haskell" issue I mean. I know this feeling with physics: "what the heck are they talking about, this is just mathematically wrong, ill-defined or otherwise void of contents?")
Let me ask you 3 simple questions. Can one use Haskell to make dynamically linked libraries (DLL on Windows, so on Linux) ?
Haskell 98, no. But GHC works fine.
If yes, what is in them ?
As has been said, object code. Which is why you can't call GHC outside of the IO monad.
If not, why not ?
Because it's not portable. These days, it is distressingly common to see the word `portable' used to mean `works on anything sufficiently willing to pretend it's a Unix'. This depresses me; I think it's a failure of imagination, mostly. jcc

On 28 Dec 2007, at 7:15 AM, Cristian Baboi wrote:
But I guess it won't work because the compiler will optimize it and the call will disappear.
On Fri, 28 Dec 2007 14:58:53 +0200, Cristian Baboi
wrote: Here is how I want print to be in Haskell
print :: (a->b) -> (a->b)
with print = id, but the following "side effect":
- I want to call the print function today, and get the value tomorrow.
Sorry, simply couldn't resist: Put a very long timing loop in the middle. jcc

On Sat, 29 Dec 2007 01:42:54 +0200, Jonathan Cast
Here is how I want print to be in Haskell
print :: (a->b) -> (a->b)
with print = id, but the following "side effect":
- I want to call the print function today, and get the value tomorrow.
Sorry, simply couldn't resist:
Put a very long timing loop in the middle.
Well, that kind of loop won't work.

On Dec 28, 2007 5:58 AM, Cristian Baboi
Here is how I want print to be in Haskell
print :: (a->b) -> (a->b)
with print = id, but the following "side effect":
- I want to call the print function today, and get the value tomorrow.
You might be interested in the standard module Debug.Trace, which defines a function: trace :: String -> b -> b Which allows you to print something avoiding the IO monad as you seem to want. Then to get your print function, all you would need is a Show instance for a -> b: print f = trace (show f) f Then the Show instance: instance Show (a -> b) where show f = "<function>" And there you have it. It's not very useful, since it just prints <function> for every function, but there you go. I suspect you want to print some serialization of the function such that it can be read in again and executed later. You're not gonna get that any time soon. But I also suspect that there is another legitimate solution to your problem. Unless the problem has to do with transferring *arbitrary* functions (that is, your program knows nothing at all about what is transferred) between processes (not to be confused with threads, which Haskell is very good at). Luke
participants (32)
-
Aaron Denney
-
Achim Schneider
-
ajb@spamcop.net
-
Albert Y. C. Lai
-
Andrew Coppin
-
apfelmus
-
Ben Franksen
-
Brandon S. Allbery KF8NH
-
Bryan O'Sullivan
-
Bulat Ziganshin
-
Chaddaï Fouché
-
ChrisK
-
Cristian Baboi
-
Cristian Baboi
-
Daniel Fischer
-
Derek Elkins
-
Donn Cave
-
Isaac Dupree
-
jerzy.karczmarczuk@info.unicaen.fr
-
Jonathan Cast
-
Jules Bean
-
Ketil Malde
-
Lennart Augustsson
-
Luke Palmer
-
Miguel Mitrofanov
-
Peter Verswyvelen
-
Ryan Ingram
-
Sebastian Sylvan
-
Tim Chevalier
-
Tony Morris
-
Wolfgang Jeltsch
-
Yitzchak Gale