« first day (3088 days earlier)      last day (394 days later) » 

5:45 AM
@Stargateur You mean a doc full of the obvious things that can be easily guessed ? By an AI hallucinating that your code is as bad as the usual documented codes it was trained with ? An AI totally unable to spot the real specific things of your code, the ones worth pointing ?
Yes, of course, you can ask ChatGPT, no problem.
People always think that serde-json parsing JSON into borrowing structs is a good thing which will magically make their code faster... Serde should come with warnings, this is just a bad trick...
https://github.com/Canop/deser-hjson/issues/11
 
 
1 hour later…
6:50 AM
@DenysSéguret haha, well, I working on doc on my parsing conbinator lib, I used #![warn(missing_docs)] sometime documente "small" thing look useless
@DenysSéguret I don't like format where you can "escape" character
that really anoying for parser
 
@DenysSéguret Allocations are expensive, though, especially when you spam a myriad of small allocations. The cost of allocating itself is typically not too bad, but that's just the beginning. The cost of the indirection, the cost of memory scattered all over the place and the cost of deallocating: all those add up.
Deallocating in particular is scary, modern memory allocators have focused on allocation performance a lot, and pushed down a lot of clean-up/consolidation work into deallocation, making its latency wildly unpredictable.
 
7:49 AM
@Stargateur yes, of course, but if you need a JSON parser, you need one which doesn't fail on real JSON
 
8:30 AM
@DenysSéguret To be fair, it depends on the payloads. If you have to parse arbitrary payloads, then certainly you need something resilient. However, if you are communicating with a process you control, or a party you trust, you may eschew strict conformance in exchange for performance :)
 
BTW serde_json is slow, and it looks like it's at least partially due to its complexity, which is not unrelated to this borrowing principle. I'm convinced it was a very bad idea
But my main gripe is the lack of warning. People unknowingly use the borrowing serde_json parser and don't even know that their code will fail in production
 
8:46 AM
I mean, r#" is perfect you escape EVERYTHING, no exception, and the whole string can be borrowed as it is
@DenysSéguret runtime fail cause what you write at compile time is wrong sux
@DenysSéguret serde_json is slow you think ? I think it's ok, thus, serde allow nice optimisation cause you don't stock the json in "ValueJson" cause that very heavy (vec, hashmap... tree format...)
but yeah I think a hand parser could do better than serde but that requiere ton of work everytime you want parse a json
anyway json is not ideal format for machine so if you pick json you pick it for flexibility not performance
at least you should
 
9:25 AM
I mean, if you're into trying to avoid allocating a few strings to improve performance at the cost of reliability, you're already performance obsessed. That's why I think the borrowing part of serde_json was a bad idea
 
good point
 
 
3 hours later…
12:36 PM
Greetings. I've been looking at nohash-hasher in one of my projects. Following on from that Crates.io page, we can see that the repo has been archived part way through 2022. I'm not familiar with the general evolution of the package ecosystem in Rust - assuming that the package as-is works perfectly for my use case, does the fact that it's archived spell a possibility that it will be pulled from Crate.io and break builds?
I know this is hypothetical but I'm just curious as to whether there's a history of things like this churning because the tooling is a lot more nascent than other languages I'm used to, so I can't really get a general sense of the exposure from including it
 
If you're afraid that the crate would be removed from crates.io, you can just fork the repository to save it: you'll always be able to make a new crate from it as it's MIT.
Now, you should try to see why it was archived: is there a major problem ? I see nothing in the readme or in issues on this topic
 
Ok, the MIT license point is something I hadn't considered in terms of publishing. The next thing I considered was it potentially exploding on rust 2024 but I guess forking it can sort that too if there's any breaking change. Thanks!
 
12:51 PM
Packages are never removed from crates.io -- baring serious violations, such as containing pedopornography. The only mechanism available to publishers is yanking and this only prevents new projects from depending on the package, existing projects can still continue using it.
 
Perfect, that's an extra safety net. Thanks both
 

« first day (3088 days earlier)      last day (394 days later) »