Readit News logoReadit News
gf000 · 8 months ago
I have just used it yesterday to better understand a math problem and found that the edit-compile-run cycle of rust with this framework was prohibitively long.

I only had a single file calling into this lib - maybe I could have improved on it with splitting the project up to some modules? Could anyone comment on their experience? Because usually I have found rust compile times okay, but this really made it hard to iterate.

generalenvelope · 8 months ago
What linker are you using? I've gotten really significant speedup over the default linker by using lld or mold.
ramon156 · 8 months ago
Modules wouldn't fix this afaik.

I feel like hot-reloading would be the fix here, but I'm unsure what the state on that is.

vacuity · 8 months ago
In Rust, crates and not modules are the unit of compilation. Hot reloading is a whole other problem for the Rust ecosystem. You'd probably have to build it yourself or buy into a whole engine.
eminence32 · 8 months ago
Demo pages like this are fun, and technically impressive when compiled to a browser environment. But I suffer from a lack of imagination so these widget demos don't really help me envision what an egui-powered app can do or might look like.

Does anyone have any examples of fun things that use egui?

Animats · 8 months ago
I use it in Sharpview. It's really for GUI programs, not web pages. It redraws everything on every frame, so it's most useful for 2D overlays on 3D game-type programs. For that, it's pretty good.

It's one pass. As a result, layouts which are ordered left to right and top to bottom work well, but ones which displace or resize items above or to the left don't work well. Egui tries to fix things up on the next frame, thereby getting the effect of a multipass layout system, but sometimes that results in mis-positioning and jitter on alternate frames. As long as you respect that limitation, good results can be obtained.

It needs some kind of dialog builder tool so that you don't have to write code for each dialog box. Someone was working on that about two years ago. Should find that project again. Meanwhile, lots of repetitive code to write.

Note that winit, wgpu, egui, and their friends all have to advance in version lockstep. All those projects routinely make breaking API changes, and when this happens, it takes a month or two before all the others catch up. Again, as long as you know this, it's not too bad. It would be nice to see some of those packages reach version 1.0.

nottorp · 8 months ago
> It redraws everything on every frame, so it's most useful for 2D overlays on 3D game-type programs.

So it's not a GUI. In my book a GUI only redraws when something changes, to save the user's power.

whytevuhuni · 8 months ago
It's really good for scrappy prototypes, e.g. here's a water simulation demo I was using to learn Rust [1]. See the "view" menu for more windows.

The code for that is all contained in a single file [2], and IMO it's pretty small for what it does. It was really easy to add/change things while developing, a new button is just a single new line.

[1] https://andreivasiliu.github.io/cybersub/

[2] https://github.com/andreivasiliu/cybersub/blob/master/src/ui...

AgentK20 · 8 months ago
The Bevy Engine in Rust has an integration (https://docs.rs/bevy_egui/latest/bevy_egui/) that supports egui, for use in making UIs in games written against the Bevy Engine. Here's a webapp example of a 2d drawing showcase that uses egui as a UI provider: https://vladbat00.github.io/bevy_egui_web_showcase/index.htm...
kelvinjps10 · 8 months ago
https://rerun.io the one that sponsors them and the author's app is one example
the__alchemist · 8 months ago
Here's my plasmid editor, using EGUI: https://github.com/David-OConnor/plascad

I also use it for the GUI for 3D rendering computational chemistry and gravity sims.

I also use it for configuring embedded devices on PC, and/or viewing their telemetry. (e.g. for drones, drone parts etc)

Broussebar · 8 months ago
I find it really practical to create a quick ui. For example i used to do glitch art with a friend that didn’t know how to use a cli, so i created a gui for him to use [0]. Egui is perfect for this use case, you create quickly lightweights softwares, than can be compiled to many different OS.

[0] https://glitchedfactory.com

liambigelow · 8 months ago
[https://truncate.town/](https://truncate.town/) is all egui (after the main menu)
mdaniel · 8 months ago
Words fail me how much I love that game

Words similarly fail me how much I loathe and detest its GUI (at least on mobile browsers, where I often play the game). As an example, one has to actually _close_ the dictionary popup if you fat finger a letter because the fucking backspace doesn't work, or rather seems to require an incomprehensible number of presses to start deleting letters

j-krieger · 8 months ago
I use egui to draw the overlay UI for game hacks I write. It's easy to use.
konart · 8 months ago
Photo editors, CADs etc.

I mean... pretty much anything you have on desktop but in your browser.

adastra22 · 8 months ago
Or just in your desktop app. You don’t have to run in a browser.
Aissen · 8 months ago
I'm afraid that until browsers provide APIs to help render fonts with sub-pixel rendering (note: that would add fingerprinting bits), canvas-based UI rendering libraries will always have a big disadvantage (vs DOM-based) on all but the high pixel density devices.

(This is well known by the egui authors, which is a great library!)

IshKebab · 8 months ago
I'm not sure. Phones and Macs are already all high density enough. Apparently it's been removed on Mac. Probably not too long before even cheap windows laptops and Chromebooks have hidpi screens.

Plus modern displays can have all sorts of weird subpixel layouts so it's not as simple as it used to be.

7jjjjjjj · 8 months ago
Hidpi monitors about about twice as expensive, and the only real advantage is that they look nicer. Maybe on a laptop that's a good use of $$$, especially if the screen is very small, but on desktop you'd almost always rather get a bigger monitor or a second monitor. So low DPI will be with us for a long time.
Aissen · 8 months ago
You tend to use the web platform for maximum portability, even for people not having high-end devices. If you only need to target people with a higher-density screen, then of course my comment is moot. I posit that it will still be a problem for large enough number of people, for a long time.
feverzsj · 8 months ago
Even if you are using Retina 5k 27", the subpixel rendering is still necessary to get sharper fonts.
amelius · 8 months ago
Why would that add fingerprint bits if everybody uses the same algorithm to render this?
guipsp · 8 months ago
The correct subpixel rendering depends on your monitor's pixel layout.
mhitza · 8 months ago
> panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/glow-0.16.0/src/web_sys.rs:282:78: called `Option::unwrap()` on a `None` value

Someone's been naughty for Christmas, forcing option unwrapping instead of pattern matching.

On the mobile version of Brave.

wyager · 8 months ago
At the very least, one should use `expect` over `unwrap` so the error is useful.
josephcsible · 8 months ago
I just opened https://github.com/grovesNL/glow/pull/331 to do exactly that.
andsoitis · 8 months ago
Limited internationalization support. For example, trying to paste in مرحبًا (Arabic for "hello") just gives me tofu squares.
avx56 · 8 months ago
It's being worked on. Merry Christmas! https://github.com/emilk/egui/issues/3378
andsoitis · 8 months ago
Text shaping is anything but easy. Harfbuzz is probably the state of the art open source solution - https://github.com/harfbuzz/harfbuzz

Used in in Android, Chrome, ChromeOS, Firefox, GNOME, GTK+, KDE, Qt, LibreOffice, OpenJDK, XeTeX, PlayStation, Microsoft Edge, Adobe Photoshop, Illustrator, InDesign, Godot Engine, Unreal Engine, ...

Thorrez · 8 months ago
There seem to be some problems with resizing windows.

In the "Highlighting" example, half the time when I click the grab area in the bottom right corner, my diagonal arrow mouse immediately switches to a vertical arrow mouse, so I can only resize vertically (which fails, see next point).

In the "Highlighting" example, it acts like it can resize vertically (vertical arrow mouse appears), but it won't actually let me resize it vertically.

In the other default examples, there's a grab area in the bottom right corner that makes me think I should be able to resize it both vertically and horizontally at the same time. But none of them let me resize them vertically.

therein · 8 months ago
I have things I use every day that I wrote in egui. It has its quirks but has been great for years. Thanks emilk.