« first day  last day (14 days later) » 

12:00 AM
you know...a type id. hence the name.
 
typeinfo can be used to compare types, but RTTI is not just typeinfo.
dynamic_cast is RTTI too.
@cHao I have no idea what you are trying to say.
There is some information about the type at runtime.
 
of course you don't. you are obviously trying to miss the point.
 
Otherwise, things like dynamic_cast would not work.
 
it's not that difficult. *****THE CLASS NO LONGER EXISTS******.
 
@cHao Nope.
You are making empty statements.
You are not able to define any of your statements.
What is the criteria for a language where types exist at runtime?
 
12:03 AM
i've defined it, and you are actively trying to miss that.
 
You have not defined anything.
And you are beginning to be abusive.
Translated at runtime is not the definition of a language.
It is the description of an implementation.
 
if a type "exists", it is retrievable and examinable.
 
C++ is rarely interpreted, but some language can be interpreted or compiled to asm.
@cHao So types exist in C++, with typeid.
 
there's a way to obtain the type and use it for something other than to compare to another.
nope.
a type in c++ is not examinable.
 
I can "examine" a type to know if it is int:
 
12:05 AM
that isn't examining.
that's comparing.
 
typeinfo &x = typeid(X); if (x == typeid(int)) etc.
What is examining exactly?
I should be able to list the members of a struct, etc?
 
if you can "examine" a type, you can see its fields, know their names, offsets, etc.
 
That could be done with tools in C++.
 
no, it can't.
 
There was a project to do just that,
Of course, WITH TOOLS!!!
With tools to do just THAT.
Anyway, that proves that you were making empty statements.
 
12:07 AM
nope. you can't take an arbitrary type in a release build and do that. because all the info that would help you do that has been stripped away.
 
Anything you want to do, you can do with a specific custom tool.
This tool is not the C++ compiler, it is another tool.
Again, you do not understand.
 
yeah. OUTSIDE THE PROGRAM. At runtime, there is no type.
 
By your logic, you are trying to not understand....
At runtime, the compiler does not need a list of class members.
 
I understand. You're just wrong.
and refuse to see that.
 
Except when debug info is output.
The debugger needs such info, so it is emited.
 
12:09 AM
Right. So*they are gone*.
 
Except when debug info is emitted.
 
And debug info is not emitted in release builds.
 
The debug allows you to examine the value of variables.
 
and you don't ship debug builds.
 
Where do you think the info comes from?
So, now you are telling me that :
1) people choose to not distribute the necessary info
2) so that the info is missing...
So, can you admit that with debug info, the information is present at runtime?
(even if it cannot be examined by the running program)
 
12:11 AM
not in any manner that's easily accessible to the program.
and that's what matters.
 
There was a tool developed to do just that for C++.
 
debug info is useless outside of debugging.
 
I do not know how the project went exactly.
What is the use of reflection, except for debugging?
It is clear that Java provides much more reflection capabilities to programs than C++.
 
reflection gives you the ability to create objects, call functions, and grab fields of types you didn't create.
 
Capabilities which allows to break the security model, BTW.
 
12:14 AM
that your code didn't even know existed til you got the type of the object.
 
@cHao What is the point (except to break encapsulation and thus the security model of Java)?
@cHao In C++ I can do that if I want.
 
the point is that you don't have types hard-coded.
no, you can't.
not without prearranging everything.
 
Of course I can.
The functionality just needs to be exposed by the library.
 
no, you can't.
also known as "prearranging everything". And no, you still can't.
 
I can have a factory that creates an object of a type I don't know.
Then I can manipulate the object via a base class interface.
@cHao Of course I can, it is a basic idiom.
I can express any functionality as an abstraction.
 
12:17 AM
no, you can't. and no, it's not.
 
That is called Turing completeness, BTW.
I can ask a factory to create an object, right?
The caller does not know the type of the created object.
 
yes, but not of an arbitrary type.
 
The called may not be able to name the type.
@cHao What is an arbitrary type?
Arbitrary WRT to what?
I can have a factory that creates different types of object depending on some argument.
 
WRT the code that you created. If it doesn't know that type, it can not create it.
 
I can have create("string") that returns a new String where String is derived from some base class I know.
 
12:19 AM
Contrast with Java, where you can create an object of any type you want simply by knowing its name.
 
The caller does not need to know the type String.
 
yes, it does.
 
@cHao When is it useful?
@cHao Non-sense.
You apparently do not know C++ at all.
 
fine. show me an example of c++ with reflection.
 
create("string") would return a pointer of type Base*
@cHao I never said that C++ has reflection like Java!
 
12:21 AM
create("string") would have to know how to create that subtype.
 
@cHao Obviously.
 
there's no way around that.
 
That does not mean that create is like a big switch.
You could have a registry of "types" that can be created with create.
All types like String would have to register themselves in the registry.
Then create simply does a lookup in the registry.
 
And again, you have to prearrange all this type mapping. In every class.
 
It is very simple actually.
You have to define what you want.
 
12:24 AM
no, you don't. except in c++, because there's no type automatically.
 
Please show me how Java unlimited reflection is useful.
Except as a way to break the invariants of classes.
Thus a way to break the security model of Java.
 
the ability to break invariants is a side effect of the rest of the power of reflection. doesn't mean the rest of it isn't useful.
 
With unlimited reflection, you have given up the strength of Java: the security model.
@cHao It does mean that you cannot use reflection whenever the security guaranties of the JVM and of the Java language are needed.
Only trusted code can use unlimited reflection.
 
but it's there.
 
Reflection break class encapsulation, and can be used to break type safety.
@cHao It is not there for untrusted code.
Sandboxed code cannot use these interfaces.
That would be a security vulnerability.
 
12:27 AM
it's not there if you use a security manager that disables it. but by default, it is there.
 
I am not saying that all code needs to be run a sandbox.
And C++ has no sandboxing at all of course.
 
your types don't have to "register" themselves in order for you to use them. if they're anywhere Java looks for classes, they're already there ready to be used.
 
It seemed to me that the number one argument for Java was its security guarantees.
@cHao For the third time, what is the use of unlimited reflection?
Do you really need to be able to create an object of any class type?
I just do not see a need for this.
Anyway, nothing prevents you from implementing reflection in C++.
I told you there was a project to do that.
 
did i say i needed it? i said, for the thousandth time, IT IS THERE. and in c++, it isn't.
 
It is no part of a standard of course, unlike Java.
 
12:30 AM
there's nothing even close to it.
 
@cHao So, you do NOT need this?
@cHao THERE IS A PROJECT TO DO JUST THAT.
 
what does my need have to do with any of this?
 
I forgot the name of the project.
 
@curiousguy link, or it didn't happen.
 
@cHao So, you are saying that Java provides something you do not need that C++ does not provide?
@cHao HUG?
If you want to say: "Java provides advanced reflection capabilities that C++ does not have"
then just say "Java provides advanced reflection capabilities that C++ does not have"
not "in C++, types do not exist at runtime"
 
12:33 AM
@curiousguy no, i am saying that c++ doesn't provide it because it can't. not without prearrangement by every "type" involved.
 
@cHao C++ does not provide that, BECAUSE IT DOES NOT.
It C++ suddenly decided to provide he info, you would have the info.
 
How does this type register itself without you calling MyOhSoSpiffyRegisteredType::register()?
 
(C++ = the committee)
or you could convince a compiler writer to provide that as an extension
 
but it didn't. it doesn't. and it probably never will.
that is what i'm saying.
 
@cHao IF reflection was provided by C++, or some other tool, then the registration would be automatically done by the compiler, or some other tool
 
12:35 AM
that info simply does. not. exist. in. the. program.
 
That is kind of the point with tools
 
how do you not get this?
 
They do things for you, automatically.
@cHao At that point, I think you understand you were wrong.
And are trying to be annoying.
The C++ COMPILER could be MODIFIED to PROVIDE THIS INFORMATION?
DO you UNDERSTAND?
The C++ COMPILER.
 
WHICH ONE?
 
The C++ compiler does not know what a class is?
ANY C++ COMPILER
 
12:36 AM
NO.
 
IT WOULD REQUIRE A CHANGE TO THE COMPILER
 
TO EVERY ONE?
no.
 
EXISTING COMPILERS DO NOT PROVIDE THE INFO
 
and most never will.
 
WITH A CHANGE THEY WOULD
IF the C++ committee required that,
 
12:37 AM
that would effectively require a change to the standard. a change that will more than likely never happen.
 
Unless they would not be "standard C++ compilers"
then compiler would HAVE TO.
 
so as far as standard c++ is concerned, the info. does. not. exist.
 
@cHao Very funny... since you said you do NOT have a need for this...
 
i couldn't give a damn what SchmoeC++ does.
 
@cHao You are annoying, you know;
and very boring.
The info could be provided BY AN EXTERNAL TOOL.
Not the compiler, an external tool.
Developers do not only use compilers.
 
12:39 AM
it doesn't matter whether i have a need for it. what matters is that it doesn't exist. That is the thing i was trying to say all along, and the thing this whole argument started over.
 
Like parser generators.
Like tools to extract strings from the program, so the English to French translator can work on them.
 
parser generators != runtime.
strings != runtime.
 
They use many tools.
Like program checkers.
 
the compiler != runtime.
program checkers != runtime.
 
Yes... so what?
 
12:41 AM
...
THAT WAS YOUR FREAKING ARGUMENT!
 
How is that an issue to have to use many tools?
THAT IS ENOUGH.
I have disproved your point.
 
i didn't say it was an issue.
sorry, no. you haven't.
in fact, you've just validated it.
 
1) In C++, there is no standard reflection feature to do stuff that can be done with reflection in Java.
2) I do not a see a need for this, you don't either, but some people might.
3) If some day you need this, this can be provided by an external tool.
4) So everyone is happy.
 
this must be provided by an external tool.
because it isn't there.
 
(but the external tool mentioned is NOT a standard tool)
It is not standard.
 
12:44 AM
it's not even remotely approaching standard.
 
Anyway, this is not what you said at first.
It is not standard, period.
 
yeah, i did. "types don't even exist at runtime".
 
This is again an empty statement.
 
no, it's not.
 
External tools are not approaching anything.
Which standard is a parser generator approaching?
AN external tool does what it needs to do.
I think flex implements some kind of lex standard.
 
12:46 AM
the fact that "classes don't exist at runtime" is one of the things that distinguishes c++ from java, c#, python, ruby, and even php.
and many others.
 
"classes don't exist at runtime" is not meaningful.
You choose to define it has "does not have Java reflection"
But it does not mean that this is a universal definition.
Can you inspect anything with Java reflection?
 
i choose to define it as "c++ does not have any provisions for retrieving any metadata about a type other than its name".
 
Can you read source code, line by line?
@cHao which is wrong
 
no, it's not.
 
typeinfo provides type name, type equatly and ordering
C++ has dynamic_cast too.
C++ as ``catch` too.
 
12:49 AM
show me anywhere in the standard where a program can know anything about a type_info other than its name and whether it's the same as another type_info.
 
C++ knows more at runtime than type equivalence.
@cHao HUG?????
 
?
 
I never said that a program can know more, given a typeinfo!!!
There is no just typeid
There is dynamic_cast and catch
The C++ runtime knows more at runtime than just type equality.
 
both of which work primarily via the vtable.
 
@cHao Yes, for dynamic types the vtable is used.
Or some datastructure accessed via the vtable.
Now the vtable is forbidden?
 
12:52 AM
but none of which requires anything resembling a "type".
 
Blablabla
I have disproved your assertion.
 
no, you haven.t
 
@cHao Yes i have.
 
in fact, you're still validating everything i have said.
 
Just now;
you choose a definition, I disproved your point
I win.
 
12:53 AM
you just make some insane leap from the evidence that there are no classes at runtime, to the conclusion that there are
 
You loose.
 
that doesn't qualify as disproving anything.
 
End of story.
 
lol...you really don't know how logic works, do you.
 
You have made some vague meaningless assertions.
You have made your own definitions to make those assertions mean something.
I accepted your own definition, and disproved your point.
 
12:55 AM
no, you haven't.
in fact, i can't see where you've done everything except repeat your own meaningless statements over and over.
that doesn't qualify as proof.
 
You may want to change your definition again, but I am soooooo tired of your cheating games.
I WIN
 
oh, wait. and talking about stuff that's explicitly outside the scope of the argument.
sorry, no. you lose.
 
Goodbye.
 
troll.
 
Goodbye, moron.
 
12:57 AM
lol...still trolling, i see.
 

« first day  last day (14 days later) »