Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.07 KB

File metadata and controls

62 lines (46 loc) · 1.07 KB

Precompilation Examples

JavaScript

Calls the toy factory module to get the toys delivered

import wRPC;
wRPC.init();
factory = wRPC.load("rusty_toy_factory");
factory.call("main");

C/C++

Describes a Santa function.

#include<wRPC>
#include<vector>
using namespace std;
wRPC.exportAll();

bool deliver(vector<string> gifts, int globalRegion){
    // Does delivering
    return true;
}

Rust

Get the Santa module to deliver gifts generated in rust.

use wRPC;

fn main(){
    let santa: wRPC::Module;
    match wRPC.get("santa") {
        Ok(jolly) => santa = jolly;
        Err(_) => panic;
    }

    let result =
        santa.call("deliver", [["gift","coal", "Commadore64"], 136);
    // All of the gifts got delivered to region 139

}

Go Lang

Not Done yet!

package main
import "fmt"
func main() {
    fmt.Println("hello world")
}