You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Might it be feasible in future to have some kind of compileScript function that allows CashScript to compile a short segment of CashScript into CashASM?
Something like:
// First arg is the script// Second arg is the named values and their typecompileScript('a + b',{a: 'int',b: 'int',})// outputs:// <a> <b> OP_ADD
compileScript(`function x(int a, int b) { return a + b }`);// orconstrequireLockscriptP2PKH=compileScript(`function checkLockingBytecode(bytes lockingBytecode) { require(lockingBytecode.length == 25); require(lockingBytecode.split(3)[0] == 0x76a914); require(lockingBytecode.split(23)[1] == 0x88ac);}`);
That way we skip the contract overhead, but keep the function definition that has parameter data
Creating self-contained "functions" is something that is on the roadmap (although specifics are yet to be defined), but when we implement that, we could try to ensure that they could be compiled by themselves so they could be used for use cases like yours
adding a "target" for CashASM (besides "regular" hex bytecode / asm) should be doable as well.
The text was updated successfully, but these errors were encountered:
@jimtendo started a convestion on telegram (https://t.me/bch_compilers/7955) to ask
Rosco replied (https://t.me/bch_compilers/8000) that we could try to support the following:
That way we skip the
contract
overhead, but keep thefunction
definition that has parameter dataCreating self-contained "functions" is something that is on the roadmap (although specifics are yet to be defined), but when we implement that, we could try to ensure that they could be compiled by themselves so they could be used for use cases like yours
adding a "target" for CashASM (besides "regular" hex bytecode / asm) should be doable as well.
The text was updated successfully, but these errors were encountered: