let x = 1 + 1
in x * x
and how does it differ from the "functional semantics" of let x = 1 + 1
y = 1 + 1
in x * y
(under GHC, if you consider that relevant)? let x = 1 + 1
in x * x
and how does it differ from the "functional semantics" of let x = 1 + 1
y = 1 + 1
in x * y
(under GHC, if you consider that relevant)? let x = 1 + 1
in x * x
is equivalent to: (\x -> x * x) (1 + 1)
As the denotational semantics of any lambda expression is represented by its normal form, for function application that would be the result of evaluating that function with substitution; the normal expression is 4, which denotes the integer 4.Similarly,
let x = 1 + 1
y = 1 + 1
in x * y
is equivalent to: (\x -> \y -> x * y) (1 + 1) (1 + 1)
and, so, by the functional denotation, this also denotes the integer 4.As 4 = 4, the denotation of these two expressions is equal.
2. Functional semantics are convenient for sequential programs.
[1]: Perhaps there's been a misunderstanding. Functional semantics means that expressions denote things similar to functions. Usually, operational semantics are state-machine semantics, certainly not functional semantics. If you'd asked for the state machine semantics, I would have described those.
I'm all in favour of you promoting technologies and approches that you think are beneficial. What I would ask you to stop doing (again) is critiquing Haskell without really understanding it.
Heh, well, in a way I guess you could say I made that "term" up, but it's not an atomic term. The formal semantics of a syntactic term is some object (in the semantic domain of the formalism) mapped to that term. If that object is a function (or something close to it), what you have is functional semantics. Similarly, you have relational semantics, behavior semantics, and any other kind that you may find useful; even evidence semantics, which assigns evidence objects to terms.
I've heard some academics refer to it as "value semantics", which, I guess, hints to the fact that the denotation of a lambda application is the value that the lambda term reduces to, but I find that terminology to be unclear. I've heard Haskell programmers (in the pseudo-mathematical atmosphere that seems to be common in that community) refer to it as "referential transparency", which is downright misleading because referential transparency does actually have sort-of a well-defined meaning, and it's not quite that. I've heard Conal Elliot refer to it simply as "denotational" (as in "functional programming is denotational programming"), which is also misleading because not all denotations are functions. So, I find "functional semantics" to be both precise and clear.
> You also seem to believe that it's the only semantics that functional programmers care about and this is why I say you have a big misunderstanding about Haskell.
Where did you get that? What I may have said or alluded to, in so many words, is that denotational semantics are important for writing and analyzing programs, and I find that functional semantics don't make a great fit for non-sequential programs. After all, it only pays to think "denotationally" if the denotation is simple and a natural fit for the domain.
https://news.ycombinator.com/item?id=11907547
I'm afraid I still can't understand your position.