Hi all,
Been a long time since I’ve actively worked with Solidity and am catching up on a few years of developments.
One language feature that I’ve always missed in Solidity is the ability to specify that a simple function should be compiled as inline bytecode rather than jumped to through the stack.
I recall some historical discussion against macros due to additional preprocessing and metalanguage development…or some reason, but I don’t know if there’s been any discussion on introducing an inline
function modifier
Use cases would typically be simple library functions and other simple checks (maths, explicit mutations, assembly snippets, transient memory sets/checks etc) where the generated bytecode of the logic compiles to less than jump routines and execution costs that would wrap it.
Somewhat related is the curious compilation of constants which if modified as public
are referenced through their getter function rather than inlined as they are if not made public.
Anyway… requesting inline
as a modifier. I don’t know how much the optimiser does to inline such code but it would be nice to have an explicit syntax