Show more

@freemo I don't count years per language, and it doesn't matter if you can't follow basic reasoning. I worked with various garbage collected language (as most of them are these days) and with every single one, once the project reaches certain level of maturity memory related performance becomes a big issue that a lot of time is spent on, to the point where a pinnacle of the language study becomes the study of the GC.

>out of the box memory waste is **Extreme** in C
yes spaghetti code memory waste is extreme, that's why you never get far with it, and that's why if you got far, you have a good design that fits your application and you don't have to worry about optimizing just to be at the acceptable level of performance.

> apps like perl and ghostscript
wow what an example, garbage collected language can't do well without a memory management of a garbage collected language, unbelievable.

>The line of thinking your using usually leads people do to what is called "premature optimization"
Exact opposite, good desing is not a permature optimization, and if you are using a language that is in general well optimized, you don't need to worry about micro-optimizations. Premature (or otherwise) micro-optimizations are much more prevalent in less optimal languages, where they actually can have an impact.

I think we went over this before, but which project was it that aprappi competes with objectively? I guess no such thing... or if you allow yourself to remove the java/jvm fanboyizm, you might actually say llvm. Is aparapi in any way better than llvm? Guess not as it uses llvm doesn't it? Oh look llvm itself actually uses a decent language, who would have thought? I wonder if they will ever have to rewrite a significant portion of the code in Java...

@freemo more like wrong tools for the wrong job if you ask me

@freemo Somehow my experience is the opposite. At certain complexity level you spend a lot more time optimizing with a garbage collected language, in the most backwards indirect ways, to get you application to acceptable level of performance, while with properly designd C you would usually only optimize to be exceptional, not acceptable. Overall of course having to care about memory management is harder than not having to care bout it. And sure it's not black and white, but overall philosophy, the ultimate goals and the history can be summarized as "don't want to care about memory management", or ok "I want to care less about memory management". The irony is that after a while you end up caring more, cause marginal slowdowns eventually add up.

@freemo I mean shagetti in terms of memory management specifically not anything else. That's the whole point of garbage collected languages, the whole philosophy, you want to forget a memory management is a thing and have some magic that takes care of it for you. How can you both forget the problem exists and also design a good solution for your specific application?

Can you sometimes get away with forgetting memory management is a thing? Sure. Other times you end up in a predicament, where you have to study the internals of the garbage collector and somehow someway get it to do some trivial thing you want, that it just won't do properly.

So yeah, with C you won't go very far writing code like that, with java you could, and you might get far enough for whatever purpose, but further you go, harder it'll be to untangle the mess.

@freemo Don't think my OP is a "thing people complain about in C's memory management". I believe most everyone are perfectly happy with not having to specify the size in free(), and that is philosophically in line with wanting increasingly more clever allocators and GCs.

Other than that the only difference is what you call "out of the box" I call "for the purposes of writing spaghetti code".

@iron_bug I get that you are furious at the 40x java peddling, but I want to get back to my point, that is if
> writing in C demands brains
why does C assume you don't have enough brains to keep track of allocation size?

@freemo

@freemo yes I'm saying that exact thing you said, has nothing to do with what I originally meant.

At the same time you try to present Java's memory management as something good, while I'm dunking on it, but that's kind of tangential.

@freemo you are comparing apples to oranges, malloc would be long done by the time java's vm boots and gets to do whatever new even means in that language. You only care about that single new vs single malloc, if you plan on spreading allocations all over the place without thinking of any kind of overall memory management strategy. Not my point at all.

@freemo there is no one true way to manage memory, java maybe faster at untangling the kind of spaghetti code java fanboys write, but that's not my point, I'm talking about inflexibility of malloc/free in context of optimization of whatever memory management one would want to design for particular purpose, and since it's at the interface level, if you want to do anything more clever you'll have wave goodby to any library code that allocates.

c: *bloats memory allocation with size information, cause stupid ass programmer can't keep track of a number*

stupid ass programmer: *still has to keep track of the size to be able to use the memory in any meaningful way*

@khird I only used the cli, can't jump out of a terminal... many belts and whistles in those gui?

@Firaas so you were just pretending to know c++ and what auto's for?

sure, fresh air, as in the crippling smell of rancid bloat.
qoto.org/web/statuses/10472254

@Firaas I take it your prefer
typename std::iterator_traits<typename std::remove_referece<It>::type>::value_type

ok in your closet maybe, but not in generic code cmon, not in a libraryyyyy ToT

Show thread

like you think you are making a backup or something? who would do that? cmon...

in general would you make a copy and hold on to it unless you want to modify it? why?

Show thread

would you write this
auto x = *it;
// modify it
if(error)
*it = x;

instead of this?
auto x = *it;
// modify x
if(ok)
*it = x;

me: noooo you can't just ignore deleted copy constructooor
: copy elision go brrrrrrrr

@twotwenty you might wanna go reread them then, unless you mean it's your religion

@twotwenty so clicking reply when you want to reply to someone is OCD? sure...

I take it you will never go back to the actual point, must be feeling so safe now, so far away. Maybe throw a couple of more insults, to help you finally forget any of this ever happend

Show more
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.