Scope: A Web Programming Language To-Be

Spencer Lockhart
Jul 29, 2018 · 2 min read

What’s Scope look like?

let server = httpServer((client: []) {
client.socket.on("buttonClick", {
client.find("#serverEmits").text("Message from Outer-space");
});
client.response.send(site);
});
let tellServer = (e: []) {
server.socket.emit("buttonClick");
};
let button = <button onClick=tellServer>
"Click me";
</button>;
let site =
<html>
<head>
<title>Example Site</title>;
</head>;
<body>
<div id="serverEmits"></div>;
button;
</body>;
</html>;
let server = httpServer((client: []) {
public message = "";
public repeatText = (data: "") {
message = data;
};
client.response.send(site);
});
let txt = <input type="text" bindIn=server.repeatText />;let site =
<html>
<head>
<title>Example Site</title>;
</head>;
<body>
<div bindOut=server.message"></div>;
txt;
</body>;
</html>;

What else needs to be done?

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade