GSoC 2020 Building binary addons in Rust
#1
Hi, I've been taking a look at the project idea which attempts to build binary addons in Rust. In the idea description it mentions:
Quote:But these [binary addons] need to be build one by one for each platform and also might fail on errors. Rust might help with both of those problems and more.
I have some queries.

How will Rust be able to help solve the problem that these addons are supposed to be built for each platform one-by-one? Shouldn't it already be possible to cross-compile C++ addons for a different target platform?
It also mentions that current binary addons might fail on errors and that Rust can help. I assume because it's easier to write safe code in Rust?
Reply
#2
I don't know much about cross-compilation with it, but Rust's build tooling (cargo) is way more streamlined and easy to use than C++ tools. I didn't write the project description but I think that's what it's getting at.

Regarding might fail on errors, it's probably referring to build issues; but certainly Rust would also bring its own strengths to the table like memory safety, as you mentioned.
Mostly working on Retroplayer graphics.
GitHub: github.com/VelocityRa
Reply
#3
I see.
Quote:Rust's build tooling (cargo) is way more streamlined and easy to use than C++ tools.
Yup, indeed! I really like the idea. This looks very interesting for external binary addons, but I guess not so much for using Rust on binary addons currently residing in Kodi's main source tree since that would introduce a big additional dependency of having Rust compiler installed for compiling Kodi. What are your thoughts on this?
Reply
#4
I think that's for the team to decide on and shouldn't keep a project like this from being accepted, as we can learn a bunch of stuff from this. Essentially this could also be a breeding ground to see if we can get acceptance for rust in the codebase and grow it into the old application parts.
Reply
#5
Alrighty, thanks! I'll dig more into to see if this is a project suitable for me.
Reply
#6
(2020-02-29, 19:57)ritiek Wrote: This looks very interesting for external binary addons, but I guess not so much for using Rust on binary addons currently residing in Kodi's main source tree since that would introduce a big additional dependency of having Rust compiler installed for compiling Kodi. What are your thoughts on this? 

I'm currently working on a side project that embeds a rust dependency in Kodi. I'll probably never PR (just like I never did after embedding OpenJDK), but if someone came along and did the work I'd argue for supporting it.
Reply
#7
(2020-03-05, 07:17)garbear Wrote: I'm currently working on a side project that embeds a rust dependency in Kodi. I'll probably never PR (just like I never did after embedding OpenJDK), but if someone came along and did the work I'd argue for supporting it.

Stumbled on this while googling.
Do you have any public progress on integrating Rust with Kodi?
I'm thinking of doing something similar (have a lib in Rust that I don't want to reimplement in C++). The CXX crate looks promising for this.
Reply
#8
(2021-01-22, 05:56)quietvoid Wrote:
(2020-03-05, 07:17)garbear Wrote: I'm currently working on a side project that embeds a rust dependency in Kodi. I'll probably never PR (just like I never did after embedding OpenJDK), but if someone came along and did the work I'd argue for supporting it.

Stumbled on this while googling.
Do you have any public progress on integrating Rust with Kodi?
I'm thinking of doing something similar (have a lib in Rust that I don't want to reimplement in C++). The CXX crate looks promising for this.

Is it possible to compile a Rust library as a C library? Quick search on google make it sound like that should be possible, example: https://docs.rust-embedded.org/book/inte...ith-c.html

If so then you might want to check out this other thread about a (PVR) binary addon written in the Go Programming Language for Kodi -> https://forum.kodi.tv/showthread.php?tid=355978

@botallen coded "Go Lang Demo PVR client add-on" as a proof-of-concept using a Go Lang library compiled as a C shared library (library.so/library.dll) and was that way able to make Kodi use it.

Should be mentioned that thread @botallen wrote that he has plans on updating that proof-of-concept addon to use Kodi's new pure C API/ABI which binary addons now use in Kodi v19.

Kodi now features pure C APIs for binary addons which can enable interoperability between different languages as long you can compile your other language code/libraries into C libraries
Reply
#9
(2021-03-09, 10:22)RockerC Wrote: Is it possible to compile a Rust library as a C library? Quick search on google make it sound like that should be possible, example: https://docs.rust-embedded.org/book/inte...ith-c.html

If so then you might want to check out this other thread about a (PVR) binary addon written in the Go Programming Language for Kodi -> https://forum.kodi.tv/showthread.php?tid=355978

@botallen coded "Go Lang Demo PVR client add-on" as a proof-of-concept using a Go Lang library compiled as a C shared library (library.so/library.dll) and was that way able to make Kodi use it.

Should be mentioned that thread @botallen wrote that he has plans on updating that proof-of-concept addon to use Kodi's new pure C API/ABI which binary addons now use in Kodi v19.

Kodi now features pure C APIs for binary addons which can enable interoperability between different languages as long you can compile your other language code/libraries into C libraries

Thanks!
The part I'm mostly worried about is integrating it into the Kodi building process, because it wouldn't be an addon but something used in the Kodi decoding code.
So it would probably have to be built along with the other current dependencies such as ffmpeg, but I'm not good with cmake.
Reply



Logout Mark Read Team Forum Stats Members Help
GSoC 2020 Building binary addons in Rust0
This forum uses Lukasz Tkacz MyBB addons.