« first day (835 days earlier)      last day (4112 days later) » 

11:00 PM
Nice to see nothing has changed since I left.
 
"Wanna use a language? Pay money to a company to help you do it" ?_?
 
C++ sucks because there's no R++.
There you go.
 
knowing when to Dispose of a resource is Halting Problem.
 
@DeadMG Damn, I must be really smart then.
Give me the Turing award or something.
 
Ell
What is the halting problem again?
 
11:01 PM
excellent, I've just been informed that the whitespace and newlines in the xml in the database are significant. How the frick do I localize this?
 
@MooingDuck Find the person who came up with this monstrosity, cut off his head, and the problem will be localized to his grave site.
 
@Ell Given a program X, prove whether or not it terminates.
 
@EtiennedeMartel Then could you teach me?
I never know when to dispose a resource, so I guess I must be interested.
 
@Ell What @DeadMG is saying is that I'm an incredible genius for solving such a complex and difficult problem (or rather, for solving a problem that is equivalent according to him).
 
@EtiennedeMartel My biggest gripe is that if you really think about it every time, it will creep up through the entire code base. I will readily admit I wrote a lot of C# code knowing that sometimes it would leak resources (they would not be definitely lost because of finalisers, but you would be at the mercy of the garbage collector)
 
11:03 PM
@EtiennedeMartel Nah, because real, useful programs aren't Turing-Complete.
but the point is that R#, effectively, can't know that.
 
@R.MartinhoFernandes I always end up having trees of disposable objects.
 
Ell
@DeadMG if you know the input you can prove it can't you?
 
@DeadMG R# only does what he tells him to. It's just that instead of writing the boilerplate he presses Alt+Enter and calls it a day.
 
do this code's error messages prove that std::map doesn't rebind the allocator?
 
The tool I'm working on has a per document approach, and every document is IDisposable. Generally that does nothing, but if the document manages some resources, then it can clean them up there.
 
11:05 PM
@Ell This is for an arbitrary program that you're required to treat as essentially a black box.
 
Closing a document calls Dispose on it.
Problem solved, beer ingested.
 
@doug65536 You could only ever prove that that one implementation of std::map did not rebind.
@JerryCoffin I think you get to know the input, though.
but that won't help
 
@DeadMG I guess you might as well treat it that way (since it does no good anyway).
 
it's still quite impossible
@doug65536 The third argument is the comparator, not the allocator, you nub.
look at the error message- GCC is trying to call the allocator to compare the elements.
 
@DeadMG lol oops. hacking together minimized test case
 
11:07 PM
@DeadMG Precisely. From an abstract viewpoint, you can just treat each combination of program+input as a separate program, with the problem equally impossible for each.
 
@DeadMG oh right, I was looking at that message trying to figure out why it appeared to be constructing from a pair...
 
@EtiennedeMartel Yeah, that's what I meant: you end up putting IDisposable everywhere because down below there is some little thing you need. That does not change the fact that when you implement any run-of-the-mill interface (say IList<T>), you cannot make use of IDisposable (well, you can, but it leaks), because your clients are not using their lists.
 
@MooingDuck Thanks for all the help over the summer. Truly awesome.
 
That may not show up often in app development, but I'm a lib dude :P
 
the simple fact is that IDisposable is, in effect, malloc and free resource management.
 
11:12 PM
@R.MartinhoFernandes alibdude seems like an okay name.
 
@DeadMG Almost.
 
hmmm
I wonder if, with the correct allocator abstraction, it's possible to write one container that can act as both RAII and GC.
 
The problem is that the GC only manages memory.
And sometimes you get resources that come from outside its heap.
 
@EtiennedeMartel It's malloc and free with an editor macro that, when you type in x = malloc(size), automatically inserts a free(x) afterwards, so within a limited scope (as long as your use is scoped, and you type the code that uses the data between the two) it'll get cleaned up as needed.
 
11:14 PM
Sure, there are finalizers.
But it's non deterministic.
 
hmmm
I disagree with that
 
@DeadMG I tried, turns out the fact that people can ignore allocator::pointer and just use T* and T& screws it all up
 
@DeadMG With what?
 
@EtiennedeMartel That the problem is that the GC only manages memory.
the problem isn't that the GC only manages GC memory- the problem is that it also manages object lifetime.
I think that if you were to treat the GC as "Just another allocator", you might get somewhere.
@MooingDuck Ah. I was thinking about for Wide, so I can ban that.
 
@DeadMG Can you take that away without losing functionality? (I'm thinking funargs and shit like that)
 
11:16 PM
@DeadMG It manages a heap. A heap is a graph of objects. It manages object lifetime because it has to reclaim memory at one point, so it needs to know when an object is no longer used.
Object lifetime management is a necessity in order to manage the memory.
 
@EtiennedeMartel Right, but that doesn't mean that I can't choose to explicitly tell it if it's unused.
 
@MooingDuck Yea, SO is still useful for programming, and SE has it's hidden treasures, which is why I still had activity on my account.
 
@DeadMG Sure, by setting it to null.
 
@R.MartinhoFernandes Funargs? I have a vague memory.
@EtiennedeMartel Not that reference, the whole object.
 
@DeadMG I thought about that too, but that means you're banning taking the address of all variables except through an allocator, which leads to library interdependence which I wasn't a fan of.
 
11:17 PM
@DeadMG Why would you want to do that?
And isn't that what calling Dispose does?
Also, how can you tell when an object is unused?
 
@EtiennedeMartel I might choose to use a deterministic ownership scheme, rather than non-deterministic, like in C++.
like a unique_ptr, except the pointer type is a GC reference.
 
@MooingDuck And to be honest, no, I still struggle with her. The holidays were near-deadly.
 
Going to sleep now. Good night.
 
@Drise I believe it. First one is always rough, for a year, sometimes two.
 
night
 
11:22 PM
@DeadMG Did you ever find a job?
 
anyway, I haven't finished forming the idea of how I want to make a GC interoperate with deterministic memory schemes
but I think it might work
 
Or finish wide?
 
@DeadMG Good luck with that, because I think it's gonna be a pain.
 
Ell
Won't it end up like * and ^ ?
 
@Drise Yes.
@Drise I made some progress, but became kinda sick, so it's stalled atm.
@Ell No.
 
11:25 PM
"Kinda" sick
 
@DeadMG For two months?
 
@R.MartinhoFernandes Quite the understatement there.
 
hmm
@Drise Naw, just the last one.
 
What the hell could be causing a program to push X's cpu usage to 70-80%?
 
Ell
Oh wait a minute, is that drise? :o
Tight loop?
 
11:27 PM
@Drise Anything, really.
@DeadMG I really wonder how that would be possible.
 
@EtiennedeMartel It makes no sense. It's doing math, not displaying anything. And when it's minimized, X stops complaining.
 
@Drise Erm.
Displaying would use the GPU, but maths are the kind of things that run on the CPU.
@DeadMG You could have two heaps (one managed by the GC, the other managed by the user), but then it would be weird on the frontier between the two.
 
@EtiennedeMartel The basic idea is GC as allocator.
 
@DeadMG It's not the first time I see you using "allocator" as a magical device that fixes all problems.
 
hmm.
 
11:30 PM
The GC is an allocator (amongst other things).
 
well, I admit that in this case, it's kinda unexplored territory.
but I don't recall using it previously as magic.
 
In .NET's case, it's a generational mark-and-compact garbage collector. It handles the allocation.
 
I know that
 
So, it's not really changing anything to make it an allocator because that's what it already is.
 
right
 
11:34 PM
Unless you meant something else.
 
but what I mean is that we already have systems for dealing with allocators and custom deleters and all those shenanigans.
 
Can someone confirm this code is showing gcc's unordered_map is not rebinding the allocator?
 
so in principle, the GC could just act like them.
 
Ell
Can't you just delete any objects that aren't reachable by the root node in an object graph?
 
@Ell Depends. GCs are quite complex beasts.
 
11:35 PM
Fuck it.
 
lol
 
@R.MartinhoFernandes You had to go and look, eh?
 
@doug65536 Uh, actually, I think that error is GCC trying to use the rebind mechanism and failing because you failed to implement it correctly.
 
@DeadMG Hmm?
 
11:36 PM
@deadmg what's wrong with the rebind?
 
@EtiennedeMartel What?
It's a forgery.
 
@R.MartinhoFernandes Damn.
It sounded so real.
And I felt somewhat vindicated.
 
@doug65536 You didn't implement a constructor from one instantiation to the others.
 
Ell
@etienne what would it depend on?
 
@EtiennedeMartel You know, looking back at it, it kinda makes sense: you just need to allocate food better (yeah, "just").
 
Ell
11:38 PM
Would speed be the problem? Searching for every object?
 
@EtiennedeMartel Well, in principle, we could just re-use the existing infrastructure to support using a GC, if it were made somewhat more flexible.
 
@R.MartinhoFernandes It was pretty obvious -- Why else make an image rather than link it? :)
 
@DeadMG So, like the Boehm GC?
 
@EtiennedeMartel Precise, not conservative.
 
I still don't understand.
I read what you write and all I understand is a "Instant solution, just add magic".
 
11:40 PM
right.
it's not magic at all.
the only difference between a GC and some other kind of allocator is that you have to extend the allocator abstraction a bit to deal with all the memory moving shenanigans.
 
@Ell In a GC, there's no "delete". The GC collects memory when, during an allocation, it notices it uses more than a certain treshold.
@DeadMG You have to deal with references, not addresses.
 
yeah
 
there's more to it than just knowing what is unrechable. most GC's try to make objects moveable
 
You also need to make sure the user does not gain the ability to mess with that memory directly.
 
@EtiennedeMartel Simple: tis UB. Done.
 
11:42 PM
@R.MartinhoFernandes I don't like the C++ "you know what you're doing" approach.
Because I never really know what I'm doing, and I don't think I'm that bad.
It's like invariant violation waiting to happen.
 
well
 
@EtiennedeMartel You can only gain that kind of ability but using shady shenanigans anyway. (Assuming his interface does not have a get_nasty_pointer() function, that is)
 
gc_allocator<T>::pointer would certainly have to be more restricted than a regular pointer.
no pointer casting, for one.
 
@DeadMG Adding template<typename U> TestAllocator(const TestAllocator<U> &other) { } and a default constructor reduced the errors. Is that what you meant?
 
Essentially, you need multiple heaps.
 
11:44 PM
@doug65536 partially, yes
 
Which leads to: what if a managed object has a pointer to an unmanaged object?
 
@doug65536 Yes. Show new paste.
 
@EtiennedeMartel What about it? That's not dangerous.
 
@DeadMG Isn't that what IDisposable is about?
 
11:45 PM
No.
 
no
 
Wait.
What are you guys talking about?
 
IDisposable is for resources in general
 
@EtiennedeMartel He wants to decouple destruction from memory management. That was his premise, just in case it was not clear.
 
Including unmanaged stuff.
@R.MartinhoFernandes It wasn't. For me at least.
 
11:46 PM
I don't know how useful that will turn out, but he made that clear at the beginning.
 
Well since only the memory is 'managed'
 
@R.MartinhoFernandes I thought it was clear.
 
31 mins ago, by DeadMG
the problem isn't that the GC only manages GC memory- the problem is that it also manages object lifetime.
 
the existing allocator interface already does that.
 
Hello, guys!
 
11:49 PM
and when you consider, say, custom deleters for unique_ptr or shared_ptr, they have no obligation to free any memory.
unique_ptr<T, gc_deleter>- non-deterministic memory, deterministic object lifetime.
 
unique_ptr<T> is GC too
By changing the deleter you only put it on a different heap or something and that doesn't really make much of a difference
Unless you refcount the object or something but then you don't have deterministic object lifetime
 
Suppose, you have this:

char hello[10] = "hello";
char *hello2 = "hello2";
char world[10] = "world";
 
then your compiler fail to compile it, because that's illegal.
 
why does hello = world fail, however hello2 = world work?
 
11:52 PM
@CatPlusPlus Refcount is painful.
 
@CatPlusPlus LOL. I wasn't going to do it.
 
@DavidFrank hello2 won't work, it will fail. Because that is illegal.
 
@EtiennedeMartel It's fine in most cases
 
refcount is far from optimal for concurrency (cache line sharing)
 
it seems to work
 
11:53 PM
one, old, compiler is irrelevant.
 
hello2 is a pointer to a global string
 
the Standard clearly defines it to be illegal.
 
@CatPlusPlus Yeah, but you have to be really careful not to have any loops.
 
30
Q: Is array name a pointer in C?

tsubasaIs an array's name a pointer in C? If not, what is the difference between an array's name and a pointer variable?

 
@DavidFrank compiler is cheating, it's supposed to error on that.
 
11:54 PM
Compiler is GCC 4.3
 
@DavidFrank an array name isnt an lvalue. am I missing something?
 
> main.cpp:3:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
IOW, it's illegal, and GCC simply hasn't forced it quite yet.
 
So far I thought an array equaled to a pointer to its first member.
 
Did @StackedCrooked Make his own ideone/lws thing?
 
@DavidFrank you thought wrong
 
11:56 PM
no.
 
@Drise yes
 
@Drise Yes.
 
What for?
 
@DavidFrank hanging around SO will show you that an array name decays into a pointer
 
@DavidFrank Everyone does this mistake at first. It's like a rite of passage.
 
11:56 PM
Because
 
@Drise latest compiler version
 
@MooingDuck I thought LWS handled that
 
@MooingDuck In most of the cases, they equal. How do they differ exactly?
 
@Drise LWS went down
 
Fun in Montreal.
 
11:57 PM
@MooingDuck Bore.
 
@DavidFrank When the array is not used as an rvalue.
 
Most of the topics only cover how they are similar.
 
@DavidFrank in no cases are they equal, but they compare equal. A char and an integer can both hold the same values and compare equal, but they are not the same thing.
 
@DavidFrank sizeof behavior is a big difference
 
@DavidFrank If you're learning from material that teaches this, then find new material.
 
Haven't you seen the link that I posted above?
 
C arrays are disgusting, terrible things.
@R.MartinhoFernandes I thought you went to bed?
 
user142019
I should learn Elixir. It seems nice.
 
@EtiennedeMartel neat
 
So the main difference is that the pointer can be an lvalue, while an array cannot.
Right?
 
11:59 PM
No
 
In any case, why are we discussing charstars?
 
no.
 
Nov 28 '12 at 2:59, by Xeo
Sleep typing, secret German skill.
 
and sizeof(pointer) is completely different from sizeof(array)
 
@EtiennedeMartel That picture is so well taken, it looks staged.
 
11:59 PM
@doug65536 ok, but thats not so important
 
Because pointers and arrays are fundamentally different things
They have no relation to each other
 
@Borgleader Was taken by a photographer for the Montreal Gazette.
 
@DavidFrank no, but it's one demonstration that they are different
 

« first day (835 days earlier)      last day (4112 days later) »