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

Explore using uniffi #65

Closed
jasoncolburne opened this issue Feb 6, 2023 · 7 comments
Closed

Explore using uniffi #65

jasoncolburne opened this issue Feb 6, 2023 · 7 comments
Assignees

Comments

@jasoncolburne
Copy link
Collaborator

To support building these interfaces easily:

  • Rust
  • Python
  • Swift
  • Kotlin
  • Ruby

as suggested in a comment on #59

@jasoncolburne
Copy link
Collaborator Author

Slightly concerning wrt our time: "Please be aware that UniFFI is being developed concurrently with its initial consumers, so it is changing rapidly and there are a number of sharp edges to the user experience."

@jasoncolburne
Copy link
Collaborator Author

I did this with a library from work and it was pretty simple, but there are a few misdocumented bits. Reach out to me in slack if you need advice.

@jasoncolburne jasoncolburne self-assigned this Feb 13, 2023
@jasoncolburne
Copy link
Collaborator Author

I think I can do this fairly quickly, tonight.

@jasoncolburne
Copy link
Collaborator Author

❯ make python-shell
    Finished release [optimized] target(s) in 0.13s
    Finished release [optimized] target(s) in 0.13s
     Running `target/release/cesride-bindgen generate src/cesride.udl --out-dir src/generated --language python`
Python 3.10.10 (main, Feb  8 2023, 05:40:53) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from cesride import Diger
>>> Diger(qb64="EABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefg")
<cesride.Diger object at 0x100341540>
>>> Diger(qb64="E0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jason/src/jasoncolburne/cesride/src/generated/cesride.py", line 450, in __init__
    self._pointer = rust_call_with_error(FfiConverterTypeCesrError,_UniFFILib.cesride_f7a7_Diger_new,
  File "/Users/jason/src/jasoncolburne/cesride/src/generated/cesride.py", line 271, in rust_call_with_error
    raise error_ffi_converter.lift(call_status.error_buf)
cesride.UniFFIExceptionTmpNamespace.General: CesrError.General('general error: shortage: insufficient material: qb64 size = 2, fs = 44')
>>> 

@jasoncolburne
Copy link
Collaborator Author

jasoncolburne commented Feb 13, 2023

This was tricker than pyo3, for sure, but I think I have it mostly figured out for the python case (I don't expect many changes for other languages).

@jasoncolburne jasoncolburne linked a pull request Feb 13, 2023 that will close this issue
@jasoncolburne
Copy link
Collaborator Author

We're leaving this alone for now. I learned a lot during this exploration that will be useful later, and we think we should focus efforts on doing this in parside, at least initially, as that will be where most consumers of this code consume.

@m00sey m00sey closed this as completed Mar 30, 2023
@kentbull
Copy link
Contributor

Meeting comment 3-30-23

We can call this dead. Work referenced from Parside. PRs #82 and #106 will be closed and stay as reference PRs.

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 a pull request may close this issue.

3 participants