Skip to content

spike: utils #119

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

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from
Draft

spike: utils #119

wants to merge 39 commits into from

Conversation

joe-p
Copy link
Collaborator

@joe-p joe-p commented Jun 3, 2025

Spike to see what a rust-based utils would be like. Focusing on Python and TS.

See this comment to see how to get it working: PyO3/maturin#2459 (comment)

joe-p added 2 commits June 3, 2025 11:29
Had to work around this bug in maturin:
PyO3/maturin#2459

This fix is relatively simple but requires you to modify the packages
post-installation. A fix (more like feature) can be added to maturin and
I think it should be fairly straightforward
Copy link
Collaborator

@aorumbayev aorumbayev left a comment

Choose a reason for hiding this comment

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

It be great to also capture the spike (once its finalized) as an architecture diagram or a md document that highlights all user facing utils interfaces (based on current py vs ts interfaces that maintain feature parity) and lists down their public user facing methods/functions, as well as which of those would be exposed via ffi vs which would only have a stub and would have to be implemented manually in binding packages in target languages (referring to packages in packages folder).

}

#[derive(uniffi::Object)]
pub struct Composer {
Copy link
Collaborator

@aorumbayev aorumbayev Jun 3, 2025

Choose a reason for hiding this comment

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

Would the idea be to expose all main high level utils abstractions but excluding any user facing methods that would interact with API clients or any excessively stateful logic (deferring the implementation to the target language ffi binding package)? For example how would we implement send method on a TransactionComposer - i presume it will be possible to handle it completely on rust side but we can't expose it via ffi (given extra fact that api clients will exist natively per each target language) but is there a way to expose some sort of abstract stub that can then be implemented in target package (py/ts/...) by ourselves manually?

joe-p added 27 commits June 3, 2025 18:32
There is something weird going on with the env package though. For now
you need to bun rm env, run the build script, and then bun i env before
running the tests
Mutex works in WASM and only adds a few nanos of overhead, so just
easier to use Mutex for both uniffi and wasm
It works, but there seems to be some closure that isn't getting cleaned
up properly in the async call
Bun prefers main over module for some reason at runtime. See
oven-sh/bun#13430 (comment)
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.

2 participants