Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Compiler gas accounting #40

Open
vaivaswatha opened this issue Jul 5, 2020 · 1 comment
Open

Compiler gas accounting #40

vaivaswatha opened this issue Jul 5, 2020 · 1 comment
Labels

Comments

@vaivaswatha
Copy link
Contributor

The compiler itself must consume gas, like the type-checker does.

Of particular concern is the monomorphizer which specializes polymorphic code and must charge for each specialization. It also has a complex type-flow analysis that needs to charge gas as it progresses.

@vaivaswatha vaivaswatha added the gas label Jan 4, 2021
@vaivaswatha
Copy link
Contributor Author

One way to do this is to run the compiler itself in a VM. For example using a custom version of the OCaml bytecode interpreter that charges gas per instruction. However, this was found to be ~10x slower than native OCaml code execution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant