« first day (515 days earlier)      last day (4440 days later) » 

7:00 PM
Happy Pi Day :D
 
A girl in my class today asked who speaks in the voices for TomTom devices all day. I guess that TomTom passed the Turing test?
 
lol
 
@Kian Mayne happy pi day.
 
actually, hbar is even better, skips the whole pi/2pi problem altogether.
@DeadMG I suppose there's the implied return statement from before. OK, but what did you gain? It's not a "template", but a what? I fail to understand the underlying difference in usage. Perhaps there's an underlying difference, but I don't see what functionally differentiates (pun intended) your approach from the "classic" template approach, minus all the C++ template cruft.
 
@rubenvb The difference is that I can go from class A(param1, param2) to std::unordered_set<float> A(param1, param2) as a metafunction, if I want to.
whereas you are stuck with only creating types
 
7:04 PM
0
A: What do we have to do as a community to reconnect with our past?

XaadeI think one thing that would serve well would be to merge the results of all the SE communities and develop settings that drive the exposure to content. Then mods can move and reassign questions to their hearts content, and it will be driven by the user what content they have access to. Any time...

@sbi @DeadMG thoughts?
 
so, I can say int factorial(int x) { if (x == 1) return 1; return x * factorial(x - 1); }
and you're stuck with that enum { value == ... bullshittery, because you can't express a non-type-related metafunction
 
huh? How will the compiler deduce compile-time calculability? Isn't that what constexpr "fixed"?
 
uh, no
have you checked out the list of constexpr restrictions?
the idea of fixing the problem that everything is constexpr and there are no restrictions
can you constexpr return complex structures, or throw exceptions, or perform I/O, or any of those things?
it's hardly "all useful metaprogramming"
 
one return statement yeah. You still have a problem of immense increase in compile time for often no good reason. A lot of scientific calculations (where all input values might be set inside the source code) would get run by the compiler?
 
@rubenvb Nah. You can JIT and pre-compile them with relatively little speed problem.
 
7:08 PM
@rubenvb Compile once, run later.
 
@DeadMG everything constexpr sounds silly to me...
 
the advantage of having them as regular functions is that they can be compiled and executed, instead of having to be extremely-slowly-interpreted
@rubenvb Why?
 
@DeadMG Apparently faster run-time == bad.... I can't keep up with this.
There was a time when fast was good. Then Microsoft came along and said, look, we can add more memory.
 
isn't the "everything is a constexpr" thing more of an implementation detail?
 
no
if everything is constexpr, then you can define arbitrarily complex metafunctions which do arbitrarily useful things
if you have C++'s constexpr, you can define ... factorial, or Fibonacci, and that's about it
 
7:11 PM
but a C++ compiler could optimize that anyways too.
 
but you can't even begin to specify a metafunction that isn't factorial
 
@Xaade if I code a weather model predictor, and the entire thing runs during compilation, and the resulting "program" is return "rain 52%", that's bad
 
@MooingDuck Obviously there are limits between "useful metaprogramming" and "excessive metaprogramming"
 
@MooingDuck I never said the compiler optimized the algorithm to a singular result.
 
@DeadMG 1) where do you draw the line? 2) what would your type_traits look like? Simpler, about the same, totally unnecessary?
 
7:13 PM
@rubenvb Unnecessary.
 
@Xaade no, but Ruben did, and you acted like he said something stupid
 
a type is just an object, you can just ask it
 
@DeadMG I think that was Ruben's train of thought
 
@DeadMG specialization/overload for integer types only and different code for floats?
 
std.vector(int).size() == sizeof(), etc
 
7:14 PM
if you can do everything at compile-time then your compile-time just became your run-time
 
@jalf or you have an infinitely flexible run-time, and don't need compile-time at all.
 
@DeadMG that argument is moot: just look at standalone std::begin() and std::end.
 
@jalf Nah, it's like deferred rendering- you can pick and choose when to perform what computations
 
@rubenvb You draw the line where Metaprogramming is used to express an algorithm in it's full, and let the compiler simplify the logic for you.
 
@rubenvb Yeah, cause those can take types.
 
7:15 PM
@DeadMG whut?
 
@rubenvb std::begin(std::tuple<int, char>) doesn't compile on my machine. Obviously it should return int
 
For example, You may want to calculate a Fibonacci for a fixed set of values. If it's a part of the algorithm that can be optimized or precalculated, then it is.
 
@rubenvb What I'm saying is that std::begin and std::end have nothing to do with what I'm talking about.
 
@MooingDuck no shit, it needs an instance. I would guess a decent sizeof function needs an instance as well. Or are we abolishing instances as well?
 
you don't need type traits because you can just implement member functions on type objects which perform the necessary queries, you don't need SFINAE and such rubbish
@rubenvb You can do sizeof(std::vector<int>) just fine.
 
7:18 PM
@rubenvb If metaprogramming can determine that for you, then it should.
 
hmm... still, an integer specialization for a function. How would that work?
 
@rubenvb type X(type T) { if (T == int) { ... } else { ... } }
 
Metaprogramming: Express std::begin(std::tuple<int, char>), return int.
 
@DeadMG so you'd have to special case every integer type?
or every integer type would inherit from int?
 
you can have a T.is_integral() if you want
 
7:19 PM
that puts requirements on an integer type.
 
which, realistically, exist anyway
 
things that are actually integers would have to have that member function, yet you might not be able to change that type?
 
no
 
you're just moving type_traits into the interface of a class?
 
@rubenvb is_integeral would be a member of the int type, not of all int instances
 
7:21 PM
@rubenvb Uh, yeah. Except they're much faster that way.
 
@MooingDuck I understand that.
 
also, you can perform other more advanced things like reflection on types at compile-time, because the class's interface is unbounded
 
@DeadMG computer science mumbo jumbo again (which I don't understand)
 
@rubenvb It means "You can implement whatever the fuck you want"
instead of "You can only implement what you can express via SFINAE"
so you can, for example, iterate through all the public member functions
 
why doesn't your Wide web page have examples of all this stuff?
 
7:23 PM
@DeadMG what, in Wide? or in D? I want to have that
 
because I took a break whilst writing it
@sehe In Wide.
 
@DeadMG brace for the 'vaporware' rejection...
 
@sehe Meh. I can invent my own language at my own pace.
 
@sehe You can have it today in boo!
 
it's common for me to take breaks from intense projects
 
7:24 PM
@DeadMG Also necessary, I'd say.
 
Yet if you'd need a type trait that doesn't exist, you'd be stuck, right? Like selecting something like int32, uint64, uint16 and int8, but not the others.
 
not really
 
a helper metafunction then?
 
you can invent any type trait that can be composed of any combination of the existing ones
although in another sense, in Wide I'm toying with the idea of dropping virtually all fixed-size integral types instead of just fixed-range
but that's another story
 
how about defining some form of "type sets"?
 
7:28 PM
Standard.Containers.HashSet<type>, you mean?
 
so you can say for example: type_set my_type = { type1, type2 } and then using that as an argument type?
 
yep
you got that for free when you added metaprogramming
 
hmm
so no language except Wide has true metaprogramming?
 
I wouldn't say that
ultimately, my experience is only of a few languages
 
@DeadMG "Ah,' said Arthur, "this is obviously some strange usage of the words "for free" that I wasn't previously aware of.'
 
7:31 PM
there are some languages noted for their metaprogramming like Forth and Lisp which I haven't tried
 
@DeadMG how would you use the HashSet<type> as an argument type here? f(mytype i) {blablabla}
 
@rubenvb You mean, like boo?
 
@RMartinhoFernandes Boo is disqualified, it's a CLR language.
 
@rubenvb f(HashSet<type> arg) { ... }?
 
7:33 PM
@RMartinhoFernandes Oh my
> Now I have seen it all. I can die happy now. -- InsertDisk2 1 year ago 48
 
won't that eventually lead to huge ambiguities?
 
@rubenvb How?
 
don't know, seems like some duality between value and type types might pop up somewhere
 
uh
 
@DeadMG You know that whether or not a language compiles to native code, doesn't actually alter whether it has metaprogramming.
 
7:34 PM
they are completely equivalent
 
I will agree that it would be more awesome in a natively compiling language
 
@sehe No, it's disqualified because in CLR languages, there's enforced-GC and "Everything inherits from Object!" bullshittery an other weaknesses
 
ok, sorry. Got to go. Interesting discussion. I will be back.
 
@rubenvb That is, if you do f(type t), there is nothing preventing t from being type, itself
 
7:35 PM
@rubenvb Already does, the author is comtemplating ditching integral types for a reason, I suspect.
 
@sehe Yeah, because they rarely represent the actual useful range we use.
I'm going to replace them with more strict bounded integers with user-specified ranges
(hopefully)
 
@DeadMG Again, whether GC is enforced, there is some kind of (fake!) root Object shittery or other weaknesses, don't really have anything to do with the question of whether a language actually supports metaprogramming
 
@sehe Sure, but before you can support metaprogramming as a language, first, you have to qualify as a useful language
 
Yay. Next stop: enums.
Next stop: flag enums
 
lol
<-- laughter track
 
7:37 PM
@DeadMG False logic. You mean, before it will be acknowledged by yours truly. Big difference.
 
@sehe Well, I appreciate that this wasn't explicitly stated, but both rubenvb and I were looking to create C++-derived languages.
 
Boo is awesome anyway. It has code written by me in it. QED.
 
so other languages which are outside the same language style aren't really competitive, as it were, because they're in a different space
 
@DeadMG Good. I know. Somewhere along the way, though, people (including you and ruben) were making references to (gasp) the real world and (gasp!) other programming languages.
You might be focusing on competition just a tiny little bit too much.
No one said Boo is competition because it might have metaprogramming.
 
@sehe Well, when you're asking for advice designing a C++-derivative, then the scope of the discussion is "C++ derivatives"
 
7:40 PM
@DeadMG Yep, but eye-flaps aren't required unless you are a horse
 
@sehe So what? We already picked a "species", as it were.
 
@DeadMG I've been idly wondering how close Lua is to having metaprogramming. The type system is so loose it seems kinda close. :/
 
Wait, what are you talking about?
 
@RMartinhoFernandes I'm not wholly sure.
@MooingDuck Hahahaha. I wish you luck with that one.
 
@DeadMG Because you are miscommunicating even before you have a language. And you might be missing opportunities to learn. That's all.
 
7:42 PM
@sehe The guy I was communicating with got it just fine, I think.
 
Awesome, my rep is a palindrome... *goes back to studying...
 
oops
 
Xeo
@Mysticial Stop pumping out those 100+ answers, or I'll never catch up.
 
@Mysticial I'm mean.
 
Xeo
(Disregarding the fact that I'm actually longer at SO than you...)
 
7:44 PM
@MooingDuck ... duck typing, reflection, late binding != meta programming in the real sense. It can be used to emulate meta-programming, but so can a code generator.
 
@sehe I'm aware it fails, but it gets surprisingly close.
 
@MooingDuck Lua's got an obscenely bad API anyway
 
no argument there
 
@MooingDuck That's the reason php, lua, javascript, perl, ruby, etc. are popular (to more/lesser extents)
 
I was wondering if there is a common agreement of a "high rep" threshold. I always thought it was around 10k-20k, but then again, when I had a couple 100 rep I thought 2k was a lot.
 
7:46 PM
@sehe They're popular because real programming is hard.
 
@DeadMG ah the real programming fallacy
 
heh
 
@DeadMG No, because we're paid to solve problems, not to wank.
 
@bitmask I know 10k is a big boundry, because then I'll be able to see deleted questions.
 
@DeadMG: for the record, I'm in this room, I'm on the same side of the fence. However, these languages aren't for people who can't program. They're for people who fancy different things.
Also, some of those language have been created by actually brilliant people. For fun.
 
7:48 PM
well, I was mostly kidding
 
@DeadMG ... :) just great. Deconstruct much?
 
but more directly, I'll say that I think that many languages like C++ are hardly optimized for user convenience, for example limited type inference
 
@DeadMG Toooooooo Trueeeeee.
 
and there's nothing wrong with wanting something more usable
 
@DeadMG Oh noes, but that's like dynamic typing!
 
7:49 PM
Real men use void *.
 
@RMartinhoFernandes Heh. That RoR advert was so bad, and yet so funny :P
 
@MooingDuck: You could also say the first two pages of users are high, which would put the threshold at about 100k
 
Xeo
@DeadMG Great thing there are compile time introspection and reflection proposals :)
 
It's just that I read the classification "high rep user" a couple of times and was wondering what it entails.
 
@bitmask usually access to moderator tools AFAIK stackoverflow.com/privileges/moderator-tools
 
7:56 PM
Just read in a method documentation: If you try to change the content of the buffer returned by this method, you will die.
 
lol
 
Xeo
@bitmask Bad API that it even lets you do something like that
 
well, not really, here it what it says afterwards:
 
@Xeo It's mostly luck. For example: This one will probably hit 100 if it doesn't get closed as a dupe.
 
Note that this method is now deprecated and will be removed in the next version of ns-3.
 
Xeo
7:58 PM
@Mysticial Don't remind me of that one, I'm still stumped why the answer even has 50 upvotes.
Not that I'm any less stumped why my compile time 1..100 sum problem got 50+
 
@Xeo just keep making edits every 10 minutes so it stays in teh "active" list for people to vote on?
 
@MooingDuck And then it gets CWed.
 
@RMartinhoFernandes I don't know that acronym
 
Community wiki, i.e. no more reps.
 
Just asked this question. Someone said it's a duplicate of this question. I don't know if aliasing as a general topic and "the strict aliasing rule"-warning are really duplicates . Should I delete my question?
 
8:14 PM
@StackedCrooked It's not a dupe of strict aliasing, although it's related.. and I just posted an answer
 
@ScottW As long as you use a scoped borrower object.
@je4d Thanks
 
@StackedCrooked no probs.. I didn't realised it was you until just after i'd posted :)
 
@StackedCrooked No, not dupes.
 
Ok, I've got three good answers and they are all saying the same thing.
 
8:30 PM
@StackedCrooked Mine was the first to show an example in full source code! :P
 
0
Q: Why are local variable structs not resetting when leaving their scope?

Eric ThomaI am writing a chess engine and to get pseudo-random moves, I pass a move generation function an array to fill. Here is some code: ... else if(pstrcmp(input, (char*)"check", 5)){ int checkIndex = getIndex(input[6], input[7] - 49); printf("checkindex %i\n", checkIndex); ...

found duplicate with Eric's most upvoted answer ever :)
please vote to close
 
@DeadMG If I understand correctly, then the same problem would also occur if I replaced the pointers with references. Only if I pass the arguments by value the optimization is possible.
So it's not really a pointer problem.
 
@StackedCrooked yeah, pointers and references are all the same to the optimizer
 
Are you guys still arguing about pointers??
 
@StackedCrooked The fact that you can't index references means that the problem applies to many more use cases.
pointers can alias whole ranges, whereas references can only alias single values
but yes, they do present effectively the same problem
 
8:34 PM
@DeadMG You can always say 42[&ref].
 
@FredOverflow eww
 
Not everything one is allowed to say is beautiful!
 
And not everything one is disallowed to say is ugly.
 
@FredOverflow Assuming that ref is a reference to an object in an array with >42 elements after it, is that actually valid?
 
@je4d sure, why not?
 
8:36 PM
NOOOOOO.
 
I wish not.
That was a despair-no, not a you're-wrong-no.
 
man
 
It's a big no-no.
 
the people in my new RTD are complaining, just because I started ripping holes in the fabric of the universe and teleporting their heads off their shoulders and stealing their items
 
8:40 PM
@DeadMG IOW, you suck at GMing.
 
@RMartinhoFernandes Hey, I'm a player in this one.
 
hey
they have automatic sniper rifles and BFGs
and various traps and soul-stealing orbs and stuff
it's not one-sided
 
So, they're whiners.
 
oh yeah
 
8:50 PM
I'm on a roll! 4 days in a row with positive rep! (note to self: do not downvote 8 more answers today)
 
now it's my turn to whine
don't you hate it when you get accepted answer, and then the questioner goes back and changes it?
 
@DeadMG never happened to me, but I can see how that would be irritating
 
I posted a perfectly good answer on gamedev to some question explaining why Java is a pile of shit
+14 and answer, and then someone else gets answer :(
 
@DeadMG maybe that someone explained how Java is an even bigger pile of shit?
 
lol
 
8:57 PM
gah, this song has a little sound in the background that sounds exactly like the SO plink. I'm going nuts
 
@MooingDuck I've heard a few like that too
 
or, I guess it's the plink from MS lync. Either way.
gah, why does my software require restarts all the time?
 
9:12 PM
@bitmask I mean the software that my company makes. Requires a reboot to uninstall, and another reboot to install. Can't be the same reboot or everything breaks.
 
If I were your customer, I'd be very unhappy!
well, perhaps not very, but at least quite
 
@bitmask it's server software, it has to restart so that it can start and stop all the background services properly.
 
Hey
 
@MooingDuck: Especially if it's server software, a system reboot should not be necessary.
just my 2c, sorry
 
Just to make sure, is it frowned upon to post the same question twice on Stackoverflow?
 
9:21 PM
yes
 
@hetelek: yes
 
Alright thanks.
Because this guy:
 
@hetelek very much so
 
@bitmask to uninstall and install? I think that's rare enough that people don't care
 
9:21 PM
becuase this guy told me to post another question.
 
@hetelek: drive-by dumps are also frowned upon in the chat!
 
@bitmask He didn't.
 
Yeah I know
I read teh newbie hints
 
@MooingDuck: Although I'm not a professional server admin (just a small private server), I would still be unhappy to restart my server, just for installing software (unless that software is something really essential, like, e.g. an operating system or a bootmanager)
@DeadMG: no?
 
9:24 PM
@bitmask Drive-by linking is linking for the sole purpose of getting attention to the question and not discussion.
it's not generally frowned on to link a question to discuss it.
 
my apologies
apparently I overlooked the discussion ;)
 
@bitmask The software is supposed to be the reason for the server, so in this case, it's fine. It'd be like the apache for a web server, except we do telephones
 
If I have to reboot my server every time I update apache ...
 
Ooops. Last fortress was near a river, so I ended up accidentally flooding it over and over again. This one was near a volcano...
 
my co-admin would kill me, because we a funny hardware problem. due to a weird fan (!) you have to manually push a button on the machine if you reboot :)
 
9:32 PM
I'd assume if we require a restart, it's due to Windows requiring it for services or extending explorer or something.
 
well, I run linux, so I'm not that used to rebooting my server (and nobody cares if the kernel is a tad outdated on that thing)
 
@StackedCrooked T main
 
9:51 PM
@RMartinhoFernandes fun!
 
@bitmask wut. You mean, you don't care. Sysadmins would care. Should care.
Out of interest: this in the mail today: ugcs.net/~keegan/talks/kernel-exploit/talk.pdf [PDF]
 
@sehe Yes, I don't care (that much), on that machine.
 
@sehe But, but, they told me Linux was 100% secure!
 
@RMartinhoFernandes No, a stone is 100% secure because it has no ethernet-port.
 
@bitmask only if it's locked in a 100% secure place with 100% secure policies
 
9:58 PM
@bitmask Are you sure? I'm pretty certain that stones can be cracked.
 
@MooingDuck No! Ensuring that the stone doesn't break would be called safety.
safety != security
 
@RMartinhoFernandes you are not that gullible
 

« first day (515 days earlier)      last day (4440 days later) »