Skip to content

feat: add PTR as an alias for I64 #16

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

Merged
merged 4 commits into from
Nov 30, 2023
Merged

feat: add PTR as an alias for I64 #16

merged 4 commits into from
Nov 30, 2023

Conversation

mhmd-azeez
Copy link
Contributor

While the new test case works, I am not 100% sure if this is all what we need. Another pair of eyes that has more experience with Java would be appreciated

Fixes #15

@mhmd-azeez mhmd-azeez requested review from bhelx and zshipko November 21, 2023 13:54
@mhmd-azeez mhmd-azeez self-assigned this Nov 21, 2023
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add this folder to .gitignore if it isn't already? I think this is IDE specific stuff.

Copy link
Contributor Author

@mhmd-azeez mhmd-azeez Nov 21, 2023

Choose a reason for hiding this comment

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

Since the .idea folder comes with a .gitignore file, I assumed all surviving files are supposed to be checked in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the folder and added it to gitignore

@bhelx
Copy link
Contributor

bhelx commented Nov 22, 2023

Sorry if i'm a bit out of the loop on this. Is this change necessary? I think we did this in rust so the convert crate could disambiguate b/w the user wanting to pass an i64 vs a ptr but i'm not sure that distinction exists here in the Java library.

@mhmd-azeez
Copy link
Contributor Author

I actually haven't spoken to @zshipko about this, but my assumption was:

  1. It let's people make intentions explicit (i.e. document that they want/return a pointer to a memory, not just a normal i64)
  2. It keeps things consistent with the other SDKs

But he probably has more insight about this

@zshipko
Copy link
Contributor

zshipko commented Nov 22, 2023

I do think this makes things a bit more clear for users who don't know about wasm native types. We can document that I64 should always be used, but I think having PTR makes things a little less confusing.

Copy link
Contributor

@bhelx bhelx left a comment

Choose a reason for hiding this comment

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

Okay I'm cool with this!

@mhmd-azeez mhmd-azeez merged commit ddc3634 into main Nov 30, 2023
@mhmd-azeez mhmd-azeez deleted the feat/ptr-alias branch November 30, 2023 10:30
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.

Add PTR alias for I64 ValType
3 participants