We present version 1.4.3
of Archetype language.
Added
Functions
Functions can now have side effects on storage. For example, it is now valid to write:
archetype function_side_effect
variable res : nat = 0
function set_res(v : nat) {
res := v
}
entry exec(value : nat) { set_res(value) }
The set_res
function above illustrates that:
- function can now have side effects (here on
res
) - return value may now be omitted, the function may then be used as an instruction
Native Michelson code
It is now possible to write native michelson code with the follwing elements:
michelson
instruction and expressionlambda_michelson
expression
For example:
archetype michelson_instruction
entry exec (i : nat) {
michelson {
PUSH nat 0;
COMPARE;
NEQ;
IF { PUSH string "NOT_ZERO"; FAILWITH } { PUSH nat 0 }
}
}
Exponential builtin
A builtin for exponential function exp_horner
is now available. It is computed with the Horner method applied to the polynomial approwimation of the exponential function.
Changed
Literals for BLS curves types bls12_381_fr
bls12_381_g1
and bls12_381_g2
are now suffixed by fr
g1
and g2
respectively; moreover:
int
,nat
andbytes
literals cannot be used anymore asbls12_381_fr
literalsbytes
literals cannot be used anymore asbls12_381_g1
andbls12_381_g2
literals