« first day (1726 days earlier)      last day (3226 days later) » 

8:00 PM
piumarta.com/software/maru A self-hosted one with GC in Lisp :v
 
@orlp Well, duh. @Noob's a scrub and refuses to hang out with me D:
 
im thar
 
github.com/darius/awklisp/blob/master/awklisp Here's a more ridiculous one in AWK also with GC
Dammit now I want to implement a Lisp
 
@rightfold ah, so you do use seperate data structures to keep track of the old->new location mapping and the alive objects
 
user1804599
8:07 PM
so for a cons cells you'd do this (assuming C++ weren't shit and had proper struct initialization syntax):

Struct cons;
cons.fields.push_back(Field{sizeof(Struct*), alignof(Struct*)});
cons.fields.push_back(Field{sizeof(void*), alignof(void*)}); // car
cons.fields.push_back(Field{sizeof(void*), alignof(void*)}); // cdr
 
markeds
 
user1804599
then to make a cons cell you call gc.alloc(cons); and then set the first field of the result to &cons.
 
user1804599
you need to keep an unordered map of GC smart pointers so that you know which objects to mark
 
@rightfold so you keep one pointer of overhead per object?
 
user1804599
yeah.
 
user1804599
8:08 PM
in your design you also do since you have a vptr.
 
yeah I know
 
user1804599
but here you do vptrs manually because you can't implement a compacting GC without UB otherwise
 
im ded
 
user1804599
Also note that you should just stop wasting your time and target an existing VM instead such as JVM, CLR, Lua or V8.
 
user1804599
8:12 PM
especially if you need threads target JVM CLR or BEAM.
 
user1804599
never implement GCs in concurrent environments
 
@rightfold llvm
 
LLVM doesn't have a GC
 
user1804599
LLVM isn't a VM that offers a GC.
 
Also lol
 
8:16 PM
@rightfold with your example I still see a problem - references are never updated to the new location
 
user1804599
@orlp refresh. now they are.
 
@rightfold that's only for the references stored within objects themselves
@rightfold not for the references held by the implementation itself
 
user1804599
smart pointer, problem solved.
 
@rightfold raw pointer or bust
 
user1804599
8:20 PM
class GCPtr {
 // ...
private:
    void* ptr;
    GC* gc;
};
 
user1804599
make the GC global if you're worried about extra pointers all over the place
 
@Noob y u ded
 
Ogre is neat
 
@Columbo Don't try to tell the Ogre that or it'll pound you into dust.
 
@JerryCoffin And then maybe into diamonds.
 
8:29 PM
@CatPlusPlus It does, however, have hooks specifically to support your attaching a GC.
 
Yeah I guess
But then you have to implement codegen and GC
 
@JerryCoffin For real, what do all those OGRE haters have a problem with, specifically.. I used that library for quite some time and it worked really well - didn't encounter problems with the design, either
 
the mass of mutable singletons
 
It has a really crappy design
 
@Puppy Mutable singletons have mass? I didn't even realize they were Catholic...
 
8:31 PM
Phabricator
 
@rightfold another problem is that the current design grows unbounded in memory usage - regardless of how much memory is actually kept alive
 
user1804599
you can shrink the heap if you like
 
I haven't tried Ogre yet. Seems really heavy
 
@rightfold everytime the 'nursery' fills up it increases in size - even if the total amount of live objects stays constant
 
I made a butt asset in Skylines and the game doesn't want to delete it
 
user1804599
8:31 PM
and the total amount may not remain constant
 
user1804599
it may get smaller or get one object bigger
 
@orlp You don't have to keep expanding the heap if you don't want to.
 
@ScottW Never heard of it
 
it's simply an optimization to avoid more collections
 
@Puppy A common mistake. It's not really to avoid more collections. It's to give objects a better chance of being dead by the time collection happens. With a copying collector, a collection cycle is really cheap as long as virtually all the objects are dead when you do a collection.
 
8:36 PM
and they're compact in memory
otherwise you're still basically iterating a graph with a bunch of random pointer accesses
that's not really free
 
@Prismatic Neat
 
Lounge(C++)
 
user1804599
@orlp for extra fun make your compacting GC find objects referenced by arrays and put them consecutively in memory in the same order as in the array for more cache-friendly iteration of the array
 
@AlexM. my charset doesn't have '<' and '>' lol
 
8:37 PM
For extra extra fun do the same for linked lists
 
Lounge!(C++)
 
user1804599
yes!
 
@rightfold I'll first get this to work lol
 
And not just on collection :v
 
so did anyone watch that andrei talk about generics fully
 
8:38 PM
@nabijaczleweli I'm pretty happy with it. The texture for the characters is embedded into source and its nice and compact.
 
I tried but 14 mins in I got bored and his voice made me feel sleepy
 
Nobody did
 
why did he want to banish generic programming
 
36 x 48 bytes
 
8:38 PM
@Prismatic You got fonts to work?
 
generic programming is the shit
 
user1804599
@CatPlusPlus which is more important, runtime reflection or parametricity?
 
@Nooble Yeah. I've had normal fonts for a long time, this is embedded debug font stuff.
 
@Prismatic 1.72kB, less than mt19937
 
user1804599
8:39 PM
That's not an answer to the question.
 
idk
Parametricity probably
 
user1804599
hmm
 
user1804599
I like downcasts :(
 
@nabijaczleweli I could pack it into 1/8th of that if I used something like std::vector<bool>... I might do that later.
 
@Prismatic DON'T EVEN THINK ABOUT USING std::vector<bool> EVER
IT'S A HORRIBLE ABOMINATION
IT SHOULD BE DED
 
8:41 PM
If you actually need a bitvector then it's fine
 
My image has a single bit channel, so it would work good for packing the data
 
@nabijaczleweli As opposed to a pleasant abomination?
 
@Nooble ( ͡~ ͜ʖ ͡°)
 
dynamic_bitset from Boost has better interface probably
 
But yes, if you want behavior identical to other vectors, you should use vector<u8>
I dont know why they specialized vector<bool> instead of just make std::bool_vector or something
 
8:42 PM
Because cplusplus
 
user1804599
because they hate parametricity!
 
@nabijaczleweli What a load of crap.
 
Load of carp
 
the shit I live in is so poorly insulated
heat is coming through the windows like fuck
cold is coming through the windows like fuck in winter too
so glad I'm moving out
 
@rightfold what about lisp objects that in turn hold resources, such as a LispStr?
 
user1804599
8:46 PM
@orlp add std::function<void(void*)> finalizer; to Struct and store a pointer to the resource in the value.
 
@rightfold how do you find the references to the dead objects?
 
user1804599
When the object is collected you call the finalizer.
 
I mean, you don't have a list magically lying around of all the objects in your heap, no?
 
user1804599
you can find all objects by iterating the heap
 
oh wait, you can keep a current idx, and keep incrementing it by the size of the object at the current idx
 
user1804599
8:49 PM
you can compute the offset of an object with the offset of the previous object, the sizes and the alignments
 
ye
 
user1804599
allocation is nothing more than incrementing a pointer and checking heap overflow
 
You want some way to keep track of unused areas anyway
Free list is probably simplest
 
@CatPlusPlus there are no unused areas in a compacting gc
only a seperator of used space / unused space
everything to the left is used, everything to the right is unused
 
user1804599
Just use Boehm and yolo.
 
8:51 PM
I guess
 
user1804599
or JVM
 
user1804599
implementing GCs is boring and implementing them well is very difficult
 
And also boring
 
1 hour ago, by orlp
also, my goal here is more or less to educate and enjoy myself rather than getting it to work with minimal effort possible
 
user1804599
how are you going to execute the code?
 
user1804599
8:53 PM
inb4 walking the tree
 
@rightfold for the initial version, p. much
might make it more performant later - probably not
 
user1804599
write a compiler and bytecode interpreter. it's much easier especially with macros and lexical scope
 
Hey, do you all think its sort of useless to try and monitor things like shader and texture switches and other OpenGL stats for performance tracking? It seems like OpenGL profiling is a implementation dependent black art.
 
for now I actually want to implement an interpreter from the start
not a multi-stage setup
 
user1804599
I have a few interpreters lying around on GH
 
8:55 PM
@Prismatic Use a vendor profiler
 
user1804599
and one I wrote yesterday on Gist: gist.github.com/rightfold/3d447bd5619104ee86b0
 
> javascript
 
jabbascript
 
@CatPlusPlus So is there any use in tracking OpenGL statistics? If so, which stats?
 
Dunno
 
user1804599
8:57 PM
 
user1804599
It uses refcounting GC which leaks when you have strong cycles but w/e
 

« first day (1726 days earlier)      last day (3226 days later) »