« first day (832 days earlier)      last day (2640 days later) » 

1:45 AM
i forgot to join the chat this morning
hello everyone
 
Hello, fellow Rastesian
 
1:59 AM
@LukasKalbertodt Cup<T>
 
Cup<T> is funnier in VB.NET ... where generics are expressed: Cup(Of T)
the joke wears off quickly once you realise you're writing VB.NET code though
3
 
ahahaha
what an... interesting subreddit.
I had no idea it existed.
 
 
7 hours later…
9:02 AM
@Shepmaster It's also not really Rust focussed... it's ... too generic badum ts
 
 
1 hour later…
10:03 AM
@набиячлэвэли Because the compiler can't know whether you're borrowing from Hitler. ;)
 
 
4 hours later…
2:40 PM
Damn. There's no way to efficiently check the last character of a string without going O(n), is there?
Oh, found ends_with. I just won't be bothered then.
 
3:04 PM
@E_net4 There is a way
you know the string length
so you can jump to the byte before
before the end
and then walk back until you find the start byte of the next character
and ends_with is probably easier to understand
 
Cool.
 
3:23 PM
And what about discarding the last character? Is there something more idiomatic than s.split_at(s.len() - 1).0?
 
welllllll
that's broken for non-ascii
;-)
 
Tru dat
But in this case I'm sure that the last character is ASCII.
 
3:52 PM
@E_net4 Your funeral. &s[..(s.len()-1)]
 
Dayum, son.
I also don't seem to need those parentheses: &s[..s.len() - 1]
 
I can never remember what that precedence is
 
I am also positively surprised that char is a valid Pattern.
 
4:16 PM
char, strings, numbers
With a feature flag, slices
 
Even functions, I see.
Furure state.
 
@E_net4 really?
like if let Some(fn(u8) -> bool) = var ?
 
@Shepmaster Unless the docs lie about impl<'a, F> Pattern<'a> for F where F: FnMut(char) -> bool, yes.
 
OOOOH
that kind of pattern
 
:|
 
4:22 PM
trait Pattern != a Rust pattern (like a match)
 
Well, I admit there was a bit of ambiguity. But I did say Pattern, not pattern. :P
 
tru
 
Onwards.
 
@E_net4 someday, Pattern will stabilize... github.com/shepmaster/jetscii
 
@Shepmaster Nice crate name. :>
 
4:24 PM
That was a community effort
 
4:40 PM
sigh
Why do people jump into the hard stuff before understanding the basics
 
5:06 PM
@Shepmaster Is it a consequence of SO oriented programming found in other languages?
 
5:24 PM
I just sent a PR to the TensorFlow's Rust bindings project. Rust is getting closer to my academic endeavours. :)
 
6:13 PM
@E_net4 nice!
 
Now, I'd still need a heckload of additional libraries before I can use it regularly, but one step is better than none. :P
My answer was suddenly +2 voted and accepted.
Even I didn't expect that.
 
@E_net4 implementing for a reference was going to be my answer
Although you might want also want to show it as foo(Thing) in addition to foo(&Thing) and foo(&Thing as &Trait)
 
@Shepmaster Agreed, I changed the order of solutions to emphasize implementing A for &'a T.
 
@набиячлэвэли You've tried too hard for this to die, isn't it? :P
 
@E_net4 Tried to do what?
 
@набиячлэвэли Making the list a known thing.
 
I really don't follow
 
Bah, forget it.
 
7:02 PM
But yeah if you have any more spicy puns ping me and I'll add them
 
You got it!
 
> Automatically generated with GCC version 4‍.‍6‍.‍3's C preprocessor on 23.01.2017 18:57:59 UTC from "src/extensive_list_of_rust_puns/index.html.pp".
SMH
 
@Shepmaster What?
 
So, now I wonder what FFI libraries usually do to convert strings. Checking...
Oo, util::to_cstring.
Oh, that's just dumb.
Don't mind me.
 
7:23 PM
@E_net4 No. I will mind you.
Hello @Cagatay!
 
hi there
don't mind me, i'm just rust-curious
 
We tend to be friendly, so ask away
There's also reddit.com/r/rust and users.rust-lang.org; in addition to IRC
 
You are indeed most welcome.
 
well thank you, this is a friendly group!
 
We can be mean too; would you prefer that? ^_^
It might make some people more comfortable, I'd suppose
 
7:27 PM
i do have one question; is there an up-to-date spec for Rust? it seems like people mostly follow release notes from one version to another to find out new features and changes, but for a newcomer, i could not find a comprehensive spec.
 
At least we usually avoid turning it into a Lounge.
 
friendly is just fine, :)
 
I believe the closest you have to that is this reference.
Rust is not really specification-oriented.
 
@E_net4 this seems pretty good; do you mean it's not exhaustive or up-to-date?
 
@Cagatay The thing is, to my understanding, it's not the Rust compiler that follows a spec. The specification is defined by the implementation.
But heh, there are better people to talk about it. @Shep?
If you're looking for feature proposals, the RFCs repository has them all.
 
7:38 PM
thx, i'll take a look
 
7:50 PM
@E_net4 Yep, I'd agree that the implementation is the Source Of Truth
@Cagatay When you say "spec", what do you mean by it?
For example, what goal would having this spec solve?
 
@Shepmaster I mean in the sense of the Java or Scala language spec; the definitive truth about every language construct and semantics, kept up-to-date. The final arbiter of correctness for a Rust program.
 
OK, yeah. Then the reference would be the appropriate thing, but as mentioned, it isn't always kept up to date
I'm sure that eventually they will align
but it feels a bit over-bureaucratic at this point (IMO)
@Cagatay I do think it's interesting for a newcomer to want to jump straight to the spec. I usually only turn to a spec when I get realllllly far into the weeds and need to figure out some tricky detail.
 
I look forward to that; I do think this community has done excellent work in documenting the standard libraries; I actually enjoyed reading them.
 
Yeah, the human-focused docs are pretty good. If you are just getting started, there's an improved version of TRPL in the works - rust-lang.github.io/book
I'd recommend reading that version until you run out of text, then switching back to the current book
 
@Shepmaster Yes agreed, the spec is not the first thing in my mind when i start learning a brand-new language. I will admit to keeping it open for reference for when the guides/tutorials fail me in explaining some detail.
@Shepmaster ooh, i had not seen that, thank you!
@Shepmaster i will also sheepishly admit to being a bit of a language lawyer when cornered :) for now, i'm finding Rust really well thought-out.
 
8:09 PM
@Cagatay to be clear, there's nothing wrong with wanting or referring to a spec. It's just usually it comes up to solve a particular problem.
 
 
2 hours later…
10:10 PM
@E_net4++ Finding similar questions! And updating them!
 
Oh stop it you. :P
That one did clarify my latest... issue.
But now I have to figure out what string encoding TensorFlow is expecting over there. :P
 
@E_net4 They take a c_char*?
UTF-8 isn't a bad guess if so
 
@Shepmaster Well yes...
Whelp, I might be better off assuming UTF-8 indeed.
 
@E_net4 Really, the truth is that they have to document it
 
They really are taking a while to stabilise the FFI API, the same goes for C++'s.
 
 
1 hour later…
11:27 PM
Are there known opinions on whether to write the test module at the top or at the bottom of a file?
 
@набиячлэвэли why not a markdown file on GitHub? Would be more rusty :(
 
@LukasKalbertodt Why would it be? Gists aren't meant for this kind of thing
And it is on GH
 
@набиячлэвэли Oh sorry, I missed that. I might not be 100% free of ethanol at the moment. Excuse that.
 
> This page is open-source, you can find it at GitHub, and contributt and/or yell at me there.
 
@набиячлэвэли "Indianer Jones raiders of the lost Arc<T>"
 
11:32 PM
@LukasKalbertodt Added
 
@набиячлэвэли Oh btw, I'm not the original owner. I read it somewhere on the interwebz
 
good enough v0v
 
11:48 PM
@E_net4 bottom
 

« first day (832 days earlier)      last day (2640 days later) »