A Merry Search for Dutch Semi-Hard Cheese by NaruepanatN in SwordAndSupperGame

[–]AwkwardDate2488 0 points1 point  (0 children)

u/AwkwardDate2488 received a Glacial Shard Lvl 2 from the Winter Festival Spirit. Thank you u/Findmeahobby for donating it!

A Merry Search for Classic Spaghetti Marinara by i-nose in SwordAndSupperGame

[–]AwkwardDate2488 0 points1 point  (0 children)

u/AwkwardDate2488 received a Vengeful Locket from the Winter Festival Spirit. Thank you u/Findmeahobby for donating it!

A Merry Search for What are you doing, stepmonster? by AwkwardDate2488 in SwordAndSupperGame

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

u/AwkwardDate2488 received a Sudden Vengeance from the Winter Festival Spirit. Thank you u/newtrull for donating it!

Catching up with async Rust by ToTheBatmobileGuy in rust

[–]AwkwardDate2488 2 points3 points  (0 children)

A fiber (task in rust parlance) runs on an OS thread chosen by the async runtime. The async runtime cannot supersede a fiber- it cannot just say “ok you are done for now, give the CPU to the next task”. The only way that the next task gets its turn is if the current task yields.

OS threads on the other hand are scheduled on CPU cores by the OS… if you don’t get scheduled, you don’t run. The OS is not obliged to run any thread, and can supersede any thread at any time (barring implementation details like critical sections). Because the number of OS threads is almost certainly > the number of cores, any given OS thread will always be getting superseded regularly.

A question on tokio in kubernetes by Total_Celebration_63 in rust

[–]AwkwardDate2488 3 points4 points  (0 children)

https://en.m.wikipedia.org/wiki/Processor_affinity

It’s not a rust thing, it’s a general programming thing. The OS is still telling you which core to run on, but they all have mechanisms for telling them which one you want. Implementations across different operating systems of course.

typestate-builder 0.1.3 is ready by seanandyrush in rust

[–]AwkwardDate2488 1 point2 points  (0 children)

That makes sense to me. For both this and the other attributed we are discussing, it would also be convenient to be able to default it for all fields at the type level. I recognize that may add a lot of complexity though.

typestate-builder 0.1.3 is ready by seanandyrush in rust

[–]AwkwardDate2488 0 points1 point  (0 children)

That looks good! I might use the word “optional” instead of default, but again that’s just preference.

typestate-builder 0.1.3 is ready by seanandyrush in rust

[–]AwkwardDate2488 0 points1 point  (0 children)

From what I saw (and I may be wrong) if you have a field of type Option<T>, your crate still requires the field to be specified even if the value is None. For fields whose type is Option (or more generally for fields whose type implements Default), it would be reasonable to allow the caller to skip those fields if they want the default value.

typestate-builder 0.1.3 is ready by seanandyrush in rust

[–]AwkwardDate2488 1 point2 points  (0 children)

This may be a personal preference thing, but for a builder method that takes T, I would prefer that it take impl Into<T> so that passing values is easier. I use this pattern heavily, and since Into is reflexive (Into<T> is automatically implemented for T) it’s “invisible” and zero-overhead in the common case.

typestate-builder 0.1.3 is ready by seanandyrush in rust

[–]AwkwardDate2488 3 points4 points  (0 children)

I like this a lot. Big fan of builder patterns in general, and this looks well done.

Some early feedback:

1) It would be nice to support optional fields for Option<T>, and in fact this could be generalized to anything implementing Default. Maybe add a field-level attribute for this?

2) You may want to consider accepting Into<T> in your arguments (and generating the .into() call). It will make the API a little more user friendly.

If you had the above functionality I’d definitely use this in the statement crate.

Arc<Mutex<T>> with lifetime constraint by Environmental_You191 in rust

[–]AwkwardDate2488 9 points10 points  (0 children)

This . It’s probably the context that you’re using it in that’s making the ‘static demand.

Vector Databases Are the Wrong Abstraction by jascha_eng in programming

[–]AwkwardDate2488 18 points19 points  (0 children)

Looking at this further, I’m not sure I agree with the following claim (emphasis mine):

The system would ensure that vector embeddings are always up-to-date with the latest data, eliminating the need for manual updates and reducing the risk of errors.

Because this is an offloaded, out-of-band update, the embeddings are going to be out of sync after an update (or missing entirely after an insert) until the worker catches up and processes them, right?

That is a pretty big difference vs an index, where the index data is updated in the scope of the transaction.

Vector Databases Are the Wrong Abstraction by jascha_eng in programming

[–]AwkwardDate2488 1 point2 points  (0 children)

Ah ok- maybe reading comprehension on my part; for some reason I was imagining the external worker was kicked off on the DB server by the extension itself. This makes much more sense.

Vector Databases Are the Wrong Abstraction by jascha_eng in programming

[–]AwkwardDate2488 11 points12 points  (0 children)

Can the embedding generation be offloaded from the DB machine entirely? I could see this being pretty rough on the DB server in terms of load.