Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-17 Thread Ketil Malde
Ryan Ingram ryani.s...@gmail.com writes: You can emulate mutation with at most O(log(n)) penalty using a map. Given that memory is of fixed size, log2(n) = 64, so for real-world programs this becomes O(1). I'm not sure assuming fixed size memory is a good idea for a theoretical discussion -

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-17 Thread Donn Cave
Quoth Jeff Shaw shawj...@msu.edu, ... I'm thinking that side effects are really only necessary because Haskell programs expect to mutate the state of a computer outside of the haskell program. I'm not a computer scientist, but in English, side effect is an effect that accompanies some other

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-17 Thread Chris Smith
On Sat, Mar 17, 2012 at 5:41 AM, Donn Cave d...@avvanta.com wrote: I hope the answer is not that in computer science we regard all effects as side effects because the ideal computer program simply exists without consequence. The answer is that side effects has become something of a figure of

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-17 Thread KC
Apparently on such solid ground that you hinder their critical thinking skills by answering for them. On Fri, Mar 16, 2012 at 9:24 PM, Donn Cave d...@avvanta.com wrote: Quoth KC kc1...@gmail.com, On Fri, Mar 16, 2012 at 7:44 PM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: ...

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-17 Thread Jerzy Karczmarczuk
KC comments the posting of Donn Cave referring to the soundness of some potential approach of software engineers: Apparently on such solid ground that you hinder their critical thinking skills by answering for them Monsieur KC, do you want to discuss, or just to be cute? In both cases, begin

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-17 Thread Donn Cave
Quoth Chris Smith cdsm...@gmail.com, ... The answer is that side effects has become something of a figure of speech, and now has a specialized meaning in programming languages. When we're talking about different uses of the word function in programming languages, side effects refer to any

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Peter Gammie
Christopher, On 16/03/2012, at 11:23 PM, Christopher Svanefalk wrote: there is a question I have been thinking about a bit. In short, we could simply formulate it like this: Are there any problems which cannot be solved a side effect-free language (such as Haskell)? In other words, are

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Felipe Almeida Lessa
On Fri, Mar 16, 2012 at 9:23 AM, Christopher Svanefalk christopher.svanef...@gmail.com wrote: Are there any problems which cannot be solved a side effect-free language (such as Haskell)? In other words, are there problems that would explicitly demand semantics that can only be provided by a

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Ertugrul Söylemez
Hi there, Christopher Svanefalk christopher.svanef...@gmail.com wrote: there is a question I have been thinking about a bit. In short, we could simply formulate it like this: Are there any problems which *cannot *be solved a side effect-free language (such as Haskell)? In other words, are

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Tillmann Rendel
Hi, Christopher Svanefalk wrote: Are there any problems which *cannot* be solved a side effect-free language (such as Haskell)? No. Haskell is expressive enough. One way to prove that is to implement an interpreter for a language with side effects in Haskell. Now if there's a program P to

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Christopher Svanefalk
Many thanks for the replies and references all of you! I will continue to read up on this from here, and you have all boosted my interest in investigating how complex systems could be developed using functional languages. On Fri, Mar 16, 2012 at 1:46 PM, Dimitri Scheftelowitsch

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread serialhex
On Fri, Mar 16, 2012 at 8:35 AM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: If you're asking about performance, as in is there a problem that can be solved in O(f(n)) time in Java but not in Haskell-sans-IO-and-ST?, then it becomes a harder question. I'm not sure what the answer is.

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Chris Smith
On Fri, Mar 16, 2012 at 3:43 PM, serialhex serial...@gmail.com wrote: an interesting question emerges:  even though i may be able to implement an algorithm with O(f(n)) in Haskell, and write a program that is O(g(n)) O(f(n)) in C++ or Java...  could Haskell be said to be more efficient if

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread David Thomas
If the question is when can I have my output, then both are equally relevant and can be safely conflated. That said, while some programming problems *are* of this type, I think most aren't, and your points certainly stand. On Fri, Mar 16, 2012 at 3:31 PM, Chris Smith cdsm...@gmail.com wrote:

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Ryan Ingram
You can emulate mutation with at most O(log(n)) penalty using a map. Given that memory is of fixed size, log2(n) = 64, so for real-world programs this becomes O(1). So any program you can implement using mutation can be implemented in a pure language with the same big-O running time (but much

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Jerzy Karczmarczuk
Ryan Ingram: Other external state is harder to emulate. For example, communication over a network most definitely requires some concept of a 'computation with side effects' since the network's response could change from request to request. In GHC, even IO objects are pure, but they

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread KC
On Fri, Mar 16, 2012 at 7:44 PM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: ... but the question of purity of a program - in my opinion - concerns the program, and nothing else. You might be thinking of software engineering purity. The networking is not expected to break the

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Donn Cave
Quoth KC kc1...@gmail.com, On Fri, Mar 16, 2012 at 7:44 PM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: ... but the question of purity of a program - in my opinion - concerns the program, and nothing else. You might be thinking of software engineering purity. Or software

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Jeff Shaw
It is the third or the fourth time that somebody recently puts the equivalence between the communication with the outer world, and side effects. I contest that very strongly, perhaps a TRUE guru might instruct me. I think there are three key concepts rumbling around in this discussion that