« first day (952 days earlier)      last day (4005 days later) » 

3:00 PM
dude
kindly do not post shitty images
 
ok, sorry :(
 
Xeo
[1,2,3] | Scan(0, function(x, y){ return x + y }) == [0,1,3,6] - taking the Haskell definition of scan
That's the range-producing fold I mean
 
@DeadMG That begs the question: why is Map not lazy?
 
3 mins ago, by DeadMG
er, ForEach is eager and Map is lazy.
 
Xeo
Damn
 
3:01 PM
lol
 
Why?
 
well
the long and short is that I wrote ForEach because it was easier than implementing and using while(val := range()) { fun(*val); } every time
 
I don't think it's wrong -- but I think you're putting too much emphasis on a supposed difference between Map and ForEach, where there isn't.
You can provide both lazy and eager maps.
 
@LucDanton I know that there isn't. If Wide correctly supported unit, I would probably not need ForEach.
I could always use Fold or even just an Evaluate() to force eagerness.
 
That does leave the interface quite compact, doesn't it?
 
3:04 PM
what do you mean?
 
So...
 
@DeadMG If you reuse and/or combine existing algos rather than introduce a new one.
 
then yes, it does.
it was always my intention for Wide to have as few SL elements as possible.
frankly, Wide ranges are so easy to write that it's really not that big of a deal.
in fact, I'm probably going to cut Range.Iterator, since it's just return Delimited(begin, end) | Map(function(it) { return *it; });
 
Hmmm. I have the option to buy a 2TB Seagate Barracuda for €75.
 
that's pretty cheap
I think, anyway
 
3:09 PM
Are there any cheap LAN SATA NAS thingies?
 
@LucDanton Also, I did implement Flatten
Standard.Range.Delimited(1, 11)
    | Map(function(val) { return Standard.Range.Delimited(1, val + 1); })
    | Flatten()
    | ForEach(function(val) { std.cout << test.to_string(val); });
 
Ell
Is this actual wide code ?
 
yes.
 
do not like
 
gieb output
 
Ell
3:10 PM
Wow, awesome
Not that I understand the syntax yet
 
Xeo
@DeadMG Delimited(f, l) | Indirected()
 
erm, it's 1121231234123451234512345612345671234567812345678912345678910
 
@Jeffrey he's showing off C++ interop. Although I think it'll bee quite necessary as he's piggy-backing on the C++ stdlib.
 
@rubenvb That specific sample doesn't contain any C++ stdlib stuff (oh, except cout, duh, and I added to_string in C++ myself)
 
@rubenvb I wish C++ had that.
 
3:13 PM
@DeadMG also what's test exactly?
 
@Jeffrey The Wide object that represents the C++ translation unit that I created and gave the Wide name "test".
 
Xeo
@DeadMG And now you can add Bind! Delimited(1, 11) | Bind(function(val){ return Delimited(1, val + 1); })!
 
lol to be honest I only read the last bit :)
 
@Xeo I'm not gonna have Bind(f) { return Map(f) | Flatten(); } - you can add it if you want
erm
also, you can't compose algorithms directly, you can only compose them with ranges.
 
Xeo
Meh
 
3:16 PM
I could actually fix that now if I wanted to... but meh.
@rubenvb Actually, I'm really hoping to avoid core dependencies on the C++ stdlib.
the C++ interop is more for stuff like Boost, and when I come to bootstrap Wide, Clang/LLVM and other C++ libraries
 
@DeadMG oh, so you are going to get a full stdlib implemented?
 
@rubenvb Hopefully.
 
Cool.
 
@Xeo So remind me what ana and cata were in English?
 
Xeo
generate and fold
Like, Delimited is also ana
 
3:19 PM
I also have
    Value(n, val) {
        return function()[curr := 0, n := n, val := std.move(val)] {
            if (curr == n) { ++curr; return Containers.Optional!(decltype(val)->decay)(val); }
            return Containers.None;
        };
    }
you know, I actually have no idea why I have this.
 
Xeo
?
 
@Xeo Remember how std::vector and friends have all those size_t n, const T& overloads?
 
Xeo
mhm?
Ah
replicate
 
yes
I actually have no idea what the use cases of that are.
 
Xeo
@DeadMG Also, shouldn't that be curr != n?
 
3:21 PM
shush, I haven't tested this at all yet :P
 
Xeo
lol
 
it probably won't even compile, I don't recall if I correctly implemented both increments for integers.
oh, I at least gave it a shot it seems.
I had a hilarious bug where for Clang types, I accidentally implemented val++ as ++val.
took me a while to figure THAT one out.
 
Xeo
Smooth
 
@Xeo Heh.
 
Xeo
So, r1 | Concat(r2)?
 
3:22 PM
well, I did something very similar to auto __hidden = val; ++val; return __hidden;
except I accidentally told the code generator to evaluate ++val first.
@Xeo Yeah.. it just glues two ranges together. I could have used something similar in the Wide implementation in a couple places
 
Unreal is one unreal game. I'm gonna have some fun now.
 
of course
 
Xeo
@DeadMG So it's actually r1 | Append(r2)?
 
the most important thing I did today is fix it so that you can code generate Clang templates which are instantiated with more than one type...
@Xeo That is definitely a better name for it.
 
Xeo
@LucDanton xs ++ ys = concat [xs, ys] ?
And concat xss = foldl1 (++) xss, I guess.
I wonder which one should be the primitive.
 
3:28 PM
@Xeo I think so.
 
hmmm
well, so far I have Append, Filter, Flatten, Fold, ForEach, and Map.
 
You guys actually talking about c++?
 
Xeo
Prelude> let xs +++ ys = concat [xs, ys]
Prelude> [1..2] +++ [3..4]
[1,2,3,4]
Prelude> let concat' xss = foldl1 (++) xss
Prelude> concat' [[1,2],[3,4]]
[1,2,3,4]
 
no.
 
Xeo
Seems correct
@DemCodeLines Haskell & Wide
 
3:31 PM
Oh ok. But still, you guys talking about programming?
 
yes
 
Strange
 
why?
 
Xeo
@DeadMG Bind! Or, ConcatMap if you will. No reason to not include it, I think.
 
@Xeo If you're saying that Bind is literally just Map then Flatten, then I have little desire to include it as a primitive.
 
Xeo
3:33 PM
Btw @LucDanton, annex::ana = unfoldr?
 
ConcatMap is cool
What does flatten do?
 
Xeo
concat
 
[[a]] -> [a]
to use Haskell notation
 
Ah
 
Expirable<T> Does this look useful? Or is there a better way?
 
3:34 PM
I say concatmap is good to add
 
@StackedCrooked How would that be substantially different to just using lock() directly? Or, indeed, as a quick helper if you really want to re-use the whole if (!sp) thing.
 
@DeadMG That would allow the user to get a copy of the shared_ptr. Which would make it possible for a session to outlive its owning protocol.
 
Xeo
@DeadMG Also, Take[While], Drop[While]
 
Linq has First/FirstOrDefault, Single/SingleOrDefault and Any/All they are useful ime
 
@Xeo Describe.
 
3:36 PM
takeWhile (<10) [1..]
 
Xeo
Delimited(1,11) | Drop(5) == Delimited(6,11)
 
shitty example :S
 
Is drop the same as skip?
 
Xeo
Delimited(1, 11) | Take(5) == Delimited(1,6)
@JohanLarsson Ya
And the [While] versions just take a predicate
 
dropWhile drops until it meets the predicate
 
Xeo
3:37 PM
@Rapptz Until it doesn't, no?
 
until it does
I think..
 
@StackedCrooked Maybe add a template parameter to take an exception type and default to std::runtime_error.
 
time to load ghci
Prelude Data.List> dropWhile (<3) [1..10]
[3,4,5,6,7,8,9,10]
 
Xeo
See
 
hmm
ideally, I'd just name them both Drop, but right now I don't really possess that much overload resolution magic
 
Xeo
3:40 PM
Take[While]({n, p}) ++ Drop[While]({n, p}) forms the full range again
 
    Drop(count) {
        return function(range)[count := count] {
            return function()[range := std.move(range), begin := 0] {
                while(begin ~= count) {
                    range();
                    ++begin;
                }
                return range();
            };
        }
    }
assuming that you're happy to only go up to 255 to drop, of course :P
 
Xeo
heh
 
so how does TakeWhile differ from Filter?
 
Xeo
Prefix vs overall
takeWhile (<3) [1,2,3,1,2,3] == [1,2]
 
yep
 
3:43 PM
I see
 
Xeo
filter (<3) [1,2,3,1,2,3] == [1,2,1,2]
I showed dropWhile at first :s
Now the examples are correct
 
    DropWhile(pred) {
        return function(range)[pred := std.move(pred)] {
            return function()[range := std.move(range), done := false, pred := std.move(pred)] {
                while(~done) {
                    var := range();
                    if (var) {
                        done = pred(*var);
                        if (done) return var;
                    } else
                        done = true;
                }
                return range();
            };
        }
 
Xeo
Oh yeah: All, Any. If you have And and Or, those are r | Map(pred) | And and r | Map(pred) | Or respectively.
 
@Xeo r | Map(pred) | Fold(function(x, y) { return x | y; })
 
This is leading up to "Add the entire Data.List"
lol
 
Xeo
3:47 PM
@Rapptz :D
 
eh
I'm happy for suggestions
the list can always be pruned later
 
Xeo
@DeadMG Fold isn't short-circuiting.
 
good point.
 
Xeo
@Rapptz Don't tell him that I take the suggestions from there!
:P
 
3:48 PM
All, Any, and Or are really just special boolean folds.
 
eh, some of these I have little interest in I think.
 
but fact n = product [1..n] is cool :(
 
Xeo
Oh yeah, Puppy, Reverse?
 
these ranges are only input
 
Xeo
Hm
Cycle
 
3:53 PM
hmmm
did you look at the DropWhile I posted? not sure if correct.
also brb chucking food for the dog
 
Did you test it with the examples?
 
@DeadMG | acts both as some kind of pipe and as boolean and bitwise or?
 
Xeo
var := range();
while(var && pred(*var)){ var = range(); }
return var;
@DeadMG ^ is how I'd implement DropWhile
 
That blows.
 
Xeo
Although that requires assignability - which isn't a problem if you take ephemeral instead of optional /cc @LucDanton :D
 
3:57 PM
@Rapptz what about it blows?
 
The price.
 
oh ok
 
@Xeo I expect that move constructibility means move assignability.
 
Xeo
@DeadMG Hm
 
also
your implementation of DropWhile is incorrect, since it would drop everything passing the predicate, even after seeing an element which didn't.
 
Xeo
3:58 PM
?
Ah
Derp
 
but I could just use the done variable like before to control that
    DropWhile(pred) {
        return function(range)[pred := std.move(pred)] {
            return function()[range := std.move(range), done := false, pred := std.move(pred)] {
                if(~done) {
                    var := range();
                    while(var && pred(*var)){ var = range(); }
                    return var;
                }
                return range();
            };
        }
    }
 
@Xeo Yes.
 
My Little Lounge >_>
 
I actually don't remember if I implemented and.
I definitely implemented or.
 
Xeo
@DeadMG if(~Exchange(done, true))!
 
4:00 PM
@Xeo wat
 
Xeo
You forgot to assign done
 
oh I forgot to assign to done, whoops.
 
done := false isn't assigning?
 
@Rapptz That creates the done.
 
Xeo
And since it will be true right after the first call, I just used exchange to assign it immediately. Although, I guess it's an unneeded assignment after the first time.
 
4:01 PM
@Xeo Sure, but I only assigned it right before return var, so it won't be assigned more than once.
 
Oh I see what you mean now
 
Xeo
@DeadMG Yeah, that's what I meant with the second sentence.
Not that it matters where inside the if block you assign it
 
indeed it does not
so TakeWhile(pred)- as long as pred(element) is valid.
 
Xeo
if(~done){
  var := range();
  if(!var || !pred(*var)){ done = true; }
  return var;
}
return Container.None;
 
            return function()[range := std.move(range), done := false, pred := std.move(pred)] {
                if(~done) {
                    var := range();
                    if (var) {
                        valid = pred(*var);
                        if (valid) return std.move(var);
                    }
                    valid = false;
                }
                return Containers.None;
            };
 
Xeo
4:04 PM
I guess?
 
you have a talent for being more compact than me, but since you have more experience, that's no surprise there
 
If I don't return a local variable, is it okay if I return an r-value reference? i.e. Stuff&& func(Stuff&&)?
 
Xeo
@Rapptz Yes. Exhibit A: std::forward. Also, std::move
 
@Rapptz It's not wrong per se, but it's not always worth it.
 
@Rapptz It is, but it's very rarely the correct thing to do.
 
4:05 PM
well it takes in Stuff&& t and returns it, should I just return it by value?
 
usually you would prefer to return Stuff by value.
 
Xeo
Fun stuff: T&& foo(T&& v = T()){ return std::move(v); } is also OK
 
@Rapptz Consider auto&& ref = f(Stuff());.
if you return Stuff, that temporary just got it's lifetime extended.
if you return Stuff&& it didn't.
 
Xeo
@DeadMG That's an interesting debate wrt. rvalue stream inserters / extractors, btw.
 
Being a top computer scientist, I also know 20+ ways to evading bans - because as a scientist, you must have an exploring mind, you need to push the boundaries - without which, you are just another ordinary programmer. Many pioneers are burned at stake before me, I understand the path I am taking. But scientist should never fear, it is truth and knowledge they will give their life to! — yiz 2 mins ago
 
Xeo
4:07 PM
See comments here.
 
@Xeo The problem is that the shitty inheritance prevents you from returning T by value.
 
Xeo
@DeadMG Hah, true.
 
else returning T would be the correct choice.
 
yiz
You did not happen to downvote me by any chance, or did you?
 
no
rather keep my little meta rep
 
Xeo
4:09 PM
@DeadMG Oh yeah, why the extra std.move there?
Don't you automatically move local variables on return? :P
 
@Xeo I'm not quite sure this is correct. You have also returned the first element of the range that did not match the predicate, if pred(*var) fails.
@Xeo I think I did implement a basic form of that, but, well, I'd rather not depend on it.
 
@DeadMG maybe Edulinq has something useful.
 
Xeo
@DeadMG Hmm, yeah.
Needs a check for done after the if(!var...)
 
@Xeo I just stuck in an extra = None; in the done = true branch.
 
Xeo
Kinda meh.
@DeadMG Ah, that works too better, yeah
 
4:13 PM
damn, I bet that the iterator version of these algorithms would be so much harder to write.
 
Xeo
Ask the robot :P
 
gonna go watch some SC2
 
Xeo
hf
 
@DeadMG SC2? As in replays?
 
no, WCS EU quater-finals
 
Ell
4:25 PM
Where to watch? o.o
I feel a need for enum inheritence
 
STEPHANO <3<3<3<3
 
user142019
Hi.
 
Hi.
 
Ell
Hi.
 
Stephano's gooood.
 
4:39 PM
user image
2
 
@Xarcell Is posting old pictures everyone has already seen the only thing you do here?
 
pretty much...
I have jokes too though. Want to see some?
 
maybe
 
@Xarcell The best version of this image had Sure, "programmers" description below it.
 
are they good?
 
user142019
4:40 PM
@Mikhail either
 
not really, but every once in a awhile someone will star it.
// somedev1 - 6/7/02 Adding temporary tracking of Login screen
// somedev2 - 5/22/07 Temporary my ass
 
So it really was temporary?
 
Xeo
That's from the "best comment" question
 
look at the dates...
 
user142019
DO NOT POST JOKES
YOU WILL ANNOY THE LOUNGERS
6
 
4:42 PM
yes it is
 
user142019
@Xarcell We have all read every single one of the answers on the comments and jokes questions.
4
 
alright, I'll leave you guys back to talking about porn.
 
@Xarcell Hey, that was few days ago.
 
user142019
Alright.
 
user142019
Time to write the server for my Android app project for school.
 
4:44 PM
Play nice, often you people talk about personal nonsense when all I want to hear is C++ jokes
 
@rightfold i thought you quit school
 
user142019
In Haskell. :>
 
@Mikhail lol
@Mikhail throw std::failed_expectations{};
2
 
This is the most awesome topic ever created
977
Q: Strangest language feature

Andreas BoniniWhat is, in your opinion, the most surprising, weird, strange or really "WTF" language feature you have encountered? Please only one feature per answer.

makes me lmfao
 
Inline asm in C# made me sad
 
Ell
4:50 PM
you can have inline asm in c#!? :O
 
user142019
No.
 
Ell
wtf. GL_STENCIL_COMPONENT. yet other gl constants are defined
stephano is going to win again
 
@BartekBanachewicz Is camera space, eye space and view space all the same thing?
 
Ell
Yarp
 
Ahh
Each tutorial uses a different name
quite confusing
One more thing @Ell, if OpenGL places the camera at (0, 0, 0) in world coordinates doesn't that make view space coords the same as world space ones?
 
Ell
4:59 PM
@Tuntuni No - remember a perspective projection or orthographic projection could be applied (and probably will be)
 
Doesn't that happen after the modelview matrix is applied?
 

« first day (952 days earlier)      last day (4005 days later) »