Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xplpc/xplpc
Cross Platform Lite Procedure Call - Support Linux, macOS, Windows, iOS, Android, Web Assembly, Flutter, Kotlin, Python and More
https://github.com/xplpc/xplpc
cross-platform cxx javascript jni kotlin mobile procedure-call python rpc swift typescript webassembly
Last synced: 20 days ago
JSON representation
Cross Platform Lite Procedure Call - Support Linux, macOS, Windows, iOS, Android, Web Assembly, Flutter, Kotlin, Python and More
- Host: GitHub
- URL: https://github.com/xplpc/xplpc
- Owner: xplpc
- License: mit
- Created: 2023-01-27T09:11:06.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-13T16:02:00.000Z (about 1 month ago)
- Last Synced: 2024-12-13T16:12:15.197Z (about 1 month ago)
- Topics: cross-platform, cxx, javascript, jni, kotlin, mobile, procedure-call, python, rpc, swift, typescript, webassembly
- Language: Python
- Homepage: https://xplpc.github.io
- Size: 7.76 MB
- Stars: 38
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
XPLPC - Cross Platform Lite Procedure Call
## Project
The XPLPC project connects languages and platforms, allowing for the transfer of serialized data between them. This is achieved without the need for a server, but instead by utilizing device memory. This approach is known as Lite Procedure Call.
The Platform Proxy class plays a crucial role in this process by connecting both languages and platforms, and facilitating the transfer of data using device memory instead of the HTTP protocol. This allows for a more efficient and streamlined communication process.
For example, you can call a procedure written in C++ code from a mobile application, or vice versa, with ease. This opens up a wide range of possibilities for developers and allows for a more seamless integration of different languages and platforms.
The XPLPC project is also highly user-friendly, as it does not require the use of generators or additional tools. This means that the generated library can be added to your existing project without the need for any rewriting of code. This plug-and-play feature allows for full code reuse and makes the integration process smooth and hassle-free.
## Workflow
## How to use
Using C++ code:
```cpp
auto request = Request{
"sample.login",
Param{"username", "paulo"},
Param{"password", "123456"},
Param{"remember", true},
};Client::call(request, [](const auto &response) {
std::cout << "Returned Value: " << (response ? response.value() : "Empty") << std::endl;
});
```Using Kotlin code:
```kotlin
val request = Request(
"sample.login",
Param("username", "paulo"),
Param("password", "123456"),
Param("remember", true)
)Client.call(request) { response ->
println("Returned Value: $response")
}
```Using Swift code:
```swift
let request = Request(
"sample.login",
Param("username", "paulo"),
Param("password", "123456"),
Param("remember", true)
)Client.call(request) { (response: String?) in
print("Returned Value: \(response)")
}
```Using WASM with Typescript:
```typescript
const request = new XRequest(
"sample.login",
new XParam("username", "paulo"),
new XParam("password", "123456"),
new XParam("remember", true),
);XClient.call(request).then((response : string | undefined) => {
console.log("Returned Value: " + response);
});
```Using Flutter with Dart:
```dart
var request = Request("sample.login", [
Param("username", "paulo"),
Param("password", "123456"),
Param("remember", true),
]);Client.call(request, (response) {
print(response);
});
```Using Python code:
```python
request = Request(
"sample.login",
[
Param("username", "paulo"),
Param("password", "123456"),
Param("remember", True),
],
)response = Client.call(request)
print(response)
```Obs: There are syntax suggar for async/await/future calls, see the documentation about each language/platform.
## Supported languages and platforms
* C
* C++
* Kotlin (Android, Desktop)
* Swift (iOS, macOS, tvOS, watchOS, Catalyst)
* WebAssembly
* Flutter (iOS, Android, Desktop)
* Python## Documentation
* [General](docs/general.md)
* [C](docs/c.md)
* [C++](docs/cxx.md)
* [Kotlin](docs/kotlin.md)
* [Swift](docs/swift.md)
* [WebAssembly](docs/wasm.md)
* [Flutter](docs/flutter.md)
* [Python](docs/python.md)
* [Dependency Manager](docs/dependency-manager.md)
* [Contribution](docs/contribution.md)
* [Purpose](docs/purpose.md)## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2022-2024, Paulo Coutinho