- Joined
- Oct 19, 2023
many compatibility concerns can be efficiently dealt with by assuming no rational person would ever attempt to use msvc as a compiler
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I'm finally starting to see people move from C99 to C11, so I guess I'll be able to use stdckdint.h sometime around 2040. How exciting!the future is now, old man, [[noreturn]] is in the standard!
(its only 30 years until its not a compatibility concern)
Don't bother with anything above visual c++ 6 (in a VM) if you're planning to go that low. My advice is to align your build tools to the minimum version of windows you are planning when it comes to pre XP/2000, otherwise you will just get utterly fucked. GUI wise you can use a very early and limited version of MFC or go the pure GDI route.What tools and programming languages can I use on a modern Windows machine to ensure that the program I write is compatible even with something as ancient as Windows 98? I don't have anything particular in mind (though being able to create a program with a proper GUI would definitively up the cool factor), I am just asking out of sheer curiosity. Any real-world examples would be appreciated.
This isn't the 1980s and the primary memory management model of malloc and free (which garbage collection is built around) shouldn't be used anymore, Rust is also built around RAII which is also based around the concept of automating malloc and free and is also bad.rust troons need to realize that garbage collection won't freeze their 2d pixel platformer for 5 seconds at a time because this isn't the 1980s and garbage collectors can go really fast now
Based and arenapilled.This isn't the 1980s and the primary memory management model of malloc and free (which garbage collection is built around) shouldn't be used anymore, Rust is also built around RAII which is also based around the concept of automating malloc and free and is also bad.
The garbage collector cannot understand your intentions and you can notice optimizations that it couldn't, this also isn't even just about processor speeds, if you don't have enough memory and go to allocate it and it isn't committed then you'll cause a page fault on the first write to each page and if you're using a garbage collector it'll probably try to delay committing memory as long as possible and freeing actively, which can also cause inconsistent performance because you don't know what the OS is doing or how busy it is. Freeing memory proactively is also what they generally try to do which means if you know you could reuse memory that generally won't happen, if you reach a bottleneck as well and you need to coerce the GC to perform better then good luck with that as well because they're usually designed to be invisible and give you very little control over them.
There's so many more things involved in garbage collection than just how fast processors can go, there's probably even more issues depending on how they manage GC in general which I honestly don't know that much about because I haven't looked into any of them in detail.
malloc and free (which garbage collection is built around) shouldn't be used anymore
RAII which is also based around the concept of automating malloc and free and is also bad.
Then how do you propose we should manage memory? Isblah blah blah GC bad blah blah blah
malloc
-and-forget what the kids call idiomatic now?alloca(), it's the ONLY SAFE memory management. Allocating bytes? Passing pointers? Psshh naw.Then how do you propose we should manage memory? Ismalloc
-and-forget what the kids call idiomatic now?
One sbrk() should be enough for anyone!Then how do you propose we should manage memory?
Each process should be allocated a 640k chunk (that ought to be enough for anyone), and it should be up to the programmer to remember where things go, just like the good old days...Then how do you propose we should manage memory?
Can't use-after-free if you never free!Ismalloc
-and-forget what the kids call idiomatic now?
I only program for RTOS and use static allocations, I cannot handle all that non determinismThe garbage collector cannot understand your intentions and you can notice optimizations that it couldn't, this also isn't even just about processor speeds, if you don't have enough memory and go to allocate it and it isn't committed then you'll cause a page fault on the first write to each page and if you're using a garbage collector it'll probably try to delay committing memory as long as possible and freeing actively, which can also cause inconsistent performance because you don't know what the OS is doing or how busy it is.
No one ever thought about it. Copying GCs? Nurseries? Nah, all bulshit.Freeing memory proactively is also what they generally try to do which means if you know you could reuse memory that generally won't happen, if you reach a bottleneck as well and you need to coerce the GC to perform better then good luck with that as well because they're usually designed to be invisible and give you very little control over them.
RAII is almost the best way to manage any resource, not only memory. Probably only Linear Types can beat it, but I would have to learn more about them to argue about it.This isn't the 1980s and the primary memory management model of malloc and free (which garbage collection is built around) shouldn't be used anymore, Rust is also built around RAII which is also based around the concept of automating malloc and free and is also bad.
I mentioned retards who think malloc/free are foundational about a month ago in this thread but didn't expect to see a literal example so soon. Nigger, almost no GC is built around malloc/free.This isn't the 1980s and the primary memory management model of malloc and free (which garbage collection is built around) shouldn't be used anymore, Rust is also built around RAII which is also based around the concept of automating malloc and free and is also bad.
Divine providence. Inshallah may it run ﷽.Then how do you propose we should manage memory?
A lot of my time spent, back when I was learning how to program initially, was on learning Java; and as someone who spent most of their time programming in java and python, I always liked how I could split off a class and its constituent methods into a file if I felt it got too big for the first file or whatnot. Does C have something similar? I know it has header files, but I don't think those are quite the same...
I can't believe I've never read about this, it would be ideal for the temporary string buffers you often see popping upalloca(), it's the ONLY SAFE memory management. Allocating bytes? Passing pointers? Psshh naw.
There's a lot you can do. Header files just contain prototypes to code implemented elsewhere. You split your functions into files according to whatever taxonomy. There's a bit of boilerplate to write, function prototypes in header files, but it's trivial. You could, in theory, even #include every code file in one, and build exactly one file. Combined with the preprocessor, there is a LOT of fun potential for HACKS. C can do modularization in ways Java can't, on the basis of its preprocessor macros.I always liked how I could split off a class and its constituent methods into a file if I felt it got too big for the first file or whatnot. Does C have something similar? I know it has header files, but I don't think those are quite the same...
#define OBJ(object,method,...) (*object)->method(object,##__VA_ARGS__)