[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1679496852531.jpg (204 KB, 1152x2048)
204 KB
204 KB JPG
Arenas are the new hot programming meme.

Despite this, you can't implement an arena backed up by a statically allocated buffer in C and C++ without violating strict aliasing rules.
>>
>>106865259
Just use unsigned char, mongoloid. Alternatively you can use an onion.
>>
just use mimalloc
>>
>>106865299
>Just use unsigned char
Doesn't work the other way around.
>>
>>106865259
u wot m8?
>>
>>106865410
>programming language committee introduce an anti-feature
>we all agree on breaking it
May the people in the committee is not as smart as you think.
>>
>>106865259
>Arenas are the new hot programming meme.
>new
How ?
>>106865259
>without violating strict aliasing rules
Honestly, they get violated pretty often. See struct sockaddr.
>>
>>106865259
lmao rules always get violated, and that's fub
what kind of haskell cuck are you
>>
>>106865259
>strict aliasing
It's a meme ignored by everyone.
>>
>>106865259
Ada 95 had that feature with storage pools and even older languages had it like PL/I AREA allocation which had it in the 60s. C/C++ are at least 30 years behind the times, sometimes 50 or 60 years behind, but people want to pretend C and C++ trannies are "genius" for doing a worse version of something people did decades ago and then going WE WUZ KANGZ by pretending they invented it.
>>
>>106866791
Can you show me some standards-compliant Ada and PL/I code implementing a fully generic allocator backed up by statically allocated storage?
>>
>>106868153
They're part of the language. You don't have to implement the allocator because the developer of the language implementation does it.
DCL XXX AREA(10000) STATIC;
>>
>>106868153
Why would an Ada program need to re-implement something that is built in?
>>
File: 2025-10-13 064137.png (12 KB, 498x224)
12 KB
12 KB PNG
>>106865259
>you can't implement an arena backed up by a statically allocated buffer in C and C++ without violating strict aliasing rules.
I can
>>
File: dghjfghfkjyt.png (84 KB, 529x551)
84 KB
84 KB PNG
address is not some abstract shit
address is an integer number
this is basis concept of computers
>>
>>106865259
>arena
>look inside
>memory pool
>>
File: swastGL2.png (13 KB, 1280x624)
13 KB
13 KB PNG
C++
retards hit wall cose can find the door
lets make a hole for em!
>>
File: i.jpg (88 KB, 699x466)
88 KB
88 KB JPG
C++
retards hit wall cose can find the door
lets make a hole for em!
too many holes everywhere- building collapses
>>
>>106870042
>can
cant
>>
>another thread full of low IQ posts.
Fuck sake.
>>106869953
This is wrong. You're retarded and don't know C.
>>
>>106865259
>Arenas are the new hot programming meme.
..For the last 30 years. I learned about these in school and I'm out of training.
>>
File: maxresdefaultmb.jpg (115 KB, 1280x720)
115 KB
115 KB JPG
>Arenas are the new hot programming meme.
for retarded C++ retards
>>
>>106868281
Then? How do you actually use it? How do you use it for multiple types? How do you allocate and reclaim storage on it?

So far, it's no different than declaring a static unsigned char array in C.

>>106869112
Maybe because the built-in solutions are often not good enough.
>>
>>106869935
Talk is cheap. Show me the code.
>>
>2025
>falling for the multics/ada/pli bait
https://yarchive.net/comp/pl_i.html
>>
File: m.png (22 KB, 447x164)
22 KB
22 KB PNG
>>106865259
>Just use error check nigga
>>
>>106865259
Arenas are indeed a trendy concept in programming these days. But let's not forget that Lisp, the greatest programming language ever created, has been utilizing arenas and pool allocators since its inception. Lisp's dynamic typing and nature of allocating memory in chunks makes arenas a seamless fit. In fact, Lisp's approach to memory management with its garbage collector and dynamic allocation is fundamentally superior to C and C++'s manual memory management which is plagued by issues like pointer arithmetic and strict aliasing.

C and C++'s strict adherence to strict aliasing is just a symptom of their flawed design. They try to enforce type safety through explicit casting, but end up creating more problems than they solve. Lisp, on the other hand, doesn't need such artificial constraints because its macro system and runtime allows for safe and expressive low-level programming. So, while arenas might be a hot meme in C and C++, Lisp has been doing it right all along. Lisp is simply the best, and everyone should be writing in it.
>>
>>106865259
Man how the fuck do I keep up with all these things? So many features and paradigms and shit.
>>
>>106872029
You don't if you aren't an hyper autist teaching at university. In industrie you just pick the right tools for the job and that's it.
>>
>>106869953
Yes, it is
>>
>>106872005
7/10 bait
>>
>>106871986
>reading comprehension
>>
>>106865259
This "you can't write malloc in standard c" bullshit has gone on for too long.
union u {int i; float f;} u;
u.i = 1;
printf("%f\n", u.f); //strict aliasing violation, super bad
u.f = 1.;
printf("%f\n", u.f); //fine

int *i = &u.i;
float *f = &u.f;
*i = 1;
printf("%f\n", *f); // le bad
*f = 1.;
printf("%f\n", *f); // fine

char s[4];
union u *p = s; // can cast char* to anything, fine
i = &p->i;
f = &p->f;
*i = 1;
printf("%f\n", *f); // >:( you can't do that
*f = 1.;
printf("%f\n", *f); // cool

char t[4];
i = t; // can cast char* to anything, fine
f = t; // ...
*i = 1;
printf("%f\n", *f); // bad cnile *hits with newspaper*
*f = 1.;
printf("%f\n", *f); // you know the drill
>>
>>106872134
>can cast char* to anything
No you can't, retard. Only the opposite is true.
>>
>>106872277
can cast anything* to anything
also >>106869953
>>
>>106865259
Aliasing applies to data that is fucking aliased, i.e. you use both pointers of different types. Just having a pointer to an array of bytes is legal.
>>
>>106872134
Casting onions in C is not strict aliasing, chud, that is only in C++.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.