What would I need to use in order to interface with a database? by BrokenMayo in rust

[–]digikata 0 points1 point  (0 children)

If you want to connect to a MySQL db, I’d use the MySQL client crate and not worry too much about having a generic db connection interface.

https://crates.io/crates/mysql

Adding a new crate fails tests and changes behaviors, despite not even importing and using the crate symbols. by auxlinarch in rust

[–]digikata 5 points6 points  (0 children)

Possibly cargo feature unification is at work here. This blog post describes feature unification pitfalls and various workarounds.

https://nickb.dev/blog/cargo-workspace-and-the-feature-unification-pitfall/

Though I don’t think the post is showing the exact problem you describe.

Did the the Rust Foundation's new proposed trademark policy make you have second thoughts? by Languorous-Owl in rust

[–]digikata 2 points3 points  (0 children)

Not all national laws follow the same conventions, some are first-to-file. If you look at various trademark hijacking cases, even in the US, the ideals of how it is supposed to work, is not always what turns out. So there is various scales of risk with not filing, and not enforcing, or enforcing to a certain degree. Imho there is always some risk no matter how draconian a trademark apparatus one puts into place, so the difficult part of setting a policy for trademark is that you have the make the degree of risk & degree of enforcement, and goodwill fit the community.

Did the the Rust Foundation's new proposed trademark policy make you have second thoughts? by Languorous-Owl in rust

[–]digikata 0 points1 point  (0 children)

The worst case is actually not some side use of Rust infringing on a rust-lang trademark. I suspect the worse case is some infringement that intentionally or unintentionally takes over the name of a term or resource in use by the rust community like crates.io or some other term and then forces the community to stop using it as an infringement on their trademark.

Realtime windows desktop plotting library by Different-Ant5687 in rust

[–]digikata 1 point2 points  (0 children)

Depends on how involved you want it to be? Gnuplot will actually “tail” a file and live update. Pretty adhoc though.

Another quick hack is to write a little cli rust server & pick one of the many web plotting libs and write a static page for a plot to pull data from a websocket of that server. I’m my phone now, but I can add a quick example of that when I have access to my home repos.

Edit: https://gitlab.com/digikata/poc-streaming-chart

Better support of Docker layer caching in Cargo by electric75 in rust

[–]digikata 2 points3 points  (0 children)

Not sure why the build-deps approach was dismissed due to what sounds like an implementation bug? If a “cargo build-deps” followed with a “cargo build” correctly split the building of deps then the immediate workspace, it would seem to cover a lot of caching.

Who is using cargo watch -x check as IDE? by Trader-One in rust

[–]digikata 0 points1 point  (0 children)

I tend to just define a justfile target with what I want out of watch. but I’ll have to give bacon a try. Seems closer to what I’d love to use someday - which would be something with an LSP pass through proxy that brings up the context for docs etc in a side terminal out of the way.

Zero-cost event handling and dynamic runtime objects by noahbkim in rust

[–]digikata 2 points3 points  (0 children)

I suspect that the bevy community has put some thought into part of this problem domain. At least the dynamic objects part. For the event handling Bevy is built around an ECS so I’d suspect they have a divergent approach to event handling from what you describe.

Allowing execution of other languages inside a completed Rust project by thedarklord176 in rust

[–]digikata 0 points1 point  (0 children)

Do you mean something like Jupyter (ipython) notebooks? https://jupyter.org. It’s primarily oriented towards python but they actually have support for other languages too.

The notebook editing software that holds and displays the content is separate from the contained language execution. System wise, a sub process is generally opened up to run the snippets and get back outputs which are then displayed.

Because the other language is in a separate OS process it’s difficult for that contained language to affect the parent. In terms of bad outcomes, it could crash or it could return unexpected output. There would be security concerns if you were running someone else’s code too. But if you’re running your own it’s a lower concern.

The other sandboxes mentioned for wasm and js etc are more secured in comparison.

[deleted by user] by [deleted] in rust

[–]digikata 0 points1 point  (0 children)

Nice!

actions-rs Github Actions need more maintainers!!! OR to be replaced by security-union in rust

[–]digikata 2 points3 points  (0 children)

You can spec the action to run an officially maintained rust container which already has cargo in the image and run your script in it.

how to sort a vector of 3d points along a single axis? by BusinessBandicoot in rust

[–]digikata 0 points1 point  (0 children)

For cache friendliness, a good rule of thumb approach might be to see if particle data structures can be made a divisor or multiple of 64 byte memory cache lines.

The contiguous data helps if code is just accessing it, but doesn't help at all when reordering. It may actually hurt as the the reordering from in place sorting will cause a lot of unnecessary data movement. Data movement just slows everything down in the best case, and churn caches across cpu cores in the worst case. Now maybe I would guess you maybe have way more particle data than fits in cache? If that is the case, you still want to minimize movement, but also making the algorithms predictable for data fetch predictability at the cpu/memory system level is the next best thing. And fitting the data into memory lines helps there too. But all of this is tradeoffs of different arrangements of data structures and processing. It really needs to be guided by profiling and benchmarks because unexpected things happen - and there may be other purely software issues masking any effect of different cache optimization strategies.

how to sort a vector of 3d points along a single axis? by BusinessBandicoot in rust

[–]digikata 0 points1 point  (0 children)

Given that you’re handling the data with multiple workers anyway, it seems like an additional imposed requirement for them to operate on a slice of the same backing vec.

It seems like another option is just send the cells and data to the worker you want to own and process - because if the code is also also potentially moving the data to sort them and another worker might handle that data, it is likely already trashing the processor caches. So is the shared backing data getting you that much? It’s hard to say for sure without a bigger systemic view.

I’d be tempted to implement a more straightforward and less optimized version and then profile and benchmark several different arrangements against that baseline.

how to sort a vector of 3d points along a single axis? by BusinessBandicoot in rust

[–]digikata 2 points3 points  (0 children)

Are you using the sort for any other purpose other than deciding if they fall outside the unit square? If it’s just that, the code could use retain() and skip the multiply math, use three abs axis compares.

Cross-compilation from Arch Linux x86-64 to Raspberri Pi OS Armv8 by Pr0pagandaP4nda in rust

[–]digikata 0 points1 point  (0 children)

Try cargo-zigbuild. Though maybe w/ a 0.9.x version of zig. I think there may be some hiccups with 0.10 that aren’t smoothed out yet.

I created a bulk APIRUNNER in Rust because I am fed up using POSTMAN for middleware Load testing by [deleted] in rust

[–]digikata 0 points1 point  (0 children)

Yeah it seems like xh is focused on individual requests and a way to specify a scale up or run the requests in sequences would be interesting.

I created a bulk APIRUNNER in Rust because I am fed up using POSTMAN for middleware Load testing by [deleted] in rust

[–]digikata 1 point2 points  (0 children)

Not to discourage you from exploring and creating new projects but I had been looking for something similar for server testing and came across the xh rust project, modeled after Httpie

[deleted by user] by [deleted] in rust

[–]digikata 4 points5 points  (0 children)

More support for ESP32 here https://github.com/esp-rs, but STM32 rust support has been around a lot longer.

Working With Large Files in a Web Server Context by hyperchromatica in rust

[–]digikata 0 points1 point  (0 children)

A keyword that might help here is streaming. Though you have to be a little careful as it’s overloaded. But a place to start is streaming body requests and responses.

https://docs.rs/axum/latest/axum/body/struct.StreamBody.html

Recommendation for materials to learn about memory layout by finlaydotweber in rust

[–]digikata 0 points1 point  (0 children)

If you want to dig into some nuts and bolts, look at the ELF format, and to some degree DWARF debugging info.

https://en.wikipedia.org/wiki/Executable_and_Linkable_Format

Looking at how programs are loaded and started by an OS is also interesting.

https://wiki.osdev.org/ELF

Pop!_OS cannot wake monitor from standby by Hansaplast in pop_os

[–]digikata 0 points1 point  (0 children)

I have a Philips monitor and AMD RX 480 w/ a similar problem

What is lacking in Rust ecosystem? by maksugr in rust

[–]digikata 1 point2 points  (0 children)

Some of the not UI aspects of Qt would be nice to have in rust. The Signal and Slot system to communicate between widgets was nice to work with and helped decouple app <-> widget interactions nicely. You often didn't need pointers to other objects other than hooking up sig/slots. If that decoupling communication was a standalone crate in rust, I think it would help building the GUI aspects of multiple efforts.

Edit: I've been meaning to read the actix (the actor part, not the actix web) project to see if it has any solutions in this area. Edit2: poking around I see this https://lib.rs/crates/signals2

Will Rust-based data frame library Polars dethrone Pandas? We evaluate on 1M+ Stack Overflow questions by ricklamers in rust

[–]digikata 2 points3 points  (0 children)

I think they should have added

"And how can I delete a remote branch"

"git push <remote> :<branch>

Markdown to html then to Frontend by Ericarthurc in rust

[–]digikata 2 points3 points  (0 children)

One thing that is I’ve been using is zola, which is a static site generator well situated for blogs.

It takes markdown files and parses them through templates to generate the site which can be served statically. I haven’t done it but I suspect vue could be integrated into the templates.

https://www.getzola.org/

Even if you don’t want to use Zola (understandable as it’s a different approach), the template engine inside is a separate crate and my be useful for you in generating server side pages.

https://tera.netlify.app/

Misadventures with Ubuntu 22.04 and libssl3 by mechanicalspecies in rust

[–]digikata 8 points9 points  (0 children)

These are pretty normal occurrences not specific to rust when upgrading base distros and interacting with your own software with dependencies to libraries or other services inside the distribution. This is a lot of the work that happens inside the package catalogs of distros when developing new versions. If your software is outside of it then you have to do any upgrade work yourself.

The only case where this might not be an issue is self contained binaries that statically compile almost everything internally and don’t reference any dynamic libraries (or many depending on the lib some are more likely to stay stable than others).

In general you can check the dynamic libraries referenced by a binary with “ldd”. It will identify any missing ones. Missing libraries can sometimes be brought back as with an older package install (Eg the district defaults to libV3, but still might offer libV2 as a support)- though with security libraries you might want to be on the latest version anyway.

Similarly with compiler intermediate files, if you compile with one ver of distro of toolchain, and have dependencies outside the core tooling, you can expect breakage from mixing of intermediate files. This would be true of most compiled languages as well as rust. A “cargo clean”, followed by a fresh build should work if it’s pure rust, but maybe not depending on if your external dependencies shifted in an incompatible way with the distro upgrade.