13. A non-transitory computer readable medium comprising instruction that, when executed by a processor, perform a method for generating an optimized application source code, comprising: determining that a programmatic expression in a first function call corresponds to a complex promise type based on the programmatic expression comprising a second function call having user-defined code, the second function call to a second function, the first function call located in a caller function of an original application source code; determining a first value for the programmatic expression based on evaluating the second function using a context of the caller function system state during execution of the caller function; compiling the programmatic expression into a first optimized code portion using the first value, an assumption, and an expression scope, wherein the assumption denotes whether the first value is valid; replacing the programmatic expression in the original application source code with the first optimized code portion to create the optimized application source code; executing the optimized application source code; responsive to executing the optimized application source code, determining that the programmatic expression is modified outside of the expression scope; in response to determining that the programmatic expression is modified outside of the expression scope, invalidating the assumption to indicate that the first value is invalid; in response to invalidating the assumption, de-optimizing the first optimized code portion, wherein de-optimizing comprises determining a second value for the programmatic expression using the complex promise type; and continuing execution using the second value for the programmatic expression.
13. A non-transitory computer readable medium comprising instruction that, when executed by a processor, perform a method for generating an optimized application source code, comprising: determining that a programmatic expression in a first function call corresponds to a complex promise type based on the programmatic expression comprising a second function call having user-defined code, the second function call to a second function, the first function call located in a caller function of an original application source code; determining a first value for the programmatic expression based on evaluating the second function using a context of the caller function system state during execution of the caller function; compiling the programmatic expression into a first optimized code portion using the first value, an assumption, and an expression scope, wherein the assumption denotes whether the first value is valid; replacing the programmatic expression in the original application source code with the first optimized code portion to create the optimized application source code; executing the optimized application source code; responsive to executing the optimized application source code, determining that the programmatic expression is modified outside of the expression scope; in response to determining that the programmatic expression is modified outside of the expression scope, invalidating the assumption to indicate that the first value is invalid; in response to invalidating the assumption, de-optimizing the first optimized code portion, wherein de-optimizing comprises determining a second value for the programmatic expression using the complex promise type; and continuing execution using the second value for the programmatic expression. 16. The non-transitory computer readable medium of claim 13 , wherein de-optimizing the first optimized code portion further comprises replacing the first optimized code portion with the programmatic expression.