Re: [Mesa-dev] Rust drivers in Mesa

2020-10-05 Thread Volker Weißmann

2. Rust's enums look awesome but are only mostly awesome:
 a. Pattern matching on them can lead to some pretty deep
indentation which is a bit annoying.
 b. There's no good way to have multiple cases handled by the same
code like you can with a C switch; you have to either repeat it or
break it out into a generic helper.


Do you know that you can use "|" for having multiple cases handled by the same 
code?

enum MyEnum {
A,
B,
C
}
fn main() {
let val = MyEnum::A;
match val {
MyEnum::A | MyEnum::B => {println!("case A or case B");},
MyEnum::C => {println!("case C");}
}
}

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Rust drivers in Mesa

2020-10-05 Thread Michael Shigorin
On Sun, Oct 04, 2020 at 08:24:08PM +0200, Alexander Schlichte wrote:
> >> For one, I'm porting ALT Linux onto e2k platform
> >> (there's only an early non-optimizing version of
> >> Rust port there by now), and we're maintaining repos
> >> for aarch64, armv7hf, ppc64el, mipsel, and riscv64 either
> >> -- none of which seem to be described as better than
> >> "experimental" at http://doc.rust-lang.org/core/arch page
> >> in terms of Rust support.
> The correct page to check for platform support would be [1].

Thank you, that's the page I've been searching for but somehow
failed to find it again (seen it before).

> From what I could find, both gcc and llvm appear to lack
> support for e2k, so that's indeed problematic for the time
> being.

It's being worked on but not there yet from what I've heard.

My point was that exotic languages _can_ provide choke points,
e.g. pandoc written in Haskell might have been a brilliant
"killer app" idea for someone but it's not trivial to bootstrap
ghc just about anywhere new either.  It's easy enough to forget
that while going mainstream (I've noted Alyssa's ARM laptop
remark though).

> As for the other architectures you mentioned, those should
> correspond to:
[...]
> riscv64gc-unknown-linux-gnu

Good it's there, even if it's harder to actually run Radeon
with e.g. SiFive these days than on e2k.

Thank you (and Jacob) for details and the links.

> [1] https://doc.rust-lang.org/nightly/rustc/platform-support.html

-- 
  WBR, Michael Shigorin / http://altlinux.org
  -- http://opennet.ru / http://anna-news.info
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Rust drivers in Mesa

2020-10-05 Thread Michel Dänzer

On 2020-10-04 11:00 p.m., Marek Olšák wrote:
I think it's just going to get more messy and complicated for people who 
don't want to learn or use another language. Mesa already requires 
people to know C, Python, and now newly Gitlab CI scripts just to get 
stuff done and merged.


I've been a Mesa developer for almost two decades, but I don't really 
know any Python.



I'm really excited that people are starting to look into taking 
advantage of Rust in Mesa!



--
Earthling Michel Dänzer   |   https://redhat.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Rust drivers in Mesa

2020-10-05 Thread Matt Turner
On Sun, Oct 4, 2020 at 2:00 PM Marek Olšák  wrote:
> I think it's just going to get more messy and complicated for people who 
> don't want to learn or use another language. Mesa already requires people to 
> know C, Python, and now newly Gitlab CI scripts just to get stuff done and 
> merged. Another language would only exacerbate the issue and steepen the 
> learning curve.

To some extent I agree, and I think that's a good reason to start with
Rust in a leaf-node of the project (a driver or compiler backend)
rather than in a common piece of infrastructure.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev