JacquelineCasey / Nom

0 stars 0 forks source link

Inline functions #10

Open JacquelineCasey opened 1 year ago

JacquelineCasey commented 1 year ago

For some functions, calling the function is a significant portion of the overhead. I'd like to eventually allow functions to be inlined by the compiler if it determines it is a good idea.

I don't think I want to expose an inline keyword though, I think that could be kinda messy.

We should choose carefully which functions to inline. For instance, a function that uses each of its arguments exactly once and returns in one place might be apt for inlining. (Note - maybe this is not as good as it seems: if we want arguments to be resolved in a specific order, we are going to have to store them somewhere no matter what).

So determine if this is feasible, which functions it would be good for, and then implement inlining for those functions.