« first day (287 days earlier)      last day (4663 days later) » 

8:09 PM
the problem with a GC in a native language is that you could have GC references reachable by arbitrarily complex native pointer references
it's gonna be slow to go through them all
 
Oh, Java 7 is officially out, didn't realize until now.
 
With borked loops.
Well, loop optimisations.
 
Ha. Java 7 managed to break loops. lucidimagination.com/blog/2011/07/28/
 
Okay, I'll just recursion then ;-)
 
lol
 
8:14 PM
Wait, still no lambdas in Java 7? Come on!
 
lol
 
I thought C++0x would be the last major language to adopt lambdas.
 
Who needs lambdas when you can sprinkle your code with finals and write an interface and then an unnamed class.
 
code maintainers?
I hade anonymous class instance bloat for a single line of code to be executed.
 
Your sarcasm detector needs some maintenance. :P
 
8:22 PM
folks
 
8:33 PM
java doesnt need lambdas. it has anonymous inner classes
 
Java desperately needs lambdas.
And first-class methods.
 
Java 8 will have lambdas.
 
Java 7 would have lambdas.
 
c++2020 will have modules
c++16 would have modules
 
lol
I really wish it's C++16 having the modules, but I'm not very hopeful.
 
8:50 PM
How can you guys already predict the release dates of the next two C++ standards? :)
Is C++16 the successor of C++0x, or is it C++0x itself? :)
 
probably c++0x :D
 
Well, 0x means base 16, so...
 
@FredOverflow Successor.
 
Who says it will take 5 years for the next standard?
 
It's a guess.
 
8:59 PM
Who says there will be a next standard after C++0x? Will Bjarne ever stop evolving the language?
 
There will be at least TR2, AFAIR.
 
Any idea what will be in TR2 so far?
 
Modules? wishful thinking
 
12
Q: Which boost libraries are heading for TR2?

deft_codeIf found this quote at boost.org: More Boost libraries are in the pipeline for TR2 It links to the TR2 call from proposals. But I can't seem to find any other information on which boost libraries are headed for TR2. I've seen a draft proposal for Boost.Asio, and I vaguely remember seeing ...

 
Well I am not as advanced as most of you, but what do you mean by modules. maybe have a link to read about it ?
 
9:03 PM
Ever wondered why other languages don't need header files? It's because they have proper modules.
 
WTF? Why isn't boost::optional in that list?
I want my std::optional!
 
You can always propose it ;-)
 
namespace std { using boost::optional; } // brillant
 
Not what I was talking about.
And you can't do that.
 
Also, he misspelled "brilliant".
 
9:05 PM
@FredOverflow thx for the link :)
 
@FredOverflow That's a meme.
 
@legion I just googled for "modules C++" and it was the first link...
 
.......
 
@MartinhoFernandes Well, it's not an error. Close enough.
 
:D
 
9:06 PM
I'd rather see/hear about a C++ module proof-of-concept implementation than have the SC work on the specs right away tbh.
 
So, someone, get cracking. I want my modules.
 
I can start you off with some modulus: %
 
My SConstruct is a mess.
 
Do we even have a plan regarding templates?
(But it's no secret that I'm quite happy with the current situation regarding headers and all.)
 
Heretic!
You know that deep down you want modules!
Search within you!
 
9:09 PM
Of course I do.
But it's a cost of opportunity thing.
Committing to specify modules doesn't come for free, all that time and resources could be used by the SC to specify other things.
Given also the potential cost of failure (no current implementation, remember export etc) well.
 
-1
Q: Performance of GCs with native objects

DeadMGI've got a question relating to the performance of a garbage collector. Let's say that I have a native language which has native pointers. I'm interested in how these pointers can adversely impact the performance of the collector. Let's say that when I create the GC, I've got the full type inform...

some fuck downvoted me! :(
 
I'm not saying the SC should get cracking on specs.
I'm saying someone should get cracking on a working implementation.
 
I don't know how we wouldn't end up either with crippled modules or a overly-specified feature nobody implements.
 
the simple fact is that modules come down to implementing export
so either implementations get cracking on it, or we never get modules, and it's pretty much just that simple
 
Also how does Ada do it?
 
9:17 PM
the trouble isn't dealing with it, it's dealing with it and not breaking legacy code
 
But I don't have legacy code to compile!
:P
 
There's also no legacy module support to break.
 
it's not about legacy module support, it's about supporting everything else
 
Of course as the forward thinker you are you meant the SC has to get it right first so as to now break legacy code later!
 
the Committee could implement modules by just cutting all the declaration requirements, for example
which would be my personal favourite solution
the problem is that doing so would involve re-architecting nearly every compiler from scratch
 
9:20 PM
I don't think most people would like to use that 'feature' tbh.
 
lol
 
Hmmm, the preprocessor doesn't help much either.
 
Another error on line 1500?
 
Last time we preprocessed stuff. Laughter was had.
 
9:29 PM
Preprocessor could be a bit less arcane and less limited.
Templates are cool and all, but being able to generate real code can be helpful, too.
And my build system will be the greatest one ever made, har!
 
user457812
Mmm hot tamales. This makes the whole day better.
 
lol
 
lol
 
9:45 PM
I didn't know Bind overloads == like that.
I think I should pay more attention to the docs.
 
It makes for a confusing error message.
 
Feed me rep!
 
only boost::bind does tho. std::doesnt
 
I did!
 
@LucDanton I did before posting the link.
I'm wondering why anyone would want to do something like that. Ideas?
 
9:47 PM
@CatPlusPlus Phoenix, Lambda and Bind have a lot of overlap these days.
 
lambda will die
 
well, with official C++0x lambdas, it's hard to see how it won't
 
Yeah, right now it's a continuum of most feature to most basic and also least likely to have legacy code to most likely. In the future I can see Boost.Bind relegated to "I'm stuck with a terrible compiler help"-status/legacy.
@DeadMG Not this again. Phoenix functors are polymorphic!
 
oh yeah
:P
 
stop. c++0x lambdas are different!
 
9:51 PM
but I almost never have a need for polymorphic functors
maybe I'm just lucky
 
> See, I've been musing over global variables. The problem is that in "DeadMG++", it's very difficult to go around not using global variables.
What?
 
Am I reading this correctly? DeadMG++ encourages globals?
 
have you ever tried writing a compile-time metaprogram with no state?
it's tough
a thread-safe, memoizing, function with no state
 
in my language, global variables will be forbidden.
 
9:52 PM
I considered that too
 
everything will be inside of a declared namespace xD
 
@DeadMG All my functions tend to be this way except for the memoizing part (the client can do that).
 
@JohannesSchaublitb So, globals.
 
although, I did make some changes to the language to make constants more viable
 
@MartinhoFernandes I don't understand
what's "SO globals" ?
 
9:53 PM
the simple fact is that I need some global variables- for example, mutable types, the way I've implemented dynamic_cast
 
@JohannesSchaublitb Maybe I misunderstood you, but namespace foo { int x; } is just a global with fancier name foo::x.
 
@MartinhoFernandes the global namespace isn't a declared one.
@MartinhoFernandes that's not a global.
x is within namespace foo
 
That is very much a global variable.
 
@MartinhoFernandes When you do type t = type {} and then you mutate that type, then it becomes a global variable- it just happens to exist at compile-time instead
 
in C++ it's not a global variable
 
9:55 PM
It's global state. All the same problems, except for naming collisions.
 
If it has external linkage and is not an unnamed namespace it's global.
 
TBH, I don't really care how standard calls it.
 
if you are outside of foo, then using x will not find foo::x. which is an advantage of non-globals over globals
it may be global state. but not a global variable which is what I meant
@LucDanton that's totally untrue
 
Skepticism shields to 120%.
 
Unnamed namespaces limit visibility, but that's still plain old stinkin' global.
 
9:57 PM
also, global has nothing to do with linkage
 
@LucDanton You're overloading your shields?
Isn't that bad for your health?
 
@MartinhoFernandes War emergency power.
 
scope and linkage are orthogonal concepts
 
I can build zlib with my flags, wooo.
 
variables in namespaces can't have extern "C" linkage?
 
9:58 PM
I don't see why 'global variable' must mean 'variable in global namespace scope'.
I care more about the law of Demeter than nomenclature here.
Which concept is really helpful in pointing out awful code here?
 
The Law of Demeter is about global variables?
Oh, it is.
 
namespace A { extern "C" int v; } . In that code, v's scope is the scope defined by A, but still, the linkage of v is extern "C" which means it is the same variable as v in the following namespace B { extern "C" int v; }
 
@JohannesSchaublitb In GCC I can also use v unqualified IIRC, is this conformant? I never bothered to check.
 
both names are different names (declaration/semantical names) and their scope is different, but they both refer to the same variable.
you cannot unless you declare v in the global namespace or you have a using namespace A; to extend the scope of v to the global scope or using A::v; to create an alias name for it.
 
I seem to have misremembered, I can't reproduce.
(That's a fun thing to say.)
 
10:04 PM
lol
 
12 mins ago, by DeadMG
have you ever tried writing a compile-time metaprogram with no state?
C++ compile-time metaprograms have no state, so yes, I have tried, and I have been successful.
:P
 
har har
"DeadMG++" metaprograms definitely are not stateless
more than that, a bunch of stuff which used to be constant - like types- are now mutable
 
Good luck slapping modules on that :)
 
@LucDanton It'll be easy
 
10:06 PM
I toyed with the idea in my mind, sort of type annotations to e.g. statically check some class invariants.
 
so you can say typedef int A; A i = 0; typedef float A; and i has type float then?
 
Can I bookmark that so I have an easy link when you come here complaining about how difficult it is? ;)
 
It's convenient for toy examples (a stack) but you hit the halting problem fast.
 
@JohannesSchaublitb no, because you already defined i
 
that's lame :( thought you can change the type
 
10:08 PM
good night..
 
So, types are frozen once you use them?
 
I think you can call metafunctions on them, e.g. const(t) (no idea if the syntax should be t = const(t)` here).
 
@MartinhoFernandes No, they're just already used.
what would happen if I output a variable and then changed it? Well, the output would be the original value
 
i don't understand. how are they mutable then
 
So, i is of a type that is a snapshot of A at the time?
 
10:10 PM
@LucDanton right now, I'm looking at something like t.Attribute(Const) right now
 
ah every use of a type will derive a new type from it that cannot be changed
 
@MartinhoFernandes Not exactly. It's a reference. You can change the referred-to type, and it will change A.
for example, I've implemented dynamic_cast by changing the source type to include a new virtual function that will do the check
 
Why won't i be a float in @Johannes example then?
 
that's not just mutating a single type, but a type and all it's derived classes in one swoop
@MartinhoFernandes Because you re-assigned a pointer, not mutated the underlying type.
if any of you read my blog, you would know wtf I'm talking about
 
10:12 PM
besides, primitive types will be very, very const :P
but you absolutely can go back and change it
 
@DeadMG I don't understand half of what you post there :( Hence my asking about it here.
 
TypeReference t = type {};
var t MahObject;
t.MemberFunctions.Add("name", [&]() { });
MahObject.name();
that's legal
 
so how can I change the underlying type
 
What about removing?
 
@MartinhoFernandes If you want to.
 
10:14 PM
TypeReference t = type {};
var t MahObject;
t.MemberFunctions.Add("name", [&]() { });
MahObject.name();
t.MemberFunctions.Remove("name");
 
but it's worth mentioning that this is a two-pass process
 
// Now you can call it, now you don't!
 
that is, implicitly, half the function takes place at compile-time
and the other half doesn't
 
Does that compile?
 
no
 
10:15 PM
what do you use for code generation?
 
do you generate x86 code?
 
Weeeird.
 
and there's type events
you can respond to changes on the type with your own changes
for example, if you wrote a vector-like container, you'd need to know if the contained type was no longer trivially movable
or just throw an exception, which is the primitive behaviour, because you can't change them
@JohannesSchaublitb No implementation yet
although I'm pretty sure that implementing it won't be that hard, conceptually- code generation will be fun as I've never done that before
 
@JohannesSchaublitb Is hacking on LLVM fun (and I have no idea if that's what you're doing exactly)?
 
10:19 PM
@LucDanton yes it is.
im working on the backend
 
Oooh, an intensive German course. That's certainly more interesting than last year's "Intensive Russian".
I think I'll take that.
 
partially the code is very unwieldy
but it's heaven compared to GCC
 
That is sad to hear.
 
well most of it is clean and all. but some is weird xD
 
The GCC state I mean :)
 
10:23 PM
argh! fuck you, old syntax
 
i'm going to write a LLVM backend for an educational processor in my spare time. so I'll get some more practice with it. currently I'm doing the LLVM work for a living as a side effect.
@LucDanton uhh GCC code is dark magic
but there exist a huge amount of back end / frontends so if you have to do something with it you can mostly steal the code of someone else xD
 
have I mentioned how much I hate C++ syntax?
so un-extensible
 
Well starting from C syntax is a losing proposition.
 
I cut quite a lot of C syntax anyways, that's not so much of a problem
 
10:46 PM
Looks like I picked the wrong week to have a reasonable sleep schedule -- it's MLG Anaheim
 
lol
 
aaaahaha
0
A: Calling private method in C++

Johannes Schaub - litbSee my blog post. I'm reposting the code here template<typename Tag> struct result { /* export it ... */ typedef typename Tag::type type; static type ptr; }; template<typename Tag> typename result<Tag>::type result<Tag>::ptr; template<typename Tag, typename Tag...

 
What's that?
 
it's something stupid
 
How come all the typename Tag::type crud is necessary?
 
10:52 PM
I would like to remove them if it would be possible :(
it needs to have a definition
 
Why can't rob<PointerToMemberType, &T::member> be explicitly instantiated directly if it's the instantatiation that allows subverting access?
 
i wanted to have the information aggregated in a class
so that when you reference the member later, you can just use the tag, instead of remembering the exact member type
and you need to have some way to make it unique
if class A has two functions both having pointer to member type void(A::*)().
 
How template<typename Class, typename Signature, Signature Class::*P> rob<Signature Class::*, P> { typedef Signature Class::*type; static Signature Class::* value; /* = P */ }; does not have all the features you mention?
You can typedef void (A::*Af)(); for your old tag.
 
@Luc a typedef doesn't provide a unique type
it's just an alias
so typedef void(A::*Af)(); typedef void(A::*Ag)(); will give the same tag
 
I thought you wanted to reuse Af::type, not Af itself. Figures.
 
11:06 PM
@LucDanton and you need a base class that doesn't have P in its argument list
 
hi guys
 
hi
 
does anyone know where nmap saves its output?
 
what on earth is nmap?
 
11:10 PM
Nmap (Network Mapper) is a security scanner originally written by Gordon Lyon (also known by his pseudonym Fyodor Vaskovich) used to discover hosts and services on a computer network, thus creating a "map" of the network. To accomplish its goal, Nmap sends specially crafted packets to the target host and then analyzes the responses. Unlike many simple port scanners that just send packets at some predefined constant rate, Nmap accounts for the network conditions (latency fluctuations, network congestion, the target interference with the scan) during the run. Also, owing to the large and ...
 
and that is related to C++ how?
 
I'm writing an application that needs that
nmap output
 
not related, you could be writing an application in a dozen or more languages
it's not even a programming question
 
in C++
 
@stdio I don't have a manpage on my system. What does yours say?
 
11:12 PM
@LucDanton I haven't too
 
@MartinhoFernandes doesn't it automatically save the output?
 
> While interactive output is the default and has no associated command-line options, the other four format options use the same syntax. They take one argument, which is the filename that results should be stored in.
 
so, no output on file by default :(
 
That would otherwise be quite unorthodox.
 
11:18 PM
ok...thanks guys
 
I should add that I get quite grumpy when, without having even heard of a tool, I'm able to solve someone else's problem just by looking at the official documentation.
 
@MartinhoFernandes Fuckin' touche
 
I don't know nmap very well :D
 
Also, the fact that I still can't get my code to compile on Windows annoys me to no end.
 
@stdio Neither does he, and that's his point.
 
11:20 PM
@MartinhoFernandes eheheh...what's your problem?
 
No idea. Can't get boost.system to link correctly. I'm building boost manually right now.
 
which compiler/IDE?
 
Not an order of object files issue then :(
 
I'm trying with MinGW for now. I had it working on my other laptop with MinGW.
Cygwin packages GCC 4.3, which is no good to me.
 
my Cygwin came with 4.5
 
11:24 PM
Still not good enough :(
I need 4.6.
 
it's a long time I don't write code on windows :D
 
I was coding on Linux, but my laptop decided to take a vacation.
And I've already done all the thinking I can do for now. I must write code now.
 
:)
I go back to write code...good luck martinho and see you guys
 
screw cygwin, just dual-boot linux
 
11:29 PM
Can't. Single partition for the whole disk.
 
use partition magic
 
That's not free, is it?
(But there might be some free tools out there.)
 
=)
there may be some free tools, dunno
 
And it means downloading and installing a bunch of stuff.
So much hassle.
I could do it in a VM though.
Hah, found someone with a similar problem that solved it in the most stupid way possible.
> So I just commented that line out like so
inline const boost::system::error_category& get_system_category()
{
  //return boost::system::get_system_category();
}
No, I'm not going to comment some random line inside boost.
 
Yeah, don't do that. Unless you hate error checking.
 
11:33 PM
well that won't even compile if u use the function or any function that depends on it
 
It will compile, with a warning for no return value.
And it will cause some nasty UB somewhere.
 
doesn't compile in VS
 
That's not conformant.
Consider int wont_always_return() { if(check_something) std::abort(); return 0; }
(Hence the noreturn attribute specifier to allow better static checking e.g. at binary boundaries.)
 
i wonder whether [[noreturn]] void unreachable() { } can be used as a "unreachable" vehicle
 
'vehicle'?
 
11:39 PM
i mean, if unreachable is never called, then it never returns
 
Welcome to Tautology club.
The first rule of Tautology Club is the first rule of Tautology Club.
And, you're lying to the compiler. Poor compiler.
 
to be used like: void f(int n) { switch(n) { case 1: ... case 2: ... default: unreachable(); } }
 
MSVC has a kind of __assume function for that purose
 
@MartinhoFernandes im not lying to the compiler xD
 
void f(int n) { switch(n) { case 1: ... case 2: ... default: __assume(0); } }
is it's use, I believe
 
11:43 PM
it depends on whether the function is called
 
Put a call to std::abort() conditionally on NDEBUG (a.k.a assert) in it though.
 
@LucDanton that's suboptimal
because it's required to abort the program
 
I don't see the link between the former and the latter of what you said. I.e. I know what abort does, that's a feature.
 
the goal of my unreachable() is to mark code is not reachable. so that the compiler's optimizer can do a better job, while still not shouting warnings about missing returns etc of code that it deems reachable
 
@MartinhoFernandes, apparently gparted in the ubuntu installer can resize NTFS partitions regardless of fragmentation
 
11:45 PM
@JohannesSchaublitb I know. You can set NDEBUG for breakneck optimization.
 
if I place an abort(); it will stop warnings, but it will not do a good job in the optimizer, because it is required to emit code to abort the program
@LucDanton then it warns in release builds :)
 
@JohannesSchaublitb No, the attribute is still here.
 
and it doesn't really know that the code won't be unreachable. so I think it's likely that the optimizer will do a bad job
@LucDanton i don't understand. I thought you meant #if NDEBUG #define NREACHABLE() #else #define NREACHAbLE() abort() #endif
what attribute is there?
 
> in it.
So your exact version, but with assert(false) in it.
The same.
With the attribute.
 

« first day (287 days earlier)      last day (4663 days later) »