-
Notifications
You must be signed in to change notification settings - Fork 32
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
ocaml-interop integration #48
Merged
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
7b77771
Use ocaml-interop for low-level operations
zshipko 077e0a5
WIP
zshipko 1678907
Add ability to rename gc handle
zshipko 3e4d49c
Mark Value methods as unsafe
zshipko e52a231
Remove ocaml-sys macros
zshipko 8d59b1e
WIP
zshipko 05157f3
Remove Rooted
zshipko 8b5c9e8
Create rooted values from parameters in ocaml::body
zshipko 468f57f
Use ocaml-interop git repo
zshipko 6b44c41
clippy
zshipko 31c53ab
ci
zshipko 692e411
clippy
zshipko 2d25bc0
Fix attr
zshipko aadc97d
Remove call to Gc.minor to ensure allocation issues have been fixed
zshipko 4f81aed
cleanup
zshipko caff018
Start adding more OCaml values in tests
zshipko bc69178
Updates for latest ocaml-interop
zshipko d3a8d68
as_i64 -> to_i64
zshipko b750c46
Switch to ocaml-interop release
zshipko ac59e68
ToValue -> IntoValue
zshipko 548276c
Use immutable ref for runtime handle in into_value
zshipko 4fc48dd
Versions, cleanup derive
zshipko 56d55c0
clippy
zshipko d8f7af4
Calls to into_value should not be marked as unsafe
zshipko a538444
Mark Value::interop as unsafe and remove unnecessary transmute
zshipko dcf0330
Fix test
zshipko 802a9f9
Add a note about ocaml-interop, use interop::ocaml to call OCaml func…
zshipko e9fb849
Fix clippy
zshipko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zshipko question, why did you go from
to
->into
? (I'm curious about this because I went the opposite direction in ocaml-interop, by makinginto_rust
->to_rust
because I think that in rust theinto
assumes thatself
is consumed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is something I probably want to change back. In this case the trait is actually consuming
self
, but I don't think that is really the best idea here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the thing is that
Value
isCopy
right? I think I had it like that for the same reason, but since the original value is still available I decided to switch to theto_
prefix. I am not really sure about what the convention is in cases like this, but my reasoning is that (in addition to what I said on the previous sentence) sinceValue
is more like a reference than the actual valueto_
made more sense.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I remember that
IntoValue
consumesself
to makeCustom
values better integrated. It seems like consumingself
is actually kind of nice because it prevents the value from being accessed after being converted to OCaml.I will need to think about the various trade-offs a little more...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main impetus behind the name change was that clippy was complaining about it being named
To*
and not taking a reference. But I think your explanation makes more sense.