If you've read GamingOnLinux regularly, you will likely know how I am a big fan of SC Controller [GitHub]. It's a user-made driver and interface for using and mapping the Steam Controller. It's also now going under some major changes.
After previously noting how they weren't happy with certain issues surrounding Linux (like the Code of Conduct), the previous release was going to be the last for a while. Glad to see them back though, it's an incredibly useful tool.
So what's going on? Well, the developer "kozec" is rewriting large parts of SC Controller from Python to C with an aim to make it "much more portable" including Windows support and eventually Android.
For those interested, you can see the code on GitHub which is in a separate branch. They've also release version 0.4.9.1, which is the first rather experimental build with it using the new code.
Now, since I'm not a programmer, somebody can explain how C will help with portability instead of Python?
Last edited by Klaus on 26 November 2018 at 11:58 am UTC
I hope this means Kozec-san has un-paused his Patreon payments, too. :)
Last edited by Nanobang on 26 November 2018 at 12:41 pm UTC
A python interpreter is a quite hefty penalty, and also there are C-compilers for _far_ more target-systems than there are platforms with python-interpreters.
Also, with C you basically "only" need to port the libs in use (with shims for everything you don't care about) when moving to an esoteric platform (this kinda was the purpose of C to begin with) while with Python you need to port the entire intepreter.
For a bit extreme case that still is easy to imagine - consider the case of an arduino (say, for an homebrew arcade machine). What would you find the easiest to do: port a C-program to fit into a couple of kB of memory, or try to wedge an entire interpreter in those same kB?
And as an aside, when working from another language it is a lot easier to interface with C than with Python (the former is often fairly automated as well as being common, not so about the latter).
Last edited by Shmerl on 26 November 2018 at 12:42 pm UTC
Quoting: GuestWhy?
Many reasons really. Here is one C developer putting it in more detail: https://dpc.pw/still-in-love-with-rust
I'd highlight this part:
QuoteI loved the simplicity and minimalism, I loved the flexibility and control, but I couldn't stand primitivism and lack of modern features.
That's exactly how I feel about C, when I work with it :) I'd take Rust over C any time.
To put it differently. If you need to support an existing project - fine. But if you are making a new one (like here switching to another language), don't start it in C or C++. Start it in Rust.
Last edited by Shmerl on 26 November 2018 at 1:02 pm UTC
Quoting: GuestAh ok, a personal preference thing rather than a technical one.
On a technical level, C is a better choice here, for ease of cross-platform support on something that is lower level and may require kernel interaction. Pretty much everything is going to have a form of libc, and target platforms will have a lot of support (from compilers and build systems, to additional libraries that might be needed) already in C.
It's both and the reason for preference is technical, not simply one of taste. Rust can interact with kernel all the same by the way. Rust does depend on libc at present.
See https://github.com/rust-lang-nursery/portability-wg/issues/13
And an interesting example here: https://github.com/tsgates/rust.ko
Last edited by Shmerl on 26 November 2018 at 1:13 pm UTC
Quoting: Guestand then advocating adding Rust dependencies on top doesn't sound like a good idea in this case. I just don't see a use case for Rust for this project's goals (or at least what I'm interpreting to be the goals).
Not any more than advocating for C in this case. If you think mixing languages is bad here, it's bad with C as well. But if you think rewrite is useful, Rust only has advantages over C, offering the same functionality.
Last edited by Shmerl on 26 November 2018 at 2:49 pm UTC
See more from me