« first day (476 days earlier)      last day (4478 days later) » 

Xeo
1:00 AM
[01:59:37] <Xeo> Quick question: Is Clang single-pass? :)
[01:59:54] <Xeo> I couldn't quite make a definite answer out of chandlerc's answer
[02:00:06] <zygoloid> Xeo: the frontend is, yes. the optimizers are multi-pass.
Ding ding ding.
 
I told you.
 
@Xeo coolio - ty
 
that was fash
*fast
 
Xeo
> [02:00:51] <zygoloid> (apart from the small places where the language standard requires us to use multiple passes: member functions, in-class initializers and default arguments in class definitions)
 
hehehe, subtext
 
1:01 AM
GoingNative needs a question voting system
 
@deftcode good idea
 
Xeo
> [02:01:15] <zygoloid> we also have to tentatively parse declaratin statements to cope with decl/expression ambiguity
 
sounds like 1+ pass
 
Xeo
Like Chandler said, if you can leave out tentative parsing, it's like SUPER SPECIAL AWESOME.
 
I'm looking forward to the day that I can drop gcc for clang (even though I appreciate having gcc)
 
Xeo
1:03 AM
@kfmfe04 Clang 3.1 release. :P
 
I'll drop it the moment they release with lambdas
 
@Xeo ty - I will keep my eye out (when's the tentative release time-frame for 3.1?)
 
The lamda are TOO DAMN USEFUL!!
 
@deft_code Next release will have pretty much everything people really really really want.
 
Xeo
1:04 AM
No idea
 
Chandler listed what will be missing, because it's very little :)
 
go clang go!
 
> All build systems are terrible.
 
full build once a night when no one cares
 
I had a crappy (incremental) build the other day on modifying a class template (using cmake for builds)
make clean solved it
 
1:06 AM
Makefiles aren't that bad. They make my life a lot easier.
 
Xeo
clang.llvm.org/cxx_status.html add lambdas, init lists, inherited ctors, delegating ctors, constexpr and probably something I'm forgetting
 
Chandler's hinting at Googles super secret sauce
 
@Maxpm Makefiles are necessary - they are discussing incremental builds in particular (problems with)
 
@deft_code Unicorn blood?
 
I was amazed when I found out about it because it't not talked about a lot
Google's build system
 
1:07 AM
Google's build system is build everything from scratch
(in a massively parallel a la mapreduce method)
there's a video out on youtube about this, somewhere
 
 
Xeo
lol. 23h -> 11min buildtime
 
that's ('#$ed up
 
incompetence the cause of bad builds :)
 
rofl no forward declarations prolly
 
1:09 AM
Lisped up?
 
They were lucky they were incompetent.
 
the size of their binaries should've been some hint that something was wrong
Andrei is a riot
 
xD
 
yeah
@kfmfe04 the binary size would be the same
the difference is the size of the preprocessed files
 
compiler cleans up afterwards?
 
1:12 AM
I'm afraid I missed that part. Something about forward declarations decreasing build times...?
 
Xeo
Lies.
TIL: I don't need full definitions for Widget foo(Gadget); :(
 
@Xeo Yeah. That was... Surprising.
 
Don't you, though?
 
@Maxpm Herb just said that.
And it makes total sense.
 
uh oh, the only compiler writer on the panel is questioning concepts
 
1:13 AM
@RMartinhoFernandes That's the part I missed.
 
@Mysticial it's exact about 50% of the time, off by one about 25% of the time, so I didn't notice until one of my tests was off by 132560718. :(
 
from twitter:
Why do I need to know the type instead of just saying that there is a name?
 
sorry, missing context
for forward declarations, why not use just the symbol name, instead of name and type
 
Xeo
#GoingNative CLang, a C++ compiler that doesn't hate you.
lol
 
1:16 AM
@MooingDuck Off by ones are typical and generally unavoidable. You need to detect and trap those cases. (That's why my answer has loops in it, but they never iterate more than twice each.)
 
obviously not with member values, but with function decls
 
@deft_code Because that simply doesn't work in a statically typed language.
 
But as for your last case... that's tough, you need to cross-check the math.
 
Things must have types.
 
@deft_code to be able to spot typos (think <ios_fwd>) and e.g. templates template <typename> struct forward_struct; works differently from struct forward_struct;
 
1:16 AM
@Mysticial it's because I had completely miscalculated how the upper half the multiplication result divides.
 
extern name x; // assume a name keyword, for example
void f(int);
f(x); // should this compile?
@deftcode The language just stops working if you take types away.
 
only for forward declartions
 
Hmm .. is there any programm that could easily translate c# to c++?
I heard there is some, but I forgot the name of it
 
@deft_code There, it's a forward declaration now.
 
more like

name Base;
Base* foo( void );
 
1:19 AM
That already exists.
struct Base;
 
Xeo
@deft_code struct Base; Base* foo();
 
where Base is either a class or a template
 
@MooingDuck Probably an off-by-one in the top word that propagated down the bottom word and caused a junk result?
 
I'd prefer no warnings where there's difference in struct/class between declaration and definition.
 
1:20 AM
@Mysticial an extra modulo is getting added in I think
 
Xeo
@RMartinhoFernandes I typed more.
 
GCC doesn't like struct X; class X {}; :.
 
@deft_code template <typename Base> Base* foo();?
 
Wait. So Herb's spiel was about ideone.com/p1EE3?
 
Not quite.
You can't define bar without definitions of the classes.
You can declare everything without definitions as long as you don' t define it.
 
1:22 AM
is it possible to come up with an in-language replacement for Macros?
 
This is awesome.
 
Xeo
// .h
struct Widget;
struct Gadget;
Widget foo(Gadget);
// .cpp
#include "Widget.h"
#include "Gadget.h"
Widget foo(Gadget g){
  return g.GetWidget();
}
 
Given my background with Pi and stuff, I'm probably one of the better bignum devs. But even then division is one of those things that I've always hated... because it's really hard to get it right.

I almost always end up just multiplying by a high-precision reciprocal - not the most efficient way, but it works.
 
This is something new.
 
1:22 AM
@Xeo Needs declarations of Widget and Gadget, but yeah.
 
Xeo
Fixed.
 
How much did I miss today in GoingNative?
 
Everything?
 
Xeo
All of it?
Last minutes of last panel Q&A
 
I mean how good were the talks?
 
1:23 AM
@RMartinhoFernandes Ah. So a definition of something needs definitions of everything it uses, and a declaration of something needs declarations of everything it uses?
 
Yes.
It makes total sense. I can't believe I didn't "know" this before.
 
WOW
clang
 
Where do Gadget&s and Gadget*s fit into all of this?
 
@Mysticial yeah, I'm a slow learner and I'm bad at math
 
You can define values of pointer and reference types with incomplete types.
 
1:27 AM
@CatPlusPlus we're still missing forward declare methods
 
struct Foo; struct Bar { Foo* x; }; is fine. struct Foo; struct Bar { Foo x; }; isn't.
@deft_code You can just declare members when defining a class.
struct Foo { Foo(); void frob(); };.
 
I'm talking about maximizing forward declarations
 
@CatPlusPlus Sadly, that will probably require definitions of stuff.
I'm not sure it's that important.
 
@RMartinhoFernandes Pimpl!
 
MyClass::Iterator foo( void );
 
1:29 AM
And what is that supposed to be?
 
Now I would need to include MyClass's entire definition
when I don't want to
 
That's a free function.
 
Oh, that. You can not use inner types.
And don't complain about how this is workaround. Workarounds is what you write in C++.
 
Industrial strength duct tape, lol.
 
1:31 AM
C++11 killed so many hacks, lets kill the rest
 
I'm glad C++ threading is not done with stupid #pragmas.
 
To kill the rest we need modules.
And get rid of declarations altogether.
That will also kill MVP as a side effect, which is always a good thing.
 
MVP?
 
Most vexing parse.
 
Xeo
most-vexing parse
Damn connection!
 
1:32 AM
Most Vexing Parse!!1
anyone else?
 
Most-vexing Parse
 
I didn't say anything.
 
You chickened out
I saw you thinking about it
 
Most Valuable Porn
2
 
MVP it's the new black
 
1:33 AM
Wat.
 
mvp = new black;
 
sorry Jose and Pussy Cats reference
 
Gosh, it's 2:30 and the traffic in the house is like it was noon.
 
so sad to see it end
 
Xeo
Nooo, it's over. :(
 
1:35 AM
At least I was able to watch the last 5 minutes :)
 
Well, I learned two obvious things.
room topic changed to Lounge<C++>: You don't need complete types for Widget foo(Gadget); [c++] [c++11] [c++-faq]
That was good.
 
I really wanted to see Bjarne and Andrei get into it over Concepts vs Template Constraints
 
Xeo
Question: What's the hashtag for C++ on Twitter?
 
Xeo
Give me #c :/
(Atleast when searching)
 
1:37 AM
#cxx?
 
Do you guys know what this type of graph is called?
http://i974.photobucket.com/albums/ae227/ElectroNerdy/Dot-LinePlot-1.png
The dots with vertical lines.
 
James uses #seaplusplus
 
#cpp? #cplusplus? #cocain?
 
@Mysticial It's based on the fact that after multiplication to Hi/Lo, then HI/(INT_MAX/Div)+Lo/Div will get you 95% of the way. The rest was the part to get it the remaining 5%, and that's what was wrong
 
1:41 AM
lol
 
lol - nice, Xeo
 
@Xeo Oh God, it's so true.
 
@Xeo Here, let me administer a cure.
 
"That's why we're committed to having this supported by a wide diverse group across the industry" "We don't have anyone who knows Windows" --same guy
(Yes I know I'm an 10m behind)
 
Xeo
@MooingDuck That's their problem and he clearly states it.
 
1:43 AM
@Xeo It's amusing. He did mention it a few times, but only when relevant
 
0
Q: Embedding Mono in C++

Adam EttenbergerNote: Windows7 using Cygwin. I have been attempting to embed Mono in c++ for the past week and have made no ground. I read the tutorial here: http://www.mono-project.com/Embedding_Mono but it won't allow me to run "pkg-config --cflags --libs mono-2" or "pkg-config --cflags --libs mono". I believ...

Ow. On Windows, using Cygwin, trying to embed Mono in C++. Whyyyyyyyyy?
 
user406009
Do they have any recordings of Going Native yet?
 
@RMartinhoFernandes Lol.
 
Xeo
@EthanSteinberg You can access todays live stream and just skip back
 
Trying to open a tuna can in an oildrum in a train car on a super tanker, without a can opener
 
user406009
1:45 AM
The plugin is failing on linux
 
@RMartinhoFernandes why not?
 
@EthanSteinberg i had to watch on my mac
 
Xeo
Well... Then you're fucked. :) Wait for tomorrow when Charles will put up the vids
 
@sehe Because it leads to pain.
It's obvious, he's been at it for a week, with zero progress.
 
@RMartinhoFernandes apparently - but it doesn't have to. Also, it leads to gain :)
 
user406009
1:45 AM
Hate silverlight. It's worse than flash.
 
@EthanSteinberg they'll have regular feeds up in the next 24 hours
until them SL is the only option
 
> TL;DR: Having trouble creating the mono (.dll) / (.lib) required to embed Mono runtime in C++ What trouble? We're not psychic. Post some error messages. Otherwise we're just going to assume that your problem is your computer isn't turned on, and your computer needs to be turned on to compile code. Push the power button, question answered
@RMartinhoFernandes That is a classy comment
 
100MB install for Silverlight - ridiculous
 
Microsoft "Why you no use YouTube!!!?"
 
@sehe But more to the point, it'd be whooole lot easier to just do it on Linux.
 
1:47 AM
@deft_code does youtube do streaming well? I haven't looked at it
 
yeah
 
@deft_code also: it's owned by a competitor
 
Right, MS using Google's product.
Fat chance.
 
@RMartinhoFernandes true. However, that wouldn't be very protable, now would it. And also, you shouldn't do only the easy things. Same reason why clang++ should still be made to work on windows
 
Xeo
1:48 AM
@sehe Hey, they want that!
 
@sehe He's writing code for Android.
 
@RMartinhoFernandes OMG!!
 
@RMartinhoFernandes oh really. do the thing on linux. pronto!
 
Your host is not really revelant.
Well, unless your host is a bunch of layers on top of layers on top of Windows.
 
@sehe, look around for game embedding Mono
everyone hates it
not because C# isn't nice
Unit is the only successful one
 
1:50 AM
Unity.
 
and look at their post mortem on their ordeal
 
You can script in boo.
 
@MooingDuck The one in my answer is similar, (but not identical). It's a simplified version of what GMP and java.math.BigInteger. Basically when dividing an N + 1 word number by an N-word number, (and the denominator is normalized), you can approximate the upper-most word of the quotient by a 2N / N division of the two words of the dividend and the top word of the divisor.
 
@RMartinhoFernandes and yes the host is relevant. Because IIRC NDK needs to be cross compiled and I doubt that the cross compilation tool chain even exists on windows. Even if it does, embedding mono is going to utterly fail because it doesn't directly support the target processor (MIPS/ARM?) at least, not when I last checked
 
That approximate quotient is guaranteed to never be more than 2 larger than the correct answer, and guaranteed never to be too small.
 
1:52 AM
@sehe So, it's even more painful that I envisioned?
 
@RMartinhoFernandes that's what I think
 
That bounds was stated in the javadocs. It took me a while to work out the proof for it.
 
@RMartinhoFernandes I've embedded mono on linux before, and I have compiled for android with NDK before (both toys) I can't imagine the pain at the crossroads of that, while avoiding the officially supported route for it (MonoDroid). That's just false frugality IYAM
 
Xeo
2:09 AM
So, GN is over and the Lounge is dead?
 
Hmm. They use template <typename T> using X = foo<T>::type; (no typename) in n3351.
Is that correct?
Have I been typing typename for nothing?
I have a feeling I asked this before.
 
Xeo
Seems to be a bug
But you know, it would make sense to not require it here.
I mean, what else can it be?!
 
Xeo
Same as in a base-class list
And even in a template<class X, class Y = X::type>, theoretically.
 
typename = typename blah<T>::type is silly.
 
2:17 AM
hi
 
any awesome stuff from goingnative?
been kinda out of the loop ;)
 
Xeo
Awesome amount of praise for Clang. :)
 
nice
so is there any progress on lambdas? ;)
 
It will be in the next release.
Along with almost everything else.
(Left out will be minor stuffs and threading/atomics)
 
2:20 AM
and the next release will be? DIdn't it take something like a year between the last two releases?
 
also threading is hardly "minor stuff", is it? :(
 
@jalf That's why I said "minor stuffs and threading".
 
Xeo
constexpr is mostly done, initializer_list about half, and lambdas are somewhere between beginning and middle from what I can tell
 
well, I hope this doesn't reflect the current state of lambdas
No progress since october
 
Xeo
2:24 AM
It's not a branch anymore
 
ah k
 
@jalf MSVC seems to be the one most committed to the threading stuffs.
(re: your tweet)
 
Xeo
r149663 | efriedma | 2012-02-03 03:04:35 +0100 (Fri, 03 Feb 2012) | 3 lines

Refactor capture in blocks to use new-style capture hooks.  Start adding a bit of the code for lambdas.  The only visible changes are that we use the C++11 odr-used rules to figure out when a variable is captured, and type-checking in lambdas is slightly more accurate.
FWIW
 
sadly, it's not even threading in general I'm desperate for
at least MSVC is adding that, and GCC seems to have it on a few platforms
 
2:29 AM
but NO ONE are even talking about adding support for TLS
 
Xeo
@RMartinhoFernandes Well, with PPL behind their back, it seems logical
 
well, gcc has __thread
 
Only works for PODs.
 
@kfmfe04 yup, and msvc has __declspec(thread)
 
the spec is for all types? that would be fantastic!
 
2:31 AM
both are TLS, but neither are C++11 TLS, working with non-POD types
@kfmfe04 well, afaik that's kinda the point. Would be an absurd limitation otherwise
 
@kfmfe04 Of course it is. Non-PODs are not second class in C++.
 
TLS could be sneaky overhead for threads though - especially for non-PODS - better be careful not to use too many of them
 
Boost actually has TLS for non-POD types, but it's too slow for my needs. Need something properly handled by the compiler
to replace my awful hacked-together approximation
 
void*s, right?
 
@RMartinhoFernandes where? In my implementation?
 
2:33 AM
Your "awful hacked-together approximation".
 
pointers to objects stored in a std::deque, iirc. I don't handle destruction correctly atm, is one of the things on my todo list
 
I seem to remember discussing working around the POD limitation with pointers.
 
a static deque, that is. Acquire a mutex when inserting into the deque, and then store a pointer to your thread's element into the TLS variable
don't need to acquire the mutex in order to access your thread's element then, so access is speedy
could do a bit better by replacing it with a list, since atm I can't safely remove objects when a thread exits
Problem is detecting that event is nearly impossible on Windows
 
Xeo
@jalf __declspec(thread) global POD whose destructor notifies the queue? (I think dtor was allowed. not sure)
 
dtor isn't allowed :(
 
2:36 AM
@Xeo POD vs destructor.
Pick one.
 
Xeo
@jalf mmm... at_exit doesn't trigget at thread exit, right?
 
the pthread api has a nice callback for TLS which is called when the owning thread terminates, but on Windows, you have to hack together an evil mix of special linker sections and a dllmain implementation, which is just.... I looked at how Boost did it, and rarely have I been more impressed/scared at the feats Boost have pulled off ;)
@Xeo nope :(
 
Xeo
Wait a second. What about the end of your passed function?
 
@Xeo hmm?
 
2:38 AM
@Xeo His library doesn't launch threads.
 
Xeo
Oh
 
yeah, that's the problem. I don't own the threads, otherwise I could just place some nice little helper object on the stack
 
Xeo
Well, you can just require the user to do it
 
You don't need TLS if you control the threads (just pass extra arguments/captures/create local vars).
 
but it's intended to be called into from anywhere by the user, and I don't want to place silly requirements on like that if it can at all be avoided
 
Xeo
2:40 AM
@jalf Well, what if it's simply the cleanest and easiest and fastest solution?
 
The user may not be able to control all threads (think pools).
 
Especially because I want it to be possible to adopt my library piecemeal. So you might have a large legacy code base and just for one little function, you want to call into my lib. Then you either have to put this magic "library cleanup" object somewhere earlier on the stack, or do it where you need it and then my library's data structures will be destroyed as soon as that function returns, rather than when the thread exits, which might be inefficient
also pools, yeah
atm I'm just ignoring destruction, which isn't really a huge deal. I leak a few KB for each thread launched
which is tolerable for now
obviously it'd be a problem if you constantly launch and destroy threads, but it allows me to move on to more interesting problems ;)
just hoping for compilers to add proper C++11 TLS before I'm forced to implement a proper solution :D
 
Xeo
Urm.. what about general cleanup in the TLS vairables? That's not just leaking "a few KB"
 
@Xeo what do you mean?
I control what's stored in the TLS variables, and they don't contain any special resources
just a memory buffer, basically
 
Xeo
Ah, okay
 
2:44 AM
hmmm. Come to think of it, I might actually be able to make it a POD, even
that would solve the problem
well
 
Xeo
Free functions to the rescue!
 
or not. It's already policy-based, and one of the policies is a fixed-size buffer, which is, or could easily be made, a POD type
but the more flexible ones for dynamically-sized buffers can't be made POD
another option is to put my library in a separate dll. Then Windows lets me detect thread exit easily through the dllmain function
but that feels kinda stupid given that until now, I've managed to keep the library header-only
adding a separate DLL component (it can't even be a static lib) just for that seems stupidly overkill
 
-3
Q: c++ code CPU spike

user1130800what kind of c++ code has the chance to spike CPU? Could you please give me some examples? CPU spike is terrible. so I want to know what's the best practise to avoid it. Thanks.

This is bad on so many levels.
 
Erm.
Hehe, people don't know how to write real infinite loops.
 
Xeo
2:51 AM
I just noticed... Bjarne on Twitter. One tweet. nearly 2k followers
@RMartinhoFernandes Yeah, with output n stuff.
Or doing tail-recursion and hoping for TCO
 
GCC can tail-call optimise even non-tail-recursive functions in some cases, AFAIR.
Meh, I've stripped 0 in public repo, pushed all changesets from parent repo back there and poof, 100MB overhead reported by BB.
I wonder if they just count the backup bundle from strip, or something went kaboom.
 
sometimes a CPU spike is good - if I'm not doing 100% utilization during an intense compute, something is wrong
 
@CatPlusPlus Kill it with fire and start again?
 
@kfmfe04 Like compiler removed your infinite loop.
 
@CatPlusPlus like I'm I/O bound rather the CPU-bound
 
2:58 AM
Btw, an infinite loop will not necessarily use CPU like mad.
Like, if it does output.
 
@RMartinhoFernandes Nah, I've cloned and it's as big as it should be. So it's the strip backup.
 
or I/O or sleeps...
 
Yeah, if the loop just blocks on synchronous IO
Then I doubt it will go above a few %.
 
No kidding.
 

« first day (476 days earlier)      last day (4478 days later) »