« first day (762 days earlier)      last day (4180 days later) » 

2:00 PM
Oct 26 at 12:40, by sehe
@R.MartinhoFernandes I once had a simple chess engine where coordinates would be neatly expressed like 042 -> 044 (e2-e4)
 
@kbok Personally, I'd keep the "first" position open as a wild-card. I don't want to have to wall someone urgently but then say, "Oh, actually, there are those people from an internet chat room who I promised first wall four years ago, so you have to wait."
 
Jul 10 at 22:59, by Jim Norton
We should be using biometric locks on our PC's.
 
@KerrekSB bigger wall, obviously
@kbok lol lol lol
 
Dec 11 '11 at 18:44, by Ethan Steinberg
I remember, just the other day

Them: "Hey your autocorrection code also causes the robot to spin in a circle when kicked."

Me: "Don't worry that is a feature."
Aug 8 at 16:48, by sbi
@R.MartinhoFernandes Yeah, you are our last hope in the sense that we will exhaust all other hopes before we'd turn to you.
Nov 22 '11 at 17:35, by IntermediateHacker
Human > robot
^ Four instances of "first against the wall" menaces from the robot
 
I just keep pushing people down the list to make room for new ones.
 
2:03 PM
sbi is already lined up
 
-2
A: PThreads & MultiCore CPU on Linux

Tony The LionThat sounds like an OS scheduler implementation to me. Not per se a problem in your code. The OS decides which thread will run on what core and if the rules of thread/CPU affinity are adhered to, it will stick that thread on the same CPU each time. That is a simple explanation for a fairly com...

how is my answer wrong?
 
So if I'm third, I'm climbing the charts ? neat.
 
Ell
@TonyTheLion doesn't look wrong. Maybe it's just because you missed the other two points?
 
@TonyTheLion It's not wrong but you missed the point so it's not useful either.
 
@TonyTheLion Because there's no way that could possibly, ever, account for such a ridiculously large difference in the running time.
you're right in that the OS scheduler does introduce an element of non-determinism into the system; but wrong in that it certainly could not be the cause of the OP's results.
 
2:08 PM
Who cares about the OP's results? The OP has not been around for more than a year. I say screw the OP's results. Let's make our own results.
 
> asked Feb 21 '11
@TonyTheLion, why are you answering this in the first place ? Oo
 
@kbok answered Feb 21 '11
 
Oh yeah, sry
My results are :
Time Sequential: 120 ms
Time Concurrent: 80 ms
 
@R.MartinhoFernandes is "obrigado" a formal 'thank you'?
 
@thecoshman It's the "thank you". I don't think there's a formal one.
 
2:13 PM
oh ok, obrigado
 
for clarifying
 
Oh. I'm silly.
 
@R.MartinhoFernandes Ok, any particular test you'd like to run?
 
I could understand if I said thanks three days later, but come on now :P
@DeadMG how long it takes to drink a pint with out rushing it
 
2:15 PM
@DeadMG lol, no. I was just spewing nonsense.
 
@thecoshman 0sec, cause you can just chuck it down the drain where it belongs.
 
@DeadMG oh, I forget you are t-total
 
A pint of water belongs down the drain?
 
@R.MartinhoFernandes are you being silly, or are you not aware of the Englishism?
 
2:17 PM
@thecoshman I was drinking Bailey's recently.
 
user1357851
errr, I need to send a video of myself pitching my newest app
 
user1357851
I need to look more presentable .. in 3 mins
 
@DeadMG that barely counts :P
 
I know
 
user1804599
@Telkitty then stop lurking here.
 
user1357851
2:18 PM
why not?
 
user1804599
Because you just said that you need to get something done in three minutes.
 
user1357851
not that I can look more presentable if I am not lurking :'(
 
user1357851
plastic surgery can not be done in 3 mins
 
hmm
didn't the Committee vote in recently wording saying that constexpr temporaries live forever?
 
@DeadMG Yes.
 
user1804599
2:22 PM
I am bored.
 
is that actually implemented in any compiler?
 
Clang, I think.
 
hmm
oh wel
is std::forward constexpr?
or does constexpr not deal with rvalue references and stuff?
 
@DeadMG I don't think so.
It might be in the batch of "stuff that should have been constexpr but they forgot but are going to fix in the next one."
There are lots.
 
lol
 
2:26 PM
Large swaths of <chrono> can be constexpr, for example.
 
so I've got
template<typename T, typename... Args> constexpr T& new_object(T&&... args) {
    return T { forward<Args>(args)... };
}
 
That's not right. The lvalue reference binding to temporary bit.
 
yeah, I figured I wouldn't get it right on the first try
 
What is that for, anyway?
 
want to build a constexpr linked list
 
2:29 PM
Can you guys recommend good book about COM? Looks like i'm going to use this crap -_-
 
And T { blah blah } is too simple for you?
 
@DeadMG Someone asked about this once. But that should be fairly simple with just a hard-coded set of nodes. Even a balanced tree should be easy to do.
 
not the point
 
Do you want an actual algorithm that runs at compile time?
 
more like
I want to show that it's quite possible for a large chunk of the containers and algorithms library to execute at constexpr, with the possible exception of random-access
 
2:31 PM
Erm.
 
Maybe you could make one out of templates: template <typename Node, Node * Next> struct StaticList;...
@DeadMG But what does constexpr mean if you don't have constant expressions anyway because everything is created at runtime?
 
naw, I'm pretty sure those can only point to regular namespace-scope
 
@KerrekSB As things are, pointer non-type arguments really are a super specialized tool.
 
@KerrekSB There have been a few cases where I've wanted constexpr data structures.
 
@LucDanton Right. But a static binary search tree is also a super specialized data structure. Certainly not for common use, but sometimes you do have static data that can benefit from being arranged elegantly.
@DeadMG The thing is, you can of course make the function int(int n) { return 2 * n; } into a constexpr, but what's the point if you're not actually using it to perform static initialization?
Same for the lists. Abstractly each member function may be constexpr, but it can never be used in static initialization.
 
2:35 PM
I really don't know that much about constexpr, so forgive me, but if you had a constexpr std::list, I don't see why you couldn't do vector v(list.begin(), list.end());
 
Haha, puppy doesn't know C++.
 
hey, my compiler doesn't support constexpr
 
@KerrekSB That's no argument.
 
Xeo
@DeadMG And who exactly binds you to only that compiler? :P
 
2:37 PM
Are you (necessarily) going to use a template template parameter for your super specialized data structure as well just because they are specialized?
 
the fact that the other compilers have truly horrendous Windows support
 
@DeadMG It depends first of all on what you mean by "constexpr std::list", and secondly, remember that those containers perform dynamic allocation. So there's a very limited amount of constexprness that you can get out of that.
You really need to start over entirely with a whole family of static containers.
 
@KerrekSB Not since "Everlasting temporaries" was voted in.
 
@DeadMG I missed that!
 
just replace new T(); with T();.
 
2:38 PM
@LucDanton Wouldn't it be fun to have a static container library?
Or "meta library", I guess.
 
@KerrekSB That's fine. You just give iterators and they quack like the other ones ;)
 
more concerned about random-access
 
@KerrekSB What do you want to have that Boost.MPL doesn't already provide?
 
@KerrekSB Boost.MPL?
 
@R.MartinhoFernandes Errr....
 
2:38 PM
except with a real interface
instead of MPL's interface
 
@R.MartinhoFernandes Does that have such a thing? A static tree?
 
Xeo
@DeadMG Don't they only live until the outermost full expression or something?
 
@Xeo Not constexpr temporaries.
 
@DeadMG MPL's interface is for template meta-programming. You cannot use your containers as template arguments.
 
true
 
2:39 PM
To be specific, the hypothetical use case is that I have a given collection of statically known values (like integers). Can I arrange them into a useful static data structure?
 
And you cannot store types in your containers.
 
@KerrekSB A balanced tree, a linked list, sure.
@R.MartinhoFernandes Also true.
 
Xeo
@DeadMG Okay, until when do they live then?
 
Linked lists probably make no sense, because they're no different from an array if the collection is not mutable. You might as well just increment an index.
 
@KerrekSB Compile-time associative containers, certainly. Just to make sure: meta-programming in the type space, which is not what 'static' always mean. (But I'm sure there are ways to easily map to the other meanings.)
 
2:40 PM
@Xeo Forever. That's why they're called "Everlasting Temporaries."
 
> I was going to compare this to Best Of The Best 3 which is among the most offensive movies ever made
lol
 
@KerrekSB intvector<0, 1, 2, 3> comes with batteries included IIRC.
 
a hilariously oxymoronic name, of course.
 
Ell
that's pretty contrived imho
 
2:42 PM
but IMO
 
Something like copy<intvector<0, 1, 2, 3>, inserter<_1, _2, set<>>> will transform it into, well, a set. (Might need some begin/end, I don't recall.)
 
user1804599
template<typename T, typename... Args>
T& everlast(Args&&... args) {
    return *(new T(std::forward<Args>(args)...));
}
 
@Xeo He means temporaries in constant expressions. It's not like they have a lifetime anyway, since they exist before the program starts.
 
Xeo
@R.MartinhoFernandes That's what I was getting at.
 
what it's really about is compile-time reflection
 
2:42 PM
any yanks about?
 
it's only a small step from "Constexpr data structures" to "Something like what I had in mind for Wide"
 
Xeo
The "outermost full expression" would be constexpr auto var = enter_expr_here;
 
@R.MartinhoFernandes serial downvoter
 
I wish we didn't use constexpr to mean 'constant expression' or 'compile-time'. Much like static, constexpr is a keyword with several uses.
 
@DeadMG Anyway, you may want to look at how stuff like Array is implemented in Haskell. I think that has cheap random-access.
 
2:44 PM
@R.MartinhoFernandes It's difficult to conceive of random-access that does not involve arrays.
but I could look at a trie or something?
to mark a type as usable in constexpr, you mark the constructor as constexpr, right?
 
Xeo
@DeadMG Or you don't have one and no member initializers, like std::array.
 
fair nuff
just so I'm not going to go insane, constexpr pointers are OK, right?
 
@LucDanton To be fair, I'd probably use std::array<int, 4> const a = { 0, 1, 2, 3}; as a perfectly functional static array... but yes, that's the basic departure point.
 
Pointer types are literal types.
 
@DeadMG Ah, never mind. GHC seems to implement it with native trickery, and not actually in the language.
 
2:47 PM
@kbok I just asked about this answer, because I got a downvote on it today :(
 
@LucDanton Right. You could start with Node root(10, nullptr); Node N1(20, &root); etc.
All constexpr.
 
@KerrekSB You'll hit the type system pretty quickly this way.
 
@TonyTheLion ah, k
 
@LucDanton yeah
 
Love you guys
 
Xeo
2:48 PM
@LucDanton Still hoping for literal types as non-type template parameters?
 
hi all
 
hi
 
@Xeo What else are they useful for?
 
@Xeo It's not a particular gain in this area (see TMP) though.
 
2:49 PM
I want to know when I declare pointer .
Do I need to initialize to NULL so that
 
argh
 
it does not point to anything
 
Chrome y u no let me enlarge the text box :(
 
@Xeo It says "error".
 
Xeo
2:50 PM
Aw crap, I forgot LWS is down.
 
@MohitSehgal Yes. NULL in C, 0 in C++
 
@MohitSehgal Why do you want it to not point at anything?
 
You need to initialize everything before use. You need to initialize it to whatever you want it to be initialized to.
 
I encourage everyone involved in this discussion to experiment wildly because apparently it's not clear enough that constexpr functions aren't that great for metaprogramming.
 
@kbok Or just NULL everywhere.
 
2:50 PM
@kbok and nullptr in C++11 ?
 
Yest you do. Because if you won't you can accidentaly use it without initialization and you never know its was it.
 
Xeo
@KerrekSB It was basically node arr[] = {{0,&arr[1]}, {1,&arr[2]}, {2,&arr[3]}, ..., {N, 0}}
And then playing around with folding that.
 
@Xeo That is outright horrifying! :-)
 
Also support for constexpr evaluation/substitution is... interesting.
 
Xeo
1 message moved to bin
 
user1804599
2:52 PM
muh
 
But again, a linked list is really not such a useful constant data structure. It's power comes from its cheap mutability.
 
@Aardvark One-boxing animated gifs -> Asking to be binned
 
user1804599
It was not a GIF.
 
user1804599
It was an SVG. :P
 
@Aardvark It was animated.
 
2:52 PM
Statically evaluating the BST order would be more interesting, but personally I'd just pre-compute the whole thing in a separate program.
 
HALP IM GOING TO MURDER MY TEACHERS WAT DO
 
user1804599
@Cicada MURDER THEM
 
YES
 
@KerrekSB So much simpler, ain't it?
 
@Cicada Let the hate flow through you and your transformation to the dark side will be complete.
 
2:53 PM
@Cicada fuck it! give no fucks
 
@thecoshman Why do you feel the need to constantly reminds us of your sex life?
 
@thecoshman I do that but it doesn't seem to work well enough
 
@KerrekSB It's not about that. It's about building more interesting data structures, like hash maps, on top of it.
 
@KerrekSB bleh, NULL in C++ ?
@thecoshman do you fuck it or do you not fuck it ? You've got to decide.
@Cicada Write a pamphlet.
 
@Cicada you're still giving too many fucks
@R.MartinhoFernandes ¬_¬
 
2:56 PM
@thecoshman What would be the correct amount of fucks to give?
 
@thecoshman Are you saying she's a whore?
 
@Cicada zero
 
user1804599
@Cicada Zero.
 
user1804599
Any fuck is a fuck too much.
 
@R.MartinhoFernandes careful there
 
2:56 PM
@R.MartinhoFernandes ... well... she is French...
 
can you use comma in constexpr?
 
user1804599
@Cicada why do you give a fuck about what he said?
 
@DeadMG Yes.
 
user1804599
@DeadMG how would that be useful?
 
goodie
 
2:57 PM
@Aardvark .... well... she is French...
 
TBH I don't know why the Standard restricted so much in constexpr when you can write more obfuscated but completely equivalent things
 
Ell
oh god. not le french AGAIN!
 
1 message moved to bin
 
@LucDanton lol touchy touchy
 
Why ?
 
2:58 PM
1 message moved to bin
 
why?
 
@kbok Because flags suck.
 
SHIT SHIT SHIT SHIT
 
FUCKS FUCKS FUCKS FUCKS
 
use ALL the swear words! FUCKER!
 
user1804599
2:59 PM
FRENCH FRENCH FRENCH FRENCH
 
@Cicada intercourses intercourses intercourses
 
you know
 
You could at least have moved it to the French room
 
user1804599
I know
 
it's the course of the internets
 
2:59 PM
it's actually, amusingly, easier to do when you don't have memory management to worry about
 
intercourses
 
are there constexpr lambdas?
 
@LucDanton Seriously, people flag "merde" ?
 
are there not?
 
user1804599
int constexpr pi = 3;
 
3:00 PM
@DeadMG Not guaranteed to work, but not guaranteed to not work either.
 
@Aardvark int constexpr piSquared = 10
 
well that's remarkably unhelpful of the Standard
I guess I'll have to do it the much-older-fashioned way
 
user1804599
 
@Aardvark Because literal types are new and nobody is sure they will ever amount to anything. Implementations are free to ensure that closure types are literal types when/if it proves useful and easy enough, and then Standardization can happen.
tl;dr standardization is a two-way street
 
tl;dr tl;dr bananas
 
3:07 PM
})?
 
man
are constexpr constructors as constrained as normal constexpr functions?
 
Yes.
 
having fun with commas and "I've got a bunch of member variables to set"
 
And they don't return anything, so you can't put your abuse in the body.
 
    (head = other.head), (tail = other.tail), (other.head = nullptr), (other.tail = nullptr);
should be fine, right?
 
3:14 PM
WTF?
 
@R.MartinhoFernandes It's a constexpr move constructor.
 
Why comma instead of semicolon?
 
what?
 
3:15 PM
@DeadMG constexpr ctors cannot have bodies.
 
now you tell me.
 
2 mins ago, by Luc Danton
And they don't return anything, so you can't put your abuse in the body.
 
you didn't say they couldn't have bodies
only that they didn't return anything
 
And constexpr function bodies must be a return statement.
 
Comma abuse goes return foo(), bar(), baz();.
 
3:16 PM
wait, no constexpr void?
 
You can put e.g. static_assert in a constructor body and be constexpr.
 
@LucDanton whyy
 
@DeadMG What would those do?
 
@R.MartinhoFernandes Modify non-const argument references, for example.
 
With what?
Can you write that as a constant expression?
 
3:18 PM
an expression?
 
constexpr implies const for an object definition. Ergo you can't have a reference to non-const initialized from a constant expression.
 
but I have a type with constexpr constructors and I didn't mark any of the member variables constexpr
and what about the temporaries?
they're not const.
I think?
 
And those do bind to rvalue references.
 
which you can immediately convert into an lvalue reference
and then a pointer and then string together in a linked list since they last forever
so a void function on a constexpr linked list makes as much sense as ... on a normal linked list.
 
Dunno how it goes for constexpr variables (which are a different beast from constexpr functions), but for constexpr functions assignment is useless.
Instead of assigning then reading the assigned place, return a value.
 
3:21 PM
so it would have to be functional only
pop_back(list), push_back(list), etc.
 
Realization dawns.
 
30 mins ago, by Luc Danton
I encourage everyone involved in this discussion to experiment wildly because apparently it's not clear enough that constexpr functions aren't that great for metaprogramming.
 
this sucks tremendously.
 
user1357851
 
I knew you were going to say that.
 
3:22 PM
Not really. There aren't that many problems that need solving in the TMP space that should be solved by constexpr functions.
 
hmm
IYAM, more accurately, it would be a lot easier to simply drop TMP and add a constexpr type API and remove all the constexpr restrictions.
 
Do you mean constexpr functions here?
Because they don't work like metafunctions at all. Not because of the restrictions, but conceptually.
 
restrictions on constexpr functions
 
@LucDanton What's the difference?
 
3:25 PM
template<typename T> struct compute { static_assert( validate<T>::value, "Oh noez! Bad input" ); using type = /* compute result */; };
Doesn't have a real counterpart in the realm of constexpr functions.
 
would do if you had constexpr type API.
constexpr bool validate(type t) { ... } constexpr type compute(type t) { if (!validate(t)) fail(); else return ...; }
 
That would make constexpr functions something else entirely than what they are right now. So you'd be reinventing TMP while simultaneously reintroducing the need to reinvent (current) constexpr function.
Examples of useful constexpr functions: min, max, abs.
 
does anyone know how RAR revovery volumes (.rev) work? I have 6 100 MB parts, and one 100 MB recovery volume, and if I delete any one of the 100 MB parts, it can still reconstruct the whole thing with the .rev
 
I wouldn't really put it that way
the existing constexpr functions would be just fine as they are
and it's true that you'd be significantly altering TMP, but I think the outcome would be vastly superior to existing TMP.
 
user1804599
@TonyTheLion That is fucking beautiful.
 
3:29 PM
for example, you can overload on a constexpr function, but not on a class template.
 
Only on template parameter kind. Since there is no function parameter kind, is the comparison meaningful at all?
E.g. if you restrict yourselves to template type parameters then yes, you may 'overload', i.e. specialize.
 
sure, but that involves a bunch of needless messing around
whereas a constexpr version, you would overload it just like any other function, and it would be quick, easy, and intuitive.
 
That's a syntax i.e. bikeshed issue. (Not to say you're wrong -- I'm just not as enthused by syntax than by power of expression.)
 
not all syntactic issues are bikeshed issues
for example, lambdas
and fundamentally, whilst in theory TMP is Turing-complete, in reality, an unrestricted constexpr would be vastly more powerful and usable.
and performant, too, and much more amenable to modules.
 
@sehe is snowbathing :P
 
user1357851
3:34 PM
nah
 
user1357851
 
guys
 
@DeadMG My compiler regularly dies during function invocation substitution on trivial expressions, while I have seen some pretty impressive metaprograms.
 
enough with the silly animal pictures
 
Can you expand on the meaning 'more powerful'? I don't think you mean power of expression here -- TMP is really powerful in this domain.
 
3:37 PM
@DeadMG wut
 
what I mean is that
 
this is the internet
it's made for silly animal pictures :P
 
on the internet, nobody knows you're a dog
...unless you're DeadMG
 
user1357851
what does MG stand for
 
if you have a cause, like, I dunno, generating a regex object or a parser or what have you at compile-time for maximum run-time performance
 
user1357851
3:40 PM
dead material girl?
 
then with unrestricted constexpr, it's a lot simpler
for example, look at the macro hacks we have to do now to get a string at constexpr, and imagine how hard it's going to be to generate a regex match function at compile-time with TMP.
but in unrestricted constexpr, it doesn't have to be that way because you can implement a (hypothetical) unrestricted constexpr function in any way that you want- imperative, or OO, or functional.
whereas TMP can only ever be the hardest pure functional thing ever
 
That stems from a lack of metaprogramming literals, it is not an inherent problem of TMP. It is a lack of expressive power though.
 
unrestricted constexpr can use the same code, even for data structures, algorithms, etc, as you use at run-time, give or take.
but with TMP you have to re-invent every wheel that comes along
 
The problem I have right now is that the only thing in common with your suggested change and what we have now is the constexpr keyword as applied to functions.
 
nah
what I'm proposing is the same as what we have now, it just supports more stuff.
if you have a pure functional data structure or whatever in the current constexpr, it's not going to be invalid or incorrect or possibly even suboptimal
 
3:45 PM
Right now you can't have a regexp compiler with constexpr functions.
 
right, that's why I said it supports more stuff
but for the places where it has the same domain, there's no reason to replace or change current constexpr functions
 
But that implies it's not "the same as what we have now".
 
user1357851
Is MG the abbreviation of your ex-girlfriend?
 
right, but it's not a re-invention, it's just a generalization
 
Having the return type of a function template be dependent on its (function) parameters is not a generalization, it is an innovation.
 
3:48 PM
A big one.
 
@R.MartinhoFernandes Certainly not claiming to the contrary.
 
Totally unlike what we have right now.
 
hmmm
 
@LucDanton s/parameters/arguments/
 
I kinda disagree, in that a lot of what it would have to offer is fairly similar to TMP but vastly easier to write and use
 
3:49 PM
@R.MartinhoFernandes No!
 
@LucDanton Parse failure. Show example?
 
@LucDanton parameters are at the right level for influence the return type: they are basically a type+name pair. Arguments are the wrong level: they are the actual objects/references passed.
 
@DeadMG The regexp compiler is a good example. As the input regexp can get arbitrarily complicated, presumably so becomes the returned value of the compiler. What type holds such a value?
 
constexpr std::function, obviously :P
 
And what type are you erasing with that?
 
3:53 PM
@R.MartinhoFernandes I was kidding. Pick whichever author switches around the usual definitions of 'formal X means Y as opposed to actual X' for some value of X.
 
does it matter? the internals can create any type they want.
 
That's why it's so fucking different from what we have. That's why it has nothing to do with what we have actually.
 
Well, what about sizeof(compile(/* input regexp */))?
 
@R.MartinhoFernandes Not really. An existing TMP library can also create virtually arbitrary types.
 
Run-time std::function can store whatever doesn't fit thanks to dynamic allocation. Hand-waving a compile-time std::function doesn't seem very fair.
 
3:56 PM
all that it would take is that constexpr objects support (constexpr) virtual functions, and then you could already write it with the current constexpr.
 
I need to double-check reference binding.
 
Yes, "all that it would take". What are you waiting for for writing that proposal?
 
I'm going to assume that storage is not a problem.
 
@R.MartinhoFernandes Well, for all I know, it's already not on the list of things which are banned from literal types.
besides, I've still gotta write more of the Unicode proposal and the I/O proposal :P
 
3:59 PM
@DeadMG But literal types are not enough. You still need the ability to change the return type based on a function argument value.
 

« first day (762 days earlier)      last day (4180 days later) »