too-many-lists
x11rb
too-many-lists | x11rb | |
---|---|---|
220 | 14 | |
3,168 | 363 | |
1.9% | - | |
2.6 | 8.1 | |
about 2 months ago | 29 days ago | |
Rust | Rust | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
too-many-lists
- MiniJinja: Learnings from Building a Template Engine in Rust
-
Towards memory safety with ownership checks for C
You seem to have a preset opinion, and I'm not sure you are interested in re-evaluating it. So this is not written to change your mind.
I've developed production code in C, C++, Rust, and several other languages. And while like pretty much everything, there are situations where it's not a good fit, I find that the solutions tend to be the most robust and require the least post release debugging in Rust. That's my personal experience. It's not hard data. And yes occasionally it's annoying to please the compiler, and if there were no trait constraints or borrow rules, those instances would be easier. But way more often in my experience the compiler complained because my initial solution had problems I didn't realize before. So for me, these situations have been about going from building it the way I wanted to -> compiler tells me I didn't consider an edge case -> changing the implementation and or design to account for that edge case. Also using one example, where is Rust is notoriously hard and or un-ergonomic to use, and dismissing the entire language seems premature to me. For those that insist on learning Rust by implementing a linked list there is https://rust-unofficial.github.io/too-many-lists/.
-
Command Line Rust is a great book
Advent of Code was okay until I encounterd a problem that required a graph, tree or linked list to solve, where I hit a wall. Most coding exercises are similar--those requiring arrays and hashmaps and sets are okay, but complex data structures are a PITA. (There is an online course dedicated to linked lists in Rust but I couldn't grok it either). IMO you should simply skip problems that you can't solve with your current knowledge level and move on.
-
[Media] I'm comparing writing a double-linked list in C++ vs with Rust. The Rust implementation looks substantially more complex. Is this a bad example? (URL in the caption)
I feel obligated to point to the original cannon literature: https://rust-unofficial.github.io/too-many-lists/
-
Need review on my `remove()` implementation for singly linked lists
I started learning Rust and like how the compiler is fussy about things. My plan was to implement the data structures I knew, but I got stuck at the singly linked list's remove() method. I've read the book as well, but I have no clue how to simplify this further:
-
Factor is faster than Zig
My impression from the article is that Zig provides several different hashtables and not all of them are broken in this way.
This reminds me of Aria's comment in her Rust tutorial https://rust-unofficial.github.io/too-many-lists/ about failing to kill LinkedList. One philosophy (and the one Rust chose) for a stdlib is that this is only where things should live when they're so commonly needed that essentially everybody needs them either directly or to talk about. So, HashTable is needed by so much otherwise unrelated software that qualifies, BloomFilter, while it's real useful for some people, not so much. Aria cleaned out Rust's set of standard library containers before Rust 1.0, trying to keep only those most people would need. LinkedList isn't a good general purpose data structure, but, it was too popular and Aria was not able to remove it.
Having multiple hash tables feels like a win (they're optimized for different purposes) but may cost too much in terms of the necessary testing to ensure they all hit the quality you want.
-
Was Rust Worth It?
> Cyclic references can be dealt with runtime safety checks too - like Rc and Weak.
Indeed. Starting out with code sprinkled with Rc, Weak, RefCell, etc is perfectly fine and performance will probably not be worse than in any other safe languages. And if you do this, Rust is pretty close to those languages in ease of use for what are otherwise complex topics in Rust.
A good reference for different approaches is Learn Rust With Entirely Too Many Linked Lists https://rust-unofficial.github.io/too-many-lists/
- What are some of projects to start with for a beginner in rust but experienced in programming (ex: C++, Go, python) ?
-
How to start learning a systems language
Second, once you've finished something introductory like The Book, read Learning Rust With Entirely Too Many Linked Lists. It really helped me to understand what ownership and borrowing actually mean in practical terms. If you don't mind paying for learning materials, a lot of people recommend Programming Rust, Second Edition by Blandy, Orendorff, and Tindall as either a complement, follow-up, or alternative to The Book.
- My team might work with Rust! But I need good article recommendations
x11rb
-
My (challenging) experience building a window switcher for Ubuntu
xdotool worked ... but I didn't want to depend on external command-line tools, so I decided to look for X11 bindings for Rust. The best library I could find was x11rb. It had very little documentation and almost no one used it (it was difficult to find people who could help me with it). Fortunately, it had a detailed tutorial. Still, it was a struggle to make things works sometimes.
-
x11rb: Listening to key presses from anywhere on the screen
I'm using x11rb, X11 Rust Bindings. I modified some code from this tutorial so that I'm listening to key presses from parent_win (screen.root) rather than win:
-
Handling two types of errors in the same function
In the end, I decided to use x11rb: https://github.com/psychon/x11rb. This way I don't have to run external commands.
-
Moving a window with Rust X11 bindings
I'm trying to move a window (the GNOME terminal) with x11rb. I followed this tutorial. But the move_window function doesn't move the window.
-
x11rs can't access window created with gtk-rs
I'm using x11rb to interact with a window created with gtk-rs. window_id is the ID of the window created with gtk-rs. window_id_2 is the ID of the window created with x11rb (for testing purposes).
-
Focusing/switching X11 windows with a Rust crate
I also checked x11rb, but I think it's too low level (and too complicated).
-
X11 programming: x11rb or rust-xcb ? What's the difference ?
There is a comparison page in x11rb but it seems to be outdated w.r.t rust-xcb and the unsafe claims, so would appreciate other perspectives.
-
We never know who is delusional..
Do you have a source for that or any specifics on how it "can't handle" the usecases? There's already work in Rust around fully supporting X11 (for example https://github.com/bread-graphics/breadx or https://github.com/psychon/x11rb)
-
Pgwm 0.3 a pure rust `no_std` no libc window manager.
I was thinking about specializing x11rb which is a great library for interfacing with X11, to my specific single threaded use case.
-
I wrote an x11 tiling window manager inspired by DWM that I've been using for a few months now. If you're using x11 and want to try out a new tiling window manager I'd love your feedback!
So if firefox is an application you can find you can query the WM_CLASS property, like this. Other applications might not set that and you'd have to use some other property or information to deduce that this given window(which is just a u32) is actually applicationA. A tip is to start the application, use xprop and see what properties it sets. call_wrapper.rs contains a lot of code about querying different properties. The x11rb example simple_window.rs has a few examples of the other side of that showing how an application can set its on properties.
What are some alternatives?
rust - Empowering everyone to build reliable and efficient software.
unsafe-code-guidelines - Forum for discussion about what unsafe code can and can't do
Rustlings - :crab: Small exercises to get you used to reading and writing Rust code!
alexandrie - An alternative crate registry, implemented in Rust.
book - The Rust Programming Language
minimax-rs - A generic implementation of Negamax in Rust.
CppCoreGuidelines - The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++
penrose - A library for writing an X11 tiling window manager
easy_rust - Rust explained using easy English
pgwm - A minimal tiling x11 window manager
patterns - A catalogue of Rust design patterns, anti-patterns and idioms
i3status-rust - Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust