/dpt/ - Daily Programming Thread - /g/ (#105530074) [Archived: 1056 hours ago]

Anonymous
6/8/2025, 10:14:42 PM No.105530074
1358677227600
1358677227600
md5: 93a38ff49db8425a9ebef30daf64a65e๐Ÿ”
What are you working on, /g/?

Previous thread: >>105515327
Replies: >>105532885 >>105533809 >>105545055 >>105545515 >>105550383 >>105550724 >>105551714 >>105553269 >>105557660 >>105557685 >>105564075
Anonymous
6/8/2025, 10:20:57 PM No.105530141
final_verdict
final_verdict
md5: fb3d9d8ada81b1d18fd039c56054f475๐Ÿ”
Threadly reminder.
Replies: >>105530875 >>105530990
Anonymous
6/8/2025, 10:23:23 PM No.105530169
>>105527765
>All code is singlethreaded.
Oooh, a swing and a miss. At least in general.
Realtime code sees your assertion and chuckles mirthlessly. Things are more complicated than you think.
Anonymous
6/8/2025, 10:25:11 PM No.105530187
a_thumb.jpg
a_thumb.jpg
md5: 42ee513f595f8a38d081f0ea081e9925๐Ÿ”
bringing graphemes to readline
Replies: >>105530211
Anonymous
6/8/2025, 10:27:46 PM No.105530211
>>105530187
what's the point?
Replies: >>105530233
Anonymous
6/8/2025, 10:30:21 PM No.105530233
>>105530211
perfect grapheme handling. readline has trouble with zwj sequences. my library adapts based on how your terminal internally handles grapheme clusters. Under two terminals different sequences will render differently, so this lets me support all rendering.

it would be way easier in a program that manages the entire terminal screen (raw mode all the way like vim or nano), but readline has to handle running in canonical echo mode then back to raw mode which makes things way more complex. also this code doesn't use any library, the clustering uses heuristics.
Anonymous
6/8/2025, 11:38:54 PM No.105530875
>>105530141
this will be another good thread with insightful discussions about programming
Anonymous
6/8/2025, 11:41:46 PM No.105530898
i wish /prog/ was still a thing
Replies: >>105541115 >>105541277
Anonymous
6/8/2025, 11:53:08 PM No.105530990
>>105530141
Needing unsafe crates doesn't mean it doesn't have hugepage support
https://youtu.be/rTo2u13lVcQ?si=teJZ_pG9MB1tmAGd

You should at least adjust that particular point
Replies: >>105531134
Anonymous
6/9/2025, 12:02:55 AM No.105531076
Criminal_Scum_Toilet
Criminal_Scum_Toilet
md5: aaa0c92a753ad713673ea23f67acfc79๐Ÿ”
Let's say hypothetically I wanted users to financially support me.
Do I set up a Pateron or a Ko-Fi?
Replies: >>105531085
Anonymous
6/9/2025, 12:03:50 AM No.105531085
>>105531076
Ko-Fi or Buymeacoffee
Patreon takes a bigger cut, and is more averse to wrong thinkers
Anonymous
6/9/2025, 12:09:29 AM No.105531134
rust_hp
rust_hp
md5: f6cad3cd38377c0bd779a59732c2e311๐Ÿ”
>>105530990
It's not just the initial allocation part though - how do you *use* them? What about dropping, dereffing, and so forth? Doesn't it just end up being a worse version than the equivalent C code?
Replies: >>105531219
Anonymous
6/9/2025, 12:18:17 AM No.105531219
>>105531134
Yes, you need 'unsafe' to use them. But that does not imply that you *can't* do that in Rust. We are not talking about a language that straight up rejects any way of doing that in its functionality
Replies: >>105531239
Anonymous
6/9/2025, 12:21:41 AM No.105531239
final_verdict_2
final_verdict_2
md5: 299b028b008ae07bb2e9a5b871d3200e๐Ÿ”
>>105531219
Alright, fine.
Replies: >>105531248 >>105539379 >>105568693
Anonymous
6/9/2025, 12:22:31 AM No.105531248
>>105531239
>made mmap schizo edit his image
That's a victory if I've seen one
this day has been greatly improved
Replies: >>105531442
Anonymous
6/9/2025, 12:45:50 AM No.105531442
>>105531248
>he's never seen the first file mapping primer
Anonymous
6/9/2025, 1:20:32 AM No.105531685
how do I write a HAL?
Replies: >>105531784 >>105533623 >>105545946
Anonymous
6/9/2025, 1:31:31 AM No.105531784
>>105531685
Step 1: asking yourself what a HAL does.
Step 2: asking yourself how a HAL helps you in whatever you want to achieve.
Anonymous
6/9/2025, 1:32:49 AM No.105531801
1713147790044609
1713147790044609
md5: 7f7006a5c68ff2a7d7a03af064b03a99๐Ÿ”
what are some kewl projects I can make in python?

>t. nublet
Replies: >>105531826 >>105538952 >>105541188
Anonymous
6/9/2025, 1:35:31 AM No.105531826
>>105531801
>kewl
>python
Choose one.
Replies: >>105540948
Anonymous
6/9/2025, 2:03:26 AM No.105531998
Is vim really worth learning? Is there a good reason to go from vscode to neovim?
Replies: >>105532008 >>105532179
Anonymous
6/9/2025, 2:05:43 AM No.105532008
>>105531998
There's no reason. Try out the vim plugin for vscode if you want to really try it.
Anonymous
6/9/2025, 2:08:20 AM No.105532023
Gonna try making an emulator. Should I:
>make a Gameboy emulator
>make a GBA emulator
>make a DS emulator
>make a PS1 emulator
>make an 80x86 emulator
Replies: >>105532050 >>105532102 >>105534459
Anonymous
6/9/2025, 2:12:19 AM No.105532050
>>105532023
Why bother? You cannot faithfully create the memory layout of any system on either Windows or Linux because their shitcode doesn't like NULL.
Anonymous
6/9/2025, 2:21:09 AM No.105532102
>>105532023
how about an Atari 2600/5200 emulator?
Anonymous
6/9/2025, 2:22:16 AM No.105532109
i don't know what to code
some of my personal projects:
BMP to ASCII image converter
rudimentary raycaster using raylib
rendering a 3d spinning cube using sdl3
was making a chip 8 interpreter but lost interest.
was working on a tic tac toe game that supports mp via sockets but i also lost interest (making the game itself is ezpz, now the networking part is kinda "hard").

any fun recommendations that would level up my skills and teach me important concepts?
Done these in C except the raycaster (used c++)
Replies: >>105532127 >>105532199 >>105532215
Anonymous
6/9/2025, 2:25:10 AM No.105532127
>>105532109
Syscall tracer.
Anonymous
6/9/2025, 2:29:23 AM No.105532151
Is a monoid im the category of endofunctors in the field of sublinear optical programming?
Anonymous
6/9/2025, 2:32:43 AM No.105532179
>>105531998
There's no reason to switch other than preferring keyboard navigation and maybe using other tools that use vim style keybinds. Personally I find it comfortable but your mileage may vary.
Anonymous
6/9/2025, 2:34:35 AM No.105532199
>>105532109
>rendering a 3d spinning cube using sdl3
next step is importing an obj file
then after that importing a skinned mesh from a gltf file
Anonymous
6/9/2025, 2:36:34 AM No.105532215
>>105532109
a boxing/packing program where you give it some objects with their 3D dimensions and it'll try to calculate what boxes (or other arbitrary volumetric containers) and how many of them you would need to fit all the stuff in
Anonymous
6/9/2025, 2:37:46 AM No.105532225
oh, and visualize the objects and the boxes they're in, in 3D
vibe
6/9/2025, 4:18:11 AM No.105532885
ui_king_tkinter
ui_king_tkinter
md5: ffb94adbde79b1df1fdd1a58835bbe3d๐Ÿ”
>>105530074 (OP)
did vibe coding and gemini free + tkinter fucking works
Replies: >>105533733
Anonymous
6/9/2025, 6:23:59 AM No.105533623
>>105531685
Here's how you create a HAL.

1. Create a physics simulation environment. You could theoretically do this in Unity.
2. Create a scaled version of our solar system. Include algorithmic placement of asteroids and such. Be sure larger planetary objects have simulated gravitational pull, light emission from the sun is accurate and casts shadows, and try to make the orbits semi-accurate.
3. Now that you have a programmatic simulation environment of space, it is time to construct a virtualized space vessel. You will need to meticulously ensure all mechanical and electrical systems can be partially or wholly integrated with an API external to the simulation environment. This means the Api should provide full remote control of the ship, such as the ability to navigate the thrusters, adjust power levels, read sensor data, ect. It cannot be understated how important fully integrating every little aspect of the ship into an API is. Hell, there should be a cockpit even with a 'camera' that cac have its current view accessed via a GET and displayed as an image.
4. Now that you have painstakingly created a space physics simulator with a scaled down version of our solar system, and a space vessel with every sensor and electromechanical feature integrated into the Api, you must now begin a very long journey of training a multi-modal agent to operate the vessel. You will have to integrate all the Api data feeds into it and give it proper training and directive. This could take a while. Ideally you would give it a higher level prompt, run multiple parallel instances, then manually rate the trials and use the results as training data.

Good luck!
Replies: >>105545889
Anonymous
6/9/2025, 6:47:25 AM No.105533733
>>105532885
>vibe coding
hobby board
post it on hackernews where people might care
Anonymous
6/9/2025, 6:59:17 AM No.105533795
i don't want to be the bajillionth guy asking about vim but is it really worth it to learn it? does coding faster really matter?
Replies: >>105533815 >>105533823 >>105534606
Anonymous
6/9/2025, 7:01:49 AM No.105533809
1746475273497452
1746475273497452
md5: 0bc09af08cd15a3961b3d3fcd4d35d8b๐Ÿ”
>>105530074 (OP)
So it's my understanding that returning pointers to local variables in C is UB. However when using Vulkan I've encountered this pattern:

VkShaderModule create_shader(
VkDevice device,
const std::vector<char>& shader_code)
{
VkShaderModuleCreateInfo create_info {};
create_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
create_info.codeSize = shader_code.size();
create_info.pCode = static_cast<const uint32_t*>(
static_cast<const void*>(shader_code.data()));

VkShaderModule shader_module {};
auto rv = vkCreateShaderModule(device,
&create_info,
nullptr,
&shader_module);
if (rv != VK_SUCCESS)
{
throw std::runtime_error("Failed to create shader module");
}

return shader_module;
}


Where VkShaderModule is a typedef struct VkShaderModule_T* VkShaderModule;

Why exactly does this work? Is it because the memory for VkShaderModule lives somewhere else? I'm not clear on this.
Replies: >>105533823 >>105533853 >>105533878 >>105533882 >>105534386 >>105534404 >>105545087 >>105545094
Anonymous
6/9/2025, 7:02:40 AM No.105533815
>>105533795
there's nothing to really learn if you're using it on a basic level. is it "worth it" probably not if youre never going to ssh / work on servers.
Anonymous
6/9/2025, 7:05:47 AM No.105533823
>>105533809
It works because vkCreateShaderModule returns a VkShaderModule a.k.a. a VkShaderModule_T*. It's the address to a structure that (most likely) points to the heap.

>>105533795
You won't know till you try.
Anonymous
6/9/2025, 7:13:39 AM No.105533853
>>105533809
Also
>std::vector<char>& shader_code
Imagine storing a copy of your shader code in a vector when you could be using a file mapping instead.
Replies: >>105552927
Anonymous
6/9/2025, 7:18:02 AM No.105533878
>>105533809
It's only UB when returned to something outside of it's stack scope, ie a function. This is a handle to something somewhere else in memory outside of your program.
Anonymous
6/9/2025, 7:18:49 AM No.105533882
>>105533809
it's not a local pointer it's a typedef of a pointer to an opaque struct which is the typical and easy way of doing a handle
the point is you don't and can't know where the memory for it is, and because of layers you can't even necessarily control or predict that either since layers can dynamically dispatch of object handles]
i've done it before but strictly speaking even if you know what you're doing and are drilling down into the real object structure from the underlying driver i don't think it's necessarily safe
Replies: >>105533904
Anonymous
6/9/2025, 7:24:16 AM No.105533904
>>105533882
and by safe i mean safe according to vulkan
i don't think there's any guarantees that the current loader behavior is stable or that the current behavior will even ever actually give you a real object handle at some point
Anonymous
6/9/2025, 7:33:48 AM No.105533962
>/dpt/ can explain why the local pointer to heap memory can be safely returned
>/dpt/ can't explain how to make a HAL
Replies: >>105545889
Anonymous
6/9/2025, 9:14:04 AM No.105534386
>>105533809
It returns the pointer by copy, simply copying the address. Address is somewhere on the heap, allocated by vkCreateShaderModule.
Anonymous
6/9/2025, 9:17:23 AM No.105534404
>>105533809
int* ub()
{
int a;
int *ap = &a;
return ap;
}

int* not_ub()
{
int *ap = new int;
return ap;
}
Anonymous
6/9/2025, 9:27:23 AM No.105534459
>>105532023
Why not work on a "piss easy" system like the ZX Spectrum and give it a niche feature not many over emulators have like:
>lua scripting and texture pack support (Mesen)
>transistor-level accuracy (MetalNES)
>static recompilation support (surprised nobody has tried this for an older system, wouldn't be too hard to get an entire system library running natively)
Replies: >>105534490 >>105549336
Anonymous
6/9/2025, 9:32:25 AM No.105534490
>>105534459
>lua
So has their memory management gotten ANY better? Because last time I checked "clusterfuck" would be selling it short.
Anonymous
6/9/2025, 9:54:55 AM No.105534606
>>105533795
it takes like 1-2 days to get familiar with it, just try it
Anonymous
6/9/2025, 10:55:33 AM No.105534880
file
file
md5: eff362fda8a7c06c1173aef29eda339e๐Ÿ”
why is this code passing in a double pointer to allocate on instead of just a single pointer?
Replies: >>105534956 >>105535176 >>105535522 >>105564168
Anonymous
6/9/2025, 11:07:17 AM No.105534956
>>105534880
Learn the fucking language or stop doing whatever it is you're doing. Your call.
Replies: >>105534994
Anonymous
6/9/2025, 11:14:32 AM No.105534994
BTl2M6elggmb5CNEh18vJ1sCGB91q56cqwoyQtPPPa0Etxr1YBpIrbHfwnyzzeKPqa15bBNVrbgykgs640-rw-nd-v1
>>105534956
Anonymous
6/9/2025, 11:51:52 AM No.105535176
>>105534880
the parameter is also the return value
Anonymous
6/9/2025, 12:42:58 PM No.105535522
>>105534880
>why is this code passing in a double pointer to allocate on
Because that code is shit.
Replies: >>105543174
Anonymous
6/9/2025, 1:19:10 PM No.105535774
If I publish an app, is my shit visible to people? Name, email etc
Replies: >>105535850 >>105535881
Anonymous
6/9/2025, 1:33:10 PM No.105535850
>>105535774
yes, play store is pretty strict with their review process.
Not sure about f-droid.
You can also just distribute the .apk yourself.
Replies: >>105535932
Anonymous
6/9/2025, 1:40:50 PM No.105535881
>>105535774
define publish and define app
app as in application or app as in mobileshit?
publish as in upload publicly or publish as in distribute through a third party vendor's store?

last i looked into it the google play store basically requires you either set up a corporation or dox yourself now and i don't think you can just use a PO box anymore either
i believe that info is public
though alternative app stores and package repositories are a thing on android a fair amount are FOSS/freeware oriented
not sure if apple is any better, doubt it

i don't think steam, gog, or epic require that though so i think game distribution is safe
microsoft authenticode certificates for making signed binaries for windows (and thus for things like publishing actually installable appx packages from the windows store) are costly and i think you do have to provide docs to CAs that issue them
i do not know if you can get ask for them without embedded personal info or at least with embedded personal info not linked to a real world identity
Replies: >>105535893 >>105535932
Anonymous
6/9/2025, 1:43:56 PM No.105535893
>>105535881
mobile shit on google and ios
Anonymous
6/9/2025, 1:50:14 PM No.105535932
>>105535850
>>105535881
Well it's natural if Google/Apple knows who I am, but I mean if that info ends up being visible to other people. Users and what not.
Replies: >>105536040
Anonymous
6/9/2025, 2:11:27 PM No.105536040
vlc_play_store
vlc_play_store
md5: 55ea1981036b2285cb6e71f4e2c6eb50๐Ÿ”
>>105535932
by dox yourself i didn't just mean to google, google publishes it in the app's store page and they don't let you use a PO box anymore, which you used to be able to
this is VLC for android's app page, all that is required

if google does something developer unfriendly the safest assumption is always assume apple is 100% worse but i don't actually know
it's really not worth caring about anything apple as a platform as a small/independent developer
Replies: >>105536053
Anonymous
6/9/2025, 2:13:57 PM No.105536053
>>105536040
wtf this is fucking grim
why is this even necessary
Replies: >>105536084 >>105542886
Anonymous
6/9/2025, 2:20:31 PM No.105536084
>>105536053
What's the alternative? Some Russian or Chinese provider? Lmao.
Replies: >>105536560 >>105542958
Anonymous
6/9/2025, 3:26:26 PM No.105536459
1747324901226868
1747324901226868
md5: bfbf7dcab9228220b55bce21904045af๐Ÿ”
Three and a half more hours spent burning brain cells in SICP today. Today's section was on time/space complexity and a lot of really dull theta(n) analysis. I've always just handwaved this stuff away, so it's probably (maybe?) good that I've got a better handle on it now. At the very least, I understand better how an idealized machine handles deferred calls with respect to pushing/reusing stack frames. None of this stuff is intuitively all that difficult to grasp since it's pretty obvious when a process is going to blow up or not, but hopefully the ability to more formally reason with more granular differences (e.g. O(log n) versus O(n)) will be helpful as I continue on the journey.

Thanks for reading my blogpost
Anonymous
6/9/2025, 3:32:39 PM No.105536498
First time programming in half a year. Making a link aggregator in PHP and Postgres, no JavaScript planned yet. Took two hours just to study PostgreSQL documentation to come up with three table layouts. I'm hella washed up.
Anonymous
6/9/2025, 3:41:49 PM No.105536560
>>105536084
christ
does adsense dox you too?
Anonymous
6/9/2025, 6:24:50 PM No.105537954
1748444893402284
1748444893402284
md5: e3179b78e34c34f637d20747dc8ef70b๐Ÿ”
I am forgotten
Anonymous
6/9/2025, 7:07:09 PM No.105538504
Hmmm today I will write some Rust
Replies: >>105538964
Anonymous
6/9/2025, 7:22:19 PM No.105538875
nig
nig
md5: ed7962c2f1ddefc6ea758a0615ce254f๐Ÿ”
that's it. this is what I am up to. the retardation.
on bottom the good ol implementation, which sucks, cuz it uses static arrays, which makes this shit stack allocated, it could be wrapped inside box, but still the stack can be fucked up if size is too big.
on top is nu implementation, which now allows to use dynamic arrays (vec), but shit looks horrendous, I am too retarded to do it right.
I've also came up with a new idea: using slices, which will imply that lifetimes are stored somewhere and all shit is just representation, but then it kinda breaks the whole point of static operation checking, even though it will be the same shit as vec rn, which still uses const type parameters but they can be left out, as they are not inferred as with arrays
Replies: >>105538919 >>105539046 >>105539049 >>105554660
Anonymous
6/9/2025, 7:24:14 PM No.105538919
>>105538875
in Haksell this is just sequence
Replies: >>105539254
Anonymous
6/9/2025, 7:25:23 PM No.105538952
1749346504579635
1749346504579635
md5: e42aeac87f8149b01bee0db3db095cfa๐Ÿ”
>>105531801
bump
Replies: >>105540948 >>105541030 >>105542096
Anonymous
6/9/2025, 7:25:47 PM No.105538964
a5fe40d647cd9ef3
a5fe40d647cd9ef3
md5: c81c6314d642791c8df074bbe85b1203๐Ÿ”
>>105538504
Leaked pic of anon later today
Replies: >>105540083
Anonymous
6/9/2025, 7:28:52 PM No.105539046
>>105538875
also names are kinda random the builder is not the builder pattern or whatever just shit that returns matrix.
allocator trait is not really an allocator just shit that provides some kind of memory representation so an array (static | dynamic)
and types A and B don't actually need IndexMut trait bound just Index, but cuz it's not the only trait, I just copy-paste where clause
Anonymous
6/9/2025, 7:29:02 PM No.105539049
>>105538875
Will you admit defeat and come back to C?
Or will you resist, learn nothing, and write angry posts on a Mongolian basket-weaving forum?
Replies: >>105539219
Anonymous
6/9/2025, 7:36:21 PM No.105539219
>>105539049
wut? there is no way to do shit like this in C, the whole idea is to check operations at compile time, so for example matrix multiplication is checked at compile time since the output type is MxK and left matrix is MxN and the right matrix is NxK there is no runtime check and all other matrix dimensions should fail at compile time.
Replies: >>105539254 >>105539287
Anonymous
6/9/2025, 7:37:23 PM No.105539254
>>105539219
does rust have HKTs and HRTs (no not that kind of HRT) if so you could implement traversable >>105538919
Anonymous
6/9/2025, 7:38:25 PM No.105539287
>>105539219
>the whole idea is to check operations at compile time
Yeah, sounds useless.
Replies: >>105539356
Anonymous
6/9/2025, 7:41:10 PM No.105539356
>>105539287
Why would he go back to C instead of just not doing it? That's like telling someone who lives in the US and doesn't like burgers that he should go live in Africa instead of just eating something else. Kek
Replies: >>105539379
Anonymous
6/9/2025, 7:42:25 PM No.105539379
>>105539356
Sanity.
>>105531239
Anonymous
6/9/2025, 8:01:49 PM No.105539938
>Android Studio system requirements
>32 GB RAM recommended
>GPU with 8GB VRAM recommended
Fucking bastards
Anonymous
6/9/2025, 8:06:29 PM No.105540083
>>105538964
Indeed it kind of fucking sucks. But I'm kind of getting the hang of it.
Anonymous
6/9/2025, 8:47:00 PM No.105540948
>>105538952
>>105531826
Anonymous
6/9/2025, 8:54:23 PM No.105541030
>>105538952
Python is a shit language for niggers, you should learn literally anything else, I guess Go is an ok starter language, or Rust if you're trans. Anyway, as a beginner project you can do something like drawing some kind of pattern or image on the terminal or in a bitmap image.
Anonymous
6/9/2025, 9:03:01 PM No.105541115
>>105530898
I wasn't there, how was it different?
Anonymous
6/9/2025, 9:10:18 PM No.105541188
>>105531801
Idk, do CLI stuff.
(I'm assuming you're a beginner here).
Connect to a database and retrieve/push values for starters. Start stretching those programming muscles first
Anonymous
6/9/2025, 9:21:30 PM No.105541277
>>105530898
>>>/mu/prog
Replies: >>105541291
Anonymous
6/9/2025, 9:23:20 PM No.105541291
>>105541277
kek
Anonymous
6/9/2025, 9:29:49 PM No.105541350
Practicing some recursion and then I may do a hello world with sneed7
Replies: >>105542022
Anonymous
6/9/2025, 10:13:40 PM No.105541787
1734047013567788
1734047013567788
md5: 53695357d6d9392581c4bf695d66d0cf๐Ÿ”
>"Please consult our API documentation to learn how to use this library."
>alphabetical listing of 5000 functions and types
>all descriptions are 1 sentence max
AAAHHHHHHHHHHHHHH
Replies: >>105541838 >>105541926
Anonymous
6/9/2025, 10:17:17 PM No.105541838
>>105541787
Typical pajeet project.
Just don't waste your life on it.
Anonymous
6/9/2025, 10:17:53 PM No.105541844
1610945629397
1610945629397
md5: 007e7ca7cd855642b6c8e47b36304122๐Ÿ”
My personal project's API now requires a lot of w*bshit and it's pure suffering.
Anonymous
6/9/2025, 10:24:07 PM No.105541926
1693157055003297
1693157055003297
md5: c721ad315082f6147b48377d32055ba0๐Ÿ”
>>105541787
It's self-documenting
Anonymous
6/9/2025, 10:33:49 PM No.105542022
>>105541350
#include <stdio.h>

void rec(char** s)
{
if (!**s)
return;
putchar(*(*s)++ - 1);
rec(s);
}

int main(int argc, char** argv)
{
char* msg = "gbhhpu";
rec(&msg);
return 0;
}
Replies: >>105542085
Anonymous
6/9/2025, 10:40:30 PM No.105542085
>>105542022
Christ.

#include <stdio.h>

void rec(char* s)
{
if (!*s)
return;
putchar(*s - 1);
rec(++s);
}

int main(void)
{
char* msg = "gbhhpu";
rec(msg);
return 0;
}


Dereferencing ain't cheap.
Replies: >>105542173 >>105542483
Anonymous
6/9/2025, 10:41:20 PM No.105542096
>>105538952
Make a Discord bot
Anonymous
6/9/2025, 10:49:01 PM No.105542173
>>105542085
why are you clowns accessing the byte before the start of the buffer?
Replies: >>105542190 >>105542191 >>105542448
Anonymous
6/9/2025, 10:50:54 PM No.105542190
>>105542173
they're not, it's (*x) - 1 not *(x - 1), its like a cipher
Anonymous
6/9/2025, 10:51:11 PM No.105542191
>>105542173
>what is operator precedence for 1000
Anonymous
6/9/2025, 11:18:11 PM No.105542448
1733019563317256
1733019563317256
md5: 4b43610a6217c5da8f9ccbf8a885d00b๐Ÿ”
>>105542173
Anonymous
6/9/2025, 11:21:53 PM No.105542483
>>105542085
>autism
Imagine if you could use your brain normally
Replies: >>105542554
Anonymous
6/9/2025, 11:28:14 PM No.105542554
>>105542483
Why are you talking about things you've never done?
Replies: >>105542569
Anonymous
6/9/2025, 11:29:31 PM No.105542569
>>105542554
>no u
Anonymous
6/9/2025, 11:31:48 PM No.105542582
1695103297257113
1695103297257113
md5: 682f55b8f3bf5b74c8a758176a144dbc๐Ÿ”
Yes.
Replies: >>105542808
Anonymous
6/9/2025, 11:52:54 PM No.105542808
>>105542582
yes u
Anonymous
6/10/2025, 12:00:21 AM No.105542886
>>105536053
>why is this even necessary
Because lying asshats otherwise shit the place up. To keep a lid on that, the big app stores require the software to be signed with real identities. Mostly people use corporate identities because it's convenient to keep the money side separate from personal accounts.
If you're not going through an app store, you don't need to follow any of those rules.
Replies: >>105546052
Anonymous
6/10/2025, 12:02:17 AM No.105542905
1695103297257114
1695103297257114
md5: f224af0eb31a01e30cbd3fd43f232b27๐Ÿ”
no u
Anonymous
6/10/2025, 12:08:53 AM No.105542958
>>105536084
jannies vetting and packaging everything like god intended.
Anonymous
6/10/2025, 12:41:23 AM No.105543174
>>105535522
the worst part is it's c++, not c
Anonymous
6/10/2025, 4:09:33 AM No.105544624
GopherG6 image board
Anonymous
6/10/2025, 4:29:41 AM No.105544759
So how far are you with your registry dumpers?
Anonymous
6/10/2025, 5:11:34 AM No.105545055
>>105530074 (OP)
Is it true modern compilers compile steganographic or encrypted EXIF data into your programs that you make? Ones that intelligence communities can trace back to your computer's unique MAC address?
Replies: >>105545098 >>105545419
Anonymous
6/10/2025, 5:14:55 AM No.105545083
Has anyone ever made a desktop environment with nurses?
What would be the implication?
Anonymous
6/10/2025, 5:15:31 AM No.105545087
>>105533809
What is UB?
Replies: >>105545098 >>105545457 >>105545507
Anonymous
6/10/2025, 5:16:34 AM No.105545094
>>105533809
Is this C++?
Anonymous
6/10/2025, 5:16:54 AM No.105545098
>>105545055
You mean this?
https://github.com/RichHeaderResearch/RichPE

>>105545087
Undefined behavior.
Anonymous
6/10/2025, 6:05:12 AM No.105545419
>>105545055
no
they do embed a history of the binutils used on them, which i think gcc usually strips out, which has been used exactly once to track down a malware dev who used odd combinations of versions of legacy and modern tools, on account of being a dumbfuck retrocoder, in both malware and software that was associated with his public identity, and that's it


that is such a retarded schizo view of how surveillance works lmao
and all shit can spoof mac addresses these days anyway, mobile devices even do it by default
Anonymous
6/10/2025, 6:09:44 AM No.105545457
>>105545087
Ultra beasts
Anonymous
6/10/2025, 6:16:39 AM No.105545507
>>105545087
Utterly Based.
Anonymous
6/10/2025, 6:19:01 AM No.105545515
>>105530074 (OP)
Lately, I've been wanting to model my programs as a pure data pipeline
Instead of the following syntax, which looks dead simple (albeit ugly, and the reverse to how one would expect the data pipeline to be read):
result = c(b(a(argument)));

I've been thinking of using a function which executes the arguments in it to make the program syntactically tacit, sort of like so. Note: all function signatures are the same:
execute_fns(&result, &argument, a, b, c);

Now, can the compiler see my intent to represent the programs as merely a series of transformations (and optimize accordingly), or is there something about variadic arguments that prevents any optimization?
Replies: >>105545585 >>105545637
Anonymous
6/10/2025, 6:29:58 AM No.105545585
>>105545515
Function calls that exceed the amount of registers the ABI allocates for parameters (4 on Windows, 6 on Linux): bad, because the parameters end up on the stack.

Variadic argument lists: bad, because the spillover parameters will end up on the stack.

Providing function pointers: bad, because the compiler is much less likely to inline the functions (especially across translation units) to improve out-of-order execution. Also compilers are terrible at estimating call depths and will rather generate a CALL/RET pair than a LEA return + JMP target + JMP return combination even though that would improve out-of-order execution (because CALL/RET use the SP register implicitly) without increasing code size.

Oh, and compilers also suck at retaining values in registers. When the ABI says "volatile" they really do mean "volatile", even if the register could act as return value.
Replies: >>105545642 >>105545760 >>105546940 >>105550350
Anonymous
6/10/2025, 6:37:00 AM No.105545637
>>105545515
just overload operator<< bro
Anonymous
6/10/2025, 6:37:35 AM No.105545642
>>105545585
In contrast using a
c(b(a(argument)))

is relatively straightforward, even if the compiler ends up not inlining the thing. After every call the compiler can just rename the return to the first parameter register:
CALL a
MOV rcx,rax
CALL b
MOV rcx,rax
CALL c
Anonymous
6/10/2025, 6:54:45 AM No.105545760
>>105545585
This sucks. I expected modern compilers to not be limited by such restrictions.

Anyway, time to present my next terrible idea: dropping down to assembly to use direct threaded code, as presented by Jonesforth.
TLDR: If my program can be represented as a flat array of calls to functions, the opcode to call a function (0xE8, iirc) can be omitted and replaced by the following two lines, provided that esi is pointing to the first member of the function pointer array itself:
lodsl
jmp *(%eax)

For an elaboration, see https://github.com/AlexandreAbreu/jonesforth/blob/master/jonesforth.S#L227
Replies: >>105546114
Anonymous
6/10/2025, 6:56:06 AM No.105545768
>c99
>_Bool
why the fuck does this stupid shit exist. do boomers really.
Anonymous
6/10/2025, 6:59:30 AM No.105545795
Anons, I need to make a fillable form that can be put on a self-hosted website. I have very little time to do this, about 9 hours and I need to sleep during that. My only coding experience is from khan academy JS exercises. This tutorial here seems to cover everything that I need: https://www.youtube.com/watch?v=fNcJuPIZ2WE

But I'm on Linux Mint, and I don't know if I can download Visual Studio and get it set up on time. What programming tool/environment should I use?
Replies: >>105545846 >>105546251
Anonymous
6/10/2025, 7:05:44 AM No.105545846
>>105545795
I'm assuming this is a class assignment? No one with a brain would put someone with no experience in charge of user input.

Just use Kate or Sublime Text or something. They have guis and already have syntax highlighting.
Replies: >>105546155 >>105556843
Anonymous
6/10/2025, 7:12:41 AM No.105545889
1730563471367653
1730563471367653
md5: 41924f271fec1812c487d0a0d1e059cb๐Ÿ”
>>105533962
>/dpt/ can't explain how to make a HAL
Now hold the fuck on
Tell me why >>105533623 was somehow not a valid explanation of how to make a HAL
You could literally train a multi modal agent to operate space vessel I/O

If serious money was put into this, as in an excellent simulation environment and thorough training data, you might actually end up with a model literal space agencies would take interest in for long term deep exploration missions or other planetary ventures
Replies: >>105545905 >>105549251
Anonymous
6/10/2025, 7:14:54 AM No.105545905
>>105545889
Hardware Abstraction Layer, anon, not whatever you've cooked up...
Replies: >>105545919
Anonymous
6/10/2025, 7:16:54 AM No.105545919
OIP-1413117893.FZXiMWw1g8VtSr0HzYJD7AHaEV
OIP-1413117893.FZXiMWw1g8VtSr0HzYJD7AHaEV
md5: bc9f0ac1f15554289210368e0f922edf๐Ÿ”
>>105545905
I rest my case then.
Anonymous
6/10/2025, 7:20:50 AM No.105545946
>>105531685
structs and function pointers
Anonymous
6/10/2025, 7:39:13 AM No.105546052
>>105542886
>Because lying asshats otherwise shit the place up.
In other words, it's because of indians. Again.
>If you're not going through an app store, you don't need to follow any of those rules.
If I'm not going through an app store, I won't make a dime.
Anonymous
6/10/2025, 7:50:46 AM No.105546114
>>105545760
>I expected modern compilers to not be limited by such restrictions.
Modern compilers become virtually blind once you remove inlining. Fuck, they can't even do partial inlining; see https://en.wikipedia.org/wiki/Loop-invariant_code_motion

>provided that esi is pointing to the first member of the function pointer array
You're confusing CALL and JMP. CALL pushes the instruction pointer to the stack for RET to retrieve and then jumps to the target, JMP jumps directly without leaving any return information on the stack.

But hey, maybe you're luckily and the CPU will prefetch the addresses into internal registers early enough that L1 latency doesn't occur.
Replies: >>105546260
Anonymous
6/10/2025, 7:58:14 AM No.105546155
>>105545846
Nope, for a voluntary organization. I'll check those out, thanks anon.
Anonymous
6/10/2025, 8:17:35 AM No.105546251
>>105545795
Have you considered giving up? You're clearly not up to the task. Sometimes all one can aspire to in life is shoveling shit.
Anonymous
6/10/2025, 8:18:49 AM No.105546260
>>105546114
I misread the code, my bad.

Anyways, one implication of replacing the typical CALL/RET pair with only appending LODSBs and JMPs that interests me is that I'm well on my way to getting myself an indirectly threaded forth interpreter.
Now, given the concatenative nature of forth code, I could recursively inline the definitions of the forth functions into one giant program (stripping away unneeded instructions such as paired pushes, pops, etc).
Now, is there any perfomance downside to running 100% inlined code, with no jumps or calls at all whatsoever?
Replies: >>105546368
Anonymous
6/10/2025, 8:38:24 AM No.105546368
>>105546260
>running 100% inlined code
Syscalls cannot be inlined. They run in an entirely different mode.

>no jumps or calls
And how do you handle failure? Especially if the failure comes from the kernel? If a file couldn't be opened or memory couldn't be allocated?

And let's assume you're doing nothing but userspace operations - even then you are going to experience slowdowns because the instruction cache would essentially turn into a ring buffer, and the prefetcher could only prefetch so much before bus latency itself becomes a problem. Same with the iTLB by the way, only that the prefetcher might not even prefetch these ahead of time.
Replies: >>105552579 >>105562309
Anonymous
6/10/2025, 10:30:53 AM No.105546940
>>105545585
C++ seems to output something okay
https://godbolt.org/z/MsEbGTozc
Replies: >>105550708
Anonymous
6/10/2025, 11:35:53 AM No.105547300
Since im new to django i asked ai to tell me how to populate a field thats a foreign key with an object instead of an id( pretty basic thing in web dev) and even after repeated prompts it couldnt do it. At the end i did it manually with the help of SO
Nice ai hype bubble you got there
Replies: >>105547554
Anonymous
6/10/2025, 12:13:47 PM No.105547519
pair programming in emacs with AI

https://github.com/MatthewZMD/aidermacs
Replies: >>105547567
Anonymous
6/10/2025, 12:18:31 PM No.105547554
>>105547300
Seems to be working as intended.
Anonymous
6/10/2025, 12:20:17 PM No.105547567
>>105547519
Have all these people using emacs been using it for 20+ years? There's no way it's worth getting into now.
Anonymous
6/10/2025, 3:33:11 PM No.105549037
>replace recursive variadic template functions by a struct and std::initializer_list
>code is easier to use and more organized
>but I don't get to feel smart when I look at it
Not sure if it was worth it
Anonymous
6/10/2025, 4:01:09 PM No.105549251
>>105545889
>If serious money was put into this, as in an excellent simulation environment and thorough training data, you might actually end up with a model literal space agencies would take interest in for long term deep exploration missions or other planetary ventures
Yes anon, the same people that forbid heap allocations will put a probabilistic next word predictor to pilot their 50 billion dollar misison.
Replies: >>105549322
Anonymous
6/10/2025, 4:10:05 PM No.105549322
>>105549251
The key points here
>long term deep exploration missions
>other planetary ventures
Give me a better solution to the problem of not being able to have crews on deep space missions then.
>cryogenics and deep sleep is a fairytale and will almost always result in a dead human
>attempting to sustain a multi-generational crew with a micro colony will almost certainly lead to a Lord of the Flies esque situation but much more grim

Make a concrete argument as to why a multimodal AI agent trained specifically for vessel operation in deep space is a bad idea and not possibly a multi billion dollar idea.
Replies: >>105549357 >>105549416 >>105549416
Anonymous
6/10/2025, 4:11:36 PM No.105549336
>>105534459
Static recompilation of an old console where cycle accuracy requires running each subsystem for only 1 cycle wouldn't be too hard? If you know how to remove the scheduler overhead and linearize the executed code of the multiple systems running in parallel while maintaining cycle accuracy, I'd be glad to hear it.
Anonymous
6/10/2025, 4:12:58 PM No.105549357
>>105549322
>will almost always result in a dead human
Good.
Anonymous
6/10/2025, 4:19:26 PM No.105549416
>>105549322
>>105549322
>The key points here
>>long term deep exploration missions
>>other planetary ventures
I can't be bothered to reformulate, it's clear enough and you should easily understand my objection. If it's for safe guarding humans it's even worse.

>cryogenics and deep sleep is a fairytale and will almost always result in a dead human
Cryogenics works on egg cells, although with a significant failure rate, so it's not complete science fiction, I want to believe that it could work on an entire organism. It's an enginering problem.

>Make a concrete argument as to why a multimodal AI agent trained specifically for vessel operation in deep space is a bad idea
probabilistic next word predictor. I know it's more complex than that but there remains the fact that AI does not do precise logical reasoning, so it's unreliable.
Anonymous
6/10/2025, 6:01:29 PM No.105550350
1737410510309156
1737410510309156
md5: 5e5e69b3dd5986ae50b5fe457a4c8bf1๐Ÿ”
>>105545585
>Also compilers are terrible at estimating call depths and will rather generate a CALL/RET pair than a LEA return + JMP target + JMP return combination even though that would improve out-of-order execution (because CALL/RET use the SP register implicitly)
You mean like
f:
jmp rax
start:
lea rax, [rip + 2]
jmp f
would be better than
f:
ret
start:
call f
for out of order execution?
Replies: >>105550445 >>105550708
Anonymous
6/10/2025, 6:04:14 PM No.105550383
1705242487
1705242487
md5: a0be83d300914197e6563ed6aeab7249๐Ÿ”
>>105530074 (OP)
What do you think of en_US ANSI as kb layout? I am going out of my way to order a laptop with that layout even though I am not a native speaker but I think the it's just more comfortable for coding compared to my localized ISO layout. Opinions? Personal experience with the american layout (no international pls)
Replies: >>105550473
Anonymous
6/10/2025, 6:07:11 PM No.105550422
Do you guys unironically do test-drive-development (TDD)? I don't understand how TDD is even possible because when you're adding a new feature to an existing codebase, the existing tests won't cover the new feature you're modifying the testable code for.

Do you guys just do TAD - testing-after-development to isolate the code you just added/changed?
Replies: >>105552199 >>105552493
Anonymous
6/10/2025, 6:09:03 PM No.105550445
>>105550350
https://en.wikipedia.org/wiki/Continuation-passing_style

instead of doing a call/return, you pass a continuation to the called procedure. that procedure can then pass that continuation to another procedure if needed.

call foo(args...) become goto foo(args..., continuation)

then foo() will either do goto continuation; or pass it to another procedure
Replies: >>105550495
Anonymous
6/10/2025, 6:11:38 PM No.105550473
1740542259143563
1740542259143563
md5: 120d29d1ff8546bfc0e3e623341b5675๐Ÿ”
>>105550383
I've used the ansi layout for years, ~, |, and " are in better positions t. bong
Anonymous
6/10/2025, 6:13:28 PM No.105550495
>>105550445
What's the equivalent assembly using lea/jmp if you don't mind writing it?
Replies: >>105550743 >>105550822
Anonymous
6/10/2025, 6:24:40 PM No.105550621
If you're not using FastAPI you're literally ngmi**


``
```python
@router.post("/videos/transcode", status_code=202)
async def submit_transcoding_job(
# Dependencies are just function args, clean as fuck
current_user: User = Depends(get_current_active_user),
db: Session = Depends(get_db),
tasks: BackgroundTasks,
s3: S3Client = Depends(get_s3_client),

# Handles multipart/form-data with file and form fields automatically
video_file: UploadFile = File(...),
options_json: str = Form(..., description="JSON string of transcoding options"),
webhook_url: Optional[str] = Form(None)
):
"""
Accepts a video file and kicks off a background transcoding job.
Responds immediately with a job ID.
"""
# Just works. No bullshit request parsing.
if not video_file.content_type.startswith("video/"):
raise HTTPException(status_code=400, detail="Not a valid video file.")

# Validate the JSON config string using Pydantic on the fly
try:
options = TranscodeOptions.parse_raw(options_json)
except ValidationError as e:
raise HTTPException(status_code=422, detail=e.errors())

# Business logic is clean and readable
temp_path = await save_upload_file_tmp(video_file)
job = crud.jobs.create(
db, user_id=current_user.id, options=options.dict(), webhook_url=webhook_url
)

# The actual heavy work runs in the background. API returns instantly.
tasks.add_task(run_ffmpeg_transcode, job_id=job.id, source_path=temp_path, s3_client=s3)

return {"job_id": job.id, "status": "queued"}
```
``
Anonymous
6/10/2025, 6:31:43 PM No.105550708
>>105546940
Yeah, I can't get the same output in C if I tried. Could be that I use inband signalling with NULL to determine when the list is at its end, or maybe C++ is even more aggressive when it comes to inlining: https://godbolt.org/z/ssPMq6KqE

>>105550350
The CPU maintains a return stack buffer (RSB) for the purpose of predicting where to fetch instructions from. A RET will still cause a sync due to SP dependency, but the CPU will be able to prefetch the target address.

Code that doesn't use RET doesn't have the dependency, and as such doesn't have to sync - but LEA/JMP is only worth it if it's a leaf function that doesn't call into anything else (CALL/RET are much more optimized for stack operations). Also the CPU is solely dependent on out-of-order execution to determine where the return will happen to, so you want to have some instructions between the beginning and the end to give the CPU enough time to realize that the register holding the return address doesn't change and can prefetch instructions accordingly.
Replies: >>105551070
Anonymous
6/10/2025, 6:33:27 PM No.105550724
jocko_uncomfy
jocko_uncomfy
md5: ec74957d48d3cd092d65b6300652d6a2๐Ÿ”
>>105530074 (OP)
Visual Studio / C# question.

I understand how to make filescoped namespaces default for new classes and projects within an existing solution. Is there anyway to make it default for new solutions as a setting within VS2022 or do I just have to make a template where that is the default?
Anonymous
6/10/2025, 6:34:51 PM No.105550743
>>105550495
i don't know. you could have a calling convention where the continuation address is passed in the register R13.

mov r13, 0x1234 ; where it should go after foo
jmp foo ; go to foo routine

0x1234:
...


foo:
... ; do stuff
jmp bar

bar:
... ; do more stuff
jmp poo

poo:
... ; more stuff
jmp r13 ; jump to continuation


this way, poo would return way back to 0x1234, bypassing the chain of call/return.
Replies: >>105550822 >>105550891 >>105551070
Anonymous
6/10/2025, 6:41:39 PM No.105550822
>>105550495
CALLEE:
NOP ; Code
NOP ; Cooooooooode
JMP rax ; As long as RAX hasn't been clobbered you're good

CALLER:
LEA rax,[rip + CALLEE_RETURN_1]
JMP CALLEE

CALLEE_RETURN_1:
NOP ; Moooooore coooooooode
LEA rax,[rip + CALLEE_RETURN_2]
JMP CALLEE

CALLEE_RETURN_2:
NOP ; Coooooooooooooooooooooooooode


As >>105550743 pointed out this requires a degree of coordination between caller and callee that's usually being taken care of by the ABI. Instead of RAX you can use RCX, RDX, or whatever other registers are out there; as long as the callee preserves the register it can return to your caller.
Replies: >>105551070
Anonymous
6/10/2025, 6:49:27 PM No.105550891
>>105550743
NTA but worth mentioning you can even have multiple return continuations to choose from like exceptions
Anonymous
6/10/2025, 7:04:04 PM No.105551070
1748363889369926
1748363889369926
md5: 6ce7fc7c73d5448c3335443b52e046b4๐Ÿ”
>>105550708
>>105550743
>>105550822
Thanks anons. I'm not familiar with x86 but it's kinda like the link register on arm, I'll try using it when the callee is a leaf
Anonymous
6/10/2025, 8:08:36 PM No.105551714
>>105530074 (OP)
Why do people use functions to organize code when it can introduce non-trivial overhead?
Replies: >>105552179 >>105552929
Anonymous
6/10/2025, 8:53:17 PM No.105552179
>>105551714
Because it reduces overhead in all cases assuming you have a compiler.
Replies: >>105552244
Anonymous
6/10/2025, 8:55:42 PM No.105552199
>>105550422
I don't test my code, I simply use it, if it didn't work, it would piss me off and I'd fix it.
Anonymous
6/10/2025, 9:00:23 PM No.105552244
>>105552179
So starting a new stack frame, popping all the passed values onto it and copying all returned values onto the calling stack frame is more efficient than just doing the work inline?
Replies: >>105552261 >>105552579
Anonymous
6/10/2025, 9:02:15 PM No.105552261
>>105552244
If your function actually needs such setup, yes, it's objectively always better.
Replies: >>105552322
Anonymous
6/10/2025, 9:07:04 PM No.105552322
>>105552261
So why is the game I made in C++ around 10% faster when I just copy and paste all the contents of the functions I call, inline into the hot loop?
Replies: >>105552372 >>105552611 >>105552936
Anonymous
6/10/2025, 9:11:05 PM No.105552372
>>105552322
Because you're too retarded to do a pgo build or just manually mark the function to be always inline. Chances are that 10% doesn't mean anything since your "game" is just a cube rotating in empty soulless void like every 4chan project ever.
Replies: >>105552419
Anonymous
6/10/2025, 9:16:04 PM No.105552419
>>105552372
Ok so you don't know or you bullshitting. Got it.
Replies: >>105552439
Anonymous
6/10/2025, 9:18:17 PM No.105552439
>>105552419
Yes I'm sorry for not knowing how to explain to a retarded nigger that marking one function as always inline is trivial but wading through 100kloc spaghetti in one file is not.
Replies: >>105552701
Anonymous
6/10/2025, 9:23:43 PM No.105552493
>>105550422
I test my code after I get something testable, notice the issues and refactor based on that. TDD comes with it's own overhead and you might end up with a headache if you decide to make radical changes, basically rewriting the entire suite.
>I don't understand how TDD is even possible because when you're adding a new feature to an existing codebase, the existing tests won't cover the new feature you're modifying the testable code for.
You gotta add (and maintain) the code so yeah. Some people make unit tests aiming for one specific part of the function instead of having a bunch of assertions in a single test precisely so they don't have to touch old tests.
If you're mocking stuff, minimize the amount of them either by increasing the surface of the unit tests by including other classes or by writing integration tests instead. It's basically guaranteed that you'll have to keep an eye on mocks and you might miss on bugs because the mock doesn't reflect the behavior of the object after you do some refactoring. Do not believe people who claim that every class has to be 100% isolated, you'll fucking hate yourself otherwise and won't feel like refactoring.
Anonymous
6/10/2025, 9:29:59 PM No.105552579
>>105552244
Yes.
>>105546368
Anonymous
6/10/2025, 9:32:43 PM No.105552611
>>105552322
If you have so little code that copy pasting the code inline is noticebly faster then it's because the relative cost is higher when you don't have a lot of things going on, the average frame time should be around 13 ms. You are claiming that your function calls in total are around 1.3 ms in a release build? That would need to be something like 5,000 function calls that you are manually inlining and there is absolutely no prefetching going on, your cache is completely trashed etc. If your game is just some shitty free spinning loop that happens 10,000 times a second then you might notice a few function calls because now 0.01 ms is "noticable" so inlining 50 function calls could do that.
Replies: >>105552645
Anonymous
6/10/2025, 9:36:03 PM No.105552645
>>105552611
Or it means that his compiler is shit.
Anonymous
6/10/2025, 9:40:28 PM No.105552701
>>105552439
Ahh so it's a personal preference on your part and you were lying through your teeth when you gave that answer. Now it's coming out. Anything else to add?
Replies: >>105552769
Anonymous
6/10/2025, 9:47:42 PM No.105552769
>>105552701
You should put your brain into a blender and ask a doctor to inject it into your bloodstream because there's clearly a bottleneck between your head and the rest of your worrhless body, especially those brown hands that wrote your post.
Replies: >>105553320
Anonymous
6/10/2025, 10:02:07 PM No.105552927
>>105533853
Could you please illustrate your point? Not quite familiar with file mapping.
Replies: >>105552957
Anonymous
6/10/2025, 10:02:10 PM No.105552929
>>105551714
Aggresive inlining bloats program size and you will need more cache / pages to hold duplicated code and such tradeoff may or may not be worth it to just calling the function.
Anonymous
6/10/2025, 10:02:45 PM No.105552936
>>105552322
You don't want me schizoing out over C++'s code generation, right?

Right?!
Anonymous
6/10/2025, 10:04:03 PM No.105552957
primer_file_mappings_3
primer_file_mappings_3
md5: 1480ac008b57099716aa3abd1e300c8a๐Ÿ”
>>105552927
Replies: >>105552997
Anonymous
6/10/2025, 10:08:31 PM No.105552997
>>105552957
WTF I hate fread now!
...
Wait, but why don't people massively use mapped files for reading then? It seems like they're the best tool.
>Array-like access
>Linear memory
>Thread safe without any locks

Where's the pitfalls?
Replies: >>105553060
Anonymous
6/10/2025, 10:14:32 PM No.105553060
>>105552997
Same reasons they don't use VirtualAlloc/mmap directly to manage their memory:
- they don't know any better (because their teachers were incompetent).
- they don't want to know any better (because then they got no one else to blame for slow performance but themselves).
- there are instances when file mappings end up being slower than direct I/O, namely when the file in question is bigger than your RAM and you write to it non-sequentially. Most programs don't do that to begin with.
Anonymous
6/10/2025, 10:14:48 PM No.105553063
From hackernews
>I wish people used mmap less.
>Creating a new memory mapping can be pretty expensive! On both Windows and Linux, it involves taking a process-wide reader-writer lock in exclusive mode (meaning you get to sit and wait behind page faults), doing a bunch of VMA tree manipulation work, doing various kinds of bookkeeping (hello, rmap!) and then, after you return to userspace, entering the kernel again in response to VM faults just to fill in a few pages by doing, inside the kernel, what amounts to a read (2) anyway!

>Sure, if you use mmap, you get to look at the page cache pages directly instead of copying from them into some application-provided buffer, but most of the time, it's not worth the cost.
>There are exceptions of course, but you should always default to conventional reads.
Replies: >>105553075 >>105553126 >>105553153 >>105553373
Anonymous
6/10/2025, 10:15:58 PM No.105553075
>>105553063
>Another problem with mmap is that there is no good way to handle I/O errors.
>The application will get a signal (SIGSEGV/SIGBUS, can't remember), and no information about what the problem could possibly be. Most applications do not catch these signals and will instead just terminate.

>Even if you do catch the signal there is a real challenge to know what caused the signal and to keep consistent book-keeping to be able to perform any sane action in response.

>At a previous employer we started seeing this problem when scaling things in production which was no fun.
Replies: >>105553126
Anonymous
6/10/2025, 10:21:14 PM No.105553126
>>105553063
>>105553075
@grok is this true?
Anonymous
6/10/2025, 10:23:04 PM No.105553153
>>105553063
>On both Windows and Linux, it involves taking a process-wide reader-writer lock
Windows pages stuff in lazily, but you can use PrefetchVirtualMemory to avoid mode switches and page faults. On Linux you can use MAP_POPULATE.
Replies: >>105553163 >>105553188
Anonymous
6/10/2025, 10:23:49 PM No.105553163
>>105553153
>PrefetchVirtualMemory
I am ignorant, is this somehow related to _mm_prefetch and __builtin_prefetch or what?
Replies: >>105553240
Anonymous
6/10/2025, 10:26:07 PM No.105553188
>>105553153
Yeah, and how to properly use PrefetchVirtualMemory and when? The official Microsoft docs suck ass at explaining stuff
Replies: >>105553310
Anonymous
6/10/2025, 10:30:21 PM No.105553240
>>105553163
PrefetchVirtualMemory is a Win32 function that calls into the kernel (NtSetInformationVirtualMemory syscall) to tell it that the provided memory region will be used very soon, and to page it in.

__builtin_prefetch => CPU-independent vesion of _mm_prefetch, which translates into PREFETCHNTA of PREFETCHTX instructions on x86/x64. These instructions don't cause paging, but instead hint to the CPU that it might want to prefetch these. If the address isn't backed by memory, then it's just a more expensive NOP.
Anonymous
6/10/2025, 10:32:51 PM No.105553269
>>105530074 (OP)
Trying to make a unit testing library for python where I can just add @Test and give an input or run the function and it will save the output of the function and automatically create all the tests.

Ideally the test output will be human readable, so when changes happen you can see the diff in version control
Anonymous
6/10/2025, 10:37:22 PM No.105553310
>>105553188
>Yeah, and how to properly use PrefetchVirtualMemory and when?
Don't you have the same problem with madvise(MADV_POPULATE_READ) (the more fine-grained equivalent)?
Anonymous
6/10/2025, 10:38:16 PM No.105553320
>>105552769
That's some impressive rage. I've not seen anyone so angry since Cniles told Rust troons that their language will never pass a systems programming language.
Anonymous
6/10/2025, 10:44:03 PM No.105553373
>>105553063
mmap is cheap, all memory is allocated using mmap, why would I listen to some fucktard drivel when I can combine mmaping a file and allocation into one syscall thanks to CoW?
Replies: >>105553387 >>105553396
Anonymous
6/10/2025, 10:45:44 PM No.105553387
>>105553373
I'm going to mmap my balls onto the face of your mother if you catch my drift.
Anonymous
6/10/2025, 10:46:18 PM No.105553396
>>105553373
So for read-only I/O mmap is ALWAYS better, correct? Does it make sense to align blocks in the file to the cache size?(4096 bytes)
Replies: >>105553474 >>105553644
Anonymous
6/10/2025, 10:54:19 PM No.105553474
>>105553396
It's already aligned.
Anonymous
6/10/2025, 11:02:09 PM No.105553555
I've did a few scripts for work but I'm nowhere near an actual programmer. How do I properly learn? Books to read or courses to take. I'm looking more into web development (backend) + automation/integrations. My biggest problem is I know my fucking ass will abuse copilot because I'll be stuck in something and refuse to figure it out.
Replies: >>105553892 >>105554578
Anonymous
6/10/2025, 11:10:17 PM No.105553644
>>105553396
>So for read-only I/O mmap is ALWAYS better, correct?
What's the alternatives?
>maintaining your own copy => congratulations, now the kernel has to handle two sets of pages
>maintaining your own copy using direct I/O => now the mapping cannot be shared with any other process
>direct I/O => hope you enjoy loading the same shit from mass storage over and over again, via syscalls and copies
Anonymous
6/10/2025, 11:34:56 PM No.105553873
>learning c# and WPF
>tutorials start off simple
>necessarily spend 15 minutes explaining what a string is
>spend 30 minutes on what the bits of VS 2022 are
>millions of examples of console.writeline and console.readline even though it's a wpf tutorial
>methods classes are shorter for some reason despite being slightly more complex
>Anyway this is the MVVM model and here's a bunch of random shit that we're doing something something view model model view model model view view model model on repeat for barely 5 minutes
>now you know how to program with c#!

I'm beginning to suspect no one really knows how to properly explain concepts that are less simple than 'here's how to write to the console'.
Replies: >>105553886 >>105554134 >>105554247 >>105555007
Anonymous
6/10/2025, 11:36:48 PM No.105553886
>>105553873
Welcome to programming. Throw shit at the wall until you're a master of throwing shit at a wall (the insult others who aren't as good at throwing shit as you are).
Replies: >>105553943
Anonymous
6/10/2025, 11:37:46 PM No.105553892
>>105553555
I think my biggest problem is I have an idea for a project and it's kinda like okay I can do x,y,z but that sounds like too many steps, that's stupid. Then I'll AI it and it'll be like just do X -> Z and I'm like yeah that makes sense and it's more sellable but it doesn't really feel like I'm learning much except prompting. I mean I guess I'm learning a bit by osmosis.
Replies: >>105554578
Anonymous
6/10/2025, 11:41:01 PM No.105553930
>nostdlib
>interacting with local x11 is easy enough
>need mesa for GPU access or write my own drivers
>even if I theoretically succeeded in rewriting all drivers, modern GPUs need proprietary ZOG approved and signed blobs
software renderer it is
Anonymous
6/10/2025, 11:42:31 PM No.105553943
file
file
md5: 64ce8e4d112fd73463234664ab2d291b๐Ÿ”
>>105553886
Thanks that makes me feel better.
It just reminds me of school, spend shit loads of time on the utterly basic shit and rush through anything useful ok bye good luck nigga!
Replies: >>105554247
Anonymous
6/10/2025, 11:53:16 PM No.105554052
java and python are for stinky poopoo diaper babbies (yes, babbies)
Anonymous
6/10/2025, 11:59:16 PM No.105554117
How cooked am I going to be if I mostly trimmed through the Smart Pointers chapter in the Rust book?
First time the book kinda lost me
Replies: >>105554632
Anonymous
6/11/2025, 12:00:18 AM No.105554134
>>105553873
kek yeah it's crazy.
>this bloopblopp is actually simply a blooppoop for the pooppoop
>oh a pooppoop? that's just a fartshart for the blooppoop with a cartmart but you're better off using a bloopshoop shartmart in a hurrdurr if you really need the beepboop of the bloopblopp
Anonymous
6/11/2025, 12:08:53 AM No.105554247
>>105553873
>>105553943
>read jeet shit
>get jeet quality
Either read a book or read code + documentation.
99% of tutorials are jeets grifting for 0.1 cents a click.
Replies: >>105554268
Anonymous
6/11/2025, 12:10:21 AM No.105554268
>>105554247
It's a pluralsight tutorial by a guy named Claudius Huber. I don't think he's a jeet but go off, retard.
Replies: >>105554355 >>105554490
Anonymous
6/11/2025, 12:16:36 AM No.105554355
>>105554268
>Claudius
What kind of braindamaged retards name their child "Claudius"?
Anonymous
6/11/2025, 12:28:28 AM No.105554490
>>105554268
What's the point of a reply like this if you have already determined yourself that it was a garbage tutorial?
Just to save you time, you probably won't find a C# WPF tutorial that isn't jeet garbage, because C# WPF is itself jeet garbage.
>what are some non-jeet-garbage gui libraries then
You think it's a coincidence that everything is an electron app nowadays? There are none.
Replies: >>105554523 >>105554566 >>105554577
Anonymous
6/11/2025, 12:31:15 AM No.105554523
>>105554490
Win32.
Anonymous
6/11/2025, 12:35:27 AM No.105554566
>>105554490
>You think it's a coincidence that everything is an electron app nowadays?
>in an era where jeetcode is spammed out like shits on the designated streets
hmm I wonder why everything is a shitty electron app. HMMMM
fucking retard.
Anonymous
6/11/2025, 12:36:28 AM No.105554577
>>105554490
>electron
>not jeet-garbage
Anonymous
6/11/2025, 12:36:29 AM No.105554578
>>105553555
>>105553892
Not anything wrong with using an LLM, you just need to go into it with the mindset of learning. You can usually understand more about the code if you seriously look at it and try to learn everything you don't fully understand, asking coppilot to explain or looking at the source for the function it uses can help

Ask it how to structure the app and for some google terms (RESTful app, frontend/backend, etc).

Also maybe learn functional programing, at least for me, once I understood it a lot of stuff that just didn't make sense opened up
https://www.youtube.com/watch?v=nuML9SmdbJ4
Replies: >>105554626 >>105555734
Anonymous
6/11/2025, 12:38:53 AM No.105554601
tux
tux
md5: 4eaa7ea97dee0125350be0187768e21b๐Ÿ”
A binary I compiled on one Linux computer throws errors on another computer about missing specific library versions that don't match the ones installed. How do I prevent this?
Replies: >>105554646 >>105554810 >>105554817 >>105555625 >>105557289
Anonymous
6/11/2025, 12:41:05 AM No.105554626
>>105554578
>vidya vlogs have now sprouted a new cancerous programming themed growth
2x playback speed is great and all but can we get an AI de-background-musicer? Just say it's about copyright or some bullshit
Anonymous
6/11/2025, 12:42:08 AM No.105554632
>>105554117
In practice you shouldn't be using smart pointers at all as a beginner. I mean real smart pointers like Arc, Rc, Box, RefCell. Obviously you should use vecs and strings, counting those as smart pointers is a stretch anyway.
Anyway, I'd say it's still pretty important to understand the concepts. But you can come back to it later.
Replies: >>105554645
Anonymous
6/11/2025, 12:43:53 AM No.105554645
>>105554632
>But you can come back to it later.
Cool, I'll just move on to the next chapter then.
I mean I understand the idea that vecs and strings are smart pointers and I think I understood the idea of Box, Rc, and RefCell but at some point the code listings really lost me, so I wouldn't say I understood how to actually use them.
Replies: >>105554712
Anonymous
6/11/2025, 12:43:59 AM No.105554646
>>105554601
If it's any library except glibc, just statically link it.
If it's glibc, see if you can use musl instead. If you can, just use musl and statically link it.
If not, you have to compile it on an old linux system, so that it works with old glibc versions.
Replies: >>105555052
Anonymous
6/11/2025, 12:45:16 AM No.105554660
>>105538875
mental illness
Anonymous
6/11/2025, 12:52:40 AM No.105554712
>>105554645
That's ok, you genuinely shouldn't use that crap anyway. Box and Rc and basically never useful. RefCell is basically only useful for thread_locals. Arc is only useful when doing some kinds of hardcore concurrent or async code. You should't have to worry about any of this for several years, hopefully never.
Replies: >>105555128 >>105555432
Anonymous
6/11/2025, 1:05:29 AM No.105554810
>>105554601
By not being a kike and giving user the code, at which point if it doesn't work, it's a skill issue.
Replies: >>105555052
Anonymous
6/11/2025, 1:06:27 AM No.105554817
>>105554601
Ship with your libs (not glu or system shit like that) in the same dir. Patch the rpath.
Anonymous
6/11/2025, 1:28:32 AM No.105555007
>>105553873
This is because Micro$oft can't stand still for more than 5 minutes before renaming .NET and changing the apis for GUI shit and web shit. Job security if you're a C# shop with hostages I mean customers.
Anonymous
6/11/2025, 1:33:57 AM No.105555052
>>105554646
It's just libjpeg. I have .so.8 on the source machine and .so.62 on the target.
>>105554810
I am the only user, smartass. I am trying to run the code on an ancient piece of shit that would take ages to compile on.
Replies: >>105557719
Anonymous
6/11/2025, 1:43:38 AM No.105555128
>>105554712
>You should't have to worry about any of this for several years, hopefully never.
big relief
Anonymous
6/11/2025, 2:24:02 AM No.105555432
>>105554712
Why did Rust come up with all this nonsense again, if not to spite C++? And why wasn't getting rid of C's malloc nonsense sufficient either?
Anonymous
6/11/2025, 2:43:25 AM No.105555539
images (8)
images (8)
md5: 624ddaaeccd2968b8bd862504d28b5f5๐Ÿ”
Opions on java EclipseStore? I saw this in the last 24 hours.

https://youtu.be/o_7CrOVVeoY?feature=shared
Replies: >>105556576
Anonymous
6/11/2025, 2:52:40 AM No.105555625
>>105554601
compile against the most ancient version of the lib that still works.
Anonymous
6/11/2025, 3:10:23 AM No.105555734
>>105554578
thanks anon, I appreciate it. I just feel kinda fraudulent doing this. I've advanced way faster in my projects with copilot compared to doing this solo and maybe I'm learning via osmosis (i mean I would've just googled copy and pasted the code) but I'm mostly looking if there's any other books for "best practices" and what the hell am i actually typing. I could ask copilot but I don't want to burn through my free code stuff or ai credits or whatever it is.
Anonymous
6/11/2025, 3:44:41 AM No.105555939
so dumb java stopped including javafx in the standard sdk because I'm always jumping through hoops to get it to work
Replies: >>105556328
Anonymous
6/11/2025, 4:39:33 AM No.105556328
>>105555939
java swing, sar
Anonymous
6/11/2025, 5:25:45 AM No.105556576
>>105555539
>18 seconds in
>insufferable accent
Dropped.
Anonymous
6/11/2025, 5:55:03 AM No.105556781
8f5b8fb1007ee51f18313453d303ff70
8f5b8fb1007ee51f18313453d303ff70
md5: e2872bde0debc5e2242822e35c7f6c16๐Ÿ”
added image decoding through ffmpeg pipe for my image viewer to support more formats
going to do the same for my music player
Replies: >>105556798 >>105560178
Anonymous
6/11/2025, 5:56:47 AM No.105556798
>>105556781
where the fuck are her nipples
Replies: >>105556849
Anonymous
6/11/2025, 6:03:35 AM No.105556843
>>105545846
Thanks anon. Used Kate.
Anonymous
6/11/2025, 6:03:58 AM No.105556849
933a7ef7c23519efa27584edc49504b6
933a7ef7c23519efa27584edc49504b6
md5: 5f36b7b91b98de5b2b88ea4794cbadc7๐Ÿ”
>>105556798
ate them
Anonymous
6/11/2025, 6:04:00 AM No.105556850
>import
>include
>use
ngmi
Anonymous
6/11/2025, 6:37:20 AM No.105557087
1743078135852569
1743078135852569
md5: 380ac94cf78882700d35e00c8906250b๐Ÿ”
I'm using a JSON library in C (yajl) to parse some GLTF (not important), and the library operates by using a callback every time it processes a token.
static int gltf_double(void *userdata, double val)
{
// ...
return 1;
}

static const yajl_callbacks gltf_callbacks = {
.yajl_null = gltf_null,
.yajl_boolean = gltf_boolean,
.yajl_integer = gltf_integer,
.yajl_double = gltf_double,
.yajl_number = NULL,
.yajl_string = gltf_string,
.yajl_start_map = gltf_start_map,
.yajl_map_key = gltf_map_key,
.yajl_end_map = gltf_end_map,
.yajl_start_array = gltf_start_array,
.yajl_end_array = gltf_end_array,
};

yajl_handle yajl = yajl_alloc(&gltf_callbacks, NULL, &state);

I was starting to write a somewhat bloated state machine to handle all of the keys I was expecting, but then it occurred to me, why don't I just fuck with the callback table itself instead?
If I encounter the "scene" key, I change the integer callback to a function that writes the value somewhere (and the others to error out) then restore the table to what it was before.
Is there anything wrong with doing it this way? Is this how people actually use these kinds of libraries?
Replies: >>105557141
Anonymous
6/11/2025, 6:46:53 AM No.105557141
>>105557087
this api is terrible
it should provide the path to the current value as a callback parameter
use another library or write your own json parser
Replies: >>105557265
Anonymous
6/11/2025, 7:08:27 AM No.105557265
>>105557141
I was originally looking at libraries like json-c, where it basically builds the entire tree in memory, which you then traverse. It seemed a bit excessive; I don't need to create a bunch of hashtables, since I'm working with a standardized format.
>the current value
I mean, that's what I was originally going to do, but once I started writing out
enum gltf_state {
GLTF_START,
GLTF_TOP_SCENE,
GLTF_TOP_SCENES,
GLTF_TOP_NODES,
GLTF_TOP_MESHES,
GLTF_TOP_BUFFERS,
GLTF_TOP_BUFFER_VIEWS,
GLTF_TOP_ACCESSORS,
GLTF_TOP_ASSET,
GLTF_SCENE_NAME,
GLTF_SCENE_NODE,
GLTF_SCENE_EXTRAS,
// ...
};
I realised that god damn there are going to be a lot of states, and the functions are probably going to be fairly messy. I guess I bunch of them can be cut down by just storing the key, but that just adds a bunch of extra string comparisons everywhere. That's when I got the idea of just changing the function pointers.
Replies: >>105560056
Anonymous
6/11/2025, 7:13:01 AM No.105557289
>>105554601
set rpath up for local shared object loading, bundle library
same way windows programs do it
Anonymous
6/11/2025, 8:01:43 AM No.105557544
Any of you schizos worked with Qt before?
Anonymous
6/11/2025, 8:25:38 AM No.105557660
20240603_110031
20240603_110031
md5: 114fbc283fd5bab773dad92e8d641c9e๐Ÿ”
>>105530074 (OP)
I added Text To Speech for 4chan threads

Here is a reading
https://voca.ro/16czryMpnexI

of the thread
https://ayasequart.org/g/thread/96520802

in op_and_op_replies mode. DFS, BFS, and OP only modes are available too.
Replies: >>105557693
Anonymous
6/11/2025, 8:28:22 AM No.105557685
>>105530074 (OP)
Nothing. Just lamenting the loss of /prog/.
Anonymous
6/11/2025, 8:30:00 AM No.105557693
1729328536772858
1729328536772858
md5: 347156d1d90cef2c875029200d897d9d๐Ÿ”
>>105557660
The code lives here, btw
https://github.com/sky-cake/ayase-quart
Anonymous
6/11/2025, 8:32:24 AM No.105557719
>>105555052
Maybe fix your project to be better than bloated tranny slop, and it will work fine on your obsolete hardware like it was built yesterday.
Anonymous
6/11/2025, 10:34:16 AM No.105558475
mmap-sama, are you still here?
https://www.reddit.com/r/cpp/comments/1l89aft/when_is_mmap_faster_than_fread/
Sorry for posting r*ddit, but they say that mmap is almost always LE BAD for both performance and memory consumption (somehow) and you should use either conventional I/O instead, or io_uring or ring buffers. Is this true? Or they got it all wrong? There are too many different opinions that completely cancel each other out I can't figure it out.
Replies: >>105558780
Anonymous
6/11/2025, 10:49:12 AM No.105558555
relax-14639125
relax-14639125
md5: 903ab18ba4eafbec5cc3f6cb9e6bd417๐Ÿ”
cleared last outstanding bug by deciding that it's WONTFIX
Anonymous
6/11/2025, 11:26:59 AM No.105558780
>>105558475
io_uring requires fixed buffers and userspace caching. Where you will put those buffers into? A mmap?
Normal fread is always garbage due to not being OS level API.
Conventional I/O is same as io_uring, but now entirely synchronous with syscall overhead, double that if you need non-sequential access.
Replies: >>105558860 >>105558927
Anonymous
6/11/2025, 11:41:58 AM No.105558860
>>105558780
>Normal fread is always garbage due to not being OS level API
But it provides automatic buffering over ReadFile/read() syscall. Or do I need to do manual buffering myself over read()?
Replies: >>105558869 >>105558873
Anonymous
6/11/2025, 11:43:20 AM No.105558869
>>105558860
Why would you want extra copying?
Anonymous
6/11/2025, 11:44:03 AM No.105558873
>>105558860
>But it provides automatic buffering over ReadFile/read() syscall
And how does its data end up in your buffer? Oh, that's right - another copy.

Sounds kinda retarded now, doesn't it.
Anonymous
6/11/2025, 11:53:17 AM No.105558915
1735272446259258
1735272446259258
md5: abef178837f4139c14dd61922d71be16๐Ÿ”
I'm trying to learn Qt.
Am I approaching this in the right way?
Assuming I want the text inside the dialogue box to be maintained.

Also what's the best way to learn. I've watched voidrealm's videos but I don't feel like shelling out money for a proper udemy course. I'm just trying to piece together things from the docs and example projects rn
Anonymous
6/11/2025, 11:54:43 AM No.105558927
>>105558780
Another hot take

>mmap can potentially trash the virtual page cache depending on the access pattern. I usually find pread (which is thread safe) more robust and reliable than mapping the file, also you can open the file with O_DIRECT to bypass cache if you will only read data once.
Replies: >>105558940 >>105559018
Anonymous
6/11/2025, 11:57:21 AM No.105558940
>>105558927
>mmap can potentially trash the virtual page cache depending on the access pattern
madvise(MADV_HUGEPAGE)
Replies: >>105558978 >>105559034
Anonymous
6/11/2025, 12:02:57 PM No.105558978
>>105558940
Noted, thanks. What about the unpredictable page faults that they scream about? Does madvise solve this too?
Replies: >>105558990 >>105559062
Anonymous
6/11/2025, 12:04:49 PM No.105558990
>>105558978
madvise(MADV_POPULATE_READ)
Replies: >>105559034
Anonymous
6/11/2025, 12:08:23 PM No.105559018
>>105558927
Oh no, not my heckin virtual page cache when a cold page fault takes less time than reading from file directly off the disk...
Anonymous
6/11/2025, 12:11:31 PM No.105559034
>>105558940
>>105558990
Neither of these are useful for file I/O.
Replies: >>105559064
Anonymous
6/11/2025, 12:13:56 PM No.105559062
>>105558978
>unpredictable
Why would anyone need to worry about this even if it were true? (it isn't)
Anonymous
6/11/2025, 12:14:12 PM No.105559064
>>105559034
Wrong.
Replies: >>105559073
Anonymous
6/11/2025, 12:16:37 PM No.105559073
>>105559064
Excellent argument, Dunning Kruger, you changed my objective mind.
Replies: >>105559082
Anonymous
6/11/2025, 12:19:06 PM No.105559082
>>105559073
Why would I need to change the mind of an idiot?
Replies: >>105559096
Anonymous
6/11/2025, 12:21:13 PM No.105559096
>>105559082
Because that would change you from an idiot to a passable midwit. You're a retarded hugepagetranny, so you won't understand anyway, but here it does: huge pages don't share page cache with normal pages, you're wasting RAM and reading big blocks, virtual page cache is a non-issue and if you weren't a retarded nocodeshitting tranny, you'd know this.
Replies: >>105564452
Anonymous
6/11/2025, 12:23:32 PM No.105559108
I think you are what they call "BTFOed".
Anonymous
6/11/2025, 12:26:31 PM No.105559125
>huge pages don't share page cache with normal pages
Yes they do.
Anonymous
6/11/2025, 12:27:24 PM No.105559131
>visual studio 2022
>try to call method
>typing . (dot) autocomplets the fucking suggestion.

How do I turn this cunt off?
Anonymous
6/11/2025, 2:25:26 PM No.105559888
hugep***s
Anonymous
6/11/2025, 2:52:21 PM No.105560056
>>105557265
I mean on the one hand yes it is excessive because you're right GLTF just ends up in a struct of arrays, but so is the effort you need to put in to pretend that you don't need hash tables to parse JSON. And what is the point of that effort anyways? GLTF is a fucking terrible scene format for runtime anyways so you need another layer after GLTF to put your data in anyways. I get that abstractions have a cost but unless you know EXACTLY what your data is going to be and it wont change you need some flexability.
Replies: >>105560292
Anonymous
6/11/2025, 3:13:07 PM No.105560178
>>105556781
Nice bulge faggot
Anonymous
6/11/2025, 3:28:45 PM No.105560292
>>105560056
>you need another layer after GLTF to put your data in anyways
What? Is this about how your in-memory representation of something isn't exactly the same as how it's serialized?
That's not a realistic concern at all.
All of the raw vertex data is storable in a GPU-ready format, so that seems good enough for my admittedly simple uses.

>but so is the effort you need to put in to pretend that you don't need hash tables to parse JSON
General purpose handling of JSON, sure. But I'm not trying to keep it general purpose. glTF is rigid enough that I don't need it, with the "flexibility" being if something is present at all, or just JSON being in different orders.
But man, trying to do it this way with a callback-based library is turning out to be a fucking mess, which yeah, isn't worth the effort. It's just turning into a fuckhuge state machine where control flow is jumping all over the place.

I'm going to look at some other libraries, and if I can't find what I'm looking for, just use json-c or whatever and build the tree.
Replies: >>105560650 >>105560708
Anonymous
6/11/2025, 4:10:20 PM No.105560650
a7715679e4b138173678489e51df38e9
a7715679e4b138173678489e51df38e9
md5: 3eefd48e634b30557c09a96b58739529๐Ÿ”
>>105560292
in my own json parser itโ€™s mostly stateless and the only state is the reading position
for formats where the path to the value i want to extract is known i just do something like char *c = json_path_get_value(json, โ€œpath.to.valueโ€);
for (char *v = json_array_first_value(c); v; v = json_array_next_value(v))
dothing(v);
Anonymous
6/11/2025, 4:20:14 PM No.105560708
>>105560292
I like jsmn, but you'll end up needing to write your own tree traversal for it. Frankly, you should just use json-c, since it's mature, easy, and I guarantee your json parser isn't going to be your bottleneck. If it is, you need a redesign.
Anonymous
6/11/2025, 4:32:23 PM No.105560804
1749437627823
1749437627823
md5: 1ba1470af637d8d408be5872c8c2b5f9๐Ÿ”
Any hare enjoyers ITT?
Anonymous
6/11/2025, 5:43:45 PM No.105561397
>have a Rust project
>one file contains a pair of complex decoder functions
>these handle the most common cases themselves
>also have ten large sub-functions that handle lots of weird edge-cases
>put the sub-functions into a separate file
>1.6x speedup
Replies: >>105562309
Anonymous
6/11/2025, 7:14:47 PM No.105562309
>>105561397
>>105546368
Anonymous
6/11/2025, 9:46:38 PM No.105563841
>LL parsers are LE BAD! b-because it just is goy! invest in LR instead
Just design your grammar correctly holy shit
Anonymous
6/11/2025, 10:05:48 PM No.105564075
rider_prob
rider_prob
md5: 389ca7d9b96077201868e730ca1e0bc9๐Ÿ”
>>105530074 (OP)
Is there anything in Jetbrains settings where I can keep the fucking completion hints and stop the fucking right box from showing?
Replies: >>105564162
Anonymous
6/11/2025, 10:12:37 PM No.105564162
>>105564075
why would you want just the first one, though? like, when do you need to type just a method name but without the parameters? not criticizing, just curious

not a Jetbrains user but seems tidy and ergonomic to have a list of function names and then all their overloads on a secondary list. i'd use this mode in Eclipse for Java
Replies: >>105564195
Anonymous
6/11/2025, 10:13:02 PM No.105564168
>>105534880
>malloc
oh no
Anonymous
6/11/2025, 10:15:59 PM No.105564195
>>105564162
Honestly it's just very distracting for me. If I know what method I want then the overloads on the side just waste space and attention.
Anonymous
6/11/2025, 10:40:48 PM No.105564452
stlb
stlb
md5: 18b31cb6243e62113a7749af55ddd844๐Ÿ”
>>105559096
Yikes.
Anonymous
6/11/2025, 11:01:53 PM No.105564683
So I made a first fit allocator to use alongside my arena allocator, for when arena allocation is not an option.
It's not a pure first fit allocator because it defaults to mmap for big allocations, it's really a very simple general purpose allocator.
The qeuestion is what do I call it? (the function prefix) I don't want to override malloc and it has a slightly different interface anyway.
Replies: >>105564829 >>105565823 >>105565915 >>105566397
Anonymous
6/11/2025, 11:16:51 PM No.105564829
1743958473787420
1743958473787420
md5: 248273310f6e225d67fe334def945f84๐Ÿ”
>>105564683
pack
Replies: >>105564910
Anonymous
6/11/2025, 11:24:38 PM No.105564910
>>105564829
>pack
what? but why? this doesn't carry the idea that it's "general purpose" or that it's fine for any lifetime
I'm thinking that "global_" could be apporpriate
Replies: >>105564952
Anonymous
6/11/2025, 11:28:38 PM No.105564952
>>105564910
malloc isn't general purpose either. It has the very specific purpose of providing individual lifetimes, which is a concept the hardware knows nothing about and has to be emulated in software.
Replies: >>105564976
Anonymous
6/11/2025, 11:31:35 PM No.105564976
>>105564952
I know, there is no such thing and mine isn't either, that's why I quoted it. It is also made for sporadic individual lifetimes, it's not made for intensive use.
Replies: >>105565042
Anonymous
6/11/2025, 11:38:45 PM No.105565042
>>105564976
Why not "hospital"? Lots of individual lifetimes in there.
Replies: >>105565106
Anonymous
6/11/2025, 11:45:08 PM No.105565106
>>105565042
Or maybe "hood"? Lots of trash around that belongs to someone else.
Anonymous
6/12/2025, 12:13:59 AM No.105565369
Zig uses the diminutive gpa for GeneralPurposeAllocator, this seems alright.
https://zig.guide/standard-library/allocators/
Anonymous
6/12/2025, 1:04:17 AM No.105565823
>>105564683
>it's really a very simple general purpose allocator.
gpa

maybe aa or aua (augmented allocator)
Replies: >>105566898
Anonymous
6/12/2025, 1:17:09 AM No.105565915
>>105564683
FirstFitAllocate
Anonymous
6/12/2025, 2:33:42 AM No.105566397
70e
70e
md5: 761113d2ea37c804537ef6e0b5204ed4๐Ÿ”
>>105564683
alloc
Replies: >>105566898
Anonymous
6/12/2025, 3:45:48 AM No.105566898
>>105566397
>alloc_free()
>>105565823
yep, that's what I chose
Replies: >>105566992
Anonymous
6/12/2025, 4:01:32 AM No.105566992
>>105566898
unalloc
Replies: >>105567112
Anonymous
6/12/2025, 4:23:59 AM No.105567112
>>105566992
dealloc
Anonymous
6/12/2025, 4:25:02 AM No.105567119
Working on a cross-platform 4chan app
Anonymous
6/12/2025, 5:29:19 AM No.105567602
So what complete retard came up with the idea of making malloc allocate memory via mmap if the requested size is over 128 KB?
>why is it retarded
Have you looked at the address malloc churns out? It's not page aligned. malloc wastes an additional page at the end because it INSISTS on adding its own state at the beginning of the allocation.

At what point will people realize that malloc was a mistake?
Replies: >>105567736 >>105567778
Anonymous
6/12/2025, 5:50:48 AM No.105567736
>>105567602
>it INSISTS on adding its own state at the beginning of the allocation.
How else is it supposed to know the size of an allocation upon reallocating and freeing, genius?
Replies: >>105567760 >>105568520
Anonymous
6/12/2025, 5:55:25 AM No.105567760
>>105567736
Not my problem.
Replies: >>105567865 >>105568538
Anonymous
6/12/2025, 5:58:12 AM No.105567778
>>105567602
Large allocations are page aligned automatically.
Small allocations are within a pool that is page aligned.

Please don't get so angry.
Replies: >>105567817
Anonymous
6/12/2025, 6:05:01 AM No.105567817
>>105567778
Are you paid to spread misinformation?
https://godbolt.org/z/qc3K59xPa

4K: 0x2c6ec2a0
2MB: 0x718b1abff010
16MB: 0x718b19bfe010
Replies: >>105567922
Anonymous
6/12/2025, 6:13:12 AM No.105567865
>>105567760
retard
Replies: >>105567871
Anonymous
6/12/2025, 6:14:00 AM No.105567871
>>105567865
You sound like a malloc user, which is the worst insult I can think of.
Replies: >>105568107
Anonymous
6/12/2025, 6:20:52 AM No.105567922
>>105567817
CE is not using mmap, and please, like I said earlier, this is a vibe thread and you're killing it with your aggression.
Replies: >>105567951
Anonymous
6/12/2025, 6:25:02 AM No.105567951
>>105567922
No one cares about your CE. Or your vibes, for that matter. I hope they all get killed.
Anonymous
6/12/2025, 6:51:25 AM No.105568107
>>105567871
you complain about what malloc does but you didn't present a better solution
as usual, useless post, waste of time
Replies: >>105568362
Anonymous
6/12/2025, 6:54:21 AM No.105568122
here we go
Anonymous
6/12/2025, 7:36:40 AM No.105568362
>>105568107
Are you stupid?
Replies: >>105568483 >>105568520
Anonymous
6/12/2025, 7:56:42 AM No.105568483
>>105568362
Has to.
He's defending malloc, after all.
Anonymous
6/12/2025, 8:03:46 AM No.105568520
>>105568362
>>105567736
Replies: >>105568538
Anonymous
6/12/2025, 8:06:11 AM No.105568538
>>105568520
>>105567760
Just don't use malloc. It's easy.
Replies: >>105568702 >>105568915
Anonymous
6/12/2025, 8:12:42 AM No.105568573
>why yes I will take advice from a place full of proven retards instead of relying on industry standards developed over half a century
Anonymous
6/12/2025, 8:16:26 AM No.105568596
>appeal to authority
Wow, you're retarded.
Anonymous
6/12/2025, 8:32:34 AM No.105568676
file
file
md5: 9ea38619ea46da9791ae28eb0768f612๐Ÿ”
New Rust book dropped: "Rust for Sศฏyjaks"
/g/ has no excuses now
Replies: >>105568693
Anonymous
6/12/2025, 8:34:10 AM No.105568693
>>105568676
>>105531239
Anonymous
6/12/2025, 8:34:28 AM No.105568697
Are there middleman services that put your app up on google play so that google doesn't dox you to everyone?
Anonymous
6/12/2025, 8:35:31 AM No.105568702
>>105568538
That's not what you said. You said that it was stupid for malloc to put metadata. So where is it supposed to put it and how does it looks up the metadata upon freeing?
Replies: >>105568709 >>105568711
Anonymous
6/12/2025, 8:36:32 AM No.105568709
>>105568702
*to put the metadata before the allocation
Anonymous
6/12/2025, 8:36:40 AM No.105568711
>>105568702
>That's not what you said.
>At what point will people realize that malloc was a mistake?
Replies: >>105568738
Anonymous
6/12/2025, 8:42:57 AM No.105568738
>>105568711
You are avoiding to respond to the question again and changes the subject. I accept your concession.

you're not a schizo, you're a faggot
Replies: >>105568746
Anonymous
6/12/2025, 8:45:27 AM No.105568746
>>105568738
You have your answer. malloc is hot garbage, and its users are retards. That includes you, so your judgement is so invalid on top of everything else it's actually makes me feel pity for you.
Replies: >>105568764
Anonymous
6/12/2025, 8:48:51 AM No.105568764
>>105568746
No I'm not using malloc,
>your judgement is so invalid on top of everything
what judgement schizo? All I did was ask a question that you never answer.

take your meds and SHUT THE FUCK UP fucking little bitch
Replies: >>105568784
Anonymous
6/12/2025, 8:54:52 AM No.105568784
>>105568764
>No I'm not using malloc
Why else would you defend it? Retard.

>what judgement
>schizo
Yeah, like that. Who cares what a retard like you has to say.
Replies: >>105568862
Anonymous
6/12/2025, 9:07:49 AM No.105568862
>>105568784
>Why else would you defend it? Retard.
I was pointing out that what you said was idiotic, you dumb motherfucker.
>Who cares what a retard like you has to say.
Apparently you do since you reply to me.
Replies: >>105568882
Anonymous
6/12/2025, 9:11:27 AM No.105568882
>>105568862
How would you know what I said, considering you didn't read the post to the end? Retard.

>Apparently you do since you reply to me.
I'll take any chance to publicly humiliate and insult you.

Retard.
Replies: >>105568911
Anonymous
6/12/2025, 9:15:31 AM No.105568911
>>105568882
attention whore
Replies: >>105568926
Anonymous
6/12/2025, 9:16:04 AM No.105568915
>>105568538
Ok, I will use _mm_malloc instead.
Replies: >>105568926
Anonymous
6/12/2025, 9:17:51 AM No.105568926
>>105568911
Retard.

>>105568915
Retard.
Replies: >>105568933 >>105568935
Anonymous
6/12/2025, 9:19:22 AM No.105568933
Screenshot_20250612-101829_Firefox
Screenshot_20250612-101829_Firefox
md5: 6487d1ae77214c9dfc44eff4f70ef6ca๐Ÿ”
>>105568926
If it's good enough for Intel, it's good enough for me.
Replies: >>105568959 >>105569069
Anonymous
6/12/2025, 9:19:50 AM No.105568935
>>105568926
>can't reply to a question because too retarded
>still answers because he likes attention
Replies: >>105569069
Anonymous
6/12/2025, 9:24:32 AM No.105568959
>>105568933
no the anon whose vocabulary mostly consists of the word "retard" (some kind of projection) knows better than intel
Anonymous
6/12/2025, 9:46:24 AM No.105569069
mm_malloc
mm_malloc
md5: 62bb85f474e0fee7c73558c6c0c54cb7๐Ÿ”
>>105568935
>so retarded it doesn't understand an answer if it's giving to it
>still replies because it's just so retarded

Retard.

>>105568933
Double retard.
Replies: >>105569153
Anonymous
6/12/2025, 9:58:39 AM No.105569153
>>105569069
Yup, that's optimal allocation code, I use it all the time.
Replies: >>105569202
Anonymous
6/12/2025, 10:05:53 AM No.105569202
>>105569153
Triple retard.
Replies: >>105569229
Anonymous
6/12/2025, 10:09:53 AM No.105569229
>>105569202
Seethe, nocoder.
Replies: >>105569250
Anonymous
6/12/2025, 10:12:32 AM No.105569250
>>105569229
>retard nocoder which is a retard with invalid opinions calls others nocoders
Classic.
Replies: >>105569273
Anonymous
6/12/2025, 10:16:49 AM No.105569273
>>105569250
Post your allocator, you have 5 minutes.
Replies: >>105569291
Anonymous
6/12/2025, 10:20:08 AM No.105569291
>>105569273
Retard.
Anonymous
6/12/2025, 10:23:05 AM No.105569316
>registry dumber is high enough to look down on others
>not high enough to avoid his flight control system from telling him to retard the throttle
Anonymous
6/12/2025, 10:24:54 AM No.105569328
final_version
final_version
md5: 5ccbf0ae1ed7d5d65d7efa3b9b038f04๐Ÿ”
You called?
Anonymous
6/12/2025, 10:31:59 AM No.105569387
>.015s
Not bad for a toy that doesn't need to exist in the real world.
Anonymous
6/12/2025, 10:32:43 AM No.105569399
I can see why other people think you're a retard.
Anonymous
6/12/2025, 11:18:06 AM No.105569780
Imagine trying to prove how good you are at something by producing the absolutely most useless showcase for it
Replies: >>105570051
Anonymous
6/12/2025, 11:23:16 AM No.105569813
How would a nocodeshitter like you know? You've never done anything in your life.
Replies: >>105569869 >>105570051
Anonymous
6/12/2025, 11:32:24 AM No.105569869
>>105569813
how many people have used your registry dumper?
Replies: >>105570051
Anonymous
6/12/2025, 11:34:38 AM No.105569882
>attempt to change the topic
Denied.
Replies: >>105570051
Anonymous
6/12/2025, 11:39:38 AM No.105569914
broken-glass-1818066_960_720
broken-glass-1818066_960_720
md5: 5aa79fda230e91d0540ea24d2d9d6cf8๐Ÿ”
ego shattered by the simplest of questions
Anonymous
6/12/2025, 11:40:52 AM No.105569925
Yeah, you can tell "nocodeshitter" really hit a nerve.
Anonymous
6/12/2025, 11:45:25 AM No.105569956
ad hominem don't hit anything, it's just noise
if anything, it proves complete lack of counter-arguments
Anonymous
6/12/2025, 11:46:13 AM No.105569960
Is that why you were desperate to change the topic? LOL
Replies: >>105570008
Anonymous
6/12/2025, 11:49:57 AM No.105569977
screenshot
screenshot
md5: 96c59c41b9ba4a9f6876cefeefda881b๐Ÿ”
Anonymous
6/12/2025, 11:52:31 AM No.105569995
>again desperate attempt to change the topic
The fun never ends.

For me.
Anonymous
6/12/2025, 11:54:59 AM No.105570008
>>105569960
topic was proving proficiency with a useless implementation
insulting posters is not a topic
failing to answer an on-topic question by deflection or ad hominem is a form of steering away from the topic
Replies: >>105570019
Anonymous
6/12/2025, 11:56:30 AM No.105570019
>>105570008
I know you're retarded and don't, but I want to know what you'll say: do you know what projection is and how it works?
Replies: >>105570051
Anonymous
6/12/2025, 11:57:55 AM No.105570028
No, Ivan. *The* topic was that you being a nocodeshitter renders you utterly incapable of such judgement in the first place, and there is nothing you can do about it.

So simple.
Anonymous
6/12/2025, 12:01:11 PM No.105570051
>>105570019
yeah, like the reply >>105569813 to post >>105569780
or reply >>105569882 to post >>105569869

those are some examples of projection
Replies: >>105570059
Anonymous
6/12/2025, 12:02:06 PM No.105570056
>Ivan doesn't understand it's not projection if it's true
Replies: >>105570143
Anonymous
6/12/2025, 12:03:17 PM No.105570059
>>105570051
If you know this, why are you responding then, moron.
Anonymous
6/12/2025, 12:05:45 PM No.105570070
1660750900685610
1660750900685610
md5: 933a35d22250c2a3ab1b4f0e8d2727a6๐Ÿ”
>implying he does
Anonymous
6/12/2025, 12:16:42 PM No.105570143
>>105570056
people projecting always think with great conviction their projections are true - that's one of the defining points of it
so you only further confirm and validate it was, in fact, projection
Anonymous
6/12/2025, 12:19:59 PM No.105570164
dump
dump
md5: bb8c2a710e58f52d26f15b5be94d460d๐Ÿ”
Still waiting for your implementation to prove you're not a nocodeshitter. 500 MiB, 10 seconds. Go.
Replies: >>105570416
Anonymous
6/12/2025, 12:38:04 PM No.105570268
1734407528623092
1734407528623092
md5: e306e7fb485cd4699837dd7ad8ebdffd๐Ÿ”
Please do not engage with the homeless schizos.
Anonymous
6/12/2025, 12:39:54 PM No.105570279
autismo_hasnt_changed_his_script_in_thirty_years
autismo_hasnt_changed_his_script_in_thirty_years
md5: 80222f433bc8f06cda58f35ee16af80e๐Ÿ”
When will you LEARN?
Anonymous
6/12/2025, 1:05:15 PM No.105570416
>>105570164
you have made the mistake of thinking anyone cares about you throwing insults at others, especially for not engaging in writing such a useless program (useless because it has no users or usecases - feel free to prove otherwise). you're like the kid who tried to be the school bully but no one bought it and instead all made fun of him

if you took time to reflect how these threads have been going for the last months, you'd realize how it has backfired on you - no one ever engages in your "challenge", no one cares about being called a "nocodeshitter" or whatever by you, while you yourself have earned the label of "regdump schizo"
at this point the only kinds of engagement you can count for is more trolling and jabs at your futile workpiece
no one will really stop you from your endless insult replies, just be aware that you're not making a dent on anyone, no matter how hard you seethe at everyone
Anonymous
6/12/2025, 1:08:45 PM No.105570437
Sorry, my currency of choice isn't empty words - only code. Which is why nocodeshitters like you are worthless to me.
>didn't even read two sentences of your post
Replies: >>105570515 >>105570777
Anonymous
6/12/2025, 1:21:27 PM No.105570515
>>105570437
now post that again without crying
Anonymous
6/12/2025, 1:22:57 PM No.105570524
See, Ivan, now THAT is projection.
Replies: >>105570546
Anonymous
6/12/2025, 1:26:08 PM No.105570546
>>105570524
Your schizo behaviour of stopping replying to posts doesn't show that.
Anonymous
6/12/2025, 1:27:35 PM No.105570550
Why change what works?
Anonymous
6/12/2025, 2:03:09 PM No.105570777
>>105570437
So where/s the code? Post direct link to the repo.
Replies: >>105570823
Anonymous
6/12/2025, 2:09:58 PM No.105570823
regger_threads
regger_threads
md5: 771ac2b3b8e063673dbc2d54b1b35222๐Ÿ”
>>105570777
What, and have some nocodeshitter steal it without having to put any work into it? I have already provided enough proof of the existence of the code and its results than /dpt/s autistic wafflers have any right to.
Replies: >>105570846
Anonymous
6/12/2025, 2:13:26 PM No.105570846
>>105570823
I see that you're severely mentally ill just from that snippet, don't post anything else, ever again, schizo.
Anonymous
6/12/2025, 2:16:01 PM No.105570864
hexes
hexes
md5: eb9a4e0fb9638e87ccb6ac2fb7773a6e๐Ÿ”
>another incompetent nocodeshitter with another strong opinion
Hold the presses.
Anonymous
6/12/2025, 2:27:33 PM No.105570929
1737211135595145
1737211135595145
md5: 3359e5b5afafb282677190f2b2e6b132๐Ÿ”
Good afternoon, Ada chads.
Reminder that basedlangs don't have a LOLITA.
Anonymous
6/12/2025, 2:29:07 PM No.105570942
Good.