louise
The Louise language: compiler, runtime, std, tooling
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#91 · main · 15 min 44 s
0Étoiles
0Forks
40Issues
| 1 | /// References to `@remote` functions (ADR 0072): what `std/dist`'s |
| 2 | /// `spawn_on` takes to start one on another node. |
| 3 | /// |
| 4 | /// @remote |
| 5 | /// fn worker :: job: Job -> () / <proc> { ... } |
| 6 | /// |
| 7 | /// dist.spawn_on node worker job 5000 |
| 8 | /// |
| 9 | /// `worker` called (`worker job`) is a function call, as for any |
| 10 | /// function; its name used as a value is a `Remote<Job>`, never a |
| 11 | /// closure: wrap it in a lambda to pass it as one. |
| 12 | |
| 13 | /// A `@remote` function whose argument is an `a`. Only the compiler makes |
| 14 | /// one, from the function's name: its key is the hash of the function's |
| 15 | /// qualified name (docs/wire-format.md, *Remote entries*), the same on |
| 16 | /// every node that runs the program. `a` is phantom, so a `Remote` that |
| 17 | /// came off the wire may name any key at any `a`: `spawn_on` checks both |
| 18 | /// before it sends anything (`UnknownEntry`, `WrongType`). |
| 19 | pub opaque type Remote<a> { Remote(key: Int) } |
| 20 | |
| 21 | /// The key that names `entry` to every node of the cluster. |
| 22 | pub fn key :: entry: Remote<a> -> Int |
| 23 | { |
| 24 | match entry { Remote(key) -> key } |
| 25 | } |