« first day (1131 days earlier)      last day (2351 days later) » 

3:17 PM
I am disappoint. Why isn't From<T> implemented for Mutex<T>?
 
@E_net4 Mutex<Mutex<T>>
 
@trentcl So what? More Mutexes, more safety. :D
 
It would conflict with From<T> for T.
 
Still, it does work for other containers.
 
@E_net4 Oh. Hmm. I don't know then.
 
3:31 PM
Yeah, there are no conflicts that I know of.
 
@E_net4 Probably just because no one needed it yet
submit a PR :-)
 
Will look into that.
 
what's the usecase?
you want to pass in a T or a Mutex<T>?
It seems odd to be passing around Mutex
 
I'm not passing around mutexes. I'm passing a T and turning it into a Mutex<T>.
So I'd just have to write v.into() instead of Mutex::new(v).
it's a common API guideline to provide From when there is such a case of new.
 
@E_net4 is that so? Wasn't aware. I haven't been following the API guidelines
 
3:35 PM
Nowait, wrong link.
Well, I might have extrapolated a bit. The real convention is to implement conversion traits where they make sense.
In this case, I'd argue it does. Smart containers such as Box and RefCell already have it.
 
@E_net4 I wonder if the box syntax will be implemented for Mutex
 
Maybe. I haven't stumbled upon a use case where I definitely needed the box syntax.
 
I don't think anyone ever needs it, it's just a performance thing
to avoid one extra copy
 
Yes, I don't usually move around large blocks of data.
 
4:05 PM
@E_net4 It doesn't even have to be "large"
just "frequent" :-)
 
Hmm, I never really used this stability attribute before.
Ok, I'm going to hate this recent question.
 
@E_net4 "It is meant It's meant to "
 
@Shepmaster It's hard to copy-paste things right while the laptop is lagging from the Rust compiler's compliation process. :P
 
@trentcl you bring up a question I had recently — must a DST have exactly two pointers-worth?
@E_net4 yodawg
 
@Shepmaster Compiler-ception
 
4:17 PM
@Shepmaster Depends what you mean by "must" I guess
 
As for the question, it's almost VTC material. :(
Answers are possible, but I can imagine doing comment tennis over this.
 
@trentcl well, all the current rust dsts are 2-pointer, but where is changing that on a scale of "one line" to "rewrite the compiler"
 
If the question is just "how do I make a multi-dimensional array", it's too broad. If it's "where can I get a multi-dimensional array API", it's borderline for a request for off-site resource.
In practice however, it sounds like the OP should (re-)consider using external crates.
 
@Shepmaster as it happens, I have been poking at the code that computes data layouts in rustc, but I don't know the answer off the top of my head
the idea of "obese pointers" has been brought up before for one reason or another
I think it uses an LLVM feature for pairs of values though, so while it might not be on "rewrite the compiler" level, it definitely wouldn't be trivial.
 
4:34 PM
@Shepmaster what server?
I tried irc.mozilla.org but there was nobody in #rustc
oh nevermind I broke my client or something
 
@trentcl yeah i saw you join
> → trentj joined (trentj@moz-cth6rc.fios.verizon.net)
 
@Shepmaster yeah I think I just didn't wait long enough for the user list to populate and it looked empty
thx
 
5:09 PM
@trentcl you gonna make all enums more efficient, eh?
 
@Shepmaster going to try
I wanted to have an enum { Foo(Vec<T>), Bar(u64, i64) } or something like that but then realized it would have an extra byte for the discriminant
now I can't remember why I needed it...
 
@Shepmaster Done and done
 
@trentcl Bar(u64, i64) — doesn't that use all the bits? Where would you stash a discriminant?
@E_net4 (badass)
oh
the Vec is 3
 
@Shepmaster Vec<T> is... yeah
 
what does Vec have to stash in though?
size / cap can be all bits
and it has a raw pointer, yeah?
 
5:18 PM
the pointer is nonzero
when you call Vec::new() it initializes it with the alignment value so it's not null
the alignment of T, that is
 
5:33 PM
@trentcl oh right, ye olde 0x1
 
 
2 hours later…
7:34 PM
@Shepmaster In my CHRISTIAN CHAT?
 
8:12 PM
@ljedrz Your quicksort is missing partition — a.k.a. the thing that makes it sorted :-)
That being said, I don't know that making it right will change your performance
Also check out:
3
Q: How can I benchmark code that mutates the setup data?

ShepmasterThe current implementation of the built-in benchmarking tool appears to run the code inside the iter call multiple times for each time the setup code outside the iter is run. When the code being benchmarked modifies the setup data, subsequent iterations of the benchmarked code are no longer benc...

quicksort is notoriously bad on sorting already-sorted data
 
9:07 PM
@набиячлэвэли I am offensive and I find this Christian. :|
2
What should we do about that multi-dimensional array question?
 
9:32 PM
@Shepmaster yeah I saw that; I'll undelete the question once I fix it :P
 
@Shepmaster Should I learn Lisp?
 
@BernardoMeurer I'm not Shep, but sure, why not.
If you haven't touched a pure FP language before, it will at least be eye-opening. :)
 
@BernardoMeurer Bad idea
 
@Shepmaster heh, I guess heapsort even more so
 
@E_net4 I was complaining to my friend about people not knowing C, and then he said people did the same thing about people not knowing Lisp, so I figured learning Lisp would be interesting
And I'm about to eat lunch so I'll have some P O W E R
 
9:42 PM
in Lounge<C++>, Jun 20 '15 at 13:15, by Borgleader
yesterday, by Borgleader
Jun 13 at 21:18, by sehe
Jul 6 '14 at 18:58, by Borgleader
@AaronKyleKilleen Public service announcement
 
@BernardoMeurer I thought now folks learn Haskell to achieve ENLIGHTENMENT
 
@набиячлэвэли I know about it, I'm just lazy and don't really care unless its an old message
 
@BernardoMeurer Why learn Lisp... when you can MAKE Lisp? peter.michaux.ca/articles/scheme-from-scratch-introduction
 
@ljedrz Yeah, Haskell also seems nice
 
s/nice/garbage/
 
9:44 PM
@BernardoMeurer I enjoyed it, its typeclasses are almost the same thing as in Rust
 
@trentcl I have some hope of still going home for Christmas
I don't want to get stuck in my basement implementing scheme from scratch :P
 
@набиячлэвэли Ok man, you've had your share of Lounge<C++>. ;)
 
@BernardoMeurer hmm, it has taken me several years and I'm still only half done...
although part of that is because I threw away the part that was in C and decided to...
REWRITE IT IN RUST
 
Oh yes
 
Seriously now, if you never tried a pure functional programming language, a Lisp dialect is not a bad thing to try.
 
9:46 PM
@E_net4 xcus me strimmer its actually Lounge<Rightfold's Vagina>
but yes
 
I did that to my baby kernel project, I still haven't managed to implement an allocator :(
But I'm learning :)
 
I actually still have never programmed anything more than a couple lines in any Lisp
 
@набиячлэвэли Lounge<whatev>, I know the drill
 
@E_net4 So I've heard! That's why I wanted to give it a try
I just didn't know:
1. What Lisp to pick
2. Just do Haskell instead?
 
Those are tricky to answer. I've tried Clojure myself.
It's fairly modern and it interops with Java.
 
9:47 PM
@BernardoMeurer depends on your preference - what do you like more? parentheses or tidy whitespaces?
 
Also, talking about weird languages, I'm having to read Julia source and it's weird
 
@BernardoMeurer Matlab's cool cousin.
Still potentially better than Matlab or Python. If only it had more support and more libraries...
 
@E_net4 Well, the joke is that people got really worked up over Lounge<nonexistant entity> on Meta
1. None
2. No.
 
@ljedrz I think I like whitespaces more? But Lisp makes me sound more like a UNIX wizard
@набиячлэвэли Can you please stop trolling? I get it, you don't like any of them, I still want to give it a try
 
@E_net4 Saying that like it's a good thing
 
9:50 PM
@E_net4 Yeah, the syntax is just a bit odd for me, specially since I'm trying to port the algorithm from Julia to Rust and I know neither :P
 
@BernardoMeurer Me? Trolling? Never! Just discouraging a decision you and all around you'll regret
 
@BernardoMeurer Hmm, which one? I ported the micro-benchmark myself.
 
@набиячлэвэли I took my final exams last semester using only my casio watch as a calculator, I thrive on chaos
 
@набиячлэвэли It's not like it's going to be an absolute waste of time. :[
 
9:52 PM
I learned enough Haskell to finally be able to understand how you do useful things in a pure language, and never plan to write it again :P
 
It's for computing factorials
I have a thing for bigints and factorials
 
@E_net4 Well, Haskell is literally useless so yes
 
Hmm, neat stuph.
 
I wanted to port it to Rust using rug
 
@набиячлэвэли I did not recommend Haskell in this chat, tho.
 
9:53 PM
And lisp will make you accustomed with s-exprs which takes 30 seconds on its own
@E_net4 And I'm backing up your disrecommendation
 
I have actually encountered Lisp at work in the guise of SKILL
I actively avoid it though
 
I feel like I've opened pandora's box with my question
 
@набиячлэвэли Little constructive arguments, I see.</yoda>
 
I'm going to give Haskell a try
 
9:55 PM
good luck
 
the main reason I figure I will eventually learn Haskell is because I keep reading all these blog posts and articles on type theory that are completely impenetrable
and maybe 10% of that is because they use haskell syntax
 
the syntax is actually quite nice
the GC isn't
 
Haskell syntax is like W -> T -> F.
7
 
Oh, it's GC'd??
 
yep
 
9:57 PM
I'm laughing too hard at my own joke.
 
I don't like GCs :(
No, no, no
No Haskell
 
@BernardoMeurer Welcome to the club. :>
 
neither do I, so I left it for Rust
 
obviously
it's a garbage language
 
@BernardoMeurer got bad news for you when it comes to Lisp...
 
9:57 PM
Is Scheme GC'd?
 
We came for no GC, stayed for f e a r l e s s c o n c u r r e n c y.
 
You'll never run into GC problems because you literally can't run anything in it so
 
but I do miss the feeling of being better than others
 
@trentcl No
Really?
 
Lisp practically invented GC
 
9:58 PM
Nooooo
I feel betrayed!
 
GCs have been very popular
 
GCs are such bullshit
 
like with OOP - never understood why
 
I am not a child, I COLLECT MY OWN GARBAGE
::picks himself up::
Is there a non-GCd Lisp?
 
@BernardoMeurer :s
 
10:02 PM
There's a scheme compiler called Bones apparently that does it
I'm just going to take the pill
 
@BernardoMeurer oh interesting, region-based
 
@BernardoMeurer godspeed
 
however if you decide to learn a Lisp and then decide to pick the one that's most like Rust... just maybe you've lost the plot
 
I'll see you guys on the other side
 
@BernardoMeurer it's a good book
 
10:08 PM
@trentcl So I've heard. I've been meaning to get it for a while
I'm waiting until Knuth stops writing to get TAOCP
So I can get a nice box set
 

« first day (1131 days earlier)      last day (2351 days later) »