How do you copy a variable? You can only copy values. A free variable has no value. You're confusing capture with closedness.
Here's a trivial example:
\f -> \y -> (runRemotely (\x -> f y x))
The expression passed to runRemotely has a free variable "y". How are you going to serialize (\x -> f y x) in order to send it across the network? When you hit the "y", what are you going to do?
For this trivial minimalist example you might cook up a one-off hack like lambda-abstracting the free variables in the runRemotely expression and then reapplying to the returned value, but there are much more complicated and insidious examples where these workarounds don't work.
Comments
How do you copy a variable? You can only copy values. A free variable has no value. You're confusing capture with closedness.
Here's a trivial example:
The expression passed to runRemotely has a free variable "y". How are you going to serialize (\x -> f y x) in order to send it across the network? When you hit the "y", what are you going to do?For this trivial minimalist example you might cook up a one-off hack like lambda-abstracting the free variables in the runRemotely expression and then reapplying to the returned value, but there are much more complicated and insidious examples where these workarounds don't work.
I was talking in the context of pure functional programming. You can send the AST of a lambda.
THERE IS NO LAMBDA.
It's a free variable, not a variable bound by a lambda.
Use typed holes
You can't serialize holes. You can't even compare them for equality (partly because it is far from clear what that should even mean).