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

Better function argument verification #1810

Open
drkameleon opened this issue Nov 22, 2024 · 0 comments
Open

Better function argument verification #1810

drkameleon opened this issue Nov 22, 2024 · 0 comments
Assignees
Labels
benchmark Benchmarks and optimizations enhancement New feature or request execution Issues related to the executor (src/vm/exec.nim) vm Issues related to the Virtual Machine implementation

Comments

@drkameleon
Copy link
Collaborator

Right now, we are verify function arguments by effectively embedding an ensure call. (more or less what I describe here: https://discord.com/channels/765519132186640445/829324913097048065/1309436123017117707)

The actual implementation is here: https://discord.com/channels/765519132186640445/829324913097048065/1309437688696537138

Given that we now (and for quite some time) store all this information in a Function value's .info field (see: https://github.com/arturo-lang/arturo/blob/master/src/vm/values/types.nim#L209-L213), we could use that to check the parameters, before execution... e.g. here: https://github.com/arturo-lang/arturo/blob/master/src/vm/exec.nim#L342

@drkameleon drkameleon added enhancement New feature or request vm Issues related to the Virtual Machine implementation execution Issues related to the executor (src/vm/exec.nim) benchmark Benchmarks and optimizations labels Nov 22, 2024
@drkameleon drkameleon self-assigned this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Benchmarks and optimizations enhancement New feature or request execution Issues related to the executor (src/vm/exec.nim) vm Issues related to the Virtual Machine implementation
Projects
None yet
Development

No branches or pull requests

1 participant