Re: [Mesa-dev] Rust drivers in Mesa

2020-10-15 Thread Alexander von Gluck IV
October 1, 2020 8:36 PM, "Alyssa Rosenzweig" wrote: > Hi all, > > Recently I've been thinking about the potential for the Rust programming > language in Mesa. Rust bills itself a safe system programming language > with comparable performance to C [0], which is a naturally fit for > graphics

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-15 Thread Tamminen, Eero T
Hi, On Wed, 2020-10-14 at 15:40 -0700, Eric Anholt wrote: > On Wed, Oct 14, 2020 at 3:26 PM Alyssa Rosenzweig > wrote: > > I didn't think to enforce a lint during CI. Part of me wonders if > > we > > should be doing that for C too, but we can shave that yak sometime > > else. > > I don't think

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Eric Anholt
On Wed, Oct 14, 2020 at 3:26 PM Alyssa Rosenzweig wrote: > > > Since the majority opinion seemed to be "if someone wanted to use it > > in a leaf node without making everyone use it, that's fine", I've > > started trying to put together the CI bits necessary to enable it. > > Currently fighting

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> Since the majority opinion seemed to be "if someone wanted to use it > in a leaf node without making everyone use it, that's fine", I've > started trying to put together the CI bits necessary to enable it. > Currently fighting with meson cross files a bit, but the linting works > and the amd64

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> > 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

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> I have found that other tools like RAII/drop, the closely related smart > pointer types, and safe containers (vectors, strings etc.) even without > the borrow checker niceties, to be relatively more useful in preventing > memory errors. However, these are features that modern C++ also offers, >

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> Yep. Before we can land a single bit of code, we need to do a bunch of > annoying things like build-system integration, FFI bridging, agreeing > on conventions and style, etc etc. Trying to do that whilst also > replacing the GLSL compiler or vtn is way too much; it's 100% doomed > to failure,

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> drive-by comment: for something like a gl driver that a lot of other > things depend on, making it harder for us to depend on other external > things is actually a good thing I agree with this as well. The Rust standard library is richer than C's, if we can get by fine with C + util/, that

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Jacob Lifshay
On Tue, Oct 13, 2020, 23:52 Thomas Zimmermann wrote: > Hi > > On Tue, 13 Oct 2020 13:01:58 -0700 Eric Anholt wrote: > > > On Tue, Oct 13, 2020 at 12:08 AM Thomas Zimmermann > > wrote: > > > > > > Hi > > > > > > On Fri, 02 Oct 2020 08:04:43 -0700 "Dylan Baker" > > > wrote: > > > > > > > I have

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Thomas Zimmermann
Hi On Tue, 13 Oct 2020 13:01:58 -0700 Eric Anholt wrote: > On Tue, Oct 13, 2020 at 12:08 AM Thomas Zimmermann > wrote: > > > > Hi > > > > On Fri, 02 Oct 2020 08:04:43 -0700 "Dylan Baker" > > wrote: > > > > > I have serious concerns about cargo and crate usage. Cargo is basically > > > npm for

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-13 Thread Eric Anholt
On Tue, Oct 13, 2020 at 12:08 AM Thomas Zimmermann wrote: > > Hi > > On Fri, 02 Oct 2020 08:04:43 -0700 "Dylan Baker" wrote: > > > I have serious concerns about cargo and crate usage. Cargo is basically npm > > for rust, and shares all of the bad design decisions of npm, including > > linking

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-13 Thread Thomas Zimmermann
Hi On Fri, 02 Oct 2020 08:04:43 -0700 "Dylan Baker" wrote: > I have serious concerns about cargo and crate usage. Cargo is basically npm > for rust, and shares all of the bad design decisions of npm, including > linking multiple versions of the same library together and ballooning >

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-12 Thread Eric Anholt
On Thu, Oct 1, 2020 at 6:36 PM Alyssa Rosenzweig wrote: > > Hi all, > > Recently I've been thinking about the potential for the Rust programming > language in Mesa. Rust bills itself a safe system programming language > with comparable performance to C [0], which is a naturally fit for > graphics

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.

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

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

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

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-04 Thread Dylan Baker
The elbrus C/C++ compiler is largely gcc compatible asks supported in meson, so that really shouldn't be a problem. Dylan On Sun, Oct 4, 2020, at 11:24, Alexander Schlichte wrote: > On 04.10.20 17:19, Alyssa Rosenzweig wrote: > > Cc'd. > > > > On Sun, Oct 04, 2020 at 03:17:28PM +0300, Michael

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-04 Thread Marek Olšák
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

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-04 Thread Alexander Schlichte
On 04.10.20 17:19, Alyssa Rosenzweig wrote: Cc'd. On Sun, Oct 04, 2020 at 03:17:28PM +0300, Michael Shigorin 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,

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-04 Thread Jacob Lifshay
On Sun, Oct 4, 2020, 10:13 Jacob Lifshay wrote: > On Sun, Oct 4, 2020, 08:19 Alyssa Rosenzweig < > alyssa.rosenzw...@collabora.com> wrote: > >> Cc'd. >> >> On Sun, Oct 04, 2020 at 03:17:28PM +0300, Michael Shigorin wrote: >> > Hello, >> > regarding this proposal: >> >

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-04 Thread Jacob Lifshay
On Sun, Oct 4, 2020, 08:19 Alyssa Rosenzweig < alyssa.rosenzw...@collabora.com> wrote: > Cc'd. > > On Sun, Oct 04, 2020 at 03:17:28PM +0300, Michael Shigorin wrote: > > Hello, > > regarding this proposal: > > http://lists.freedesktop.org/archives/mesa-dev/2020-October/224639.html > > > >

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-04 Thread Alyssa Rosenzweig
Cc'd. On Sun, Oct 04, 2020 at 03:17:28PM +0300, Michael Shigorin wrote: > Hello, > regarding this proposal: > http://lists.freedesktop.org/archives/mesa-dev/2020-October/224639.html > > Alyssa, Rust is not "naturally fit for graphics driver > development" since it's not as universally

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-03 Thread Konstantin Kharlamov
On Sun, 2020-10-04 at 00:48 +0300, Konstantin Kharlamov wrote: The standard > > library is rather minimal "because just pull in 1000 crates". The distro > > people can correct me if I'm wrong, but when librsvg went to rust it was a > > nightmare, several distros went a long time without updates

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-03 Thread Konstantin Kharlamov
On Fri, 2020-10-02 at 08:04 -0700, Dylan Baker wrote: > And if you're not going to use cargo, is rust really a win? Sure. When people talk about Rust in context of advantages against other languages, I don't remember Cargo ever being mentioned. People love it for other reasons. > The standard

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-03 Thread Konstantin Kharlamov
On Sat, 2020-10-03 at 00:51 +0200, timur.kris...@gmail.com wrote: > The Rust syntax is slightly annoying. They departed from C/C++ enough > to make Rust look different, but then they got lazy and for some reason > they chose to keep the most annoying parts from C/C++ like curly braces > and

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-03 Thread contact
On 2020-10-02 at 17:53 Jason Ekstrand wrote: >b. Pulling two items out of a list and looking at them is painful. > Unfortunately, this is a surprisingly common operation in compiler > passes. The usual way to get around it is to structure your code such > that you first look up all the

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread timur . kristof
On Fri, 2020-10-02 at 18:21 -0500, Jason Ekstrand wrote: > > The good thing about C++ is that you can pick a subset of features > > that > > you like, and stick to them. Then you'll never have to deal with > > other > > the stuff if you don't want to. There exists a subset of the > > language > >

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Jason Ekstrand
On Fri, Oct 2, 2020 at 5:51 PM wrote: > > On Fri, 2020-10-02 at 12:53 -0500, Jason Ekstrand wrote: > > On Fri, Oct 2, 2020 at 11:34 AM Eric Anholt wrote: > > > On Thu, Oct 1, 2020 at 6:36 PM Alyssa Rosenzweig > > > wrote: > > > > Hi all, > > > > > > > > Recently I've been thinking about the

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread timur . kristof
On Fri, 2020-10-02 at 12:53 -0500, Jason Ekstrand wrote: > On Fri, Oct 2, 2020 at 11:34 AM Eric Anholt wrote: > > On Thu, Oct 1, 2020 at 6:36 PM Alyssa Rosenzweig > > wrote: > > > Hi all, > > > > > > Recently I've been thinking about the potential for the Rust > > > programming > > > language

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Jacob Lifshay
On Fri, Oct 2, 2020, 10:53 Jason Ekstrand wrote: > > 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

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Jason Ekstrand
On Fri, Oct 2, 2020 at 11:34 AM Eric Anholt wrote: > > On Thu, Oct 1, 2020 at 6:36 PM Alyssa Rosenzweig > wrote: > > > > Hi all, > > > > Recently I've been thinking about the potential for the Rust programming > > language in Mesa. Rust bills itself a safe system programming language > > with

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Alexander Schlichte
On 02.10.20 08:14, Dave Airlie wrote: My feeling is the pieces that would benefit the most are the things touch the real world, GLSL compiler, SPIR-V handling, maybe some of the GL API space, but I also feel these are the messiest things to move to rust. I'm not sure you'd get much benefit from

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Eric Anholt
On Fri, Oct 2, 2020 at 8:05 AM Dylan Baker wrote: > > I have serious concerns about cargo and crate usage. Cargo is basically npm > for rust, and shares all of the bad design decisions of npm, including > linking multiple versions of the same library together and ballooning > dependency lists

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Eric Anholt
On Thu, Oct 1, 2020 at 6:36 PM Alyssa Rosenzweig wrote: > > Hi all, > > Recently I've been thinking about the potential for the Rust programming > language in Mesa. Rust bills itself a safe system programming language > with comparable performance to C [0], which is a naturally fit for > graphics

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Nirbheek Chauhan
On Fri, Oct 2, 2020 at 8:35 PM Dylan Baker wrote: > > Add a meson developer the rust community has been incredibly hard to work with > and basically hostile to every request we've made "cargo is hour you build > rust", > is essentially the answer we've gotten from them at every turn. > > On the

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Dylan Baker
I have serious concerns about cargo and crate usage. Cargo is basically npm for rust, and shares all of the bad design decisions of npm, including linking multiple versions of the same library together and ballooning dependency lists that are fetched intrigued from the internet. This is both a

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Alexandros Frantzis
On Fri, Oct 02, 2020 at 04:14:17PM +1000, Dave Airlie wrote: > On Fri, 2 Oct 2020 at 15:01, Jason Ekstrand wrote: > > > > On Thu, Oct 1, 2020 at 10:56 PM Rob Clark wrote: > > > > > > On Thu, Oct 1, 2020 at 6:36 PM Alyssa Rosenzweig > > > wrote: > > > > > > > > Implications for the build system

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Luke Kenneth Casson Leighton
fransisco, alyssa et al: you may be interested to know that the Libre-SOC Kazan Vulkan driver, funded by NLnet, is written in rust. https://salsa.debian.org/Kazan-team/kazan the insights and analysis that you are going through is - was - pretty much exactly why we chose it (or, more accurately:

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Daniel Stone
Hi, On Fri, 2 Oct 2020 at 08:31, Kristian Kristensen wrote: > On Fri, Oct 2, 2020 at 8:14 AM Dave Airlie wrote: >> My feeling is the pieces that would benefit the most are the things >> touch the real world, GLSL compiler, SPIR-V handling, maybe some of >> the GL API space, but I also feel

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-02 Thread Dave Airlie
On Fri, 2 Oct 2020 at 15:01, Jason Ekstrand wrote: > > On Thu, Oct 1, 2020 at 10:56 PM Rob Clark wrote: > > > > On Thu, Oct 1, 2020 at 6:36 PM Alyssa Rosenzweig > > wrote: > > > > > > Implications for the build system vary. Rust prefers to be built by its > > > own package manager, Cargo, which

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-01 Thread Jason Ekstrand
On Thu, Oct 1, 2020 at 10:56 PM Rob Clark wrote: > > On Thu, Oct 1, 2020 at 6:36 PM Alyssa Rosenzweig > wrote: > > > > Implications for the build system vary. Rust prefers to be built by its > > own package manager, Cargo, which is tricky to integrate with other > > build systems. Actually,

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-01 Thread Rob Clark
On Thu, Oct 1, 2020 at 6:36 PM Alyssa Rosenzweig wrote: > > Implications for the build system vary. Rust prefers to be built by its > own package manager, Cargo, which is tricky to integrate with other > build systems. Actually, Meson has native support for Rust, invoking the > compiler directly

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-01 Thread Francisco Jerez
Alyssa Rosenzweig writes: > Hi all, > > Recently I've been thinking about the potential for the Rust programming > language in Mesa. Rust bills itself a safe system programming language > with comparable performance to C [0], which is a naturally fit for > graphics driver development. > > Mesa

[Mesa-dev] Rust drivers in Mesa

2020-10-01 Thread Alyssa Rosenzweig
Hi all, Recently I've been thinking about the potential for the Rust programming language in Mesa. Rust bills itself a safe system programming language with comparable performance to C [0], which is a naturally fit for graphics driver development. Mesa today is written primarily in C, a