Skip to content

feat(interpreter): add initial built-in function call path - #100

Open
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:feature-task#96-Interpreter-initial-built-in-functions
Open

feat(interpreter): add initial built-in function call path#100
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:feature-task#96-Interpreter-initial-built-in-functions

Conversation

@Franklin-Qi

Copy link
Copy Markdown
Collaborator

Lower BuiltinCall to IntrinsicCall carrying BuiltinFunction, dispatch via Registers::get_range(), and implement trivial math/string/bitwise helpers with placeholders for the rest. Also accept builtins in expression context and load ImmF consts.

Closes: #96

@Alonely0 Alonely0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this quite a bit :)

I have a couple of small comments, other than that I'd ask if you can add some small tests for the fixmes, and annotate them with #[ignore] for the time being. Also, I'll be mostly unavailable until Tuesday or Wednesday, so feel free to take your time and merge this if my review comments are addressed okay.

Comment thread interpreter/src/vm.rs Outdated
Comment thread interpreter/src/builtins.rs
Comment thread interpreter/src/builtins.rs Outdated
Comment on lines +29 to +33
pub(crate) fn call<'a>(
fun: BuiltinFunction,
args: &[Value<'a>],
symbols: &SymbolTable<'a>,
) -> Result<Value<'a>, BuiltinError> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is likely we will need to access more properties from the interpreter (like ExecMode) and perform I/O in the future. The latter needs not be addressed for now (tho I'd guess we'll just use Either) , but I think we would benefit from implementing this as a method of the Interpreter. What do you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that's great.

Lower BuiltinCall to IntrinsicCall carrying BuiltinFunction, dispatch
via Registers::get_range(), and implement trivial math/string/bitwise
helpers with placeholders for the rest. Also accept builtins in
expression context and load ImmF consts.

Closes: uutils#96
@Franklin-Qi
Franklin-Qi force-pushed the feature-task#96-Interpreter-initial-built-in-functions branch from 278c726 to 04f945d Compare August 3, 2026 09:53
@Franklin-Qi

Copy link
Copy Markdown
Collaborator Author

I like this quite a bit :)

I have a couple of small comments, other than that I'd ask if you can add some small tests for the fixmes, and annotate them with #[ignore] for the time being. Also, I'll be mostly unavailable until Tuesday or Wednesday, so feel free to take your time and merge this if my review comments are addressed okay.

@Alonely0 Thank you for your review, that's great feedback. I've added some tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

interpreter: initial built-in functions

2 participants