« first day (2563 days earlier)      last day (927 days later) » 

8:41 AM
With my new site, I try to subtly hint that I'm only interested in contracts involving Lego and Rust.
 
8:54 AM
That looks cute! In a good way!
 
thanks :)
With this new site, I'm quite confident I can be hired by my kids
2
 
 
4 hours later…
1:25 PM
It's painful to see so many questions and posts on reddit about linked lists...
 
 
1 hour later…
2:32 PM
How to get the sum of a struct's fields mem::size_of's? Or more generally, how to iterate over the fields of a struct in Rust? Is such stuff even possible with regular macros or do I need procedural macros or something else?
 
@purefanatic These two might be relevant: stackoverflow.com/questions/61978903 stackoverflow.com/questions/38111486 Unfortunately, it is not quite the best idea overall.
 
What do you mean with "not the best idea"? Serde for example must use some kind of "compile-time iteration" mechanism which makes it very powerful and generic and I'd like to understand how.
 
2:48 PM
@purefanatic are you looking for this ? doc.rust-lang.org/reference/…
But really procedural macros are a PITA to code. It you can avoid them, it's better
 
@purefanatic Well, doing macros for a dedicated feature in a library is one thing. Serde does use derive macros for that, but as Denys says, it's not a regular walk in the park, and might be too much for something as simple as making a sum.
 
@DenysSéguret Probably? :D Yes I avoided them for the most part. I just thought there might be some kind of simpler reflection API. But according to your suggestions I might continue staying away for now as it's not really that important for my case at hand...
 
3:01 PM
Well thanks a lot to the both of you, I might come back later with more (specific) questions
 
 
2 hours later…
5:16 PM
I've a bunch of programs which were compiling and which randomly aren't anymore with last rust versions. Common points: several paths to the same crate (same version) due to republish
 
 
2 hours later…
7:21 PM
@DenysSéguret at least it's easy to fix
 
Not so much because some of the uses are in exported macros. I now have to explicitly import the reexported crate...
This is now a mess and I don't understand why the crates appear to be different to the compiler since one or two rust versions
 
cause for now you have the luck the two import was the same version
 
It's still the same version because there I have the exact version in all Cargo.toml
> | |__________________^ expected struct termimad::minimad::Composite, found struct minimad::Composite
In both cases it was minimad 0.8.0
 
did you check with cargo tree ?
 
no, it's not on my computer. It doesn't happen for everyone, but always with fresh installs
> I downloaded rust from rustup.rs on a fresh clean system and tried to compile
 
7:26 PM
strange cargo should follow semver
 
Never had such problem until last week or this week-end
 
mmm
I don't see anything wrong with your cargo.toml
maybe a change in rustc
 
I'm tired to answer mails from blockchain companies. They seem to be ready to hire people whatever the cost... They have too much money, it's insane...
 
haha
unfortunately money can't buy everything
in the github issue:
   Compiling minimad v0.9.0
   Compiling minimad v0.8.0
 
7:40 PM
wait, a little one by one, and so your minimad was indeed github.com/Canop/termimad/blob/master/Cargo.toml#L14 and github.com/Canop/bacon/commit/… so compiler was right
 
For bacon, yes. But I'm speaking about broot, where termimad was written with version 0.16.0
Not totally excluding a confusion because I'm on too many projects...
 
no you changed 3 hours ago github.com/Canop/broot/commit/…
 
See, it was termimad = "0.16.0"
 
no you introduce a soft breacking change here
cause cargo didn't take 0.16.0 it take 0.16.3 on fresh install
 
And termimad 0.16.0 specified minimad 0.8.0 : github.com/Canop/termimad/blob/…
oh... you mean 0.8.0 means the same than 0.8 ?
I should probably use the "=" then
 
7:46 PM
not sure on this one
but I think
well you don't need
just use reexport item
 
That's what I do now but it's quite a mess when I use minimad in a macro of termimad used in yet another crate... I have to manually import termimad::minimad even while minimad isn't visible because it's in the macro...
I'd so much like imports in macros to be done as if they were in functions...
 
import it in the macro ? like use termimad::minimad as __minimad ? well that indroduce some problem if user rename termimad in cargo
I don't like macro
oh
@Shepmaster anytips ?
 
Maybe don't bother. Termimad is a weird beast anyway...
I'm always disturbed by the number of stars it gets. It feels like an imposture. I doubt so many people manage to use it
 
oh I know
you should define a pub function that get the use the stelement
so the macro only interact with termimad pub interface
why do you use a macro btw
I don't see any good reason seeing what inside
 
Variable number of arguments
But you're right it should be possible to use only functions from termimad, with a little duplication
I put this in my todo list
 
7:59 PM
well at least don't use a vec so since you used a macro
 
It's because of the to_string: to keep the values
 
$(TEMPLATE.apply(&mut composite, i, $value.to_string()); i += 1;,)*);
something like this ?
 
The template accepts only references
 
well add & ?
I miss emote on this chat
 
No because then you pass references to objects you don't keep. Hence the vec
 
8:03 PM
well anyway this would make the function harder to do
oh you must keep it ?
 
I must sleep now. The plan of being freelance was to have more time but right now it doesn't work, mainly because I sell all the days...
 
short term it's OK. But I lost job security so the change will be confirmed to be OK when I have several recurring customers
> The string "0.1.12" is a semver version requirement. Since this string does not have any operators in it, it is interpreted the same way as if we had specified "^0.1.12", which is called a caret requirement.
!!afk slleeeep
 
 
1 hour later…
9:29 PM
> By default, the Cargo.lock file that is included with the package will be ignored.
@DenysSéguret using "=" just risks making things worse, since it won't lock transitive dependencies, so you may end up with 2 versions of the same crate in a way that wouldn't happen with "^" (implicit or explicit)
this is important e.g. when you implement a trait from crate A on type X and pass an X to crate B with a generic constraint on the same trait from crate A (if you have 2 versions of crate A, you're screwed)
 
I agree that use = is evil that just ask for more problem
 

« first day (2563 days earlier)      last day (927 days later) »