leo
leo copied to clipboard
[Feature] Use a keyword to designate external functions?
There are currently two kinds of functions in Leo:
- External functions, callable "from outside" (e.g. via input files), and designated via the
@program
annotation. - Internal functions, also called 'helper functions', callable only from within the program, and designated via the absence of the
@program
annotation.
Given that this is an important distinction, we could consider using a keyword like external
to designate external functions. There is nothing wrong with using an annotation. This is just an idea.
Based on today’s discussion with @d0cd: Related to this, we could also consider whether, instead of the @inline
annotation, we could use an inline
keyword instead. This property is more “internal” to the Leo compiler, instructing it to either inline a function or to map it to an Aleo closure, so perhaps an annotation might be appropriate after all.
Closing this since this is the motivation for transition functions which exist in Leo v1.6.2.