« first day (883 days earlier)      last day (4071 days later) » 

user142019
9:00 PM
In JavaScript, because JavaScript's == is designed by a moron.
 
Wait... does javascript have null? I forget.
 
yes JS has null but it's not == 0
 
Maybe just undefined.
 
user425495
I'm building a project using cmake. It results in an exe and a libSourceFileName.dll.a for each .cpp file that I compile - any idea why this is happening?
 
Ah. One good thing, anyway.
 
user142019
9:00 PM
Use Fay and ==.
 
@ScottW Stop making me want to kill myself. First IE, then this. :P
Hahaha
> SyntaxError: Unexpected token =
which one
 
user142019
Use Python instead of JavaScript.
 
that doesn't even make any sense
Python is not for web stuff
you can't manipulate the DOM with python
or program HTML5 canvas stuff
 
user142019
@Doorknob Oh no?
 
user142019
@Doorknob Use Python instead of JavaScript, or C++.
 
9:03 PM
@Doorknob Yes you can.
 
What was that C++ for statement? It looked sort of like for 1 -> 10 I thought. Something that was totally different than it looked, but worked exactly as intended.
 
hm.
 
meh
burnt jews it will be
 
@Pawnguy7 while (x --> 0)
 
Xeo
@Pawnguy7 x --> 0?
 
9:03 PM
works in Java too
 
Oh. One more dash, yes :D
 
and JS
 
user142019
JavaScript is Turing-complete so you can use any programming language you want in the web browser.
 
Or any language that uses > to mean greater than and x-- as a post-increment.
 
I found that pretty neat. Then again, there is that odd a[10] or 10[a]` thing.
 
9:04 PM
in Javascript: var x = 10; while (x --> 0) {console.log(x);} will 'slide' x to 0
 
user142019
s/s/S/
 
Works in any language that has decrement operator. So doesn't work in Python. Khekhekhe.
 
@Zoid messed up replace regex?
 
user142019
@Doorknob no?
 
How does the compiler parse that? Like... there could be two things there, either -- and >, or - and ->. How does it decide?
 
9:05 PM
what was that supposed to be
 
user142019
It's "JavaScript", not "Javascript" or "java script" or "javascript" or "javaScript" or any other variation.
 
@Pawn I think it just goes left to right
 
Xeo
@Pawnguy7 precedence and validity.
 
Ell
@Zoidberg it doesn't matter
 
@Doorknob I thought so to, but I don't know what the standard says
 
user142019
9:05 PM
Just like it's "Stack Overflow" and not "Stackoverflow" or "StackOverflow".
 
user142019
@Ell it does.
 
Xeo
It can't be parsed as anything other than x-- > 0.
 
Ell
@Zoidberg that doesn't matter either
 
user142019
@Ell tell me why not.
 
Xeo
9:06 PM
Since x - ->0 doesn't make sense. Also, two - signs next to each other are always --.
 
Ell
@Zoidberg Tell me why - everyone already knows what you mean when you say javascripT
 
user142019
> Welcome to Stack Overflow
 
user142019
@Ell everyoneknowswhatImeanwhenIdon'tusespacessonotusingspacesisjustfine.
 
Ell
I got that pretty easily
 
9:07 PM
@Xeo Ah. I thought of precedence, but that was more of an assumption, as I was not sure what rules they would choose and where it is in the standard.
 
notusingspacessavesbandwidth
2
 
Ell
And you know that is a stupid example
 
user142019
@Ell I hope you will make a lot of spelling errors on your CV and you won't ever get a job.
 
Ell
ithinkIWILLgetajobjustfine :3
 
user142019
"Hey, they know what I mean. It won't matter, right?"
 
9:07 PM
with programming it does
 
Ell
My bros have arrived brb :3
what @ScottW said
 
user142019
@ScottW Lounge<C++> is serious business.
 
Hm. I have always said it "Javascript" - most places I have seen it are that way.
 
@Zoid that is the least true thing I have ever read :P
 
user142019
Time to shit. This stupid conversation makes me need to.
 
9:08 PM
Though to be honest, I still think "LiveScript" was a better name.
 
@Pawnguy7 I didn't know you could capitalize spoken words. Usually I would have to write it down to see it.
 
user142019
@Pawnguy7 "ECMAScript" FTW.
 
@Insilico He meant he always typed it that way. As in "saying" in a chatroom
@Zoid I was about to say that :P
 
@Zoidberg That is how it is standardized, yes, but... that is so nondescript. You only know it AFTER - then people learning JavaScript for the first time have no idea what you mean, and wonder when they get to use Java...
 
user142019
9:10 PM
Use Fay. No more problems with naming.
 
I know. But the names don't exactly imply that to new learners.
 
user142019
If you start programming with Java or JavaScript, you're doomed anyway.
 
user142019
So it doesn't really matter.
 
I hate people who think JS and Java are similar :P
 
user142019
The only similarities between JavaScript and Java are the syntax and some of the naming conventions used.
 
9:12 PM
How much marketing hype do you think the name change latched onto,anyway?
 
"JavaScript and Java are not similar"
"But they both have the word "java" in it!"
 
user142019
The object model is completely different.
 
Java : JavaScript :: ham : hamster
 
user142019
The semantics are completely different.
 
user142019
And on a binary scale from terrible to decent, Java is terrible and JavaScript is decent.
 
9:13 PM
"'Penis' and 'Pen' both have the word 'pen' in it. Therefore, they're exactly the same!"
 
hahaha
 
You prefer JavaScript to Java? I admit, Java has issues - but I would sooner keep its strong types, weak types really mess me up.
 
Java has terrible support
I used to like Java
 
user142019
Die.
 
@Pawnguy7 Eh
 
9:14 PM
but... no :P
 
JavaScript is a mix of really good and really bad ideas
 
Well, JavaScript also has the DOM...
 
Java is a mix of really boring ideas with other really boring ideas
 
Java was the first PL I learned (well, succeeded to learn)
 
@Pawnguy7 Does it, now? Please show me where in the JavaScript spec it says anything about the DOM :)
 
9:15 PM
I completely failed at C++
 
user142019
@Pawnguy7 wat.
 
@jalf document, window, document.body, document.getElementById, etc.
 
user142019
DOM and JavaScript are separate.
 
user142019
They are unrelated.
 
you can manipulate the DOM with JavaScript
 
user142019
9:16 PM
The DOM API is exposed using JavaScript.
 
user142019
But Node.js doesn't have it.
 
@Doorknob again, please show me where the Javascript spec says anything about those
 
...therefore they are related?
 
they are not part of JavaScript
 
True, but the DOM is JavaScripts interface from abstract to the browser. It is nothing without that.
 
9:16 PM
(or ECMAScript, if we're being pedantic)
@Pawnguy7 ... and any other language operating within the browser would have to use the DOM too
that's like saying C++ sucks because of the Win32 API
 
user142019
@Doorknob OpenGL can be used from C++, hence C++ and OpenGL are related and OpenGL is defined in the C++ spec.
 
Any other language running on Windows has to deal with the same API
 
user142019
You're basically saying this.
 
Ok, point taken. Anyway, the way the DOM is interfaced in JavaScript code seems ugly to me. I mean, look at why we have Jquery.
 
...okay good point.
 
9:18 PM
On a technicality here - the API to openGL is in C, correct?
 
user142019
Yes.
 
@Pawnguy7 Everything about the DOM is horrific, yes. But that has nothing to do with JS
 
user142019
And the DOM API is not in JavaScript.
 
Think of it this way: if you used Java and the JVM always crashed randomly... well, Java is not the JVM - you could make your own to run it - but, they are related. You wouldn't want to use Java, right?
 
javascript:$('#leave').trigger('click')
 
9:20 PM
Admittedly, that is not the best example because of, for example, Java needs a classloader.
 
user142019
You wouldn't want to use Java anyway.
 
@Pawnguy7 But I can run JS without the DOM!
via node.js, for example
No DOM whatsoever
(and even if I couldn't, the presence of the DOM API wouldn't cost me anything if I didn't use it. Just like the ugliness of the OpenGL or Win32 APIs doesn't affect me if I never call into them, even if they're present)
 
Hm. Ok, arguing with using JavaScript VIA the DOM - the primary majority - then I would take Java over it.
 
@Pawnguy7 That's like saying you'd eat a mouthful of gravel instead of having your leg run over by a tractor
 
user142019
If you take Java over anything else you're an idiot.
 
9:22 PM
Ahem, anyway
 
@jalf I thought that was established when was started this.
 
Can anyone figure out why this fails to compile under MSVC?
Failed to specialize function template
 
@jalf It doesn't seem to compile under gcc-4.7.2 under, if I'm looking at that link correctly.
 
You're definined a function outside of a template? o_O;
 
@Insilico well, under GCC you get a linker error because the foo function is missing its definition
 
9:23 PM
Yeah, that.
 
but MSVC doesn't even get to the linker stage
 
@jalf Probably because MSVC doesn't implement two-phase name lookup for templates? (wild stab in the dark)
 
I just removed the definition to get a minimal example of the problem
@Insilico vectors?
 
No use in a minimal example if it doesnt compile :P
 
But yeah, might be the missing two-phase lookup I guess
 
9:24 PM
@jalf templates, not vectors. -__-
 
@Borgleader It does compile
linker != compiler
The code snippet compiles, but does not link
which is expected
under MSVC, it doesn't compile :)
I guess I should post it on SO, and see if anyone can diagnose it more accurately. And then maybe submit it on Connect and watch them close it
 
I don't know why, but I seem to read templated code really badly.
 
@Pawnguy7 C++ templates are not exactly the easiest things to read in general.
Especially template metaprograms.
Or anything in the Boost headers.
 
True, but it will happen sooner or later. Well, that, and this and/or a combination of a bunch of other pointers.
 
@DeadMG: Life has balls of steel
 
9:31 PM
Why doesn't USB-IF provide their USB verifier tools in a way that does not require I turn off Driver Signature Enforcement on Windows?
 
Question.
Is it possible to make a JIT for C++ ?
 
Yes.
 
Has anyone attempted it?
 
yes
 
9:32 PM
I get pointers by themselves fine, but mix in templates and I get pretty lost.
 
The C++ standard doesn't care about what you run your programs on. All it talks about is an "abstract machine".
 
Who here has played hangman?
 
Oh.
Hm.
Does GCC, VC++, or Clang do any kind of JIT?
... Lol, obviously not, what am I saying. x3
 
user142019
@ThePhD there is cling but I'm not sure if it's a JIT.
 
user142019
No, that was not a typo of clang.
 
9:33 PM
@ThePhD No they don't.
 
I wonder how successful a JIT-C++ could be.
 
@ThePhD LLVM?
 
They all do have something called "profile-guided optimization", which is almost vaguely like JIT.
The idea being is that you run your programs normally with some instrumentation attached
 
Instrumentation?
 
Then using actual program runtime data generated from said instruments you recompile the code with that new information, this time allowing the compiler to make better optimization decisions.
 
9:35 PM
@ThePhD Violins and stuff.
Bells and whistles.
 
Oooh.
Like that CPU Sampling and other stuff.
Well, that makes sense.
Probably how you get better Branch Predictions and stuff.
 
@ThePhD Yes. That's one of the things profile-guided optimization attempts to gather data on.
Of course when you run the program with PGO instruments has to be run in a way that's representative of actual use. Otherwise that profiling data is useless.
 
Hm.
 
@Insilico As always.
 
9:37 PM
So you'd have to figure out a way of having an intermediate data set and a roaming compiler.
Much like the .NET framework's IL.
 
@Pawnguy7 I have.
@ThePhD You don't need a roaming compiler (if I understand you correctly).
You don't have to ship a compiler of any sort to the end-user.
 
But then how would you perform the usual things that JIT is supposed to do?
 
@Insilico I see. Well, my textual hangman is complete, except... how many tries do you get per word? As an auto thing, I did it as length of the word, but this is obviously wrong. I don't know how to derive a formula, or if I should go with a constant, say 6 or 7, and what the amount is.
 
No, PGO'ed programs are delivered exactly the same way to end-users as non-PGO'ed programs.
 
You'd essentially have to re-compile parts of the code or flip switches that say "run this special code path for this arch."
 
9:38 PM
@ThePhD Yes.
3 mins ago, by In silico
Then using actual program runtime data generated from said instruments you recompile the code with that new information, this time allowing the compiler to make better optimization decisions.
The whole PGO process takes place before you ship your program to end-users.
 
Oh.
The JIT I was referring to for the last few things I said were about when it gets to the End-User.
E.g., JIT-ing the program for their computer.
 
Yes. Which is why I said "almost vaguely like JIT".
5 mins ago, by In silico
They all do have something called "profile-guided optimization", which is almost vaguely like JIT.
 
Yeah, I get PGO. I'm talking about actually doing that for the end-user, which is why I said you'd need to ship that intermediate data set with the application and then have a runtime capable of JIT-ing it.
Hencewhy I referenced .NET's IL and stuff.
 
@ThePhD Oh, I see. PGO is really geared towards developers though, so I'm not sure how you can repackage that for end-users.
 
Albeit, I don't know if any C++ Runtime has amanged to do that.
... Is there even a C++ runtime? o.0
... Oh wait, yeah. Cling.
They've got one... but I don't think anyone else has one.
 
9:42 PM
But it's not a "runtime" in the sense of "JVM" or ".NET runtime".
 
Ah, yeah.
 
Is the VS November CTP worth getting?
 
It's more like "A collection of functions virtually all C++ programs need".
 
That's moreso just "A crapload of libraries."
 
Does it break anything?
 
9:43 PM
@Borgleader Other than my back, nope.
Don't get it if you're expecting anything like GCC or Clang.
It'll feel horribly disappointing to you.
 
user142019
@ThePhD you need runtime support for exceptions and RTTI.
 
user142019
That's a few functions and that's basically it.
 
I think new and delete embed information before their memory segments about size and such.
 
user142019
new and delete in libc++ are implemented like this:
 
Ell
what does "runtime support" mean?
 
9:46 PM
Which is why a lot of compilers work with void* pointers anyhow.
 
user142019
if (n == 0) n = 1;
auto* ptr = malloc(n);
if (!ptr) throw std::bad_alloc{};
return ptr;
 
user142019
And delete is just free(p);.
 
2
Q: Why does MSVC fail to compile this template function?

jalfI ran into a problem porting some code to MSVC, which puzzles me. As far as I know, the code should be legal, and Clang compiles it just fine. I've narrowed it down to the following: enum E { x }; template <typename T> struct traits { static const E val = x; }; template <E e&...

free rep if you can answer it, go go go!
 
Awww
But my compiler's still all bent out of shaape.
 
user142019
> Because MSVC has a bug in this respect.
 
user142019
9:49 PM
I think that's about the only reasonable answer.
 
user142019
(Given that the code is correct.)
 
user142019
There isn't much of a "why" to add to it.
 
@Zoidberg well, that's what I want to find out ;)
or perhaps just, a bug in the implementation of which language feature?
 
@jalf So, it's like any other question then right?
 
@LucDanton yes
I never claimed it was more free rep than any other question ;)
 
9:54 PM
Thank you for the free time if you had it to answer me.
 
@jalf The problem is traits<T>::val.
Using a regular value, it works fine.
So, maybe it's that <> nesting ?
It's most likely a compiler bug.
 
@Borgleader Crushing MC.
 
Yep
that was one sided
 
@ThePhD yeah, but that's not very specific, is it? ;)
 
working on it
 
9:58 PM
@jalf This manages to compile, so I'm pretty sure the problem is in using traits<T>::val inside the template instantiation of S<>
enum E {
	x
};

template <typename T>
struct traits {
	static const E val = x;
};

template <E e>
struct S {
	S(){};
};

template <E e, typename T>
S< e > foo(T t) {
	return S< e > ();
};

int main() {
	char c = 0;
	foo<traits<char>::val>(c);
}
How do we solve it? Fuck if I know, looks like an MSVC compiler bug to me.
 
I've already worked around it in my own code. But this puzzled me, so I figured I'd post it here as well, and see if anyone had any insights
 
It's most likely a compiler bug.
 

« first day (883 days earlier)      last day (4071 days later) »