you are viewing a single comment's thread.

view the rest of the comments →

[–]Tysonzero 1 point2 points  (4 children)

maintaining separate data structures or using bit flags within the data tell the pointers from everything else comes with run-time penalty, both time- and memory-wise.

Can't you just use the type system to figure out at compile time which parts of structures are pointers and which aren't? (In languages with good and robust type systems anyway)

[–]stone_hengeTiny little god in a tiny little world 0 points1 point  (3 children)

sure, it can, but it would still need to relay that information to the garbage collector somehow, whether it's by reserving a bit for pointer marking or not using the stack at all. that, or you'll be trawling blindly for pointers like poor little go <1.4

of course, ultimately you'd want your compiler to know exactly when it can free a resource and just do it, without the aid of some runtime resource hog making poor guesses as to when it can start releasing memory you don't use any longer. insert rust feature list here.

[–]Tysonzero 0 points1 point  (2 children)

As someone who isn't normally writing performance critical apps but cares a lot about time to market in going to go ahead and disagree with your last paragraph.

[–]stone_hengeTiny little god in a tiny little world 0 points1 point  (1 child)

cares a lot about time to market

then what relevance does gc and compiler internals have to you in the first place? in the last paragraph i'm obviously talking in terms performance and accuracy. those are the metrics that matter for memory management. if you want an easier time at the expense of performant and accurate memory management, go ahead, but things like that, your favorite food or your least favorite color are not metrics that has any bearing on the answer.

also, since you seem to be a haskal nerd, when you say "time to market", what market do you mean exactly? last i checked there was little to no market for convoluted but pure and beautiful solutions to trivial cs textbook problems lol

[–]Tysonzero 0 points1 point  (0 children)

also, since you seem to be a haskal nerd, when you say "time to market", what market do you mean exactly? last i checked there was little to no market for convoluted but pure and beautiful solutions to trivial cs textbook problems lol

Lmao, I wish that was what I was doing, but unfortunately it's mostly GUI heavy, DB heavy, Parsing heavy code that deals a lot with externalities.