« first day (2775 days earlier)      last day (696 days later) » 

12:58 AM
my "website" is hosted on a server that still runs Linux 2.6.32 (at least according to uname)
@Stargateur Linux's major versions aren't even that major, the bumps are a bit arbitrary (Linux certainly doesn't follow semver)
regarding the 3.0 release: "As already mentioned several times, there are no special landmark features or incompatibilities related to the version number change, it's simply a way to drop an inconvenient numbering system in honor of twenty years of Linux."
if the trend continues, we'll see Linux 6.0 soon
 
 
7 hours later…
8:18 AM
I'm a little concerned by how complex and hard to decipher the code can be with generics. Here's the last function I just wrote:
pub async fn query_scalar<'c, 'e, E, T>(
    &self,
    base_sql: &str,
    executor: E, // either a pool or a transaction
) -> Result<T, sqlx::Error>
where
    T: Send + Unpin,
    (T,): for<'r> FromRow<'r, PgRow> + Send + Unpin,
   'c: 'e,
    E: 'e + Executor<'c, Database = Postgres>,
{
 
Still nicer than Scala.
 
(and it would have been much more complex if I had supported several databases)
It's not even a generic utility for a public lib, it's just some private code...
This also explains why I'm still the only one in the team able to simplify code with generics. Those things are hard
 
8:50 AM
@FrancisGagné so there is zero reason there don't update linux kernel xd
@DenysSéguret after experience with nom and my conbinator lib I really advice generic with long name
not single char
 
9:07 AM
what is (T, ) here ((T,): for<'r> FromRow<'r, PgRow> + Send + Unpin,)?
A tuple with a single T? I never saw that
 
it's mean the trait is implemented for (T,) yes so a tuple of 1 elem of T
A little strange if you ask me :p
denys must have a good explanation
 
@Stargateur That specific constraint is required by a sqlx type I'm using in the function. To tell it simply, it's because the tuple is what's technically read from the row representation in sqlx, and it's only one item because we want only a single value ("query scalar") from the query
 
 
1 hour later…
10:30 AM
oh, that makes sense, thanks!
 
 
3 hours later…
1:10 PM
@DenysSéguret It's extremely rare that 'c: 'e is needed in my experience. 99.8% of the time it's redundant. 0.1% it's wrong (in unsafe code).
 
@Shepmaster This part is defined as is in sqlx. It's probably useless but I'm not trying to improve sqlx (which could be much better designed on the trait side, it makes me use macros sometimes just because they didn't define enough traits)
 
Another thing that can sometimes be useful with functions like this is to put more stuff on the left side of the bounds. I don't know this enough, but as a hand-wavy example: sqlx::Result<T>: SomeHigherTrait
I'm also surprised that (T,): Send + Unpin doesn't imply T: Send + Unpin
that feels like a trait system weakness thing
 
Hum... there might be a little too many constraints, let me check
No, you can't remove the first constraint line
 
I've certainly done that before — added constraints incrementally and ultimately redundantly, so it's a good thing to check.
 
1:25 PM
I'm more on the "I don't know what I'm doing" side of the spectre. I just hit the code with a hammer until it's afraid enough and accepts to work
 
work nice with rust
 
2:26 PM
posted on May 19, 2022 by Ryan Levick and Mara Bos

Last month, the core team, all the leads of top-level teams, the moderators, and the project representatives on the Rust Foundation board jointly sent out an update to all Rust project members on investigations happening into improvements to the governance of the Rust project. As is detailed in the update, this report follows extensive conversations with many inside of the project and will con

 
@DenysSéguret lol, just opened some code to work on today:
where
    'c: 'e,
    E: sqlx::Execute<'q, Self::Database>,
 
Take that as an opportunity to improve it ^^
 

« first day (2775 days earlier)      last day (696 days later) »