Originally posted by oleid
View Post
Announcement
Collapse
No announcement yet.
Mesa Developers Discuss The Possibility Of Rust Graphics Driver Code
Collapse
X
-
Originally posted by cb88 View Post
Exactly... its not like Mesa is exposing itself as a high level library like LLVM... its providing C APIs..
Plus if in the future it is decided to bring even more languages into the internals of Mesa, they will have to bind against Rust and/or C++ and that will be difficult compared to if it was C throughout.
Getting Rust in mesa will be great for Rust because it will help cement the language into the real world but I believe it may add maintenance burden onto these guys. Luckily they are the ones that are going to make the choice so who knows.Last edited by kpedersen; 02 October 2020, 03:36 PM.
- Likes 1
Comment
-
Originally posted by kpedersen View Post
I'm not really talking about having good compatibility with C code. That is "easy" because C is so flexible and simple to work with. The difficulty arises trying to have good compatibility between two higher level languages (C++ <> Rust). That is much harder and Rust doesn't do anything particularly magical here. Having a lot of Rust (or C++) in Mesa will block any newer high level languages in future.
I don't disagree that Rust is safer than C and C++ (and certainly *much* safer than how many developers use C++). But my vote is simply keep to homogenous C with everything and just AddressSanitize like hell. It gives a cleaner architecture overall.
Originally posted by ed31337 View PostYeah, and then when Mozilla implodes and takes down Rust with it, what then? Mesa developers will have to take up maintaining Rust in addition to Mesa?
- Likes 3
Comment
-
Originally posted by kpedersen View Post22% of mesa is C++ code. Interacting that with Rust is not going to be feasible without a lot of binding machinery to go down to C and then back up again to the other high level language.
Also, I'm not sure which components are in C++ but they don't seem to be central ones. A Rust driver will probably only need to talk to the C core.
- Likes 2
Comment
-
Originally posted by Alexmitter View PostThe issue with Rust is still that there is no proper compiler that just creates proper bytecode, just this LLVM thing. I guess if GCC could compile Rust, this can be asked again.
And no, Rust doesn't "create bytecode"...
Originally posted by zxy_thf View PostYeah this is actually one of my major concerns.
I'm really relucant to be packed into the LLVM bandwagon
Yet another example of somebody that has absolutely no idea what he is talking about but still decides to complain about it.
- Likes 1
Comment
-
Originally posted by elatllat View PostRust can use more RAM, but it's about the same speed as C and the extra safety in Rust is well worth it's negligible costs.
Rust allows to easily write Zero Copy parsers and to pass references worry-free, resulting not only in less memory consumption but also significantly better performance.
It's one of the reason why usually Rust tools are the fastest version of that tool.
grep: https://blog.burntsushi.net/ripgrep/...rch-benchmarks
find: https://github.com/sharkdp/fd#benchmark
etc...
- Likes 5
Comment
-
Originally posted by kpedersen View Post
I'm not really talking about having good compatibility with C code. That is "easy" because C is so flexible and simple to work with. The difficulty arises trying to have good compatibility between two higher level languages (C++ <> Rust). That is much harder and Rust doesn't do anything particularly magical here. Having a lot of Rust (or C++) in Mesa will block any newer high level languages in future.
Rust has it's own drawbacks, but I'm more positive about those than the drawbacks of dealing with C++ tbh (which I'm not overly experienced in, I've mostly read about how there's so many footguns that the language itself is quite an investment to learn how to do it right, while Rust is sorta geared with it's own learning curve but far more resistant to you having to learn how to do it right, it'll catch a lot of the problems that C++ wouldn't, I haven't kept up with C++ so maybe tooling has improved there). My experience with C doing embedded work was awful (no std lib available IIRC and I was mostly used to higher level languages at the time), it's how I came across Rust in 2016 and would still prefer it over C or C++.
Comment
-
Originally posted by elatllat View PostRust can use more RAM, but it's about the same speed as C and the extra safety in Rust is well worth it's negligible costs.
- Likes 1
Comment
-
Originally posted by Alliancemd View Post
You don't work on the compiler, you have absolutely nothing to do with LLVM. Rust binaries don't depend on LLVM.
Yet another example of somebody that has absolutely no idea what he is talking about but still decides to complain about it.
Code:$ ldd `which rustc` linux-vdso.so.1 (0x00007fffe71cd000) librustc_driver-a65f53cf2e449c04.so => /lib64/librustc_driver-a65f53cf2e449c04.so (0x00007f4547f7e000) libstd-ce0075fa4a63cdc8.so => /lib64/libstd-ce0075fa4a63cdc8.so (0x00007f4547e7e000) libc.so.6 => /lib64/libc.so.6 (0x00007f4547cb4000) [B][COLOR=#e74c3c]libLLVM-10.so => /lib64/libLLVM-10.so (0x00007f4542f33000)[/COLOR][/B] libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f4542d43000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f4542d3c000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4542d18000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f4542cfd000) /lib64/ld-linux-x86-64.so.2 (0x00007f454bdb7000) libm.so.6 => /lib64/libm.so.6 (0x00007f4542bb7000) libffi.so.6 => /lib64/libffi.so.6 (0x00007f4542bac000) libedit.so.0 => /lib64/libedit.so.0 (0x00007f4542b6f000) libz.so.1 => /lib64/libz.so.1 (0x00007f4542b55000) libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f4542b24000)
LLVM is the ONLY back-end of rust compiler. This is COMMON SENSE.
- Likes 2
Comment
Comment