This PR aims to reduce the memory consumption of inferno, by storing prelude functions that are defined as inferno Exprs as Exprs in the prelude and not evaluating the expressions until runtime. You can think of this as though we're inlining any such primitives to the script.
Because of this, prelude evaluation no longer needs to be within the ImplEnvM monad, so that has been removed as well. This has meant we changed the type of toValue to no longer be under a monad too.
This should reduce the memory consumption significantly, but might increase runtime slightly. I don't expect the increase to be too much because most primitive definitions are functions, so they can't be fully evaluated at compile time anyway, which is why they were being stored in memory as huge thunks.
This PR aims to reduce the memory consumption of inferno, by storing prelude functions that are defined as inferno
Expr
s asExpr
s in the prelude and not evaluating the expressions until runtime. You can think of this as though we're inlining any such primitives to the script.Because of this, prelude evaluation no longer needs to be within the
ImplEnvM
monad, so that has been removed as well. This has meant we changed the type oftoValue
to no longer be under a monad too.This should reduce the memory consumption significantly, but might increase runtime slightly. I don't expect the increase to be too much because most primitive definitions are functions, so they can't be fully evaluated at compile time anyway, which is why they were being stored in memory as huge thunks.