-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpreter called only when adding a contract #970
Comments
This problem occurs because the interpreter is called when the writer is called. In turn, the writer is called only when there is a declared contract in the Tact file (see the for-statement at line 100 in file I understand that a FunC file describes the behavior of a contract (it is basically a list of receiver functions together with auxiliary functions). Therefore, if there is no declared contract in a Tact file, there is no FunC program to generate. But then, in a file like this,
what is point of running the typechecker if it is not going to be compiled into FunC anyway? Probably because there are Tact files that are essentially collections of functions that can be used in other Tact files? In that case, I think that the interpreter should be called not when the writer is called, but immediately after the typechecker finishes. In other words, there must be a pass to simplify expressions before the FunC code generation phase. What do you think of this? |
yes, this makes sense. btw, when you implement this, please add a CLI option to output the resulting simplified Tact contract (will be really useful for debugging) |
@anton-trunov, I think I should already create the "optimization phase" in
Inside |
Note that this is only the high level optimization pass. Optimization phases for lower level code will need to be added after the FunC generation. |
@jeshecdom sounds good also, let's add the ability to opt-out of optimizations, for instance, in case there is a bug in the optimizer |
Are you using the latest released (or pre-released, a.k.a. "next") version?
Tact source code
Relevant Tact/build system log output
No response
What happened?
The interpreter is not activated. But, if we add a dummy contract, like so:
The interpreter now produces the div by zero at line
A
.What did you expect?
I expected a div by zero at compile-time.
Steps to reproduce
No response
How do you run Tact?
Tact CLI
Anything else?
No response
The text was updated successfully, but these errors were encountered: