Created
October 11, 2018 12:18
-
-
Save shaunlebron/4475edcf89a1a7693fb2a820cbf0682b to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/nisoget
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://unpkg.com/[email protected]/dist/walt.js"></script> | |
<script id="jsbin-javascript"> | |
// See https://github.com/ballercat/walt/tree/master/packages/walt-compiler | |
const walt = Walt; | |
function walt2wat(source) { | |
const {prettyPrintNode,compile} = walt; | |
return prettyPrintNode(compile(source).ast); | |
} | |
console.log(walt2wat(` | |
const x: i32 = 2; | |
export function echo(): i32 { | |
const x: i32 = 42; | |
return x; | |
} | |
`)); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">// See https://github.com/ballercat/walt/tree/master/packages/walt-compiler | |
const walt = Walt; | |
function walt2wat(source) { | |
const {prettyPrintNode,compile} = walt; | |
return prettyPrintNode(compile(source).ast); | |
} | |
console.log(walt2wat(` | |
const x: i32 = 2; | |
export function echo(): i32 { | |
const x: i32 = 42; | |
return x; | |
} | |
`));</script></body> | |
</html> |
This file contains hidden or 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
// See https://github.com/ballercat/walt/tree/master/packages/walt-compiler | |
const walt = Walt; | |
function walt2wat(source) { | |
const {prettyPrintNode,compile} = walt; | |
return prettyPrintNode(compile(source).ast); | |
} | |
console.log(walt2wat(` | |
const x: i32 = 2; | |
export function echo(): i32 { | |
const x: i32 = 42; | |
return x; | |
} | |
`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment