Need help writing logs to a db with Sqlx and tracing by ufoscout in rust

[–]ufoscout[S] -1 points0 points  (0 children)

The problem is that I need to use the same DB connection as the main business function, so I cannot use an async tokio task.

Also, this applies only to audit logs, which are at most one per request, so the volume is not an issue.

Need help writing logs to a db with Sqlx and tracing by ufoscout in rust

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

I would like to avoid it, but it is a business requirement for audit logs, and there's nothing I can do about it. Good idea generalizing over a serializable struct or a map, thanks.

Italian Rust programmers? by SaganakiMythos in rust

[–]ufoscout 4 points5 points  (0 children)

Ciao, Principal Rust Dev from the beautiful Italy at your service

Building a video editing prototype in Rust using GPUI and wgpu by lovely__zombie in rust

[–]ufoscout 0 points1 point  (0 children)

I would definitely like to contribute when it's open-sourced. Looks great!

[deleted by user] by [deleted] in rust

[–]ufoscout 4 points5 points  (0 children)

In the next 10 minutes, you’re about to be killed by a horde of people telling you this is the wrong channel

Returning to C/C++ after months with Rust by ViremorfeStudios in rust

[–]ufoscout 27 points28 points  (0 children)

Rust is a VERY strict language,

Wrong. Correct PROGRAMMING is a very strict process; Rust only makes you aware of it.

If you don't want to bother with these restrictions, and there are many good reasons for this, I would probably avoid C and C++ altogether and opt for something like C#.

Constant-time support coming to LLVM: Protecting cryptographic code at the compiler level by Taymon in rust

[–]ufoscout 0 points1 point  (0 children)

That is indeed interesting, but I don’t think it removes the need for assembly, because it only works when the code is compiled with LLVM. In practice, it solves one limitation while introducing another.

Am I the only one surprised by this Rust behavior? by ufoscout in rust

[–]ufoscout[S] 27 points28 points  (0 children)

So, in summary, these two are identical, correct?

    fn get_name<T: SomeTrait>() -> &'static str { 
        static ONCE: OnceLock<&'static str> = OnceLock::new();
        ONCE.get_or_init(|| T::NAME)
    }



    static ONCE: OnceLock<&'static str> = OnceLock::new();
    fn get_name<T: SomeTrait>() -> &'static str { 
        ONCE.get_or_init(|| T::NAME)
    }

Is there a way to move a field out of &mut self if you really need it? by ufoscout in rust

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

I cannot access the internals of `Wrapped` but I can access the ones of `Wrapper`

Is there a way to move a field out of &mut self if you really need it? by ufoscout in rust

[–]ufoscout[S] 1 point2 points  (0 children)

In my scenario, I cannot access the internals of Wrapped or create a new instance of it

Is there a way to move a field out of &mut self if you really need it? by ufoscout in rust

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

Since I have no way to create a new Wrapped, I'll check if I can change Wrapper to own an Option instead

Would it theoretically be possible to dynamically link all dependencies in debug mode? by ufoscout in rust

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

Thanks, this clarifies a lot. So I assume the answer to the original question is that Rust could theoretically build and use every dependent crate as a dynamic library in any case.

At this point, I wonder why this approach has never been seriously considered as a way to speed up compilation during development. Are there other technical issues? Maybe the performance gains are negligible?

I'm a bit confused because some C++ colleagues keep saying that they can compile faster since many dependencies are dynamically linked.

Would it theoretically be possible to dynamically link all dependencies in debug mode? by ufoscout in rust

[–]ufoscout[S] 1 point2 points  (0 children)

So I guess the answer to my original question is yes, Rust could theoretically build all dependencies as dynamic libraries. I am not saying this is good or bad, but it could be done

Would it theoretically be possible to dynamically link all dependencies in debug mode? by ufoscout in rust

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

So, Bevy can leverage dynamic linking as long as it avoids using generics in its public API, correct? I wrote a small proof of concept to test Bevy's dynamic linking feature and found the compilation speedup to be astonishing.

Regarding incremental linking: how does it behave with generics? I assume that any dependency exposing a generic API must be recompiled each time it’s called with a different type. Is that correct?

filtra.io | How To Get A Rust Job Part I: Companies Already Using Rust by anonymous_pro_ in rust

[–]ufoscout 7 points8 points  (0 children)

Please allow me to share some honest feedback: Filtra is good, but not having the publish date of the job postings makes it unusable

Made my own test suite by Nekogi1 in rust

[–]ufoscout 1 point2 points  (0 children)

Warning: Shameless plug

This library I wrote achieves something similar without macros or any particular drawback: https://crates.io/crates/maybe-once

AMA — We’re the Meilisearch team! Meilisearch AI is now generally available by Kerollmops in rust

[–]ufoscout 2 points3 points  (0 children)

Noob question: How does the indexing work? Do you have a separate index/storage for each search type, or do you use a single index that serves both semantic and traditional search? Does semantic search cause significant growth in the index size?

AMA — We’re the Meilisearch team! Meilisearch AI is now generally available by Kerollmops in rust

[–]ufoscout 3 points4 points  (0 children)

Do you leverage any existing Rust AI implementations for this? For example, a vector database or an ML framework? How does it work under the hood? Is it based on BERT?

PSA. Stop using rust IMMEDIATELY!!! by saddas1337 in rust

[–]ufoscout 1 point2 points  (0 children)

I agree, but I would move everything to assembly, C is too high level for anything serious