« first day (323 days earlier)      last day (4608 days later) » 

8:01 PM
on the coast pretty much in the middle of wales
 
I see
 
aka the middle of the edge of nowhere
 
=)
aka harmony perhaps?
 
it's a nice place. I get to pretend I'm working on yachts from time to time
 
8:19 PM
ok, I'm a genius - again
 
Has anyone of you ever coded in Ada?
 
apparently it's similar conceptually to C++, but that's the limit of my knowledge
 
It is way stricter than C++.
 
@ManofOneWay no, but i wanted to for a long time. i liked the "rendezvous" task synchronization. pretty difficult to express cleanly in C++ i think.
 
@DeadMG Sorry, I interrupted you. You were saying you are a genius again? How come?
 
8:28 PM
namespaces = types
I solved one fundamental problem of "DeadMG++" with something so simple and excellent
 
@DeadMG bertrand meyer did that b4
 
@AlfPSteinbach I'm having an assignment in Ada in my real time systems course
 
@AlfPSteinbach Shush you, I just had that idea on my own
 
And I'm trying to code a watchdog
 
@ManofOneWay remember Ariane
 
8:32 PM
man, it's been so long since I wrote any "DeadMG++" code, my mind is having trouble bending back into shape
 
@AlfPSteinbach I've heard about it before. Never knew it was written in Ada though.
 
@ManofOneWay with less safe language they would perhaps not even have noticed. :-)
 
Btw, are you guys using C++ as your main language at work?
The only course I've actually used C++ in is Computer graphics. Otherwise it's mainly C. High performance courses, real time systems, operating systems, all C courses.
 
I use C++ for almost everything I do at work
 
hai all
 
8:40 PM
Nice. In which areas are you working?
 
vision graphics and visualisation
@Tony - they let you in here then?
 
@ManofOneWay C++ is higher performance than C.
 
@awoodland let me back in after 30mins
I'm sure if I got banned from this place, some of the regulars here would protest, at least I hope :P
 
@DeadMG In what way? You can write larger code faster sure. But performance wise?
 
inlining
compare the performanc of qsort vs std::sort
because std::sort takes a C++ template parameter instead of a function pointer, the code can be inlined
 
8:42 PM
inlining is possible in C ?
 
whereas the C qsort must call through a function pointer every time
technically, I guess, but it's a lot more work for the C compiler and impossible if the CRT was dynamically linked
C++ allows a lot more work to be done at compile-time, compared to C
 
meh can we talk about something fun?
 
I'm sexy
 
oh, damn, I didn't really need to know that
 
also, I'm naked
 
8:48 PM
Man, that's nasty
 
we don't need to know Mr. Puppy.
 
lol
but you have no idea what I look like, maybe you'd like to know
 
Regarding C++ vs C performance, I find it hard to believe that it would be any real performance difference at all.
 
euh, perhaps not, esp after that episode
 
lol
@ManofOneWay I did a timing where std::sort was twice as fast as qsort on the same input data.
 
8:50 PM
Puppy is the expert :P
 
not to mention many necessary costs of C having inferior type genericity in containers- what are you gonna do, malloc a separate region of memory for every value? C++ you can allocate them in-place because the type is known at compile-time
 
measuring perf on languages is really rather pointless
I thought we'd had this conversation before
 
mm
I think that individual languages can significantly impact performance
like the pointer-orgasm of Java code will slow things down compared to C++'s more compact value semantics
 
with compilers today, I don't think at the end of the day, it's gonna make that much difference
 
So you're saying that the things you do are impossible to do in C?
 
8:51 PM
well, Java is a separate case
 
Don't mention Java in this conversation =)
 
lol
 
@ManofOneWay he's not saying that, he's saying that in C++ they'd be faster
 
it's exactly the same principle
 
This Windows code:
wcout << std::error_code( ERROR_NOT_ENOUGH_MEMORY, std::system_category() ).message().c_str() << endl;
 
8:52 PM
fundamentally, the language semantics of C dictate that in some situations, it simply must be slower than C++
 
C is too primitive.
 
"Exec format error"
 
Why c_str?
 
it seems that std::error_code thinks argument must errno code or something like that, in spite of std::system_category()?
@CatPlusPlus because wcout doesn't support std::string. it was faster to add c_str() call than to remove the w.
 
8:56 PM
@AlfPSteinbach I think std::errc is the type for the first argument corresponding to this error category.
 
uhuh?
N3290 says arg type int
 
It doesn't support std::string, but supports const char*? Weird.
 
error_code(int val, const error_category& cat) noexcept;
 
@AlfPSteinbach errc is an (unscoped) enum so will convert.
It's int so that other enumerations types be compatible when extending error codes and categories.
 
@CatPlusPlus no it's not weird it follows from char* support in basic_blahblah
@CatPlusPlus The design is weird though. I can't fathom the reason for having cout.
so, is there any way to get that message() to call Windows' FormatMessage?
 
9:00 PM
0
Q: Windows GNU compiler suite without external dependencies

Unsigned Code LabsAre there any GCC-compatible suites for Windows that generate standalone executables without external dependencies? Here are a few that do not fit the bill, ordered by undesirability, least to most: MinGW (MSVCRT.DLL) Cygwin (Cygwin runtime DLLs) DJGPP (NTVDM.EXE; not present on x64 platforms)...

Lol this guy. "I want to use CRT but don't want CRT to be a dependency, derp."
 
@CatPlusPlus msvcrt.dll is bundled with every modern Widnows version, AFAIK
 
yeah, but not usually the more modern versions
 
no, but MinGW g++ uses the old one, the one whose name is literally "msvcrt.dll". IIRC.
 
I can't link statically and I can't link dynamically, how can I link!!!11
Redistributables are there for a reason. Namely, to redistribute them.
I fail to see the problem.
 
@DeadMG Depends... if you share immutable objects, the Java approach can actually be faster. For example, string assignment is only a couple of machine instruction in the JVM, because all you do is assign a reference.
 
9:06 PM
the number of JVM instructions is quite irrelevant
I could design a VM where the whole program is 1 instruction
what matters is the real time it takes
and if you wanted to do it that way in C++, you could
 
He said machine instructions.
 
maybe I misread
but the point is still the same- you can make immutable objects in C++ as well if you want
 
nice thing with immutable strings is that substring op is constant time
 
@DeadMG But then you have the overhead of reference counting. In practice, nobody uses immutable strings in C++, right?
 
however, at least some years ago it was a well known fact that Java did not optimize += on strings
so the poor suckers got O(n^2) performance for appending to a string
he he
 
9:09 PM
How would you optimize +=? I don't think it's possible.
 
@FredOverflow Java still has to manage their memory. Just because you don't pay immediately doesn't mean you don't pay.
 
the first one creates a buffer with just 1 reference
this can then be reallocated as necessary with usual doubling strategy
e.g. CPython does that optimization
it yields O(n) for the whole thing where n is length of final string
as opposed to silly Java O(n^2) :-)
 
@DeadMG I strongly believe that good garbage collection is faster than reference counting, but of course it's less predictable, and in most areas where C++ is dominant, predictability is very important.
 
@AlfPSteinbach Well, good news is they didn't manage to break strings while trying to optimise them.
 
@FredOverflow It's not just about that. Fundamentally, collection is a different algorithm.
 
9:11 PM
Like loops.
 
garbage collection is O(n) in the pointers in the area you're collecting
 
@AlfPSteinbach java.lang.String does not have a mutable buffer, such an optimization is not possible in Java.
 
reference counting is O(n) in pointer mutations
 
@FredOverflow wrong
 
the generational GC is a good optimization, but it's not the same as C++'s zero-maintenance for objects that you know don't yet need collecting
besides, I firmly believe that a good language would offer it's users the choice
 
9:13 PM
I like incremental GCs.
 
@AlfPSteinbach Could you elaborate? All fields of java.lang.Strings are final, so how would this work?
 
By cheating on the implementation level.
 
@FredOverflow uh, i have already elaborated? we're talking internals here. if user could do it then it would not be a problem with Java.
 
If user could do what?
 
If the user could check reference counts and if user could reallocate the buffer then it would not be problem. But then other things would be problematic. You don't want user code to have that kind of access, lest you get into C++-like problems.
 
9:16 PM
Are you sure you're talking about += and not about repeated applications of +? Because a + b + c + d + e does use a mutable StringBuilder underneath.
 
in DeadMG++, I made expression templates part of the language
 
I'm talking +=. In Java, at least some years ago, it created temporary and assigned. Yielding quadratic complexity for repeated applications.
Pretty silly.
 
@DeadMG Implement it first. :P
 
@CatPlusPlus quiet you, I iz like, well working on it bruv
 
@AlfPSteinbach In Java, a += b is just syntactic sugar for a = a + b, so there is no opportunity to optimize.
 
9:18 PM
@FredOverflow right, that's what i remember. utterly silly. a trap for novices (and with Java there are a lot of effectively novices using the language). it's not that there is no opportunity. it's that it's not USED.
 
Hello everyone
 
Yes, Strings are a minefield for beginners. How often have I seen programmers compare strings via a == b... sometimes it works, sometimes it doesn't. Usually it works during testing and fails in the field :)
 
any one from HR position?
 
@AlfPSteinbach Well, you could only do it through "magic", and I don't think that would be a good idea.
 
any HR's are here?
 
9:20 PM
@FredOverflow No, no magic. What's so hard to understand about this? Lemme give code
 
Because if a = b does something other than simply assign a reference, you must be able to overload operator=, and it wouldn't be Java anymore.
 
if( refCount(buffer) == 1 ) { modify(); } else { replace(); }
 
When will that code be executed?
 
everyone is developer here?
 
@MrAnubis - I doubt anyone from HR is in this channel
 
9:23 PM
@FredOverflow as part of operator += invocation.
 
But the reference count would also have to be modified during assignment. And that's simply not possible in Java.
 
@awoodland can i ask you question?
 
@AlfPSteinbach determining refCount would require a full GC cycle every time it's called, or reference counting
 
@FredOverflow yes it is modified. the first append brings it down to 1.
@DeadMG no, there is existing practice to look, like i mentioned CPython. get a grip folks. you
 
@MrAnubis Stop hassling people personally and just ask away. Just don't expect answers.
 
9:24 PM
@MrAnubis - sure
 
re arguing impossibility of reality. that's stupid.
 
@AlfPSteinbach Python is reference counted. Java is mark&sweep based
 
@AlfPSteinbach Okay great, but what happens if I say a = b? How do you increment the refcount?
 
@Luc you're so rude some times
 
@FredOverflow usually with an assignment refcount is incremented by 1
 
9:26 PM
@DeadMG Is the reference count accessible in Python?
 
I don't know
all I know for sure is that Python's GC is reference-counted, with some special logic for reference cycles
 
@FredOverflow depends on the Python implementation.
 
whereas Java's GC is fundamentally based on mark&sweep
 
@AlfPSteinbach What do you mean "usually"? Where would you write that code? As DeadMG points out, there is no "native" reference counting in Java.
 
@MrAnubis - "can I ask a question?" is somewhat circular and nobody does it here or on IRC
 
9:26 PM
that means that they don't have a ref-count available
 
@FredOverflow reference counting is an internal implementation detail. AFAIK it's not specified by the Java language specification.
 
got it, thanks
 
an implementation detail Java doesn't have
 
anyway fire away
 
It's not specified by Python either.
 
9:27 PM
@DeadMG AFAIK the language specification does not specify the implementation.
 
@AlfPSteinbach Okay, but you can't seriously complain about the lack of an optimization that would require reference counting when in practice no JVM does reference counting.
 
anyways one question is what to say to HR in interview if you got little bit low percentiles in graduation?
 
Anyone checks that?
 
@MrAnubis tell them the truth
but honestly, no one has ever asked me about my grades
 
@AlfPSteinbach Technically. However, pretty much all JVMs use a generational mark and sweep.
 
9:29 PM
Also, your optimization would require at least some fields in the String class to be non-final, and that would break the thread-safety of String.
 
so I doubt they would
 
@FredOverflow Why can't I complain about it? It's utterly silly. It forces O(n^2) performance for a common task. And I'm not buying the assertion that "no JVM does reference counting".
 
but they will ask why did you get low low percentages
 
I wouldn't go out of your way to tell them, but if they ask I would definitely not lie and wouldn't hide it or avoid it
 
@MrAnubis you don't know that, and if they do, tell them the reason
 
9:30 PM
in which case the honest answer should hopefully be something about experience since
 
Meh, caring about grades.
 
@AlfPSteinbach No, it does not if you know what you're doing. If you want to build up a string in a loop, use a StringBuilder, not a String. Every effective Java programmer knows that.
 
I stopped doing that sometime in primary school.
 
and why you struggled with grades, but are worth more to them than just a pile of numbers
 
9:30 PM
i was busy learning 3dsmax and maya and never paid too much attention to theory thats why
 
@CatPlusPlus lol you're so funny
@MrAnubis yea well, so what, pay attention to what you want to do in your job
 
@TonyTheTiger Really. School grades are basically worthless, sans what you need to get to the next one. :P
 
Thanks Tony and awoodland , honesty is best policy in interview i got today
 
9:32 PM
@FredOverflow I fail to see to how the possibility of using an alternative excuses the blatant inefficiency of the natural way?
 
I could also complain that strings in C++ suck because strlen is O(n). But I would look very silly, because every effective C++ programmer knows that std::string has a length method that is O(1), and you generally shouldn't use char pointers in C++.
@AlfPSteinbach In Java, using StringBuilder is the natural way of building strings. It may not seem natural to you, but it is.
 
Even in .NET you have stringbuilder to build strings
so it's not that unnatural as you might think
 
@FredOverflow well, that fact is, Java sucks at += compared to Python (whose strings are also immutable).
 
> well, that fact is, Java sucks
 
+= on strings is hardly Java's biggest fault. :P
 
9:35 PM
so I think we've come to the conclusion that Java sucks
have we not?
 
We usually do.
 
I think it's too early to say that for certain.
 
considering the massive list of grievances I have against Java, inefficiency on += is hardly topping the list.
now please gief stars
 
Well done, lads.
 
I've never even coded one line of Java, I've only ever heard that its horrid
so maybe I will live that much better of a life cause I've never coded Java :)
 
9:36 PM
Most C++ programmers will tell you Java sucks, and most Java programmers will tell you C++ sucks. I would say they're both right, in their own way.
 
Nobody coded one line in Java, because you need a hundred for the hello world.
4
 
lol
 
can't ever say anything without someone cracking a joke around here
well perhaps only the flagger guy would take it serious and flag it
lol
 
9:37 PM
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("hello world");
    }
}
@CatPlusPlus hardly 100 lines
 
Even in C you can get less then that
int main () { printf("Hello World"); return 0; }
 
Jokes are not required to be based on facts, dammit!
 
@TonyTheTiger That's four lines in real world, maintainable code.
 
@FredOverflow there's hardly a need to put that on four lines, any old fool can read that :P
 
Real world C code is not maintainable.
 
9:39 PM
and you missed the #include
which is necessary in modern C, I believe
 
@DeadMG I don't remember what printf lives in, been to long since I last used it
 
stdio.h.
 
@DeadMG No, functions are still implicitly declared on first use in C99 I believe.
But of course nobody in their right mind would write it without the include :)
 
@FredOverflow whoever said I was in my right mind when I wrote that :P
 
@FredOverflow Yeah but for a variadic function like printf, it's a landmine, isn't it?
 
9:41 PM
@LucDanton it's a good function for testing all sorts of nasty exploits with
 
It's a landmine anyway. You're just substituting anti-vehicle one for an anti-personnel one.
 
@LucDanton Aren't functions implicitly declared to be variadic? A little rusty on my C here.
 
@FredOverflow no, you need to use the ... in the args, and it has to be the last arg in the list afaik
 
@FredOverflow Maybe I'm mistaking that for something else. My memories of C seem to be fading.
 
They are. Also declared as ().
 
9:42 PM
and then use the VA_ARGS thingy
 
... is only required when you already got args in the declaration.
 
It seems I was wrong: warning: incompatible implicit declaration of built-in function printf
 
that's what I was talking about
 
int foo() is variadic, int foo(void) is not, int foo(int a, ...) is, int foo(int a) is not.
 
#define MOAR ...
int printf(const char* format, MOAR );
 
9:43 PM
lulz
what the hell can you do with a foo() that makes it variadic?
 
There should be a word for delegating one's memory to the Internet. Crowd-remembering?
 
But in GCC printf declaration is augmented with attributes for compile-time format string checking, so including is always a good idea.
 
@LucDanton Delegating?
it's proven to be changing the memory structure of all populations with reliable Internet access, by the way
they tend to remember less information and focus more on where to find it
 
@DeadMG For the stuff that I don't remember per se, but that I remember how to find.
On the same line I see.
 
Sounds about right.
 
9:46 PM
Anyway, what to call it?
 
these days one doesn't need to remember much anymore, just Google it
lol
 
I'm basically dead when offline.
 
lulz :P
@CatPlusPlus I guess you're not ever offline much then?
 
No.
Only when forced to.
 
when I'm sleeping
 
9:47 PM
@TonyTheTiger Google can be wrong.
 
that's pretty much it
 
ghosh, don't you have some sort of live outside this?
@FredOverflow yea sure, but then you come here
 
Outside what?
 
or IRC
@CatPlusPlus the interwebs?
 
oh cock, I just confused myself in a really big way
 
9:48 PM
I guess I'm a weirdo that memorizes a ton of stuff, even if I could just recall it with a simple query on the Internet.
 
Well, a job that's basically online. And university that has WiFi everywhere. So, no, not really.
 
I thought I lived a sad life
 
Apropos query, will we ever see LINQ++? :)
 
@FredOverflow I've written it. It's not hard at all.
 
oh that would be cool
but I doubt it
 
9:49 PM
@FredOverflow Boost.Range.
 
well, the converting to SQL stuff is hard, but the range-stuff is pretty easy
 
Not exactly the same, but it's a damn good start.
 
there's a lot of stuff that's in LINQ that I've not seen in C++
 
@TonyTheTiger On the contrary- LINQ is exactly what you can do in C++.
it's just got a cleaned up interface
it's pretty trivial to convert iterators to LINQ
 
meh, I fail again :(
 
9:50 PM
You won't get the same clean interface, though, but the functionality is dead easy now with lambdas.
 
you guys keep reminding me of all the things I don't know
damn you
 
@RMartinhoFernandes Actually, as long as you don't want it to start converting to SQL, you can get the same clean interface
 
@TonyTheTiger Why sad?
You're on the funnest room on Stack Overflow.
 
and with lazy evaluation and shit too
 
@CatPlusPlus spending all day, every day behind my computer, being a nerd
having hardly a social life
 
9:52 PM
@DeadMG Without extension methods?
 
And that is sad why?
 
You need some "bootstrapper" somewhere.
 
besides this room
 
mmm
the problem is that without extension methods, you can only provide the slick interface for the pre-provided methods
 
Exactly.
LINQ is highly extensible.
 
9:52 PM
@CatPlusPlus cause life is more then just a computer and a bunch of animal gravatars
2
 
@TonyTheTiger It is? That's new to me.
 
@TonyTheTiger Life is what you want it to be.
 
@TonyTheTiger Yes, it's that with robot gravatars on top!
 
I think that extension methods are much more valuable than people make out.
 
@DeadMG walk on the street someday, there's other live people around too, you might be surprised
 
9:53 PM
yeah, I know! they scare me
 
@DeadMG The C# community I know values extension methods dearly.
 
@DeadMG lol
 
ok, when I said "people", I really meant, "@sbi"
 
I agree with @Tony, but as long as people are happy the way they live...
 
If you enjoy computer and a bunch of animal gravatars, then fuck people who say it's a bad thing and you absolutely need to do something else because some unwritten social rules.
 
9:54 PM
@CatPlusPlus of course it is.
 
sbi
@CatPlusPlus If so, he should climb down and come in.
 
I hate unwritten social rules with passion, and intend to disregard as much as I can.
 
@sbi lol :P
 
@CatPlusPlus Fully agree. I also tend to ignore written social rules
 
Fuck people who say how I must live, because something.
Well, unless it's a police.
 
9:55 PM
You must live without being dead, because you would be dead if you did otherwise.
 
@CatPlusPlus I do enjoy it, but sometimes I feel a need for social interaction with a live human being in front of me
 
Tautology FTW.
 
@TonyTheTiger Me too. That's when I go to the shop and buy chocolate.
 
@TonyTheTiger That's what Lan parties are for!
 
@CatPlusPlus I hope not meta police :P
 
9:56 PM
room topic changed to Lounge<C++>: If you join this room, you will be in this room. [c++] [c++11] [c++-faq]
 
@CatPlusPlus yea, and never return back
 
@TonyTheTiger I thought that was easy: go out and meet people.
 
I saw a damn mosquito flying near the light, sneaky bastard then flew into the darkness.
Those things are ninjas, I tell you.
 
I don't give a fuck about social rules, but I do give a fuck about meeting live human beings every few months
@RMartinhoFernandes I do that, sometimes
 
Once I was tracking one for three days.
 
9:57 PM
@CatPlusPlus wtf, really?
 
@CatPlusPlus What?
You're talking about mosquitos, right? Not live human beings, right?
 
Of course I'm talking about mosquitos.
 
@TonyTheTiger I need it once or twice a week.
 
Human beings don't keep me up at night.
 
9:58 PM
I'm in tears, tracking a mosquito for three days
what in the fuck
 
Well, unless you count this room.
 
@RMartinhoFernandes lol
 
We can never know. Cats are hunters.
 
@FredOverflow oh, you're more human then me then
 
He's more gregarious, you mean.
 
9:59 PM
this room has kept me up more then nights then I have fingers
lol
 
@TonyTheTiger That sonofamosquito activated at night, and was buzzing while being invisible.
And it just disappeared every time I turned the light on.
 
@TonyTheTiger Well, I share my apartment with another human being. If I were to live alone, I guess I would feel the urge to socialize more often.
 

« first day (323 days earlier)      last day (4608 days later) »