Introduce comptime builtins corresponding to FunC string literal types #444
Labels
feature: builtins
Builtin functions
scope: partial-eval
The constant and partial evaluation optimization mechanisms (src/optimizer/constEval.ts)
Milestone
like
h
,c
, etc. See https://docs.ton.org/develop/func/literals_identifiers.I don't think we should extend the syntax of string literals with these suffixes, because those are too cryptic for beginners, we should just introduce those as compile-time builtin functions, like
crc32("foobar")
as a Tact analogue for"foobar"c
in FunC."string"s
— defines a raw slice const by its contents (hex-encoded and optionally bit-padded) [added in PR #787 -rawSlice("string")
];"string"a
— creates a slice const containing MsgAddressInt structure from a specified address [already have it:address("string")
];"string"u
— creates an int const that corresponds to the hex values of the provided ASCII string [added in PR #787 -ascii("string")
];"string"h
— creates an int const that is the first 32 bits of the SHA256 hash of the string [no need: can be solved withsha256
and a bit mask, this will be optimized in compile-time];"string"H
— creates an int const that is all 256 bits of the SHA256 hash of the string [already have it:sha256("string")
];"string"c
— creates an int const that is crc32 value of the string [added in PR #787:crc32("string")
].The text was updated successfully, but these errors were encountered: