Skip to content

Distributed Computing (proposal)

Raivat Shah edited this page Mar 5, 2021 · 4 revisions

AY 20/21 Sem 2 CS4215 Project: Distributed Computing for Source

Idea: Introduce Promises in Source 2 to facilitate distributed computing.

User Stories

User Story 1: Simple Display

  1. Student A executes:
function my_shared_function(x) {
   display(x);
}
share(my_shared_function); // returns access-token
  1. REPL displays the access token "2e7d5196-bc90-4482-9b9f-749b6c23b089"

  2. Student A sends the access token to Student B (e.g. through Telegram)

  3. Student B executes:

const promise = connect("2e7d5196-bc90-4482-9b9f-749b6c23b089"); 
then(promise, shared_function_from_a =>
    shared_function_from_a("hi there");
}
  1. Student A sees "hi there" in their REPL

Story 2: Promise Chaining with Prompt

  1. Student A executes (whats_your_name could be from a library):
function whats_your_name() {
    return prompt("what's your name?");
}
share(whats_your_name);
  1. A's REPL shows string "2e7d5196-bc90-4482-9b9f-749b6c23b089"

  2. Student A sends string to Student B

  3. Student B executes

const promise = connect("2e7d5196-bc90-4482-9b9f-749b6c23b089");
then(promise, shared_function_from_a => {
    const my_promise = shared_function_from_a();
    then(my_promise, name => display(name));
}
  1. Student A gets a prompt: "what's your name?", and enters "Raivat"

  2. Student B sees "Raivat" in the REPL

Clone this wiki locally