5 ms·
>The stdout buffer. The stdout buffer is not part of the haskell language, it is part of the OS. The haskell runtime reads the haskell language and accesses th
by nendroid 6y ago
>The stdout buffer.
The stdout buffer is not part of the haskell language, it is part of the OS. The haskell runtime reads the haskell language and accesses the buffer. Neither the runtime or the buffer is part of the haskell language, get it? That's why haskell is called "pure" Category Hask: https://wiki.haskell.org/Hask#:~:text=Hask%20is%20the%20category%20of,%3E%20f%20(g%20x)%20 https://wiki.haskell.org/Hask#:~:text=Hask%20is%20the%20cate....
>Just because mutation isn't explicit doesn't mean it isn't there.
So? I never said it wasn't there. I'm basically saying as far as the programmer is concerned when operating within the haskell language no haskell language primitive is mutating. stdout buffer is not a haskell primitive... it is an OS primitive.
>That's completely untrue. Imperative languages can be implemented as a subset of functional ones[1] and vice versa.
This is true theoretically, but physically but you can't actually build a functional machine. Lisp isn't actually a functional language and you'll see from the instruction primitives that the lisp machine is more or less a turing machine that mutates memory.
>No language can do anything if it isn't implemented in a machine.
So? Never said this wasn't true.
>A machine isn't "imperative"[2], it's a pile of atoms that do what atoms do, without paradigm or instruction.
The machine you build is limited by what you build it with. You have a limited set of atoms. Therefore you can only build a machine with limited amount of state. In order to use the state efficiently the state must be mutable. Mutable state means imperative instructions. You can imitate functional programming with such a machine and you can sort of solve the memory problem with garbage collection. But with what paradigm do you implement the garbage collector? Imperative primitives.
> The reason nobody has, is because it doesn't matter: any Turing complete language can be used to implement any other language[3].
No the real reason is also because it's physically impossible. A physical translation of a actual lambda machine cannot be realized. What they can make is register based machine that are more efficient at compiling certain functional languages that's it. All machines we build have some sort of state that changes.
>Don't assert it, Prove it. Show me one computable function that cannot be computed using boolean algebra.
Sure I can prove what I said. But you're changing the problem from IO and ST to a computable function which I assume is algebraic. So of course all of algebra can be used to create all algebraic functions. I'll just prove what I said rather than what you changed it to.
Assuming mutation is an axiomatic operation that cannot be built from immutable operations, you will see that no mutation operation exists in algebra indicating that mutation cannot ever exist in any theorem of algebra:
https://www.wikiwand.com/en/Algebraic_operation#:~:text=In%20mathematics%2C%20a%20basic%20algebraic,taking%20roots%20(fractional%20power) https://www.wikiwand.com/en/Algebraic_operation#:~:text=In%2....
You will see that no algebraic operation involving mutation exists in the above document.
>Try to implement `volatile` in C without using another language. Does that mean C fails to model real hardware? No, because it has `volatile` to get volatile semantics! Just like Haskell has IO to get I/O side-effects. Or ST to get mutation semantics.
No but I can implement volatile with imperative primitives from other languages. All I am saying is you cannot implement ST and IO with functional primitives.
- phizy 6y ago>Mutable state means imperative instructions. It does not. I don't know where you got that idea, or why you just keep repeating it, but at this point your thoughts on the matter aren't worth reading, so lets consider this discussion tabled. I won't be reading anymore of your posts on it. Everything I said in my last post is basic, well-understood computing knowledge. If you want me to disagree with it, you need to find yourself a competent computer scientist to aid you in framing your ideas in a way that is comprehensible with respect to the subject matter. You don't have to listen to me, but you should seek out a second opinion from a competent person who can get through to you. EDIT: Apparently, asking someone to get their opinion checked by someone who isn't a crank is a personal attack. HN, you need me more than I need you. Ban away, mods.
- AnimalMuppet 6y agoPersonal attacks are against site rules on HN. You are clearly across the line here. Moderators ban people for repeated violations, so if you want to continue here, you should stop posting abuse.
- phizy 6y agoYou can do better, then. Read nendroids latest reply to me, and help them understand that it's the "use of statements" that makes a language imperative, not the "modification of state." I won't be responding, and they seem to think they're quite the expert in this sort of thing.
- nendroid 6y ago"In computer science, imperative programming is a programming paradigm that uses statements that change a program's state." The above quote is ripped straight out of wikipedia's definition of imperative programming showing that what I said wasn't a misunderstanding but an official definition. The definition of imperative programming must include mutation otherwise it's isomorphic to functional programming. Because functional programming is simply statements without mutation.