Benefits and use cases for strong mobility in presence of closure serialization

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Benefits and use cases for strong mobility in presence of closure serialization

Станислав Черничкин
Benefits and use cases for strong mobility in presence of closure serialization

I read a paper about strong mobility in Haskell http://www.dcs.gla.ac.uk/~trinder/papers/strongm.pdf and I wondering what benefits it gives in presence of closure serialization? I guess for some languages strong mobility could be only way to transfer execution state of program, e.g.

[Mobile Pascal;)]
program Test;
var
  a: Integer;
begin
  readln(a);             // acquiring on current host
  moveTo("anotherHost"); // transfering state and terminating
  writeln(a);            // printing on another host
end.

but in Haskell same program can be written just using rfork :: Host -> IO () -> IO ():

main = do
  a <- readLn
  rfork AnotherHost $ do
    print a

The difference comparing to moveTo :: Host -> IO () version is purely syntactic:

main = do
  a <- readLn
  moveTo AnotherHost
  print a

--
Sincerely, Stanislav Chernichkin.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Benefits and use cases for strong mobility in presence of closure serialization

Brandon Allbery
You might want to consider the difference between threads and processes — and that the latter are more or less impossible to get correct in the presence of multiple threads.

On Wed, Jul 17, 2019 at 10:03 AM Станислав Черничкин <[hidden email]> wrote:
Benefits and use cases for strong mobility in presence of closure serialization

I read a paper about strong mobility in Haskell http://www.dcs.gla.ac.uk/~trinder/papers/strongm.pdf and I wondering what benefits it gives in presence of closure serialization? I guess for some languages strong mobility could be only way to transfer execution state of program, e.g.

[Mobile Pascal;)]
program Test;
var
  a: Integer;
begin
  readln(a);             // acquiring on current host
  moveTo("anotherHost"); // transfering state and terminating
  writeln(a);            // printing on another host
end.

but in Haskell same program can be written just using rfork :: Host -> IO () -> IO ():

main = do
  a <- readLn
  rfork AnotherHost $ do
    print a

The difference comparing to moveTo :: Host -> IO () version is purely syntactic:

main = do
  a <- readLn
  moveTo AnotherHost
  print a

--
Sincerely, Stanislav Chernichkin.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.


--
brandon s allbery kf8nh

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.