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

docs: improve C-FFI docs, link to corresponding JSON-RPC docs #6303

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

r10s
Copy link
Member

@r10s r10s commented Dec 2, 2024

this PR mainly links to at least some JSON-RPC docs - not sure, if there is a better link, this is the best source i could find :)

at some point, we will streamline all that, but also for now it is good to have some pointers (i am also failing regularly to find json-rpc docs :)

* and at some point we will get to improve that :)
*
* Also, note that most calls are more high-level than this CFFI, require more database calls and are slower.
* They're more suitable for an environment that is totally async, which might not be true for native apps.
Copy link
Member

Choose a reason for hiding this comment

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

Or in cases where you can not use the cffi, for example when you need to use the api over a process boundary where you can not safely pass over C-Pointers.
Like in deltachat desktop using the deltachat api from the frontend, which is a separate process.

Copy link
Member Author

@r10s r10s Dec 2, 2024

Choose a reason for hiding this comment

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

sure, we created the JSON-RPC for that - but this is about the documentation of C-FFI. but i refined that point

@Simon-Laux
Copy link
Member

Simon-Laux commented Dec 2, 2024

First of all thanks for caring!

at some point, we will streamline all that, but also for now it is good to have some pointers (i am also failing regularly to find json-rpc docs :)

I have improvements for jsonrpc documentation included in the nlnet proposal that I submitted yesterday ("improve bot docs").
In an ideal world we would have auto generation of a wrapper library also for python, java and swift. To get the same type checking, autocomplete and docs generation that we have for typescript
But that's currently out of scope.

While the description in this pr might sound a bit negative of the jsonrpc api, the one I made in my draft blogpost is a bit biased against the cffi.

I have a section at the end of my blog post draft, mentioning what still needs to be done to improve the jsonrpc api.
I believe I don't have all the aspects yet that need to be improved. For example I just added the naming inconsistency topic to the to do of the pr. (thanks for mentioning it again, it had forgotten about it)
It would be great if you could help me complete the list of jsonrpc shortcomings, that:

  • we have a list that we can track
  • that I can mention that list in the blogpost under the motto of showing the reader what still needs improvements and invite them to contribute

The blog post draft: deltachat/deltachat-pages#984

@r10s
Copy link
Member Author

r10s commented Dec 2, 2024

yeah, i know there are ongoing efforts, this is why i wrote "we will get to improve that" :) for other points, i commented at deltachat/deltachat-android#3459 (comment)

however, the gist of this PR is not to discuss the pros+cons of C-FFI s. JSON-RPC, but to add a pointer to JSON-RPC and to clarify some things for C-FFI usage as there was just nothing before, and it regularly happens that i get asked :)

so, this PR is even pro-JSON-RPC, if you will, it adds a pointer, also clearly stating that things won't become available outside JSON-RPC :)

@r10s r10s force-pushed the r10s/fix-improve-docs branch from d002e74 to 60b3485 Compare December 2, 2024 12:48
@r10s r10s force-pushed the r10s/fix-improve-docs branch from 60b3485 to b84c63c Compare December 2, 2024 12:55
@r10s r10s merged commit 6099222 into main Dec 2, 2024
37 checks passed
@r10s r10s deleted the r10s/fix-improve-docs branch December 2, 2024 13:35
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