« first day (1826 days earlier)      last day (3123 days later) » 

11:00 AM
@VermillionAzure with any of the many algorithms that are implemented in GCs
 
you start from a set of known alive objects (the roots), and explore all alive objects from there
you never even touch a dead object
 
@Puppy TIL Garbage Collection is olive.
2
 
@Puppy But how does that handle fragmentation without essentially becoming a compacting GC?
 
@R.MartinhoFernandes That depends exactly on the circumstances, but object pools and memory arenas are both fragmentation-free.
 
@VermillionAzure They're simply not a problem there. It eliminates the problem altogether.
 
11:02 AM
@R.MartinhoFernandes freelists?
 
@orlp No longer trivially cheap.
@orlp I'm talking p += size cheap
 
@R.MartinhoFernandes one freelist for every common size is trivially cheap?
 
@R.MartinhoFernandes Ahhh something about roots
 
I also don't understand how destructors are more deterministic in reference counting as opposed to GC. Yes, you know that destructors are invoked once all references are gone, but why would that matter?
 
@R.MartinhoFernandes trivial distinction
it's ~2 cycles vs ~20 cycles
both are simply so fast it's almost impossible to measure
 
11:03 AM
@R.MartinhoFernandes Arenas can do that with zero fragmentation, as long as your allocation/deallocation needs are LIFO.
 
@Jefffrey One has a precondition, one doesn't?
 
@Puppy It stops being trivial when you add all sorts of considerations.
@orlp Sounds like the sort of difference that can make you think about your allocation patterns in some cases.
 
@R.MartinhoFernandes Well, I'm not gonna argue that GC is not quite a flexible solution, because it is. It's just not always the best or only solution, and GC has plenty of problems of it's own.
 
@Puppy Never said it is. I was just adding to the list of its good properties.
 
my main issue with GC is that it's very hard to do parallel
 
11:06 AM
fair enough.
in that case we pretty much agree.
GC has advantages and disadvantages just like refcounting and a smart man would apply each in the appropriate situation if he could.
 
and anything which requires real-time processing (games, audio, etc) effectively becomes impossible for no other reason than your cleanup protocol
 
What does a GC need anyways?
 
@VermillionAzure what do you mean with 'need'?
 
@orlp As in, you just can't put a GC on a C++ program, right?
Or can you?
 
you can
 
11:08 AM
I have written a GC for C++
but you need to code in support for every type you want to store in your GC
 
@orlp so the GC needs to know about types
what else
 
@VermillionAzure not necessarily
it needs to know a couple of things
the size of the objects you're allocating/tracking
a way to move an object from one location to another
the alignment of the objects you're allocating/tracking
a way to destroy an object
 
@Jefffrey The most obvious thing you can do with RC that you can't with a GC is keeping a count of the number of (conceptually) live objects.
 
and a way to ask an object for every other object it refers to
 
@orlp Only if you're compacting.
 
11:11 AM
@R.MartinhoFernandes true
I was just listing the things from my GC, which is compacting
 
@orlp Doesn't this require also changing the value of the references
 
@orlp Hmm, how?
 
struct Type {
    TypeId id;
    std::string name;
    std::size_t size;
    std::function<void(void*)> visitor;
    std::function<void(void*, void*)> mover;
    std::function<void(void*)> destructor;
};
@Jefffrey you fill out this struct and call register_type with it :)
 
Wait, I thought you were talking about RC
 
no, GC
 
11:12 AM
@orlp what is this visitor
 
So much blasphemy.
 
@Jefffrey The Boehm-Demers-Weiser GC does it by checking the memory occupied by the object and taking anything that looks like a pointer. Yes, that has limitations.
 
@VermillionAzure it's the function that gets called with a pointer to your object, that in turn must call gc_visit on every object it refers to
 
@orlp Sounds awfully resource consuming
 
@VermillionAzure it's just basic tree traversal
 
11:15 AM
@orlp the size of that type struct is not exactly trivial and the time spent doing all of this is certainly gonna have overhead if the program is realtime
 
"the size of that type struct is not exactly trivial"
 
@VermillionAzure that type struct is stored only once per type
 
not once per object
 
How many types do you expect to have?
 
11:15 AM
bools and strings oughta be enough for everyone
 
I also have a function register_class_as_type<T>(std::string name), which does all the mover, destructor, etc for you, and asks your type to define a visit() method if you have any references
@R.MartinhoFernandes I think he assumed it would be stored for every object
 
18 mins ago, by Jefffrey
> GC does not have the performance penalty of ARC when dealing with object references however it incurs pauses while it is collecting garbage (rendering unusable for real-time processing systems) and requires a large memory space in order for it to function effectively such that it is not forced to run, thus pausing execution, too often.
 
@R.MartinhoFernandes But the memory overhead is light?
So it's more of a little smurf going around doing his thing instead of a huge bulky system?
@orlp My mistake
 
@VermillionAzure yes
 
@orlp Ohhhhhhhhhhhhhhhhhh
 
11:17 AM
the memory overhead for my GC is 8 bytes per object
 
Haha thanks
@orlp wait what
 
well, every object must still know it's type
 
can a 10k screenshot this for laff
@GregorMcGregor
 
@Mr.kbok broken
 
@VermillionAzure you're not 10k
 
11:19 AM
whatttttt rep reqs
 
That's what I linked 2 days ago
 
@orlp wait so it's per object then?
 
> BONEIST, YOU ARE A FUCKING CRAPHEAD
 
@VermillionAzure it's 8 bytes per object, not the full struct
 
> --Removed offensive comment here--
> SEAN PUT IT IN YOUR BIG ASSHOLE
 
11:20 AM
@GregorMcGregor linky?
 
@GregorMcGregor kinky gregor mckinky
 
@orlp hmmm I'd be worried but that's literally only 2 ints so whatever
I wonder how large an R int is...
 
> Who has the biggest craphead, Sean or Boneist?
 
union {
    GCObject* new_location;
    struct { TypeId id; bool marked; };
};
that's the overhead which I store for every object
the new_location is used to store the new location of the object during the compacting phase
 
@orlp I see
 
11:21 AM
I also lied when I said I handled alignment - every object is aligned to 8 bytes and not more in my GC
 
@orlp I see
 
71
Q: Gender insults in comments

ViveI've never asked a question here and I hope it's a good place to ask this. Someone today asked a question, where I gave a logical answer. Then another person answered and accused me of copying his answer. Please review the edit history to see that the only person who can be accused of copying, i...

 
to be fair, I don't really see a need for super-aligned objects in a GC
 
more meta drama
 
oh wow
every variable in R is a minimum 40 bytes
 
11:24 AM
@VermillionAzure yep, now my 8 bytes doesn't seem so bad huh? :)
(although R tracks a lot more things than just GC in that 40 bytes)
 
2 hours ago, by sehe
I think Bartek is really just here to vent, not even considering dropping out. It's a stress relief thing.
what can I say
 
@orlp Yeah
Oh you've used R?
 
@VermillionAzure no, but I'd assume it'd be very similar to Python
 
Fun fact a one character string in R is 96 bytes
 
(the internals)
 
11:25 AM
looool Python
 
python types are gigantic
I think they're like 100+ bytes
 
@Rapptz holy shit
 
In [158]: sys.getsizeof("A")
Out[158]: 50
 
is that py2 or py3k
 
3
 
11:26 AM
>>> class Test:
...     pass
...
>>> import sys
>>> sys.getsizeof(Test)
976
I suck at getsizeof
why is it reporting 976
 
3x3 array of numbers in R: 328 bytes
 
that's a type though
 
1 kB for an empty object?
 
the real interesting part is how large every object is
 
11:27 AM
3x3 array of floats in C++: 36
 
@GregorMcGregor no, an empty type
 
@GregorMcGregor It’s not that empty.
 
@GregorMcGregor in python3 every class inherits from object.
 
In [162]: sys.getsizeof(Test())
Out[162]: 56
 
@Rapptz isn't that the object definition
Or the function?
 
11:27 AM
In [163]: sys.getsizeof(Test)
Out[163]: 976
 
@orlp Let me guess
 
@orlp right (I don't lnpw Python), still scary as hell, no?
 
man so big
2
 
@orlp Jupyter?
 
@GregorMcGregor ehh
not THAT scary
 
11:28 AM
In [163]: sys.getsizeof(Test)
Out[163]: your_mom
 
Python has a lot of introspection data it stores
 
1kB for an empty type is kinda scary in my book
but sure why not
 
>>> len(dir(Test))
25
 
@GregorMcGregor Dude
 
In [164]: dir(Test)
Out[164]: ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
 
11:29 AM
@orlp oh
Those... are all probably py functions too...
 
@GregorMcGregor well, how many types does your program use/define?
 
speaking of python
 
100? weee 100kb memory usage
 
how do you nerds document your operator overloads?
 
@Rapptz I don't think I really operator overload in Python
 
11:30 AM
don't overload if you need to document it too much :P
 
@orlp Have you heard of cache, probably not because you don't care about performance in python anyway
 
is what I'm doing at the moment
 
@Rapptz what the shit
 
@Rapptz that's bloody overkill
 
wot m8
 
11:30 AM
I use markup to spare me the effort
 
@GregorMcGregor cache and Python?
hahaha
everything is stored in giant dicts mate
 
isn't it obvious that == compares two colors?
 
it's documenting the fact that it exists...
lmao
 
@orlp giant dicks everywhere
 
color1 == color2 i'd expect to exist anyway
 
11:31 AM
Hi Rapptz
 
Python is an amazing language
 
are you sure?
 
@orlp You know this little thing CPUs use
 
but don't try to squeeze performance out of it
 
I am positive
 
11:31 AM
@ScarletAmaranth Check your privilege. :P
 
well you'd be wrong
 
@Rapptz Short docstring.
 
btw this is what the python docs do
 
@ElimGarak what ^^?
 
11:32 AM
even if the encoding of colors might differ, i'd still expect operator== to either compile time error to tell me that the encoding is different or for it to simply work
 
Why do you guys use Python
 
@VermillionAzure because it is an amazing language?
 
ezpz lemon squeezy
 
I don't use python
 
 |  __add__(self, value, /)
 |      Return self+value.
for lists
 
11:33 AM
and 90%+ of your program code doesn't need performance whatsoever
 
Mebby I should but I can't stand untyped languages
 
@GregorMcGregor it's not untyped
 
So many people writing graphics-related code without understanding anything they write. Gawd, makes my skin crawl.
 
no, it's strongly typed
 
it's not statically typed
 
3rd element in the table
 
lol here we go again
people not understanding type systems. python users, what a coincidence.
 
@ElimGarak well
It's not easy
 
@ElimGarak IS IT TRUE THAT IF SLOWS DOWN MY GPU CODES???
no shut up
 
11:34 AM
@Rapptz The good thing is that I’d never feel the need to do that because I would always have my operator piggyback on another pre-existing operator behaviour.
 
Yeah me too.
But I'm just documenting the fact it exists.
and iunno how to do that.
 
Sphinx does that for me.
 
so I'm making a table
how
 
__add__ totally counts as an operator
 
I can't use :special-members:.
 
11:36 AM
that’s what I showed you earlier
 
Or well I can but it'd be super noisy.
It adds shit like __weakref__
 
@GregorMcGregor That's like saying math doesn't have sets
 
> napoleon_include_special_with_doc = True
 
yeah that's :special-members:.
 
I’d have to look up the docs to see if that’s strictly the same as :special-members:
 
11:37 AM
@VermillionAzure please make less sense
 
@Rapptz I don’t have noise then. Using Python 3 if that matters.
 
I'm using python3 too :(
 
Ell
@GregorMcGregor pls expln
 
@GregorMcGregor Python has types. It's just not statically-typed.
 
4 mins ago, by Gregor McGregor
people not understanding type systems. python users, what a coincidence.
 
Ell
11:38 AM
when you say python is untyped, do you mean because it is duck typed? my mind is open
 
9
Q: Include specific special-methods in sphinx

mgilsonI have a bunch of classes which use "special-methods": class Foo(object): "Foo docstring" attr1 = "Attribute!" #: first attribute attr2 = "Another Attribute!" #: second attribute def __init__(self): self.x = 12 def say_hello(self): """ say_hello(self) -> No...

 
@GregorMcGregor I don't use Python and I still don't know what you mean by "types"
 
@LucDanton Maybe napoleon removes the noise then.
 
@VermillionAzure every language on the planet has types
 
Sep 28 at 19:23, by Luc Danton
@EthanBierlein A careful enough type system (that’s 'type' as in 'static type', nothing like what Python does) can allow you to make statements about a program, such as 'this program is well-typed and will not throw an error'. Languages such as Python do something else entirely.
 
11:39 AM
@VermillionAzure "type" is a mathematical concept.
it's well defined
 
Days since last argument about Python's non-type system: 0.
 
@BartekBanachewicz I know
So why does @GregorMcGregor say Python is typeless?
 
Days since people last engaged Cinch: 0
 
@VermillionAzure because he's not a mathematician wanker like me
 
Python's only type is PyObject.
 
11:40 AM
@BartekBanachewicz Wait aren't you CS?
 
:smirk:
 
@VermillionAzure didn't we just establish I don't have any degree
 
@VermillionAzure See Luc's quote above.
 
@BartekBanachewicz Aren't you in school with a major?
 
Ell
11:41 AM
is this a type?
In model theory and related areas of mathematics, a type is an object that, loosely speaking, describes how a (real or possible) element or elements in a mathematical structure might behave. More precisely, it is a set of first-order formulas in a language L with free variables x1, x2,…, xn which are true of a sequence of elements of an L-structure . Depending on the context, types can be complete or partial and they may use a fixed set of constants, A, from the structure . The question of which types represent actual elements of leads to the ideas of saturated models and omitting types. ��2...
 
@VermillionAzure "with"?
 
@Ell Yes
 
no it’s a Type 1 eh enough jokes for today
 
@BartekBanachewicz What's your major
 
But not the one we're talking about
 
11:42 AM
@Ell yes
 
In mathematics, logic, and computer science, a type theory is any of a class of formal systems, some of which can serve as alternatives to set theory as a foundation for all mathematics. In type theory, every "term" has a "type" and operations are restricted to terms of a certain type. Type theory is closely related to (and in some cases overlaps with) type systems, which are a programming language feature used to reduce bugs. The types of type theory were created to avoid paradoxes in a variety of formal logics and rewrite systems and sometimes "type theory" is used to refer to this broade...
 
@GregorMcGregor pretty damn similar
 
Ell
@GregorMcGregor thanks
 
@VermillionAzure uhm
@VermillionAzure no idea, who cares
 
@BartekBanachewicz But... you have one semester left?
 
11:42 AM
so what
 
Aren't you guys forced to declare?
 
doesn't imply I care about that
I probably chose something at random
 
see ya guys
 
@Rapptz bye
 
bye cinch
 
11:43 AM
@BartekBanachewicz lol
 
@GregorMcGregor Do you just not like Python because it's not statically typed?
 
 
@VermillionAzure Isn't that exactly what I said
 
tdWTF so funny
 
@ElimGarak You know the solution though.
 
11:44 AM
@Mr.kbok Plonk? :D
 
Write articles so good it will discourage badlets to write their own
That's the reason Cinch wants to write a C++ tutorial and not a Rails one (no offense)
 
@Mr.kbok Did somebody say... tutorial?
 
yes
 
@Mr.kbok no
 
@Feeds No.
 
11:46 AM
God I hate it it's so shitty
 
Yeah, Telkitty is a nuisance.
Oh, wait... I see what I did there.
 
@sehe lol
 
Oooh somebody needs to make a New Age mutability joke
 
@VermillionAzure what?
 
@Mr.kbok You're not supposed to say yes
 
11:54 AM
why? because you wrote a shitty one?
 
@VermillionAzure but I did
also what's shitty?
 
@Mr.kbok My tutorials
So much cruft
 
I won't ever write tutorials about C++ because loungers might read them.
 
I think we might succeed in doing it together
 
Not writing them? :D
 
11:58 AM
can I join
 
Of course.
 
you can join @Morwenn's effort of not writing c++ tutorials
maybe we can set up an empty gh repo and accept empty pull requests
 

« first day (1826 days earlier)      last day (3123 days later) »