Skip to content
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

dev: move python hints to a dedicate module #290

Open
3 tasks
ClementWalter opened this issue Dec 18, 2024 · 0 comments
Open
3 tasks

dev: move python hints to a dedicate module #290

ClementWalter opened this issue Dec 18, 2024 · 0 comments
Assignees

Comments

@ClementWalter
Copy link
Member

ClementWalter commented Dec 18, 2024

Why

Currently, python hint implementation are just python code in a plain text variable. This prevents benefitting from all the features required when developing (IDE, testing).

What

Create a hint module where each function is actually a hint.
Use import_lib and inspect to get the body of each function as a hint registered with the function name

Tasks

Preview Give feedback
            exec_locals["memory"] = memory = self.validated_memory
            exec_locals["ap"] = ap = self.run_context.ap
            exec_locals["fp"] = fp = self.run_context.fp
            exec_locals["pc"] = pc = self.run_context.pc
            exec_locals["current_step"] = self.current_step
            exec_locals["ids"] = hint.consts(pc, ap, fp, memory)

            exec_locals["vm_load_program"] = self.load_program
            exec_locals["vm_enter_scope"] = self.enter_scope
            exec_locals["vm_exit_scope"] = self.exit_scope
            exec_locals.update(self.static_locals)
            exec_locals["builtin_runners"] = self.builtin_runners
            exec_locals.update(self.builtin_runners)
CairoHint(
    accessible_scopes=hint_.accessible_scopes,
    flow_tracking_data=hint_.flow_tracking_data,
    code=inspect(hints).get(hint_.code).get_body(),
)
@ClementWalter ClementWalter moved this to Backlog in Keth Dec 18, 2024
@ClementWalter ClementWalter moved this from Backlog to Todo in Keth Jan 6, 2025
@ClementWalter ClementWalter moved this from Todo to In progress in Keth Jan 7, 2025
@ClementWalter ClementWalter self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

No branches or pull requests

1 participant