Guest User

Untitled

a guest
May 26th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. “This is our whole routine, that does something or other for people.”
  2. routine {
  3. “This bit will grab some text from the disk; it will block, and take a while to do so.”
  4. a ← routine { get.some.text.from.the.disk(some.location.to.get.text.from) }
  5.  
  6. “This one will do the same thing, but get it from the network instead, and take a different amount of time.”
  7. b ← routine { get.some.text.from.a.network.resource(obviously.google.duh) }
  8.  
  9. “Finally, this simplistic piece adds two bits of text together and prints the result.”
  10. c ← routine { print.to.the.terminal(join.two.strings(@1, @2)) }
  11.  
  12. “This is the crux: the ‘sync abstraction’ here, is what allows us to very clearly declare what, where, depends
  13. on what else, without having to use any unfamiliar or complex syntax, or anything, really, other than our
  14. basic, familiar, elements: `routine`s, `list`s, and lookups on them:”
  15. c( a(), b() )
  16.  
  17. “The rest of this routine doesn’t depend upon the results of `c()`, and thus will execute in parallel with
  18. `c()`, whatever it has to do.”
  19. do.some.stuff.that.doesn’t.depend.on.c.at.all!()
  20. }
Add Comment
Please, Sign In to add comment