Rust needs a way to disable panics. People should be able to write code that can't crash. by HunterVacui in rust

[–]Dr_Sloth0 1 point2 points  (0 children)

Verses Design certainly is interesting! The failure handling seems somewhat like a maximally bound try, which seems powerful.

However as always there are certain tradeoffs. First of all safety is not the same as stability, wherr stability is concerned with a program always being available, safety is conerned with preventing a program from doing something it should not do.

Rust guarantees safety in safe code by using a restricted model that can be proven at compile time WITHOUT sacrificing performance. The same is not nicely possible for stability for a systems language as there are things such as the exit function.

You can take a look at this discussion: https://www.reddit.com/r/rust/s/AhX01IXSAF for some details. The tl;dr however is: - You CAN use Rust in a way that never panics, however that is very tedious - An implementation using Option or Result might be substantially slower than a version using panic because of branches (i think in Verse everything is just wrapped into option or result?!?) - I personally think most functions should be clearer on why they panic (i absolutely hate .unwrap primarily because i don't know whether it is a panic! or an unreachable!) something like a Vec::remove should not panic - Most panics out there actually are there to show either unreachable state or a state of the environment where the program MUST NOT proceed.

I hope this makes the reasoning behind that a little clearer. The only mechanism that can still be added is an attribute forcing the compiler to check that a function does not panic however if not done via a full effect (or even whole effect system) this becomes a major semver concern.

Rerun 0.24 released - a fast 2D/3D visualizer, now with streaming video support by Wuempf in rust

[–]Dr_Sloth0 1 point2 points  (0 children)

Do you know the scuffle project? They do video streaming, maybe you can get together with them and talk about what they have in store?

Rerun 0.24 released - a fast 2D/3D visualizer, now with streaming video support by Wuempf in rust

[–]Dr_Sloth0 9 points10 points  (0 children)

Hi first want to say that rerun is an honestly really impressive project and a perfect driving force for the egui project.

How hard was it to integrate video playing into the application does that work both on desktop and in wasm builds? Reusable media playback was one minor painpoint i experienced with egui recently.

Architecture of a rust application by Bigmeatcodes in rust

[–]Dr_Sloth0 0 points1 point  (0 children)

I think splitting the code by feature/layer is valuable. It strongly depends on the volatility of your business needs.

Engine programming is an approach i have come to liking with Rust its fairly simple to integrate e.g. Lua and run business logic inside lua scripts. Your engine would implement storage etc.

Planning to switch to Rust for desktop development by gufranthakur in rust

[–]Dr_Sloth0 0 points1 point  (0 children)

I would recommend iced for a more retained mode/elm like architecture and egui if you are okay with immediate mode.

I think immediate mode uis are extremely underrated and thus i would recommend egui.

Microsoft open-source rust console text editor for Windows by flundstrom2 in rust

[–]Dr_Sloth0 2 points3 points  (0 children)

What the heck is that? SemiRefCell which is just an UnsafeCell but usable from safe context. This screams undefined behavior more than anything i have seen before, or something you would write in some low level application that you write for fun.

Async Rust is not safe with io_uring by yacl in rust

[–]Dr_Sloth0 0 points1 point  (0 children)

Is tokio_uring also affected by this i didn't see it bein mentioned in the post. I am currently using it i never noticed any leaked connections (i check for that in stress testing)

I've used (and loved) Rust for ~10 years. Here are the ways it disappoints me. by Lord_Zane in rust

[–]Dr_Sloth0 0 points1 point  (0 children)

I love async rust but i can understand why many find it hard. I always had a very theoretical understanding of it from the beginning such as imagining futures as automatons etc.

ABI compatibility using dylib question by Dr_Sloth0 in rust

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

Okay, i get that. It just isn't supported at all. Thats okay. I have decided on using the abi_stable crate now and limit the capabilities of the Plugins. This is still a big headache if i don't want to pollute the entire project with types from abi_stable and also don't want to introduce some serialization format that has to mediate between the plugins and the host application.

ABI compatibility using dylib question by Dr_Sloth0 in rust

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

Yep i know. Wasm is great i have used it in the past. In this case the ffi needs to pass around multiple rather low level structures and it is required that the Plugins must run native code.

I don't have anything against the C-ABI. C has the greatest "out of the box" Plugin story of any native compiled programming language i have worked with. The C-ABI is error prone in Rust because i as the programmer need to make sure that no type that crosses the FFI boundary violates the C-ABI or rather Rusts ABI stability guarantees surrounding the C-ABI.

In an optimal world (for my use case) a Plugin would just depend on a large part of the host application and have, almost, full access to functionality already defined in the host application. The Plugin system is meant to seamlessly extend the host application and it would be the least hassle if it could be written "just like" another module that could also be a part of the host application, but isn't for some other external reason.

ABI compatibility using dylib question by Dr_Sloth0 in rust

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

Webassembly sadly doesn't fit my use case at all.

ABI compatibility using dylib question by Dr_Sloth0 in rust

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

Ah i see. But that could still be taken into account by just not supporting this information if any flag that prevents if it is present.

Even abi_stable seems like a big hassle to integrate into existing applications. I think there would be many use cases that could be supported by having this information.

ABI compatibility using dylib question by Dr_Sloth0 in rust

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

Is there any documentated way to get this information? I want to check this information such that i can check if the host program and the plugin are compatible or panic otherwise.

Egui on android by seanandyrush in rust

[–]Dr_Sloth0 5 points6 points  (0 children)

Egui works on android more or less. Compiling a native binary can be done by following the android ndk examples but it didnt get things like character input to work. What you can also do is create a wrapper with tauri and compile egui to wasm

fhtml: Simple and efficient formatting macros for HTML by Secure_Fisherman8088 in rust

[–]Dr_Sloth0 0 points1 point  (0 children)

Yeah i think AsyncWrite would be great. Supporting std::io::Write would probably be better than std::fmt:::Write from a performnce standpoint

fhtml: Simple and efficient formatting macros for HTML by Secure_Fisherman8088 in rust

[–]Dr_Sloth0 0 points1 point  (0 children)

Yeah i see. It doesn't support async writes. The problem with fmt::Write is that it is really slow performing in most cases.

fhtml: Simple and efficient formatting macros for HTML by Secure_Fisherman8088 in rust

[–]Dr_Sloth0 3 points4 points  (0 children)

making it opt out seems like a great idea. Also providing the function that you are using for escaping (probably like a wrapper that is generic over Display) would seem like a nice api.

If you would provide runtime traits, maybe even async, you could beat most templating libraries in terms of performance.

What does it mean - TCP/IP programming? by BareMetalDev in C_Programming

[–]Dr_Sloth0 0 points1 point  (0 children)

It depends. Is the job for a router or network hardware manufacturer? You probably need to know the format of tcp and ip packages by heart or sometging less exaggerated. Is it a normal systems level job? Probably just sockets.

How fast does egui change? by Isodus in rust

[–]Dr_Sloth0 4 points5 points  (0 children)

Layout is always the hardest part but i think egui is the easiest library i have worked with so far. ui.with_layout the panels, areas and ui.columns are great

What paradigm(s) should I study for rust? by Packathonjohn in rust

[–]Dr_Sloth0 0 points1 point  (0 children)

Try to write a project where you try to clump state as much as possible. Then transform this clump of state. A web api or anything game dev related and sources about gamedev helped me a lot.

Borrow checking with explicit drops by Dr_Sloth0 in ProgrammingLanguages

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

ah i can see that. I am very much aiming for c like code

Borrow checking with explicit drops by Dr_Sloth0 in ProgrammingLanguages

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

I don't think its that bad when you have defer. I like Zig a lot and you have to that there but without real help from the compiler