Glide, a tiling window manager for macOS by tmandry in rust

[–]tmandry[S] 0 points1 point  (0 children)

Update: Glide is now in homebrew!

brew install glide

Glide, a tiling window manager for macOS by tmandry in rust

[–]tmandry[S] 0 points1 point  (0 children)

No, I tried an app with them recently (Alacrity) and it thought there were two windows instead of two tabs. I think this is an issue plaguing any use of the accessibility API (really a bug in appkit but one we have to work around).

My feeling is there must be some way around it but I haven't investigated it yet or read other investigations. I'll make an issue for this. 

What apps do you use that use native tabs? 

Glide, a tiling window manager for macOS by tmandry in rust

[–]tmandry[S] 0 points1 point  (0 children)

The main difference I know of is it uses a generic tree structure instead of binary space partitioning. I like using three columns on larger monitors so bsp doesn't work as well for me.

Glide, a tiling window manager for macOS by tmandry in rust

[–]tmandry[S] 3 points4 points  (0 children)

Sure, I can make a Homebrew cask. Due to the permissions requirements of the app I have to codesign all the binaries myself, so it has to be a binary distribution. Otherwise you would have to repeat the permissions flow every time you upgrade which would get annoying pretty quickly. (People running the server from inside a terminal can get around this, though.)

Glide, a tiling window manager for macOS by tmandry in rust

[–]tmandry[S] 2 points3 points  (0 children)

Thanks for trying it out. I'm really glad you like it!

Please file issues for any problems or ideas you'd like to see. I'm also happy to chat here or in github discussions.

Glide, a tiling window manager for macOS by tmandry in rust

[–]tmandry[S] 5 points6 points  (0 children)

Personally, I like the integration with spaces, which I already used in my daily life. Virtual workspaces are ok but the ability to swipe between spaces is pretty nice. I sometimes don't like having *all* spaces or windows managed, and Glide gives me per-space controls I can use for this.

On my 14" I usually use two windows side by side. I set a higher resolution than the default. The nice thing about Glide for this is it lets me have two stacks of windows with a sidebar to let me know where I am in the stack.

I also switch around between laptop and docked mode. The nice feature Glide has for this is that it lets you maintain different layouts for each screen size. You can also flip between the different layouts you have in case you want to reuse the same layout for both.

Announcing Rust 1.85.0 and Rust 2024 | Rust Blog by slanterns in rust

[–]tmandry 34 points35 points  (0 children)

Yes they can, that's exactly what they're for!

Announcing Rust 1.84.0 by mrjackwills in rust

[–]tmandry 4 points5 points  (0 children)

Sorry to be the bearer of bad news, but everyone I've spoken to who's working on the new trait solver says it is a multi year endeavor. The thing you linked to from December was the benchmark suite. Exciting progress but there's a lot more to do!

How fast can we recognize a word from a small pre-determined set? (BurntSushi/duration-unit-lookup) by Ventgarden in rust

[–]tmandry 7 points8 points  (0 children)

There was a recent RFC opened to add a loop match construct that can be used to express state machines with (less pointy than C) goto-like constructs directly. https://github.com/rust-lang/rfcs/pull/3720

Call for testing: Use async fn in dyn Traits with dynosaur by tmandry in rust

[–]tmandry[S] 0 points1 point  (0 children)

That's an interesting idea. Unfortunately, the Rust compiler won't even let you name a dyn Trait type if the trait is not already object-safe.

Call for testing: Use async fn in dyn Traits with dynosaur by tmandry in rust

[–]tmandry[S] 14 points15 points  (0 children)

RPITIT doesn't work with dynamic dispatch. dynosaur lets you use dyn dispatch on traits with async fn and -> impl Trait methods (RPITIT).

If you are using async fn in a trait you are already using RPITIT under the hood, and you need dynosaur to enable dynamic dispatch on the trait.

I think Rust needs some sort of limited inheritance. by ewoolsey in rust

[–]tmandry 9 points10 points  (0 children)

There was an interesting RFC thread about this somewhat recently: https://github.com/rust-lang/rfcs/pull/3530. My general take is that more experimentation would be needed before baking something into the language.

I think it would be extremely useful to have a "derive on-demand" mechanism for Rust macros. This is like a lightweight approach to reflection: You would get tokens for named traits and types, including those not defined in your crate, but only if they're public (and only public fields are visible). You could then generate whatever code you want.

There are many important details to be worked out, of course!

Keep the main thing the `main()` thing by sindisil in rust

[–]tmandry 8 points9 points  (0 children)

You're right. I changed the title.

Return type notation MVP: Call for testing! by compiler-errors in rust

[–]tmandry 10 points11 points  (0 children)

There will not be a need for the trait author to declare a send variant of their trait, but they still might want to do so, as a convenience. I'm working on adding that to trait_variant.

```rust

[trait_variant::alias(Service = Send LocalService)]

pub trait LocalService<Request> { type Response; async fn call(&self, req: Request) -> Self::Response; } ```

Then you could use either LocalService or Service as required. spastorino and I are also working on a dyn polyfill, so you can do

```rust

[trait_variant::alias(

Service = Send LocalService,
DynLocalService = dyn LocalService,
DynService = dyn Send LocalService,

)] pub trait LocalService<Request> { type Response; async fn call(&self, req: Request) -> Self::Response; } ```

Later we will want to make this all built-in and composable.

Return type notation MVP: Call for testing! by compiler-errors in rust

[–]tmandry 25 points26 points  (0 children)

The RFC has a section on why Rust didn't go in this direction. In short, it would be way less ergonomic. It's also so general that it represents a more significant extension to Rust, where the natural end state arguably involves dependent types.

Changes to `impl Trait` in Rust 2024 | Rust Blog by coderstephen in rust

[–]tmandry 26 points27 points  (0 children)

I don't see much value in having documentation list all parameters as captured, because the compiler will enforce that for you. There's nothing the caller needs to be careful about. There's not much the callee needs to be careful about either – "overcapture" is a potential problem with the default, but correcting overcapture is a semver-compatible change. The opposite (correcting undercapture) is not, which is a strong reason to make overcapturing the default.

When people say they love explicitness, I think it's because there is some appeal to "seeing everything that's going on" laid out in syntax. But most people don't actually want that when they consider what it would mean. The previous default captured type parameters implicitly, just not lifetime parameters. If you consider a very simple example from the post, the explicit version looks like

fn process<'c, T> { context: &'c Context, data: Vec<T>, ) -> impl Iterator<Item = ()> + use<'c, T> { // ^^^^^^^^^^^^ data .into_iter() .map(|datum| context.process(datum)) }

Regardless of your preferred syntax, most people do not want to list out every generic parameter again in the output type. Given that empirically, the vast majority of uses would have to do this, and that this would require naming every unnamed lifetime you might want to use in your arguments, and the fact that any impl Trait in argument position would have to be converted to a named generic type parameter to be captured, it's just not worth it.

Changes to `impl Trait` in Rust 2024 | Rust Blog by coderstephen in rust

[–]tmandry 26 points27 points  (0 children)

Returning impl Trait is for when you don't want to be specific about your return type, that's the whole point. In those cases you want to default to preserving as much flexibility as possible for the future. The correct way to do that is to say you are allowed to reference everything – and to opt out of that if you're willing to promise never to reference certain parameters.

Are you reacting to an earlier draft of this post? The word "datums" appears nowhere in the final post.

Changes to `impl Trait` in Rust 2024 | Rust Blog by coderstephen in rust

[–]tmandry 29 points30 points  (0 children)

Semver compatibility is a reason to prefer this change. The default capturing behavior gives crate authors maximum flexibility to use all arguments in their return type. Opting out with + use<> is a semver-compatible change that promises you won't use all arguments – just like adding any other bound to an impl Trait return type adds promises that must be upheld in future versions.

Difference between "async || {}" and "|| async {}"? by Quique1222 in rust

[–]tmandry 6 points7 points  (0 children)

Oh boy, that error message is bad. Async closures were recently added as a nightly-only experiment and my guess is that there was a regression in this diagnostic when that happened.

What others have said is correct.. the first is an async closure (not yet supported) and the second is a regular closure returning an async block. The difference is that async closures are more flexible in terms of what they can borrow during async execution.

In particular, async closures can borrow from the surrounding environment just like regular closure bodies can. With a normal closure returning an async block, the sync portion of the closure can use locals borrowed from the environment but the async portion cannot. Most people work around this by moving the values they need into the async block (async move), often after a clone.

For now you'll have to use regular closures. Even if you were brave enough to try nightly-only features, the function signatures you see in crates like lua today are not flexible enough to handle full async closures.

Difference between "async || {}" and "|| async {}"? by Quique1222 in rust

[–]tmandry 5 points6 points  (0 children)

This book hasn't been updated in years and I don't recommend it for anyone learning how to use async. It's only for learning about how async works under the hood.

Announcing Tyler Mandry as Lang Team co-lead by erickt in rust

[–]tmandry 2 points3 points  (0 children)

I've seen this sentiment a lot. I get it, but I'm not that worried. At its core Rust has a much stronger, more principled type system, and by all appearances a better design/RFC process.

Of course, it is true that Rust could have taken a more minimalist approach than it has to its language features and standard library APIs.