« first day (675 days earlier)      last day (4291 days later) » 

Xeo
10:00 PM
And thunder every other second
Hell yeah
That's what I like
 
hehe :)
 
Xeo
2 messages moved to bin
 
Yes, the Fermi devices as you said (with CUDA 4.0 and sm_20), support indirect jumps (and therefore C++ virtual methods, inheritance etc). — Salad Fruitcake Jul 11 '11 at 15:04
 
Fuck Java type erasure
 
^ reminds me we haven't seen @Cicada in a while.
 
10:03 PM
oh yea
what happened to the Cicada
 
+1 and sorry to destroy your 6666 score :) — hochl 51 secs ago
 
hmmm she was on SO itself 9mins ago
 
Xeo
@TonyTheLion End of summer, died.
 
per her profile
@Xeo har har
 
@Xeo Oddly pertinent
 
10:05 PM
We could downvote him 5 times
 
She'll probably come back in like 13 or 17 years.
 
@sehe didn't nvidia also add virtualization with kepler?
 
@Mysticial When she's in another prime?
 
@sehe Yeah
 
@melak47 Don't ask me :)
 
10:06 PM
@Collin You think type erasure is bad, wait till you find out they're getting rid of primitives lol
 
wut? Java getting rid of primitives???
 
@Mehrdad What do you mean? They can hardly change semantics from Jave 7 to Java 8?
 
It's Java, Everything is possible
well, and PHP
 
@Mehrdad Also, getting rid of primitives is what we do at least once a week in this lounge, I feel
 
@TonyTheLion Yeah they are, and they're introducing real lambdas too. Lemme find a link...
 
10:07 PM
primitives, as in int etc?
or what do you mean by primitives?
 
what else
 
@TonyTheLion yes
 
Dafuq
what the hell do you then store your int in?
 
or PI?
 
10:08 PM
@TonyTheLion Integer
 
I'm more curious what they'd be replacing it with
 
@sehe Just the Object equivalents
 
> turns everything into objects and means no more primitives.
urgh
 
even C# has no such thing
 
Ell
10:09 PM
I don't see the problem with type erasure like that
 
@TonyTheLion Yea, because those guys know what they're doing lol
 
Maybe they want to turn Java into JIT-ted javascript
 
so...are they kicking out math operators as well? :D Integer.Add(oneIntger, Anotherinteger); the future is looking bright
 
@sehe mind blown
@melak47 lol idk
 
meh, another reason to stay far away from java
 
Ell
10:09 PM
I like the "everything is an object" style
all of Ruby's ints are Fixnum or Integer or Bignum instances or whatever
 
@Ell ew
 
@Ell yeah, as long as it means: the paradigm, not the underlying implementation, please
 
Ell
What is up with it? it's consistent
 
@TonyTheLion This comes from Smalltalk.
 
@TonyTheLion Well, value types inherit from Object.
 
10:10 PM
@Ell What @sehe said I guess.
 
@JerryCoffin message passing FTW
 
Ell
@sehe well the only reason you don't want the underlying implementation is because of efficiency isn't it?
 
@Ell Yeah
 
@EtiennedeMartel hmmm
 
@Ell and interoperability
 
10:11 PM
too much OOP wankery I think
 
Ell
@sehe never thought about interoperability. Also i thought it was "interopability" until I just read that word aloud.
 
@TonyTheLion They live on the stack, though, so anytime you upcast a value type, it's automatically boxed by the runtime.
 
@Ell adjust the entry right now
 
Ell
I've been saying it wrong :O
 
10:12 PM
@EtiennedeMartel but aren't just plain primitives simpler and easier?
instead of adding OOP where it's not really needed
 
@sehe Even Smalltalk had (has) a SmallInteger type that looks/acts/works like an object, but really stores the value directly in what would otherwise be the pointer to the object (traditionally, pointers were all even, so SmallIntegers have N-1 bits, with the LSB set to 1 to distinguish from any valid pointer.
 
@JerryCoffin Why not the MSB?
 
@Ell many words are routinely being mispronounced by masses. Dutch people can't seem to say 'identicatie' (identification) or 'bibliotheek' (library) right, e.g.
 
@TonyTheLion Depends. Having everything inherit from the same root probably makes it easier from a language designer's perspective.
 
Ell
well if you have a C++ class like class Integer {int a;} then it's just stored as an int, right?
 
Xeo
10:13 PM
@Mehrdad LSB to 1 means odd number
 
@Ell "implementation defined".
 
Ell
right kk
 
@Mehrdad I think mostly because they were using hardware that required even pointers anyway, so it was easy without losing much. If they used the MSB, they're lose half the address space for pointers.
 
@EtiennedeMartel but I don't see how this change can make things easier, won't it just break a lot of existing code?
and Java runs on a lot devices around the world
 
@JerryCoffin hmmk
 
Xeo
10:14 PM
@EtiennedeMartel Except that root can't really do anything
I dislike Object bases, did I mention that before?
 
@Xeo Except be used for reflection.
 
Ell
@Xeo well you could have id or whatever
 
@TonyTheLion It will make things easier... people will just use C# lol
 
yea fuck Java
 
I mean, the only thing that really belongs on Object is GetType().
 
10:14 PM
@Ell "stored as an" <undefined term> You mean, DWORD, QWORD?
 
@EtiennedeMartel If int doesn't inherit from anything, then it's not going to require reflecting on, since the only way to get one is statically.
 
@EtiennedeMartel ...and force idiotic common characteristics. What do "dogs" and "rainbows" have in common? According to Java, that they both have hashcodes!
 
@JerryCoffin LOL
 
@Mehrdad sooo, nothing changes
 
@sehe lol if you wish
 
10:16 PM
@JerryCoffin and can stringify, in a rather dumb fashion
 
@JerryCoffin Indeed. I recall reading something from Eric Lippert that said that if C# had generics since version 1.0, then they could have gone with a IHashable interface and simply put constraints on that in the classes that require hash codes.
 
@Mehrdad sounds like you're doing java right now?
 
@sehe Me? hell no lol
 
@DeadMG Depends. A single root means that anything can be type erased simply by upcasting. Then, reflection might be useful.
 
@EtiennedeMartel Thanks, but boost::any does that just fine.
 
10:22 PM
@sehe Yeah -- I knew there was something else, but the only one I can usually remember is the hash code. One's (more than) enough though.
 
Ell
so does Object.
 
I blame James Gosling for Java
 
@Ell not really
 
Ell
why not?
 
Dr. James A. Gosling, OC (born May 19, 1955 near Calgary, Alberta, Canada) is a computer scientist, best known as the father of the Java programming language. Education and career In 1977, Gosling received a B.Sc in Computer Science from the University of Calgary. In 1983, he earned a Ph.D in Computer Science from Carnegie Mellon University, and his doctoral thesis was titled "Algebraic Constraints". His thesis advisor was Bob Sproull. While working towards his doctorate, he wrote a version of Emacs (gosmacs), and before joining Sun Microsystems he built a multi-processor version of Unix...
oh, he's Canadian as well
@EtiennedeMartel you can blame a fellow countryman of yours for this thing we call Java :P
 
10:23 PM
because Object requires that every fuckin thing is a reference, for one.
and even C# accepted the need to have value types, even gimped ones.
and two, any doesn't pretend that every fucking thing has, well, anything, in common.
 
Xeo
1
Q: nextafter vs nexttoward functions in C++ 2011?

VincentWhat is the difference between the nextafter and the nexttoward functions of the C++ 2011 standard library ?

Didn't even know about those functions until I read the question
 
@Ell because it doesn't really unify anything. It can only unify things that already is-a an Object anyway - IOW it unifies things that need to be the same first...
 
@sehe To put it slightly differently, when you say that everything is an "object", you're just reducing "object" to meaning nothing.
 
gn all
 
10:28 PM
@LuchianGrigore G'night. Come to think of it, isn't it closer to "good morning" though?
 
Ell
@DeadMG why do we need value types?
 
Xeo
Fuck yeah, thunder's only getting worse :D
 
@Ell Mutable values are much easier to reason about than mutable references. Also, they're vastly faster to use in many essential circumstances.
 
@JerryCoffin it's only 11:33pm here
 
Ell
what makes mutable values easier to reason about?
 
10:34 PM
and 12:33pm in mainland EU then
 
@TonyTheLion But Luchian (at least according to his profile) is is Romania -- something like 3 or 4 more hours east, if I'm not mistaken.
 
@Ell Because if you change a value, only other code that has a direct way to access that value can observe the change.
 
Ell
oh wait I read mutable as ...unmutable? derp derp
 
@Ell unmutable is something else than immutable, I think
@TonyTheLion because they don't want to accidentally trade prisoners...
 
Ell
10:40 PM
immutable, thats the ticket
 
@sehe more history to it then that
 
@TonyTheLion I was slamdunking the obligatory cross connection
 
11:00 PM
@Ell You don't really need them (Smalltalk proved that), but you generally do really want them (Smalltalk proved that too). In Smalltalk when you look carefully you run into all sorts of circularity. For example, every class has a meta-class, ultimately leading back to Metaclass, and from to a circularity: the metaclass of Metaclass is itself an instance of Metaclass.
 
Ell
yeah I think its like that in ruby
Class.class = Class
 
Smalltalk ends up as a system where you need several classes already instantiated and working before you can create any objects and make them work. This leads to a separate bootstrap program to get things up and running, because the system can't bootstrap on its own.
 
Ell
Object.class = Class
hmm
 
is there a strtok alternative for std::string
 
@MohamedAhmedNabil Do you mean "something with global state and a horrendous interface to be avoided far more than the plague", or "something to break it up into tokens"?
 
11:07 PM
@MohamedAhmedNabil in boost
@JerryCoffin lol
 
wow, I'm getting some interesting errors from clang now
what kind of type is int (**)()?
 
@jalf Pointer to pointer to function, I guess.
 
pointer to function pointer?
geez
 
Hmmm...three star functional programming anybody?
 
@JerryCoffin second
 
11:13 PM
@MohamedAhmedNabil See link above.
 
@JerryCoffin but there isnt one already in C++?
@JerryCoffin i think ill just do it by finding the delim and changing to null
 
@MohamedAhmedNabil If your delimiter is simple (e.g., whitespace) you can put the string into an istringstream, then read tokens from there with your_stringstream >> some_string;.
 
Ell
I think c++ strings are very contrived
 
@Ell They're very much the result of design by too large a committee working for too long a time, then being (for lack of a better metaphor) thrown a curve ball and having to try to fit some serious changes in after they thought it was mostly done.
 
also, they were idiots
 
Ell
11:23 PM
what were the serious changes?
 
being an STL-compatible container
 
Ell
oh kk
 
well - that's all fine, but this is mostly about what's not in there
like, tokenizing algos
 
Ell
do you think a 'split' function would be worthy of bei.g I. the stranded?
 
@Ell it would take any predicate of course
 
Ell
11:25 PM
one that takes a lambda or whatwve
yeah, for an iterator pair
 
of course, as a generatlized algorithm; split(b,e,value) and split(b,e,functor) perhaps with the usual split options flags
 
I don't know what a C++03 string was, but a C++11 string is pretty much just a vector<char> with a null at the end.
 
@DeadMG Under the circumstances, I think they did pretty well really. If they'd followed the fashion of the time, we'd probably have ended up with an AbstractString, ConcreteString, AbstractStringFactory, etc. (back then most of the people screwing up Java were doing their worst on C++).
 
c++03 was the same, but it was allowed to be so much else under the covers
 
@R.MartinhoFernandes I think that it wasn't an explicit requirement, but someone important (Herb, I think) said that there was basically no other possible implementation that could meet all the requirements.
 
11:27 PM
@DeadMG see the star board :)
 
@JerryCoffin But Java did do one thing correctly that C++ completely screwed the pooch on, and that's Unicode.
 
Ell
what is the problem of having one implementation?
 
@Ell none, really.
 
is there any way to get the return type of a function pointer without having to list all its parameters? As in, I can do decltype(fp(a, b, c)), but can I do it without having to specify a, b, c?
 
@jalf std::result_of<decltype(fp)> can do that.
 
11:28 PM
last silly contrived question for tonight, I promise
 
assuming that you have a function pointer. If you tried that with an overloaded function, boom headshot.
 
@DeadMG hmm, that's what I thought too. Just spent the last hour trying to get that to compile though, with no success
 
@DeadMG I'm not sure I'd say Java did it truly correctly, but trying to make C++ Unicode specific would have been a bit the same -- it was only really about the time the C++ standard was published (or even a bit later) that it became apparent Unicode was going to go into wide use. Worse, it wasn't an ISO standard, and having an ISO standard endorse a non-ISO one (especially when there's a competing ISO standard) is next to impossible politically.
 
maybe I should just sleep on it :)
@DeadMG nah, no overloads, just a function pointer :)
 
Ell
competing ISO standard?
 
yeah, been looking at that too :)
 
@Ell ISO 10646, in this case. Nowadays, Unicode and ISO 10646 cooperate -- but back then, Unicode was still pushing their own entirely separate character set, not just encodings of ISO 10646.
 
clang chokes on std::result_of<int(*)()>::type though, which should be equivalent to your suggestion
 
try remove_pointer<decltype(fp)>::type
 
@DeadMG then I get no member named 'type' in 'std::__1::result_of<int ()>' instead of implicit instantiation of undefined template 'std::__1::result_of<int (*)()>'
 
11:34 PM
if you're on clang then it's pretty easy to write your own spec for it
 
@jalf result_of takes a function type, not a function pointer.
 
@R.MartinhoFernandes According to the msdn page, it should be able to take a function pointer as well?
@DeadMG assume no variadic templates :)
 
thanks to msvc
 
11:36 PM
result_of<decltype(fp)()>::type is int.
result_of<std::less<int>(int, int)>::type is bool.
It's a hack where you need to "pass" the function type as the return value, and the arguments as arguments.
 
@R.MartinhoFernandes ok, which brings me back to my original question: is it possible to get the return type without having to specify the parameters? :)
and without relying on variadic templates
 
@jalf How would that work for overloads?
 
@R.MartinhoFernandes It wouldn't. It's a function pointer, not a functor or function name.
 
@R.MartinhoFernandes assume I just have a function pointer, like fp in your example. Overloads are a non-issue then
 
The first movie from C++ and beyond seemed to be a stern warning against TMP.
Or at least against overuse.
 
11:39 PM
@StackedCrooked well, overuse is kind of bad by definition, isn't it? Wouldn't be overuse otherwise
 
@jalf Without variadic templates? Lots of specializations...
 
honestly
 
Although, Alexandrescu seemed to differ in opinion :P
 
@R.MartinhoFernandes fun fun...
 
I'm pretty gobsmacked that result_of<decltype(fp)> won't work out the box.
 
11:40 PM
Because it's a hack.
 
I mean, I had a pretty low opinion of the Committee, but this is taking the piss, even for them.
 
It's not "extract the return type from a signature".
 
but why won't result_of<remove_pointer<decltype(fp)>::type>::type work?
 
Because int is not callable.
 
right
well, that's the stupidest type trait I have ever seen.
 
11:41 PM
@DeadMG remember it's basically only there for backwards compatibility
 
It's a hack left from TR1.
With decltype you don't need it.
 
ah hell, sleepytime for me
 
I think boost function traits should work...
Oop, not.
function_traits is intended to introspect only C++ functions of the form R (), R( A1 ), R ( A1, ... etc. ) and not function pointers or class member functions
 
@jalf G'night.
 
Dammit :P
But: To convert a function pointer type to a suitable type use remove_pointer.
 
11:45 PM
remove_pointer would solve that problem handily
 
So, problem solved?
function_traits<F>::result_type
 
@DeadMG you haven't seen many traits
 
wow, that was dumb
never mind all of the above. Turns out there was a much simpler solution :)
 
which was?
 
aaaaand that is probably a pretty strong indicator that I should just go to bed now
 
11:50 PM
Don't leave us in the dark now.
 
@jalf Tell us!
 
eh, it's not a general solution, but it sidesteps the problem in my case :)
I had a list of parameters available already as a macro parameter... So I could just do decltype(fp args)(where args expands to (a, b, c) or whatever the function should eventually be called with)
 
ah. Go sleep :)
 
probably std::function<std::remove_pointer<decltype(fp)>::type>::result_type
 
yes... I will
 
11:52 PM
@jalf G'night.
 

« first day (675 days earlier)      last day (4291 days later) »