language. So far, the parser kind of works but the compilation step is still work in progress. The language (bitscript) uses a Javascript like syntax.
The following script should compile to a standard transaction script (eventually):
function main(sig, pubKey) {
pubKeyHash = '1eHhgW6vquBYhwMPhQ668HPjxTtpvZGPC';
pubKeyHashA = hash160(pubKey);
// should be optimized to OP_EQUALVERIFY
assert(pubKeyHash == pubKeyHashA);
// should be optimized to OP_CHECKSIGVERIFY
assert(checksig(sig, pubkey));
}
I'm posting this here mainly to keep me motivated and in case anyone wants to participate. I'm writing the compiler using Node.js + Jison. https://github.com/olalonde/compiler/