You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To optimize we'd first need to add an IsPure() to the Function interface, so the optimizer could pre-evaluate pure expressions that only rely on known literal values (like (+ 1 2)).
Optimizing would be mostly for fun and giggles and not truly something that I consider necessary for a small language with usually small programs like with Rudi. But it could still be fun to try.
The text was updated successfully, but these errors were encountered:
Work on the optimizer has stalled because Rudi cannot represent intermediary data. Think of a statement like
(set! $v (semver "1.2.3"))
semver is pure (i.e. side-effect free), so the optimizer would pre-evaluate the function call, but then I currently have no option to represent that output value (a *semver struct) as Rudi, so I cannot generate (set! $v ...???....). My goal was originally to be able to have an optimizer that would take an AST and return an AST, which can be dumped as Rudi code. But currently I see no good way of doing it.
One workaround would be to say that optimized AST's can only live in memory and not be dumped. Then I can use ast.Shim to contain arbitrary values.
To optimize we'd first need to add an
IsPure()
to the Function interface, so the optimizer could pre-evaluate pure expressions that only rely on known literal values (like(+ 1 2)
).Optimizing would be mostly for fun and giggles and not truly something that I consider necessary for a small language with usually small programs like with Rudi. But it could still be fun to try.
The text was updated successfully, but these errors were encountered: