Squiggle syntax brainstorm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let ( | |
http = require("http"), | |
handler = fn(_req, res) do { | |
res.writeHead(200, {"Content-Type": "text/plain"}); | |
res.end("Hello, world!"); | |
} | |
) do { | |
http.createServer(handler).listen(1337, "127.0.0.1"); | |
print("Server started at http://127.0.0.1:1337/"); | |
if (P) do { | |
A; | |
B; | |
C; | |
} else do { | |
D; | |
E; | |
F; | |
}; | |
console.log(if (DEBUG) then "debug" else "production"); | |
xs | |
.map(fn(x) x + 1) | |
.reduce(fn(acc, x) acc + x) | |
.forEach(fn(x, _, _) print(x)); | |
finalValue; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let ( | |
http = require("http"), | |
handler = ~( _req, res | | |
res.writeHead(200, {"Content-Type": "text/plain"}); | |
res.end("Hello, world!") | |
) | |
) in | |
http.createServer(handler).listen(1337, "127.0.0.1"); | |
print("Server started at http://127.0.0.1:1337/"); | |
(if P then | |
A; | |
B; | |
C | |
else | |
D; | |
E; | |
F | |
); | |
console.log(if DEBUG then "debug" else "production"); | |
xs | |
.map(~( x | x + 1 )) | |
.reduce(~( acc, x | acc + x )) | |
.forEach(~( x, _, _ | print(x))); | |
finalValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
http = require("http"), | |
handler = fn(_req, res) do | |
res.writeHead(200, {"Content-Type": "text/plain"}); | |
res.end("Hello, world!") | |
end | |
in | |
http.createServer(handler).listen(1337, "127.0.0.1"); | |
print("Server started at http://127.0.0.1:1337/"); | |
if P then | |
A; | |
B; | |
C | |
else | |
D; | |
E; | |
F | |
end; | |
console.log(if DEBUG then "debug" else "production" end); | |
xs | |
.map(fn(x) x + 1) | |
.reduce(fn(acc, x) x + 1) | |
.forEach(fn(x, _, _) print(x)); | |
finalValue | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment