« first day (1981 days earlier)      last day (1509 days later) » 

12:18 AM
I am the worst at profiling + optimizing
Every thing I've tried has made this code slower.
 
 
6 hours later…
6:00 AM
@Shepmaster You're not the worst: you measured so you don't introduce ineffective "optimizations"
 
 
2 hours later…
8:04 AM
@Shepmaster Yeah, we should get this stabilized. But a few tricky unresolved questions. I'm currently super busy. My review queue already grew way longer than I'm comfortable with °_°
 
 
3 hours later…
10:50 AM
@DenysSéguret Me neither, it just took my attention, i am overly using due to adding unit tests. I haven't deeply analyzed the Lapin's code but i'll check when it is possible, i would like to discuss about should we use generics or not.
 
 
1 hour later…
12:01 PM
Greetings everyone, how is everyone doing?
 
12:15 PM
Doin' fairly well. Although this morning is presenting itself as a particularly unproductive one for me.
 
Good to hear you're doing well. Shame about the productivity.
 
12:34 PM
Anyone know how to turn this off in VS code?
 
You're using rust-analyzer, aren't you? :)
 
I've seen types in my time, but that takes the biscuit
 
12:58 PM
@PeterHall use emacs
 
@E_net4removesmeta-commentary Yup. I keep switching between that and RLS. Both have severe problems
@NebulaFox It's hyper. I have to wonder if that level of genericity is necessary. Some of the errors I've had are almost impossible to unravel..
 
@NebulaFox It's definitely not the worst.... hackage.haskell.org/package/Nussinov78-0.1.0.0/docs/…
 
@PeterHall Not using VS Code but in IntelliJ I can click the arrow to make it narrow, hope it helps :P
 
@PeterHall I knew there was a Haskell joke in there
and now I've seen everything
I still prefer @E_net4removesmeta-commentary f:: O -> M - G or W -> T -> F though
 
 
2 hours later…
2:37 PM
I feel like stackoverflow.com/q/60721295/155423 is teetering on the edge of on-topic-ness
@Stargateur joke's on you i.stack.imgur.com/e9YhA.png /cc @PeterHall
 
@Shepmaster haha I'm currently working on SIP parser with nom
my file is 1070 lines so far
 
@Stargateur Have you done any benchmarking?
I've gotten some slower than expected speeds
Slow enough that I'm rewriting my nom parser in my own parsing library just so I can compare the speeds
 
@Shepmaster haha, hoho, hihi
I'm still implementing a sub RFC
but I already did 2-3 nom project
was all time very fast
 
@Stargateur I'm talking like... parsing at 50MB/sec
which is terribad
 
@Shepmaster OMG SO SLOW !!! ;)
 
2:46 PM
@Stargateur the same parser in Go was 150 MB/sec. the hand-written Rust impl (but with some bugs) was 250MB/sec
 
@Shepmaster is the code open source ?
 
not yet :-(
 
well can't help you :p
but nom is a parser but also can be a lexer
if you do a lot of tokenisation in nom but not in your other parser that not fair
 
mini-rant time: My library had all of this far before nom did, but I simply didn't / couldn't market it nearly as well.
e.g. in fuzzy-pickles, my Rust source parser, I use the same library to parse and lex in two phases
and in the xml library I parse/lex at the same time
 
@Shepmaster question: how does someone get into the stuff that you do
 
2:53 PM
@NebulaFox I'm not sure I know exactly what you mean, but "one bite at a time"
I'll try for a more helpful answer if you wanna hit me with something more specific
 
@Shepmaster I mean, writing a parser library for instance
I mean...
Following the conversation, I see a lot of technical projects and I'm just a humble App developer
 
That's an "easy" one to answer; there are even blog posts ;-)
Realistically, I started that from a few different avenues
Many years ago (10+, IIRC) I worked at a company that did a lot of XML
we used C, so we had libxml2
which, in my hubris, I felt I could do better
so I started writing an xml library in C
then realized I was rewriting C++
so I moved it to c++11
then heard about rust
so I copy-pasted foo.cpp to foo.rs and ran the compiler until it worked
(literally)
so really I just started from a problem and kept going lower
(really low, I even investigated using SIMD to help with that)
 
Interesting. From my experience, instead of going lower I went sideways. I was interested in gpus and OpenGL on devices like iPhones. But then I eneded up being an App Developer.
I still think in a highly abstract ways
 
@Shepmaster how crazy are you ?
 
@Stargateur This was during Rust 0.12 as well. It worked surprisingly well.
@NebulaFox I mean, I know almost nothing about GPUs and associated hardware
 
3:10 PM
THERE IS TOO MANY RFC
> provider-hostname = domain ; <domain> is defined in [RFC1035]
 
3:24 PM
@Shepmaster I guess my problem back then was I had knowledge of GPUs, but nothing to use it on.
Thanks for sharing your experience. It has given me some useful insight.
 
@NebulaFox np. I feel like you are burying the lede by saying "app developer" There are so many kinds of apps, even.
 
@Shepmaster mostly building front-ends for REST APIs. The challenge there was view logic: loading and reacting - and data logic and loading. I am a big fan of Reactive frameworks.
 
 
1 hour later…
4:48 PM
how do I implemented a backtracking rule in nom ?
// <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
// letter is alpha
// let-dig is alphanum
// ldh-str is many // <let-dig-hyp> ::= <let-dig> | "-"
a big fat if at the end ? :p
 
5:12 PM
combinator::verify(ldh_str, |ldh: &str| {
        ldh.chars().rev().next().unwrap() != '-'
    })(input)
who can stop me ? a bad BNF ? hahaha
 
5:46 PM
posted on March 15, 2020 by Joshua Nelson

Recently, docs.rs added a feature that allows crates to opt-out of building on all targets. If you don't need to build on all targets, you can enable this feature to reduce your build times. What does the feature do? By default, docs.rs builds all crates published to crates.io for every tier one target. However, most crates have the same content on all targets. Of the platform-dependent crate

 
Rather surprised that they did the whole "build everywhere" to start with
And I've gotten support requests for SNAFU because of it
as someone asked if SNAFU didn't work for some platform the docs didn't build for at the time
71
Q: Upcoming Feature: Follow Questions

Yaakov EllisWe are planning to release a new feature on the network in the next few weeks that will give users the ability to follow and unfollow questions. This was mentioned by Teresa in the Q1 Roadmap. The plan is to roll out these changes in multiple releases. (Work is well underway, and we are aiming fo...

 
@Shepmaster Yep, that's some neat stuph.
 
6:06 PM
@Shepmaster by the way
I struggle very hard to make good error with nom
how do you do ?
 
@Stargateur well... I wouldn't say that I've gotten there yet (and this is one of the big reasons I like my framework as errors are front-and-center).
But can't you create your own error type and use something like docs.rs/nom/5.1.1/nom/error/fn.append_error.html
 
I have the carpiest of errors in dicom-rs. :'(
 
It's very very very very hard to use in my opinion
I tried few time
didn't make it work
 
What are you guys working on?
 
6:23 PM
Errors for the xml library have all the data needed, but could do with a better presentation:
Unable to parse: XML parsing error at 5: {Expected("?>"), ExpectedWhitespace}
>
(parsing <?xml>)
@E_net4removesmeta-commentary do share
 
@Shepmaster It's roadmap'd, but another important feature was given priority.
 
> A good candidate for this refactor is with the use of snafu, as its error handling paradigm scales better and leads to more informative error values.
<3
 
@E_net4removesmeta-commentary nice to see you got some participants in your issues
 
@Shepmaster Indeed, I am grateful. The project, while pretty much at its infancy, has attracted some interested and helpful people.
 
6:34 PM
@E_net4removesmeta-commentary but is it async/await yet ;-)
 
@Shepmaster Nope. It's sync I/O all the way, and that part is complicated enough as it is. :(
All decoding/parsing and encoding/printing is backed by standard readers and writers, which can and should be buffered in some way.
Fetching it all into memory is out of the question, since some DICOM images can get absurdly big.
And we won't know where the largest sector of the data (i.e. the pixel data) starts until we parse the file into the respective header.
 
I was only kidding :-)
 
Are you all working on parsers?
 
heh
 
It's a fair point though, someone could be interested in parsing a DICOM file while it's still downloading or something similar.
Sort of.
 
6:39 PM
it does seem like that, doesn't it
Rust is a pretty good language to do parsing in
 
@E_net4removesmeta-commentary sounds like a nice to have but no really needed feature
@Shepmaster so was Haskell
but clearly Rust is a lot better
 
@NebulaFox True! And only recently is async/await available, I started the work on DICOM-rs in 2016.
 
@NebulaFox Haskell parsing libs are more mature
 
@E_net4removesmeta-commentary async parsing is also notably harder, AFAIK
until we get generators, maybe...
 
@Shepmaster I can definitely imagine.
 
6:41 PM
Rust parsing had a watershed moment when we got impl trait
 
Aye, generators are actually one of the features I'd like the most. After GATs.
 
because it made parser-combinators realistic
 
I'm going to be naive here, isn't a generator just an iterator
 
very similar
 
@NebulaFox See e.g. generators in JavaScript and Python. It's about being able to write iterators like an imperative function, instead of explicitly as a state machine.
 
6:42 PM
Do you just need something like yield?
 
I think of them as the same, but turned inside-out from each other
 
@E_net4removesmeta-commentary I understand
 
but (at least for rust) generators require entire new language constructs
while iterators are "simpler"
 
Right now with DICOM-rs I'm having a hard time turning objects into a sequence of tokens. With generators this would've been peanuts.
 
with async/await, arn't we one step away from generators
loop, wait, loop, wait
 
6:45 PM
:-D
you ready for the secret?
 
okay
 
Rust's async/await is built on top of generators
 
...
 
async/await is effectively a simpler generator
 
6:46 PM
but you can't return a value?
or it's not exposed?
 
Yet with similar requirements. AFAIK Pin is important to both.
 
you can only return a final value, there's no yield equivalent
 
dam
 
but yield maps to the "wait" step
 
it's a matter of time then
 
6:47 PM
so .await can be thought of as effectively yield;
absolutely.
 
the semi-colon at the end XD
 
27
A: Lazy sequence generation in Rust

ShepmasterRust does have generators, but they are highly experimental and not currently available in stable Rust. Works in stable Rust 1.0 and above Range handles your concrete example. You can use it with the syntactical sugar of ..: fn main() { let sum: u64 = (0..1_000_000).sum(); println!("{}...

That shows how unstable generators look at the moment
 
Oh, now I remember why I can't use impl Trait for the tokens thing.
 
@E_net4removesmeta-commentary use Either ;-)
(you like my random guess?)
 
@Shepmaster If only that was enough. The logic is more complex than an Either can hold.
@Shepmaster But yes! :D
 
6:50 PM
Now, the problem it, I've forgotten what I was doing
 
@NebulaFox writing a parser, obviously
 
@Shepmaster actually no, I'm learning Rust but creating command-line tools and documentation
 
Or another alternative CLI tool.
:D
 
no, no. Rust is only good for parsers ;-)
 
only good for parsers???? I need to find another language to learn then XD
 
6:54 PM
Oy, untrue.
It's also good for b l o c k c h a i n
 
And WASM
 
@E_net4removesmeta-commentary regarding your name, should I remove 2 of the sentences of this answer?
 
Pretty much wasm. It's nice to see the progress here, both as the compilation target as well as the runtimes available.
@Shepmaster Shepmaster removes meta-commentary
Indeed.
Although ideally we'd have closed the Q sooner in this case.
But speaking of WebAssembly, DICOM-rs supports it! I can run its current implementation of the dcmdump tool in wasmer.
Speaking of errors again, couldn't new editions allow us to remove Error.description entirely?
Or maybe the core/std libraries can't easily change over editions?
 
7:30 PM
Not really. Isn't Editions more flavour of the language while `Error.description` is part of the standard library.
To completely remove we would need Rust 2.0
backticks stopped working?
hmm...
 
@NebulaFox i concur with this.
conceptually, we could hide a function in an edition, I suppose
so that if you tried to use it in edition 2021 you'd get an error
 
8:16 PM
Silly question: what happens when you clone &str? Is the cloned &str pointing to the same place as clonee &str?
 
yep
 
I thought so but I couldn't find any documentation it
 
&str === { data: *const u8, len: usize }
 
Shall I create a question on StackOverflow XD
I just need to press Post
Apparently it's too subjective o_O
 
Hello I'm documentation bot ask your question about what you search :p
 
8:27 PM
@Stargateur dam
Want +10 points?
Wait, that doesn't mention what happens when you clone it
Skim reading is not helping me here
 
@NebulaFox clone use copy when copy exist, intern representation of &str is implementation behavior
 
I did not know that
 
See also : https://doc.rust-lang.org/std/primitive.reference.html#trait-implementations
`Clone (Note that this will not defer to T's Clone implementation if it exists!)`
means that it will only clone the reference *
https://doc.rust-lang.org/std/primitive.str.html#implementations
please check there is no Clone implementation, if i am not mistaken then this means it will just clone the reference
 
If it's a copy then &str isn't moved.
There is no Clone implementation for str
 
8:40 PM
Yes this means it will only clone the reference
it is because of the first link that i've shared
 
Excellent, thanks for all the links
 
:( pourquoi?
 
9:11 PM
Jamais sortir
 

« first day (1981 days earlier)      last day (1509 days later) »