/dpt/ daily programming thread - /g/ (#106108612) [Archived: 10 hours ago]

Anonymous
8/1/2025, 10:35:33 PM No.106108612
1646116393232
1646116393232
md5: a4caa20fa77e32af7ab2197ace6845b4๐Ÿ”
The general is very dead lately
How are you guys?
Replies: >>106108646 >>106108827 >>106109754 >>106109848 >>106110201 >>106111414 >>106116294 >>106117239 >>106121655 >>106122160 >>106124955 >>106129208 >>106137349 >>106137705 >>106141189 >>106143241 >>106145413
Anonymous
8/1/2025, 10:38:27 PM No.106108646
>>106108612 (OP)
>no - in subject
>no previous thread:
>no what are you working on /g/
Replies: >>106108653
Anonymous
8/1/2025, 10:39:04 PM No.106108653
>>106108646
what are you working on /g/?
Replies: >>106108668
Anonymous
8/1/2025, 10:40:07 PM No.106108668
>>106108653
nothing it's the weekend
Anonymous
8/1/2025, 10:41:55 PM No.106108685
1750898550724946
1750898550724946
md5: b0aae2f5417ee387b6f33c393bc361eb๐Ÿ”
I got buck broken by an AI at my company's code duel yesterday. I've been feeling pretty shit, bro.
Replies: >>106108732 >>106108739
Anonymous
8/1/2025, 10:45:51 PM No.106108732
>>106108685
Our jobs are safe for the next 10 years no worries bro
Replies: >>106108744 >>106109126
Anonymous
8/1/2025, 10:46:23 PM No.106108739
>>106108685
Dumb frogposter
Anonymous
8/1/2025, 10:46:45 PM No.106108744
>>106108732
Try 15, nocoder.
Anonymous
8/1/2025, 10:53:31 PM No.106108827
>>106108612 (OP)
this image is actually accurate beyond author's comprehension. It is true that c++ feels like cloud, but once there is more people on the project, your cloud crumbles.
A person who conquered rust would be extremely proficient in actually good languages (C, Zig...) because it is a great playground for learning programming in general (though awful in production).
Replies: >>106137789 >>106139291 >>106140429
Anonymous
8/1/2025, 10:58:16 PM No.106108880
I miss AoC bros
Replies: >>106119454
Anonymous
8/1/2025, 11:15:27 PM No.106109126
>>106108732
they're safe until someone fundamentally changes how "AI" is made. LLMs have 0 chance of being anything other than very sophisticated autocomplete
Anonymous
8/1/2025, 11:44:04 PM No.106109461
My vibe coding experience so far:

>chatgpt.com copy and pasting, it verks so vell!
>grok.com + chatgpt.com copy and pasting to fix when it gets stuck in a loop of trying to fix an error/bug
>grok.com only copy & pasting
>cursor
>cursor + grok.com
>grok.com only copy & pasting
>github copilot inside Visual Studio

And that's where we are. Copilot is generating small, usable code snippets and intelligently inserting them whilst I have a discussion with the bot and manually edit the file in the background in between tasks I give it.

Also Grok4 is fucking broken for generating code, shit doesn't even work. Grok3 worked well though. Grok3 is not bad at programming.

This GitHub Copilot approach seems extremely reasonable even for a large project.
Replies: >>106114136
Anonymous
8/2/2025, 12:15:51 AM No.106109754
HitsPipe
HitsPipe
md5: 9efa6274c9f208596fd5642d90c1c083๐Ÿ”
>>106108612 (OP)
>decide to make shitty FTP-like program in Java to practice networking skills
>discover I am basically making worse FileZilla
The fun of recreational programming is that nothing you make has to be particularly original or useful
Replies: >>106109839
Anonymous
8/2/2025, 12:23:55 AM No.106109839
>>106109754
I start next to no projects and finish literally none because I have an unshakeable need to make something actually useful instead of just [thing] but worse and I don't know how to stop.
Replies: >>106111425
Anonymous
8/2/2025, 12:24:56 AM No.106109848
>>106108612 (OP)
>C++
>lvaues
>rvalues
>raii
>move semantics
>[[nodiscard]]
>member initialisation
>raii
>sfinae
>type erasure
kek
Replies: >>106109935 >>106119374
Anonymous
8/2/2025, 12:33:12 AM No.106109935
>>106109848
>raii twice
Replies: >>106109998
Anonymous
8/2/2025, 12:40:39 AM No.106109998
order-of-constructor
order-of-constructor
md5: eba3b0d5a0d6c2cb9c7de2ae44559996๐Ÿ”
>>106109935
yes.
Replies: >>106110034 >>106138088
Anonymous
8/2/2025, 12:45:38 AM No.106110034
>>106109998
This is like a zoomer saying math is stupid and posting an image of 1 + 1 = 2 as if it's the most mindboggling shit in the world
Replies: >>106110541
Anonymous
8/2/2025, 1:03:03 AM No.106110201
>>106108612 (OP)
>The general is very dead lately
I don't post in threads with tranime in the OP.
Replies: >>106110248
Anonymous
8/2/2025, 1:07:34 AM No.106110248
>>106110201
Yet you posted in the frog thread
Replies: >>106114037
Anonymous
8/2/2025, 1:11:25 AM No.106110294
Untitled
Untitled
md5: 8f010879259a139696f404a8c2b859cb๐Ÿ”
I wanted to use lua to make very basic command line programs, but I ran into a road block and was hoping for some insight.

when I run the script with the lua interpreter, the arguments are processed as expected, if I use rtc however, a Lua script to executable compiler that comes with LuaRT Studio, the varargs no longer prints, I tried using `io.write()` instead of `print()` but that didn't work either. Anyone familiar enough to point me in the right direction?
Replies: >>106110377
Anonymous
8/2/2025, 1:17:29 AM No.106110359
i feel like negative progress is being made in major compilers implementing C++26
Replies: >>106114029
Anonymous
8/2/2025, 1:19:52 AM No.106110377
Untitled
Untitled
md5: 83d36db7d8be95d08de465622c6c742f๐Ÿ”
>>106110294
nevermind, I found it right after I posted this, replace `...` with `arg` then you get a table
Anonymous
8/2/2025, 1:36:12 AM No.106110541
9680
9680
md5: c8946799b7901b9534331b84d4b45a44๐Ÿ”
>>106110034
uh huh.
Replies: >>106110910
Anonymous
8/2/2025, 2:12:11 AM No.106110910
>>106110541
holy shit a makefile im so impressed
Replies: >>106111294
Anonymous
8/2/2025, 2:55:01 AM No.106111294
>>106110910
>cargo r
rust won.
Replies: >>106143304
Anonymous
8/2/2025, 3:13:39 AM No.106111414
1751418204654658
1751418204654658
md5: a86084f1e2fe0d691529b3f02fc5390a๐Ÿ”
>>106108612 (OP)
Working on O(1) switch/case statements for my compiler. It's very comfy
Anonymous
8/2/2025, 3:15:28 AM No.106111425
KuugaThumbsUp
KuugaThumbsUp
md5: 8c3348bb075952606efc15c8c4a9ffde๐Ÿ”
>>106109839
Accept that some things are just practice and not everything you make has to be something you can show someone else. Your first projects in a new language or with a new library are probably going to be shitty, but the purpose of starting out like that is to learn something.

Making something bad is a stepping stone to making something good, anon.
Anonymous
8/2/2025, 9:42:56 AM No.106113785
original rust compiler in ocaml
interesting read

https://github.com/rust-lang/rust/blob/ef75860a0a72f79f97216f8aaa5b388d98da6480/src/boot/fe/lexer.mll
Replies: >>106114065
Anonymous
8/2/2025, 10:29:39 AM No.106114029
>>106110359
Literally nobody completed std23, import std seems to be very challenging
Replies: >>106114736 >>106133050
Anonymous
8/2/2025, 10:30:15 AM No.106114037
>>106110248
Yes, why are you confused?
Anonymous
8/2/2025, 10:34:33 AM No.106114065
>>106113785
This remind me of this video
https://youtu.be/XJC5WB2Bwrc?si=ySnOufmSVFjBhQSH
Highly quality content
Replies: >>106114079
Anonymous
8/2/2025, 10:37:27 AM No.106114079
>>106114065
can't stand aivoiceslop, can people really not just record themselves speak
Replies: >>106114089 >>106114094 >>106138488
Anonymous
8/2/2025, 10:40:22 AM No.106114089
>>106114079
The whole thing looks like AI. ChatGPT wrote the script, read it out loud, and made the animations. Bet "George" (funny how the voiceover mispronounced his name) just asked a gen AI to make a video about a topic.
Anonymous
8/2/2025, 10:41:02 AM No.106114094
>>106114079
When the audience asked the guy why is he using ai edited voice, he said he is from south America
I guess south American English accent aren't the nicest to the ear
Anonymous
8/2/2025, 10:51:06 AM No.106114136
>>106109461
this is a thread about programming
Anonymous
8/2/2025, 12:08:09 PM No.106114605
9f962797db85acfeec5c6cbecdf7e478
9f962797db85acfeec5c6cbecdf7e478
md5: f3959622df9869673ab0e8e8f2d41b27๐Ÿ”
I'm hate C style C++ ,I use classes everywhere
I wrap static functions inside a class
I make everything an object
I prefer using over #define
Thanks God for concepts they saved me from the pain of sfine
Replies: >>106133050
Anonymous
8/2/2025, 12:30:24 PM No.106114736
>>106114029
Nobody cares about modules
Replies: >>106116303 >>106133050
Anonymous
8/2/2025, 1:59:52 PM No.106115331
What's the general logic for handling scheduling errors because of server downtime?
For example, a message has to be posted at 9:00 and deleted at 10:00, but the server crashed at 8:45 and came back online at 10:15.
What if it came back online at 9:30?
Replies: >>106115813
Anonymous
8/2/2025, 2:32:46 PM No.106115609
Anybody checking out jai after the leak?
Replies: >>106115743
Anonymous
8/2/2025, 2:45:27 PM No.106115694
I built a NAS a few days ago and wanted to make sure my files won't corrupt over time. Especially when I create backups on my external drive (unfortunately bit rot is a thing). I looked for open source tools but didn't find anything viable but hashdeep. However I wasn't really impressed by the time to run the tool since it didn't provide incremental hashing. That's why I implemented small tool to make sure my files won't rot without notice. And before making backups I make sure no rotten files are going into my backups. I'm pretty happy with it. First tool which I finished outside of work in the last years
Anonymous
8/2/2025, 2:52:31 PM No.106115743
>>106115609
>leak
Hook me up
Replies: >>106115781
Anonymous
8/2/2025, 2:58:13 PM No.106115781
>>106115743
>>106077531
I haven't really tried it yet, but I'm reading the docs and tutorials. It's pretty comfy.
Replies: >>106115804
Anonymous
8/2/2025, 3:01:47 PM No.106115804
>>106115781
Thanks. Will try it out.
Anonymous
8/2/2025, 3:03:27 PM No.106115813
>>106115331
store message status in file or whatever

get time on server start

if startup time within hour of message required posting and message status not posted post message
else if time outside of message required posting and message status posted delete message
else do nothing
Anonymous
8/2/2025, 3:58:46 PM No.106116294
C++
C++
md5: edd515848315c814c20eeb444f8b1cfe๐Ÿ”
>>106108612 (OP)
rate my code, how to improve this ?
export class VertexShader
{
std::string source;

public:
operator std::string() const { return source; }
operator std::string_view() const { return source; }

explicit VertexShader() = default;
explicit VertexShader(const std::string& src) : source(src) {}
explicit VertexShader(std::string&& src) : source(std::move(src)) {}
};

export class FragmentShader
{
std::string source;

public:
operator std::string() const { return source; }
operator std::string_view() const { return source; }

explicit FragmentShader() = default;
explicit FragmentShader(const std::string& src) : source(src) {}
explicit FragmentShader(std::string&& src) : source(std::move(src)) {}
};
Replies: >>106116718 >>106121294 >>106132984 >>106133037 >>106133886 >>106134926
Anonymous
8/2/2025, 3:59:48 PM No.106116303
>>106114736
I do care about them and want to use them, I hate headers and pre compiled headers
Replies: >>106119429
Anonymous
8/2/2025, 4:26:28 PM No.106116545
Screenshot From 2025-08-02 10-25-45
Screenshot From 2025-08-02 10-25-45
md5: aff2f52162a836783a59fd5a004866df๐Ÿ”
Goofy ass feature
Anonymous
8/2/2025, 4:47:20 PM No.106116718
>>106116294
It's crazy to me that 90% of a C++ program is dedicated to fixing problems that arise from using C++.
Replies: >>106116870
Anonymous
8/2/2025, 5:02:21 PM No.106116870
>>106116718
I made a value type to do a proper separation of concerns, std::string is too crude for what I'm doing, C strings are lame and make the API less safe less C string less problems
Inb4 wHy noT ruAt...
Too many restrictions and a lot of unsafe usage
Anonymous
8/2/2025, 5:11:42 PM No.106116958
capture
capture
md5: 37eaa543e7dd9443a6a1f8442929a091๐Ÿ”
ASMlet here, why is only the top function in my assembly listing working? other ones crash when called
I try swapping the functions around, only the top one works.
MASM x86
Replies: >>106117202
Anonymous
8/2/2025, 5:41:07 PM No.106117202
>>106116958
just tried these with nasm BTW and they work. I fucking hate microjeet
Anonymous
8/2/2025, 5:45:04 PM No.106117239
makefile_file_extension
makefile_file_extension
md5: d7cdfbf2399235bb1effbbd7d7ff243d๐Ÿ”
>>106108612 (OP)
Writing calibration tool for my diy gaming console.


What cross platform Makefile alternative do you guys like/recommend?

Cargo workspaces do not work the best with projects that uses different architectures for different crates and I have bunch of assets that have to be processed with ffmpeg/imagemagick/custom rust scripts and it doesn't make sense to put it all under build.rs script. I am currently using cargo-make, which has some really neat features but it's kind of tedious to write everything in toml and conditions ignore env vars(which I use as template variables).
What I am looking for is some make alternative that is:
>cross platform (at least linux and windows)
>skips tasks if their output is newer than input/source
>simple syntax without having to repeat yourself
>macros/templates so I can write tasks for bunch of similar files without having to repeat same shit over and over
>function as command alias (bonus)
>translate common linux commands into windows equivalents (bonus)
>autocomplete (bonus)
I don't need any Rust specific functionality, I just need something to run right commands when they are needed.
Replies: >>106139536 >>106139554 >>106143721
Anonymous
8/2/2025, 6:24:15 PM No.106117579
If I'm designing a new protocol today, should I just swallow my pride and define that protocol as something that is implemented on top of HTTP+JSON or should I actually make that protocol an application-layer protocol that is transmitted directly on top of TCP+TLS? I feel like I would be fucking over everyone with the latter option because they can't do load balancing as easily anymore and things like Cloudflare won't work either.
Replies: >>106117660
Anonymous
8/2/2025, 6:32:18 PM No.106117660
>>106117579
This entirely depends on what will the protocol be used for.
Replies: >>106117746
Anonymous
8/2/2025, 6:38:03 PM No.106117746
>>106117660
How so? I don't expect it to be used from web browsers and to be completely fair I don't think anyone is going to know about it at all, I'm just making it for myself essentially, so it doesn't really matter, but still
Replies: >>106117794
Anonymous
8/2/2025, 6:42:20 PM No.106117794
>>106117746
>How so?
Because there is no reason to require entire IP+HTTP stack when you have two MCUs talking to each other on a single circuit board.

What is your usecase
Replies: >>106117879
Anonymous
8/2/2025, 6:49:50 PM No.106117879
>>106117794
It's kind of an unusual RPC protocol that would be expected to be used over the public Internet and there is no real reason to send more than one RPC request before getting a response
Replies: >>106121327
Anonymous
8/2/2025, 7:56:46 PM No.106118486
ss+(2025-08-02+at+19-54-37)
ss+(2025-08-02+at+19-54-37)
md5: 680773e9a098fe82acc6b3c003adb077๐Ÿ”
Result/Option/Iterator play so nicely together in Rust.
Writing this imperatively required like 3 times more LoC and pointless intermediaries.
Replies: >>106118525 >>106122893 >>106126860 >>106126906
Anonymous
8/2/2025, 8:01:14 PM No.106118525
>>106118486
>Result/Option/Iterator play so nicely together in
traverse
Anonymous
8/2/2025, 8:01:21 PM No.106118528
file
file
md5: b855063e9c68e5023e79a25e749bf136๐Ÿ”
thekuzzy.win
thekuzzy.win
thekuzzy.win
Anonymous
8/2/2025, 9:23:55 PM No.106119182
Is there no way to write a macro in C that computes the min of 2 args which both: evaluates each of its arguments only once, and is a compile time constant? Statement expressions don't work because declarations in statement expressions are considered stack variables.
Replies: >>106119740
Anonymous
8/2/2025, 9:46:22 PM No.106119374
pepe
pepe
md5: e6b29a0441c1f626958667c037aed491๐Ÿ”
>>106109848
All those are features, not curses like the borrow checker.
Replies: >>106120456 >>106136799
Anonymous
8/2/2025, 9:53:04 PM No.106119429
Kyubey
Kyubey
md5: b77d32ab3c8074d622503500a4e1e615๐Ÿ”
>>106116303
Skill issue.
Replies: >>106119597
Anonymous
8/2/2025, 9:56:09 PM No.106119454
>>106108880
Work on your own library with comfy syntax to be ready this year.
auto operator+(const auto& v) {
auto s = decltype(*v.begin()){};
for (const auto& i : v) s += i;
return s;
}

https://godbolt.org/z/qs19hbK5s
Anonymous
8/2/2025, 10:04:41 PM No.106119543
// *(ADVANCED NOTE):
//
// Note that because a [] array points at someone else's memory, if you take
// a pointer to an element of the array, it may not remain valid indefinitely!
// This can easily happen with [..] resizable arrays, covered below, or in
// any other situation where the backing array could be deallocated.
//
// This is true not just for pointers to elements within the array, but also
// for the .data pointer of a [] array. And if that pointer becomes wrong,
// it invalidates the whole array! So, for example, the following code is wrong,
// and is a common mistake that many people may make:

{
a: [..] int;
for 1..10 array_add(*a, it); // Just fill a with some values.

v: [] int = a; // Make a view onto a.
for 1..10 array_add(*a, it); // Add more stuff to a.

// The following use of 'v' is incorrect, so let's put it in an 'if false' so it doesn't break.
// The problem is, any time you call array_add on a, it might move its memory. If you do this
// after assigning v, that is no good!
if false {
for v print("%\n", it); // <------- This is BAD, since 'a' moved!
}
}


I've seen so many times Jon himself and other people in the nu-C crowd say that these resizeable arrays suck and you should be using either a chunked version or virtual memory tricks, so that they have stable pointers. Kinda shocked to see this basic ass reallocating vector in here.
Anonymous
8/2/2025, 10:10:12 PM No.106119597
>>106119429
>Skill issue.
No skill is going to improve compile time
Replies: >>106120497
Anonymous
8/2/2025, 10:27:29 PM No.106119740
>>106119182
you can have a _Generic that accept all int types and evalutes to a different inline function in each clause and invoke that on (a, b)
that's standard but doesnt work on compile time constants
but then for compile time constants you dont care about double evaluation so you can use normal min-max macros
i don't think it's possible to write a macro that handles both cases
Replies: >>106122378
Anonymous
8/2/2025, 11:49:02 PM No.106120456
>>106119374
the borrowil checker is a feature. Get good.
Replies: >>106120483 >>106137808
Anonymous
8/2/2025, 11:51:41 PM No.106120483
>>106120456
LMAO
Anonymous
8/2/2025, 11:52:42 PM No.106120497
stare
stare
md5: 6d46ba20f7619c3c749acd5b59f87d02๐Ÿ”
>>106119597
Anonymous
8/3/2025, 12:17:50 AM No.106120701
Jai has a lot going on I gotta say. I like being able to intercept everything as it's being built.
Replies: >>106121270
Anonymous
8/3/2025, 1:29:15 AM No.106121270
>>106120701
Stop wasting your time.
Replies: >>106121958
Anonymous
8/3/2025, 1:32:40 AM No.106121294
>>106116294
>std::string&& src
replace that without the &&, so it's just std::string, and you don't need 2 constructors, also the default constructor is pointless (explicit stops a certain silly syntax).
I personally just make a program and I don't hold onto the vertex or fragment shader, since after you make the program they aren't used anymore (you can delete them after compiling the shader program), the only reason to hold onto the shader is if you reuse the shader, but the GL driver should cache old shaders (GL performance debug callbacks should give you a notification when you compile a new shader that isn't cached, at least on nvidia).
I also don't use setters / getters when there is no point (just make variables public / use a struct), I also don't need to hold a copy of the shader text (RenderDoc/etc should already store a copy you can read, so I personally just have 2 functions, (const GLchar*) OR (const GLchar**, int count) for macros).
So my "shader" class just holds a program GLuint, and the uniform / attribute GLint's (plus an event handler for something else).
an initialization + destruction function that returns an error (constructors can't return errors).
then I have a function that initializes the VAO and VBO.
Also wtf is that export shit? This shouldn't be a module.
Modules are for library designers. As a C++ developer you should just stick to high level applications and stick with includes. Obviously it's all stylistic, you might just prefer the module style, but to me it seems like a solution to something that is very hard to explain in terms of productivity or fixing bugs, and for the issues it does solve, there is always a different way (C programmers will always prove you wrong in showing you that there is nothing that another language could do that you can't do in C, and all the issues you point out are just a skill issue).
Anonymous
8/3/2025, 1:32:55 AM No.106121298
I have a question regarding best practice. I have some code like

match my_choice:
case 1:
val_1 = ...
val_2 = ...
case 2:
val_1 = ...
val_2 = ...

some_val = val_1 + val_2

So obviously my IDE complains, that val_1 and val_2 could be unassigned if my_choice is neither 1 nor 2. However those two values are assigned through a combo-box in a UI, so it can only ever be 1 or 2. Nor do val_1 and val_2 have any default values that make sense that I can initialize them with or set them to in an else case.
Should I just leave it as is or is there some convention how to handle stuff like this, mostly for readability, since functionally there isn't anything more needed to cover all possible cases.
Replies: >>106121393 >>106121629 >>106121711
Anonymous
8/3/2025, 1:36:00 AM No.106121327
>>106117879
Not that anon nor did I understand what you mean. Though I can suggest looking at:
>registerProtocolHandler
>websockets
>local proxy that handles your protocol and normally routes everything else (like i2p)
Anonymous
8/3/2025, 1:44:04 AM No.106121393
>>106121298
case _:
raise Exception("unreachable")
Good for in case somehow another case becomes possible.
Replies: >>106121848
Anonymous
8/3/2025, 2:10:32 AM No.106121629
>>106121298
You should always be able to create a "blank" value.
Anonymous
8/3/2025, 2:14:49 AM No.106121655
Rust_WIP
Rust_WIP
md5: a69fcd6ceac75369ef56cc911c896e89๐Ÿ”
>>106108612 (OP)
Borrow checker is such an infantile phrase. I would deconstruct such a thing to see if it has anything useful, but would never lower myself to using fisher-price trash.
Anonymous
8/3/2025, 2:22:23 AM No.106121711
>>106121298
you should be asking yourself if you really need a switch statement for something so simple in the first place. iโ€™d have to see the full code but you could probably make it branchless relatively easily
Replies: >>106121848
Anonymous
8/3/2025, 2:35:25 AM No.106121848
>>106121393
That's the next best thing I could come up with
>>106121711
I thought about it too, but couldn't come up with anything good.
This part is supposed to rescale an image while preserving aspect ratio, so the actual code looks more like

match reference_dimension:
case "width":
target_width = image.get_width() * scaling_factor
target_height = target_width * height_factor / width_factor
case "height":
target_height = image.get_height() * scaling_factor
target_width = target_height * width_factor / height_factor

So depending on if I select width or height to be scaled in the UI (I know I should probably make it an Enum not a string later) the way the target dimensions are calculated is slightly different. I'm not sure if there is some smart math trick to do here to simplify it, but if there is I'm too tired to see it
Replies: >>106122655
Anonymous
8/3/2025, 2:50:03 AM No.106121958
>>106121270
Why is it a waste of time?
Anonymous
8/3/2025, 3:22:55 AM No.106122160
kPQ__at4fKKgnYwxUE1Y50bSW7dMyypwpCgPUmFRg04
kPQ__at4fKKgnYwxUE1Y50bSW7dMyypwpCgPUmFRg04
md5: fb16bc02efc57e072e53d9ae6838b76b๐Ÿ”
>>106108612 (OP)
Anonymous
8/3/2025, 3:55:22 AM No.106122378
>>106119740
I prefer the statement expression implementation for single eval, I'm fine with my code being coupled to clang/GCC because of how much useful stuff they provide
#define min(a, b) ({ \
typeof(a) a_ = (a); \
typeof(b) b_ = (b); \
a_ > b_ ? b_ : a_; \
})

After thinking about it a bit, this almost works, but doesn't work for at file scope, but it can be used in the length of a static array within a function.
#define min(a, b) (__builtin_choose_expr( \
(__builtin_constant_p((a)) && __builtin_constant_p((b))), \
min_ct((a), (b)), \
min_rt((a), (b))))
Anonymous
8/3/2025, 4:31:26 AM No.106122608
How do I sell the programs I make? Well, the programs AI make for me.
Replies: >>106122623
Anonymous
8/3/2025, 4:33:10 AM No.106122623
>>106122608
submit them to an app store then start advertising
Replies: >>106122626
Anonymous
8/3/2025, 4:34:08 AM No.106122626
>>106122623
Does it cost anything to put them up on Microsoft Store?
Replies: >>106122803
Anonymous
8/3/2025, 4:39:01 AM No.106122655
>>106121848
this is a trick i use in a lot of cases like this, it's especially useful for applying masks to things. it will make the code branchless but it will also be a little more difficult to read

int should_scale_width = (reference_dimension == "width");
target_width = should_scale_width * (image.get_width() * scaling_factor);
target_height = !should_scale_width * (image.get_height() * scaling_factor);
target_width += !should_scale_width * (target_height * width_factor / height_factor);
target_height += should_scale_width * (target_width * height_factor / width_factor);


>I know I should probably make it an Enum not a string later
yes you should, or just a bool in a case this small. my example only uses the string comparison for clarity following your original code
Replies: >>106125020
Anonymous
8/3/2025, 5:03:11 AM No.106122803
>>106122626
yep
https://www.windowscentral.com/software-apps/windows-11/windows-11-app-store-free-publishing-announcement-build-2025
Anonymous
8/3/2025, 5:15:51 AM No.106122893
>>106118486
>3 times more LoC
and 3 times more readable
what you posted is horrifying
Replies: >>106122925
Anonymous
8/3/2025, 5:21:33 AM No.106122925
image
image
md5: c677b0c991485119de030024e1b13ab7๐Ÿ”
>>106122893
You get used to reading it.


Eh, I hoped this will work but now even the compiler is giving up. I guess I can simplify the bounds if I ditch split_const altogether and generate these split_const_n with macros and a helper trait.
Replies: >>106126823
Anonymous
8/3/2025, 9:12:05 AM No.106124265
Are there any decent (And up to date) books on memory and writing allocators?
Or am i really stuck piecing together everything from cs books, github, blogs, and video presentations?
Replies: >>106124511
Anonymous
8/3/2025, 9:55:17 AM No.106124511
>>106124265
I don't know, but you probably don't need that shit anyway.
>short lifetime
Arena
>long lifetime, fixed size
Slab
>long but predictable lifetime, variable size
Arena is still fine
>long and unpredictable lifetime and variable size
This is usually rare enough that you can just use malloc or even mmap and it will be fine.
Anonymous
8/3/2025, 11:12:22 AM No.106124955
>>106108612 (OP)
Where's the game making guide? I got a crazy game idea that will set me up for retirement...
Replies: >>106125567
Anonymous
8/3/2025, 11:27:22 AM No.106125020
>>106122655
Uhh that's a neat trick, I'll make sure to remember that.
I think in my case I'll stick with the switch case though, mainly because it's a lot more readable and for a 100 line script I'm not concerned with optimizing for performance
Anonymous
8/3/2025, 1:10:41 PM No.106125567
>>106124955
Game making guide:
>1) download Unity
>2) add some entities and components
>3) add script
>4) search "how do I do X in Unity" on Google
>5) test if it is fun
>6) go back to 2)
There is no faster and more reliable way of making a game than just prototyping tons of shit until it is fun. Then you just add more content, assets and ship it as on itch.io or steam.
Anonymous
8/3/2025, 4:10:42 PM No.106126644
i want to contribute to an open source project but the only ones i actually use are too hard for me
Replies: >>106126769
Anonymous
8/3/2025, 4:22:38 PM No.106126769
>>106126644
Search the issue tracker for smaller bugs. I was in the same boat and couldn't find much for the app I used, beyond styling errors. If you can't find any bugs, just download the repo and make changes on your own. You don't have to push them to the project, but you can improve your familiarity with the software. Having done that, when you do see a bug pop up, you might be able to solve it before the regular maintainers get to it.
Anonymous
8/3/2025, 4:27:17 PM No.106126823
Screenshot 2025-08-03 at 16-26-41 Compiler Explorer
Screenshot 2025-08-03 at 16-26-41 Compiler Explorer
md5: b5af926cd7952250547c2e049cf5bb3c๐Ÿ”
>>106122925
Got it working.
Replies: >>106127027
Anonymous
8/3/2025, 4:28:34 PM No.106126837
1750143972951471
1750143972951471
md5: 6d9f0615b8bfb8b9e45df9bd0ae00073๐Ÿ”
doing a read about github backup

pretty cool how a snapshot of the whole of github fits in a cabinet in some mine in norway
Anonymous
8/3/2025, 4:30:31 PM No.106126860
>>106118486
which font are you using?
Replies: >>106126869
Anonymous
8/3/2025, 4:31:40 PM No.106126869
>>106126860
JetBrains Mono IIRC
Anonymous
8/3/2025, 4:34:59 PM No.106126906
>>106118486
had fun using rust for about 8 months at my old job but seeing that code i know i won't be going back. don't need the performance to warrant all that syntax, something like Haskell or Lisp is way more elegant.
Replies: >>106126946
Anonymous
8/3/2025, 4:39:59 PM No.106126946
>>106126906
Except for the range operator (from..to), the syntax in that image is very basic. Just normal dot chains and lambdas, very similar to what you would see in Javascript or any other modern language.
It's the semantics that are complex here.
Replies: >>106126966 >>106127091
Anonymous
8/3/2025, 4:42:16 PM No.106126966
>>106126946
the semantics you get used to in a few months. borrow checker, lifetimes, smart pointers, never had a problem with them. it's the syntax that's ugly and cluttered and hard to read.
Replies: >>106127027
Anonymous
8/3/2025, 4:50:51 PM No.106127027
>>106126966
Are you sure you are not confusing IDE inline hints as part of the syntax?
Just add explicit return and change |_| into [](auto &&) and you got C++ syntax. Or () => and you get JS syntax.
The syntax here is nothing radical. If you want to see some complex syntax look at metaprogramming here: >>106126823
Replies: >>106127173
Anonymous
8/3/2025, 5:00:15 PM No.106127091
>>106126946
>Except for the range operator (from..to), the syntax in that image is very basic
the syntax may not be that bad but the code layout and indentation are profoundly retarded
Anonymous
8/3/2025, 5:09:28 PM No.106127173
>>106127027
i wasn't talking about that example in particular, it just reminded me that rust in general is a bit of an eyesore. add in explicit types (which you have as IDE hints) and yes it's even worse.
fn fetch_and_parse(urls: Vec<String>) -> Result<Vec<(String, usize)>, Box<dyn std::error::Error>> {
let client = reqwest::blocking::Client::new();
let mut results = Vec::with_capacity(urls.len());
for url in urls.iter() {
let resp = client.get(url).send()?.text()?;
let line_count = resp.lines().filter(|l| !l.trim().is_empty()).count();
results.push((url.clone(), line_count));
}
Ok(results)
}

think about what this would look like in haskell lol
Replies: >>106128333 >>106133939
Anonymous
8/3/2025, 7:07:42 PM No.106128208
uh oh rust is not as "desired" as it was

https://survey.stackoverflow.co/2025/technology/#admired-and-desired
Replies: >>106128865 >>106128913 >>106128945 >>106133115
Anonymous
8/3/2025, 7:21:20 PM No.106128333
>>106127173
>it just reminded me that rust in general is a bit of an eyesore
The code you have included is not that weird as well. Except for ? operator and no parentheses in for, this is something you would often see in typescript or C++.

>think about what this would look like in haskell lol
I don't know haskell though. Haskell is quite different from languages you generally use to get shit done.
Anonymous
8/3/2025, 8:16:10 PM No.106128845
might implement a trie
Anonymous
8/3/2025, 8:18:12 PM No.106128865
>>106128208
>haskell didn't make the list
bros... we got too cocky
Replies: >>106128872 >>106128913
Anonymous
8/3/2025, 8:19:14 PM No.106128872
>>106128865
>rustroons don't know we exist
we're safe... for now...
Replies: >>106128913
Anonymous
8/3/2025, 8:23:24 PM No.106128913
>>106128208
>>106128872
>>106128865
rust is literally stone dead all development has halted
Replies: >>106128920 >>106128970
Anonymous
8/3/2025, 8:24:31 PM No.106128920
>>106128913
Source?
Replies: >>106128932
Anonymous
8/3/2025, 8:26:02 PM No.106128932
>>106128920
the developers who make it are looking for jobs
Replies: >>106128968 >>106128993
Anonymous
8/3/2025, 8:27:38 PM No.106128945
>>106128208
>scroll through it
>web shit
>scripting shit
>docker
Who fucking cares?
Replies: >>106128983
Anonymous
8/3/2025, 8:29:27 PM No.106128968
>>106128932
lmao i was just reading about
two rust compiler devs weren't getting paid enough and now they are throwing a tantrum because the good paying jobs they are getting offered won't let them work on the rust compiler
Replies: >>106129018 >>106129063
Anonymous
8/3/2025, 8:29:35 PM No.106128970
>>106128913
https://blog.rust-lang.org/2025/07/03/stabilizing-naked-functions/
Literally a month ago. What are you on about retard?
Anonymous
8/3/2025, 8:30:52 PM No.106128983
1738800751266267
1738800751266267
md5: eeb6f4a5d1074d35c12fa9118e47b8b9๐Ÿ”
>>106128945
Well, most developers are working on webshit, what do you expect?

Also what's interesting is that everyone is against vibe coding with almost no variance across age groups.
Replies: >>106128999
Anonymous
8/3/2025, 8:31:49 PM No.106128993
1746226848685506
1746226848685506
md5: c467dd7b140e84fbc285800539793c48๐Ÿ”
>>106128932
Wasn't that just two people? It seems like a lot more than just two dudes work on it.
Replies: >>106129176 >>106133202
Anonymous
8/3/2025, 8:32:08 PM No.106128999
>>106128983
>11% of people are vibe coding
out of SO survey responders. which means probably 50% of devs are doing this
Anonymous
8/3/2025, 8:32:41 PM No.106129005
mental how im scrolling through rust contributors and all the "women" are men
Anonymous
8/3/2025, 8:33:05 PM No.106129008
running build_ext
running build_rust
error: can't find Rust compiler

If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

bros I hate rust trannies so fucking much
Replies: >>106129043
Anonymous
8/3/2025, 8:33:48 PM No.106129018
>>106128968
Really telling how Jewish our society is that you need permission from your noseberg to contribute copyright code (legally) to FOSS. How did we let this happen?
Anonymous
8/3/2025, 8:36:13 PM No.106129043
>>106129008
>A bloo bloo I'm a scripting babby
No one cares about you thougheverbeit. Write your own cython or cffi bindings faggot.
Replies: >>106129075
Anonymous
8/3/2025, 8:37:40 PM No.106129063
>>106128968
Reddit was acting like these two dudes are out on the streets begging for food. They're delusional asking for $600,000 a year to do what they want.
Anonymous
8/3/2025, 8:38:46 PM No.106129075
>>106129043
kill yourself you fucking nigger
Replies: >>106129081 >>106129092
Anonymous
8/3/2025, 8:39:33 PM No.106129081
>>106129075
LMAO done him
Anonymous
8/3/2025, 8:40:46 PM No.106129092
>>106129075
Why are you so butthurt? Do you realize I'm right? This is /dpt/, start coding, stop whining or just install rustc.
Replies: >>106129117
Anonymous
8/3/2025, 8:43:14 PM No.106129117
>>106129092
got it fixed by downgrading the packages but the ecosystem is going down the tubes because of rust trannies
>I'm right?
kill yourself you fucking nigger
Replies: >>106129160 >>106129234
Anonymous
8/3/2025, 8:46:55 PM No.106129160
>>106129117
Mate calm down. NTA I don't even use Rust but you can't shit on anything when you're working with that horrid mess that is pip. Delete Python and use something better.
Anonymous
8/3/2025, 8:48:07 PM No.106129176
file
file
md5: d60ed1fc99d7c31686a4a12c306ece3f๐Ÿ”
>>106128993
Replies: >>106129213
Anonymous
8/3/2025, 8:51:12 PM No.106129208
>>106108612 (OP)
>The general is very dead lately
computers do the work.
Anonymous
8/3/2025, 8:51:38 PM No.106129213
1752778426266537
1752778426266537
md5: 439dddac85dfb566c9f6011e0d740b13๐Ÿ”
>>106129176
>see girl name in commiters
>look "her" up
>pic related
EVERY
SINGLE
TIME
Replies: >>106129221 >>106129866 >>106133062
Anonymous
8/3/2025, 8:52:12 PM No.106129221
>>106129213
Why you shouldn't troon out if you're Dutch
Replies: >>106129262
Anonymous
8/3/2025, 8:52:46 PM No.106129229
Bro we get it, you're obsessed with troons.
Can you maybe just post about programming though.
Anonymous
8/3/2025, 8:53:19 PM No.106129234
>>106129117
>Muh ecosystem is going down the tubes
I deal with a lot of fly-by-night JavaScript garbage too, but since I didn't write it and it works and having nodejs isn't onerous, I just accept it instead of throwing a shit fit. Set up a container that has all the build tools you need and stop crying like a bitch. I ask again, what exactly is your problem?
Replies: >>106129253
Anonymous
8/3/2025, 8:55:07 PM No.106129253
>>106129234
why are you helping him when he's being so rude to you
Replies: >>106129277
Anonymous
8/3/2025, 8:56:08 PM No.106129262
>>106129221
he must have a massive dick
Anonymous
8/3/2025, 8:57:26 PM No.106129277
>>106129253
Because I legitimately don't understand the mindset. When I was younger I cared about purity and everything, but being forced down the stupid blackduck, sbom, retarded cancer path, I realized almost all of it is 100% a meme.
Anonymous
8/3/2025, 9:32:47 PM No.106129639
I'm implementing bit vectors as I'm trying to learn about compression and need some primitives for building variable length codes.
Anonymous
8/3/2025, 9:48:50 PM No.106129814
finally got around to fixing some things in my filemanager i am currently writing
Anonymous
8/3/2025, 9:53:39 PM No.106129866
>>106129213
I love Mara
Replies: >>106130028
Anonymous
8/3/2025, 10:10:17 PM No.106130028
>>106129866
All I know is I have his book and it was easy to read and digest. Needed more depth though, but whatever. Points you in the right places at least.
Anonymous
8/3/2025, 10:20:35 PM No.106130163
ChatGPTClient_โ€“_ChatGPTHandler.java_phwO7
ChatGPTClient_โ€“_ChatGPTHandler.java_phwO7
md5: 32b134fbae3eab352ea49034e707e762๐Ÿ”
should i be using final string static like this?
the key isn't changing
Replies: >>106130495
Anonymous
8/3/2025, 10:51:14 PM No.106130495
>>106130163
why don't you ask chatgpt since you're just gonna vibe code anyway
Anonymous
8/4/2025, 12:19:13 AM No.106131368
>Java
>GPT
Saar...
Replies: >>106133033
Anonymous
8/4/2025, 3:45:54 AM No.106132984
>>106116294
avoid implicit convertions, instead of operators use toString method
never return sting views
Anonymous
8/4/2025, 3:53:50 AM No.106133033
>>106131368
projecting gojeet
Anonymous
8/4/2025, 3:54:52 AM No.106133037
>>106116294
>modules
holy ARYANโ€ฆ
Anonymous
8/4/2025, 3:57:56 AM No.106133050
>>106114029
Why is it that challenging? I can write my own module std and import that. Am I missing something?

>>106114605
Based Java-with-destructors GOD.

>>106114736
No one wants to keep fully qualifying namespaces, Rajesh. I will use using statements as much as I please and modules are the key.
Anonymous
8/4/2025, 3:59:20 AM No.106133062
>>106129213
WOULD
Anonymous
8/4/2025, 4:07:19 AM No.106133115
IMG_3095
IMG_3095
md5: ae87637d1ece1eab8042615dd573f125๐Ÿ”
>>106128208
>Gleam is a new addition to the list, and for good reason - developers like it!
Oh, itโ€™s โ€œWhat if Rust, but also Elixir?โ€ for maximum transexuality
Replies: >>106134414 >>106135002 >>106136753 >>106137844
Anonymous
8/4/2025, 4:23:18 AM No.106133202
>>106128993
>It seems like a lot more than just two dudes work on it.
you forget how niche this """"""""languaige"""""""" is
Anonymous
8/4/2025, 5:46:49 AM No.106133737
The ideal language would be C++ with Java style conventions and syntax and Java sized standard library, Rust-style modernisations to standard library classes, and Rust-style ecosystem.
Replies: >>106134431
Anonymous
8/4/2025, 6:12:37 AM No.106133886
>>106116294
where's the code
Anonymous
8/4/2025, 6:21:28 AM No.106133939
file
file
md5: e17fecb055a53de5a5b55023ce9201cf๐Ÿ”
>>106127173
>Box<dyn std::error::Error>
Anonymous
8/4/2025, 8:01:21 AM No.106134414
>>106133115
holy shit it's real
why would they assume that nazis want to infiltrate a programming language to the point of having that on their front page
Replies: >>106134888 >>106136662
Anonymous
8/4/2025, 8:03:41 AM No.106134431
>>106133737
>i only know java, heard that c++ is fast, and that rust has some improvements over it
Replies: >>106136607
Anonymous
8/4/2025, 8:13:40 AM No.106134505
Currently learning Rust right now.
Kill me.
Anonymous
8/4/2025, 8:21:49 AM No.106134553
Miss reading interesting articles written by humans back in the day.

https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/
Replies: >>106134941
Anonymous
8/4/2025, 8:55:37 AM No.106134736
If the c math library is part of the standard library, how come I have to link it?
Anonymous
8/4/2025, 9:22:06 AM No.106134888
1730308833473587
1730308833473587
md5: d5479180cfd487bc454ed78d64d1b7bb๐Ÿ”
>>106134414
Funny how every discussion on Gleam turns into an argument on their political messages.

https://news.ycombinator.com/item?id=42821399

Also funny that the creator is one of those 2014-twitter-SJW-tier militant progressives and thinks anything right of far-left is "Nazi bullshit" and will ban you for giving his posts a thumbs down.
Replies: >>106136216 >>106136753
Anonymous
8/4/2025, 9:28:48 AM No.106134926
>>106116294
>rate my code
>posts boilerplate
Anonymous
8/4/2025, 9:32:12 AM No.106134941
>>106134553
the guy misunderstood (or at least misrepresented) what abstraction is

the point of abstraction in programming is that you are not supposed to care about the implementation details. but what he does is focus on the implementation anyway, then calls the abstraction "leaky" because there are bugs in the implementation. which, if fixed (like the SQL WHERE example), would not require any downstream corrections - only proving abstractions actually work as intended
Replies: >>106134979 >>106134984
Anonymous
8/4/2025, 9:40:10 AM No.106134979
>>106134941
Yeah I don't think it's very good either, it's basically a strawman. Nobody thinks TCP is truly guaranteed delivery. The benefit of TCP is either your data gets delivered or you are made aware that data may have been dropped in the form of a TCP disconnect (keepalive timeout or TCP reset), and you can handle that appropriately for your application.
Anonymous
8/4/2025, 9:41:23 AM No.106134984
>>106134941
his point is that you need to understand what's underneath the abstractions to actually fix the leak

if you're working with an abstraction like SQL or String class and something breaks or you get performance issues, you can only fix the problem if you understand the implementation

i guess a modern example is using a server framework but you hit a bottleneck and don't know why because you don't understand what network operations that framework does under the hood
Replies: >>106135318
Anonymous
8/4/2025, 9:43:41 AM No.106135002
>>106133115
I can't imagine spending time creating something as big as a programming language, something that is already hard to get adoption for, and then going out of your way to be divisive up front. As if 1% of the population was just too many people to contribute they had to constrict it even farther.
Anonymous
8/4/2025, 10:02:52 AM No.106135094
weird how compilers have like 100,000 stars on github as if the people who star it will come back to it to make a contribution
Anonymous
8/4/2025, 10:44:03 AM No.106135318
>>106134984
>his point is that you need to understand what's underneath the abstractions to actually fix the leak
and it's a wrong premise when it's not a problem with the abstraction itself

yes, you do need to know of and have access to the implementation to fix issues with the implementation
but it's not a problem with the abstraction until there's an actual issue with its interface, eg. a SQL library/wrapper that doesn't let you use the same table twice in one query
Anonymous
8/4/2025, 12:26:10 PM No.106135884
Thoughts on Elixir for servers? It handles hundreds of thousands of connections out of the box (JVM thread-based servers could never).
Replies: >>106137865
Anonymous
8/4/2025, 1:22:49 PM No.106136216
1728410773517215
1728410773517215
md5: dd5450def78b1fa6a19e3bf69f250d9b๐Ÿ”
>>106134888
>https://news.ycombinator.com/item?id=42821399
>It le speaks to me
Oldfags should have done a better job gatekeeping
Anonymous
8/4/2025, 1:54:04 PM No.106136417
Why did Rust off the deep end with appealing to trannies etc? Why didn't they just make a language and focus on that instead?
Replies: >>106136753
Anonymous
8/4/2025, 2:19:51 PM No.106136607
>>106134431
I use C++ regularly, love the Java standard library, and wish C++ had a modern toolchain and ecosystem like Rust. Kill yourself fag.
Replies: >>106136647 >>106136676 >>106136698
Anonymous
8/4/2025, 2:25:58 PM No.106136647
>>106136607
learn TLC, Prolog, Erlang, Lisp etc then come back and talk about languages
Replies: >>106137268 >>106137871
Anonymous
8/4/2025, 2:29:15 PM No.106136662
>>106134414
reading these threads and posts like yours, I almost think having a filter like this is a good thing. I say this as someone who's probably more of a fucking nazi than most you cucks. get the fuck over your retarded opinons. FOSS is about code only. socioeconomic politics bullshit belong somewhere else.
Replies: >>106136682
Anonymous
8/4/2025, 2:31:34 PM No.106136676
>>106136607
hey, at least zig (as a c++ compiler) exists. that has been an immense uplift in dev usability honestly.
I was able to remove a bunch of bullshit gcc build systems since zig can target most non-meme archs w/ libc choice in a ~100MiB distribution.

clangd is ok. vcpkg is acceptable if you don't care too much. etc.
Replies: >>106137327
Anonymous
8/4/2025, 2:32:19 PM No.106136682
>>106136662
literal schizo can't see his own post contradicts itself.
Anonymous
8/4/2025, 2:34:24 PM No.106136698
>>106136607
have you looked into C#?
P/Invoke is ok and they're making C# less boiler plate-y. If you're on Windows, you also have C++/CLI for more C++ interop, only works on Windows though and it's kind of a bitch.
Replies: >>106136717 >>106137368
Anonymous
8/4/2025, 2:36:42 PM No.106136717
>>106136698
what is the c# equivalent for people who want nothing to do with windows
Replies: >>106136724
Anonymous
8/4/2025, 2:37:33 PM No.106136724
>>106136717
uh... Vala I guess?
dead lang though. Pretty sure even GNOME is going with Rust moving forward.
Anonymous
8/4/2025, 2:40:55 PM No.106136753
>>106136417
>Why did Rust off the deep end with appealing to trannies etc? Why didn't they just make a language and focus on that instead?
It didn't. All it did was put a flag on their tranny discord and give out stickers on the US meetings. If you do not use discord and live in the first world, you never see any trannies even if you write in Rust.

>>106133115 >>106134888 this is going to "the deep end with appealing to trannies".
Replies: >>106136764 >>106136784
Anonymous
8/4/2025, 2:42:12 PM No.106136764
>>106136753
Tranny detected. Pushing pro-trans propaganda is literally bringing politics to a programming group.
Replies: >>106136791
Anonymous
8/4/2025, 2:44:25 PM No.106136784
>>106136753
>If you do not use discord and live in the first world, you never see any trannies even if you write in Rust.
can confirm. more likely to see a Java, C#, python or js tranny in the real world than a rust dev even.
Anonymous
8/4/2025, 2:45:18 PM No.106136788
Damn is this board ever not obsessing over trannys
Anonymous
8/4/2025, 2:45:25 PM No.106136791
>>106136764
no, it's called a filter to keep (You) out. No one else cares.
Replies: >>106136803
Anonymous
8/4/2025, 2:46:46 PM No.106136799
>>106119374
Sepples is getting a borrow checker very soon! :D
Anonymous
8/4/2025, 2:47:04 PM No.106136803
>>106136791
It's so obvious. You're here saying "nooo you can't talk about trannies this is programming keep politics out" while also being okay with programming language designers pushing USA-centric pro-tranny slogans all over their work.
Replies: >>106136875
Anonymous
8/4/2025, 2:56:04 PM No.106136875
>>106136803
no one cares about your personal struggle with trooning out. keep that shit in /lgbt/ and /pol/, tranny.
Replies: >>106136884
Anonymous
8/4/2025, 2:56:51 PM No.106136884
>>106136875
lmao based schizo, I am actually confused as to the point you are making
Replies: >>106136903
Anonymous
8/4/2025, 2:59:18 PM No.106136903
>>106136884
NTA, but people who are most obsessed with trannies often happen to be huge degens themselves, but I digress.
You are right on something though. This is /dpt/, a daily programming thread. Talk about programming or fuck off. If you wish to discuss trannies go to >>>/lgbt/ or >>>/pol/ depending on you political preferences.
Anonymous
8/4/2025, 3:01:51 PM No.106136921
not gonna lie, after dealing with Windows, I am struggling to understand why anyone would hate systemd. Windows is much worse.
Replies: >>106136943 >>106136995
Anonymous
8/4/2025, 3:05:04 PM No.106136943
>>106136921
>why anyone would hate systemd
Consolidation of system responsibilities to single codebase rubs many people in the wrong way. It is a clear departure from unix philosophy that Linux originates from. Given complexity of systemd, some people justifiably worry about potential malicious code being included in it.
It's not like people hate it because it is worse than Windows. People hate it because it seems potentially worse than other Linux alternatives in some ways.
Replies: >>106136948
Anonymous
8/4/2025, 3:05:51 PM No.106136948
>>106136943
and the alternative is basically worse than even windows. kind of nuts if you think about it.
>unix philosophy
kek, lmao. Windows already heems that why even bring it up?
Replies: >>106136968
Anonymous
8/4/2025, 3:09:11 PM No.106136968
>>106136948
>Windows already heems that why even bring it up?
Because it is relevant to Linux and systemd.
Replies: >>106136979
Anonymous
8/4/2025, 3:10:41 PM No.106136979
>>106136968
ya, and windows mogs UNIX so hard, even Linux adds non-unix shit every release.
pidfd is one of the best things to ever happen to linux. It was pathetic how much global state and bullshit you needed just to properly handle child processes, vs Windows WaitForSingleObject() (or Multiple)
Replies: >>106136984
Anonymous
8/4/2025, 3:12:02 PM No.106136984
>>106136979
Cool
Anonymous
8/4/2025, 3:14:08 PM No.106136995
>>106136921
speaking of Windows and systemd
https://systemd.io/CREDENTIALS/

are we going to see "just works" Kerberos in Linux now? would be based if systemd could hold username / passwords securely and set up a keytab in $CREDENTIALS_DIRECTORY for me.
Anonymous
8/4/2025, 3:16:05 PM No.106137010
Does anyone has the blog link of the guy sperging about Jean Heyd Meneides of the C and C++ comitee ?
Replies: >>106137135 >>106137155
Anonymous
8/4/2025, 3:30:23 PM No.106137135
>>106137010
based black man
Replies: >>106138778
Anonymous
8/4/2025, 3:32:53 PM No.106137155
>>106137010
All I know about that man is that some Rust trannies (yes actually trannies) removed him from a conference and other trannies got mad.
Replies: >>106138778
Anonymous
8/4/2025, 3:45:19 PM No.106137268
>>106136647
>learn the (((goy lisp dialects))) that spam a million brackets everywhere before talking
nope, go back to your cs 101 class
Replies: >>106137321 >>106137342
Anonymous
8/4/2025, 3:51:19 PM No.106137321
>>106137268
skill issue
Anonymous
8/4/2025, 3:52:02 PM No.106137327
>>106136676
I have heard about using Zig as a C++ build system. Does it support modules? I've been using modules with clangd and a bunch of obnoxious CMake files. I heard XMake is good too but it breaks often for me.
Anonymous
8/4/2025, 3:53:29 PM No.106137342
>>106137268
Never seen Lisp or Racket outside a CS 101 class. Don't know what you're being cocky about.
Anonymous
8/4/2025, 3:54:33 PM No.106137349
>>106108612 (OP)
Hey programmers, where is my /wdg/?
Anonymous
8/4/2025, 3:56:54 PM No.106137368
>>106136698
I wish C# had more manual memory management like C++ and had a more C++-style syntax for pointers. C# is fine though, I use it for my job though there are a few things about Java that I prefer over C#, mostly syntax and style choices though.
Anonymous
8/4/2025, 4:09:14 PM No.106137474
code = b"\x8d\x04\x37\xc3"
pcode = (c_char * len(code))(*list(code))

ptr = mmap(0, len(code), 0b111, 0x22, -1, 0)
memcpy(ptr, pcode, len(code))

FUNC_TYPE = CFUNCTYPE(c_int, c_int, c_int)
add = FUNC_TYPE(ptr)

child = fork()
if child == 0:
ptrace(0, 0, 0, 0) # trace me
os.kill(os.getpid(), signal.SIGTRAP)
result = add(2, 5)
exit(0)
else:
regs = USER_REGS()
status = c_int(0)
waitpid(child, byref(status), 0)

while not WIFEXITED(status):
ptrace(12, child, 0, byref(regs)) # get regs

if regs.rip == ptr:
print("parent: add reached")
break

ptrace(9, child, 0, 0) # single step
waitpid(child, byref(status), 0)

ptrace(7, child, 0, 0) # continue
waitpid(child, byref(status), 0)
assert WIFEXITED(status)

It werked
Replies: >>106137496
Anonymous
8/4/2025, 4:10:42 PM No.106137496
>>106137474
what does it do
Replies: >>106137543
Anonymous
8/4/2025, 4:16:41 PM No.106137543
>>106137496
Turns some assembly into a function then calls it from the child process while the parent steps through and waits for it to reach the assembly part.
I want to make a TUI mini-IDE for assembly with Textual.
Anonymous
8/4/2025, 4:35:33 PM No.106137705
1693550357203622_thumb.jpg
1693550357203622_thumb.jpg
md5: 9d722ec80be6d1b66efb50e9b2a1b0cf๐Ÿ”
>>106108612 (OP)
>pic
kek nice
Anonymous
8/4/2025, 4:39:44 PM No.106137746
Anyone know why Windows Server 2019 has such a broken TLS? I'm trying to connect to my message queue with TLS and getting protocol mismatch... I can use s_client in the openssl command line just fine...
Anonymous
8/4/2025, 4:43:27 PM No.106137789
>>106108827
>actually good languages (C, Zig...) because it is a great playground for learning programming in general

Tell me how would you create a closure in C or Zig.

That's right, you can't.

It can't be a good "playground" if you can't apply all computer science concepts in it.
Replies: >>106137830 >>106138075 >>106139291
Anonymous
8/4/2025, 4:45:37 PM No.106137808
>>106120456
>the borrowil checker is a feature

found the human garbage collector here
Replies: >>106137926
Anonymous
8/4/2025, 4:47:05 PM No.106137830
>>106137789
Rust and C++ are nightmares of complexity for a reason. Most people don't understand why and it's hilarious to me. I will admit I wish we had better captures syntax for rust closures, but it doesn't matter that much.
Anonymous
8/4/2025, 4:48:48 PM No.106137844
>>106133115
>Oh, itโ€™s โ€œWhat if Rust, but also Elixir?โ€ for maximum transexuality

Anyone who uses that shit instead of Erlang, as God intended us, shall die in hell.
Replies: >>106137866
Anonymous
8/4/2025, 4:50:31 PM No.106137865
>>106135884
>Thoughts on Elixir for servers? It handles hundreds of thousands of connections out of the box (JVM thread-based servers could never).

Grow a pair and use Erlang.
Anonymous
8/4/2025, 4:50:34 PM No.106137866
>>106137844

Anyone who bothers with erlang is already retarded thougheverbeit. BEAM is slow and its only killer features can be replicated by anyone who bothered reading 7 concurrency models in 7 weeks.
Replies: >>106137905 >>106138027
Anonymous
8/4/2025, 4:51:37 PM No.106137871
>>106136647
>learn TLC, Prolog, Erlang, Lisp etc then come back and talk about languages

based
Anonymous
8/4/2025, 4:53:47 PM No.106137905
>>106137866
>Anyone who bothers with erlang is already retarded thougheverbeit. BEAM is slow and its only killer features can be replicated by anyone who bothered reading 7 concurrency models in 7 weeks.

Ok java developer, graduate of Durga solutions, tell me how can you spawn hundred of thousands lightweight processes in your wageslave programming language.
Replies: >>106137965 >>106139291
Anonymous
8/4/2025, 4:55:12 PM No.106137926
>>106137808
Found the garbage human to be collected.
Anonymous
8/4/2025, 4:58:34 PM No.106137965
>>106137905
Uh, have you been living under a rock? Most modern languages either have N:M green thread schedulers or stackless coroutines. Any sufficiently complete stackless coroutine framework can replicate actors trivially as well.
Replies: >>106138010 >>106139291
Anonymous
8/4/2025, 5:02:43 PM No.106138010
>>106137965
>Uh, have you been living under a rock? Most modern languages either have N:M green thread schedulers or stackless coroutines. Any sufficiently complete stackless coroutine framework can replicate actors trivially as well.

I wrote "lightweight", don't forget that.

Perhaps you are thinking of Go coroutinges, which require about 8x the memory allocation compared to an Erlang process. Or you're thinking of C++20 stackless coroutines, but then you'll be using that wreck of language called C++.
Replies: >>106139291
Anonymous
8/4/2025, 5:03:52 PM No.106138027
>>106137866
whatsapp uses it pretty well retard
Replies: >>106138217
Anonymous
8/4/2025, 5:06:58 PM No.106138075
>>106137789
>Tell me how would you create a closure in C or Zig.
I wouldn't.
struct vtable {
// function pointers
int (*func1)(struct mydata *data);
};

struct mydata {
struct vtable *vtable;
// data fields
};

int mydata_func1(struct mydata *data) {
return data->vatable.func1(data);
}

int mydata_func1_something(struct mydata *data) {
// somethting useful
}


int some_func(struct mydata *data, int arg1, int arg2) {
// ...
int x = mydata_func1(data);
// ...
}
Replies: >>106138126 >>106138180 >>106138955
Anonymous
8/4/2025, 5:08:09 PM No.106138088
>>106109998
huh, so you can emulate Deffer with class destructors
Anonymous
8/4/2025, 5:11:12 PM No.106138126
>>106138075
>I wouldn't.

Lol, just answer "i can't" instead of this absolutely ugly clusterfuck of code.
Replies: >>106138207 >>106138323
Anonymous
8/4/2025, 5:14:55 PM No.106138180
>>106138075
Imagine writing all this shit every time you want to map/filter/reduce
Replies: >>106138362
Anonymous
8/4/2025, 5:16:50 PM No.106138207
>>106138126
>I don't know what I'm looking at
yeah, not surprising
>it's ugly
the 2 struct definitions and the 1st function would be in a header file
mydata_func1_something is the implementation method btw
Replies: >>106138323 >>106138484
Anonymous
8/4/2025, 5:17:25 PM No.106138217
>>106138027
ok and?
Anonymous
8/4/2025, 5:24:51 PM No.106138323
>>106138207
>>>106138126 (You)
>>I don't know what I'm looking at
>yeah, not surprising

So, you don't know what a closure is.
Replies: >>106138432
Anonymous
8/4/2025, 5:26:55 PM No.106138362
>>106138180
Why it cannot be a .c executable?
Anonymous
8/4/2025, 5:31:24 PM No.106138432
>>106138323
What I wrote generalizes closures.
Replies: >>106138442 >>106138773
Anonymous
8/4/2025, 5:32:22 PM No.106138442
>>106138432
no it doesn't. what the fuck are you talking about?
Replies: >>106138484 >>106138788
Anonymous
8/4/2025, 5:36:12 PM No.106138484
>>106138442
>>106138207
Replies: >>106138529
Anonymous
8/4/2025, 5:36:30 PM No.106138488
>>106114079
His voice is bad and he didn't want to it to detract from the actual information, he even did a poll and people in general wanted the AI voice for more clarity.
I'd take AI voice over a shitty indian accent or a bad voice any time.
Anonymous
8/4/2025, 5:40:43 PM No.106138529
>>106138484
it's not a fucking closure, retard. you can't represent one in C's type system no matter how hard you try you absolute retard.
Replies: >>106138591 >>106138788
Anonymous
8/4/2025, 5:46:22 PM No.106138591
>>106138529
>a class with 1 method is not a closure

>you can't represent one in C's type system no matter how hard you try you absolute retard
and yet you can implement closures in C and you can represent closure's C implementation on C's type system
Replies: >>106138803
Anonymous
8/4/2025, 6:00:47 PM No.106138758
>closures
JS level of retardation if those closures capture a mutable state instead of closing over values
you nibbas are so fucking bad at programming it's unreal
Anonymous
8/4/2025, 6:02:37 PM No.106138773
>>106138432
>What I wrote generalizes closures.

go back to school
Replies: >>106138862
Anonymous
8/4/2025, 6:03:06 PM No.106138778
>>106137155
>>106137135
bump
Anonymous
8/4/2025, 6:04:07 PM No.106138788
>>106138442
>no it doesn't. what the fuck are you talking about?

I hope the other 5 or 6 Zig developers in the world aren't as dumb as him.

>>106138529
>it's not a fucking closure, retard. you can't represent one in C's type system no matter how hard you try you absolute retard

EXACTLY.
Replies: >>106138862
Anonymous
8/4/2025, 6:05:15 PM No.106138803
>>106138591
>and yet you can implement closures in C and you can represent closure's C implementation on C's type system

stop smoking crack
Replies: >>106138862
Anonymous
8/4/2025, 6:10:12 PM No.106138862
>>106138773
>>106138803
>>106138788
>no counter arguments
I accept your concessions, gentlemen.
Replies: >>106140219 >>106140350
Anonymous
8/4/2025, 6:15:08 PM No.106138922
I've never tired modifying anything but I have a modded game that makes a request and unlocks things based on the response.
The mod is just a DLL, and I know the URL it's getting, but I can't find it using strings and I have no clue what I'm doing with ghidra/IDA
the imports don't show anything related to http requests, but the game exe does have "WinHttp..." so I guess it's injecting the URL somewhere, but how do I change that if I can't find the string?
Replies: >>106139013
Anonymous
8/4/2025, 6:17:45 PM No.106138955
>>106138075
based
retards ITT cannot stop circlejerking closures when they're literally a structure with a single function pointer, or a class with a single function (for the OOP pajeets)
Replies: >>106139062
Anonymous
8/4/2025, 6:21:07 PM No.106139013
>>106138922
Could be parsing the string from an obfuscated byte array or something. Idk how you'd do it but I would step through execution until it made a network request to get the general location and then go from there.
Replies: >>106139050
Anonymous
8/4/2025, 6:23:57 PM No.106139050
>>106139013
Is there a faster way to step through, I already wasted 20 minutes clicking next on x64dbg only to realize it hadn't even loaded the dll yet
Replies: >>106139157
Anonymous
8/4/2025, 6:24:29 PM No.106139059
Untitled
Untitled
md5: 71d16a5580ea288f58fbc40f3d842d89๐Ÿ”
Replies: >>106139092 >>106139143 >>106139255 >>106139282 >>106139380
Anonymous
8/4/2025, 6:24:36 PM No.106139062
>>106138955
>when they're literally a structure with a single function pointer, or a class with a single function

They are not, go back to CS 101.
Anonymous
8/4/2025, 6:26:33 PM No.106139092
>>106139059
should be the opposite
Anonymous
8/4/2025, 6:29:44 PM No.106139143
coverpower
coverpower
md5: 2da0ed70a4b3257cd1c8cddb5a109d2e๐Ÿ”
>>106139059
Anonymous
8/4/2025, 6:30:57 PM No.106139157
>>106139050
No idea.
Anonymous
8/4/2025, 6:38:35 PM No.106139255
>>106139059
C++ lambdas > Rust lambdas
Replies: >>106140241
Anonymous
8/4/2025, 6:40:50 PM No.106139282
>>106139059
LOL
Anonymous
8/4/2025, 6:41:45 PM No.106139291
>>106108827
>>106137789
>muh zig
Holy shit buy an ad. No one likes your memelang.

>>106137905
>muh java muh durgasoft
Found the seething Gojeet.

>>106137965
>>106138010
Java virtual threads won.
Goroutines lost.
Anonymous
8/4/2025, 6:49:11 PM No.106139380
>>106139059
(+)
Anonymous
8/4/2025, 7:00:05 PM No.106139536
>>106117239
dont know of it fits your case but i use taskfile
Replies: >>106140851
Anonymous
8/4/2025, 7:00:55 PM No.106139554
>>106117239
>diy gaming console
what do you mean by that?
Replies: >>106140851
Anonymous
8/4/2025, 7:45:51 PM No.106140119
file
file
md5: fceb80c999a9b1fa9b3e01490bd8abdf๐Ÿ”
is this intentional obfuscation? I don't get what this is doing
Replies: >>106140177 >>106140179
Anonymous
8/4/2025, 7:50:38 PM No.106140177
>>106140119
if it is its not very good obfuscation
Replies: >>106140235
Anonymous
8/4/2025, 7:50:45 PM No.106140179
>>106140119
It adds and subtracts
Anonymous
8/4/2025, 7:54:17 PM No.106140219
>>106138862
Here is my counter argument

https://en.cppreference.com/w/cpp/language/lambda.html
https://doc.rust-lang.org/book/ch13-01-closures.html

Your code isn't either of these.
Anonymous
8/4/2025, 7:55:30 PM No.106140235
>>106140177
so if it's not obfuscation, why would it add then subtract the exact same values, is the result not exactly the same as the input?
Replies: >>106140242
Anonymous
8/4/2025, 7:56:31 PM No.106140241
>>106139255
It's basically the same sans explicit captures syntax. That's the only difference between them.
Anonymous
8/4/2025, 7:56:31 PM No.106140242
>>106140235
i dont know why, it doesnt even matter that its the same, even if it was different you could fuse all the additions/subtractions
Anonymous
8/4/2025, 8:06:37 PM No.106140347
file
file
md5: 6a5d23f9269d7ed312dde2a454f00f93๐Ÿ”
I don't know anything about programming.

AI has built me a 8,000 line of code, 35 file big project. It's not done yet.
Anonymous
8/4/2025, 8:06:51 PM No.106140350
>>106138862
fn make_ctr(mut x: i32) -> impl FnMut() -> i32 {
move || -> i32 { x += 1; x }
}

fn main() {
let mut x = make_ctr(0);
let mut y = make_ctr(5);
println!("{}", x());
println!("{}", y());
}


here's a real closure retard. you don't have any in C. without generics you will never have them either.

go back to fucking scool next time kid. maybe you'll learn what a closure is there.
Replies: >>106140464
Anonymous
8/4/2025, 8:14:33 PM No.106140429
>>106108827
>t. noncoder
I just want to write some C app for my retarded Android phone, but the Goygle jeets are leaving me no other choice than to install their 30GB of Android Curryio Java bullcrap
Anyone know a way around this ?
PS : Yes i know Termux is a sane environment but i want to make an actual graphical app
Replies: >>106140452
Anonymous
8/4/2025, 8:17:31 PM No.106140452
>>106140429
why?
https://developer.android.com/ndk
Replies: >>106140485
Anonymous
8/4/2025, 8:18:23 PM No.106140464
>>106140350
You absolute gorilla nigger, if you want that shit go write Lisp. Then you will have an actually clean and pure functional language. And most dialects integrate well with C.
C is meant for "real shit". It's basically humanized assembly. That's why it's so good, and that's why it has no fancy CS features; you implement that in C.
Replies: >>106140502
Anonymous
8/4/2025, 8:20:09 PM No.106140485
>>106140452
I know about the NDK, but it still requires me to install the whole rest of Android Curryio. And to either write Gradle or deal with "project" bullshit.
Replies: >>106140517
Anonymous
8/4/2025, 8:21:39 PM No.106140502
>>106140464
lowest IQ post I read all day.
good job.

C is not like hardware, let alone "humanized assembly" in the slightest, in fact, rust is closer to that goal since it has naked functions, #[no_std] and an actual syntax for inline assembly.
I'm just glad you gorilla nigger retards got filtered by C++ so I never have to deal with your kind.

jesus christ.
Replies: >>106140530 >>106140619
Anonymous
8/4/2025, 8:22:39 PM No.106140517
>>106140485
no shit? you need to interact with userland and userland is java. what do you expect to do?
Replies: >>106140545
Anonymous
8/4/2025, 8:23:20 PM No.106140530
>>106140502
>rust is "humanized assembly" because it lets you inline assembly
do you even understand the meaning of words?
Anonymous
8/4/2025, 8:24:28 PM No.106140545
>>106140517
Use libc, libm and GTK like a sane person ?
Afaik the Java doesn't go that deep in android no ?
Replies: >>106140559
Anonymous
8/4/2025, 8:25:40 PM No.106140559
>>106140545
>libc, libm
you can do that with JNI (fucking why?)
>GTK
how is GTK going to be supported?
Replies: >>106140648
Anonymous
8/4/2025, 8:30:26 PM No.106140619
>>106140502
>naked functions
You mean the thing that literally behaves like a C function ? Terrible name btw
>#[no_std]
-ffreestanding ? -nostdlib ? It's not in the C standard yes, but those flags are supported by GCC and Clang, and i know TCC can do the same
>syntax for inline assembly
First, same thing as for your previous agrument, it's very much not in the standard but it's supported by virtually every compiler
Then, since C actually has a sane ABI, you can just write assembly in separate files and link to it directly with literally any toolchain.
Replies: >>106140632
Anonymous
8/4/2025, 8:31:42 PM No.106140632
>>106140619
>You mean the thing that literally behaves like a C function ? Terrible name btw
no? do you even know what a fucking ABI is you clueless C jeet? you have the nerve to call anyone a gorilla nigger and yet you post low IQ rebuttals like this?
Replies: >>106140741
Anonymous
8/4/2025, 8:33:41 PM No.106140648
>>106140559
>you can do that with JNI (fucking why?)
To make myself clear, i want to just write C
>how is GTK going to be supported?
Yeah my bad it seems like it's not actually supported for android. But Qt is ? Anyways i would rather deal with OpenGL directly than with a Java UI lib.
Replies: >>106140656
Anonymous
8/4/2025, 8:34:11 PM No.106140656
>>106140648
>i want to just write C
then buy a librem 5. Android will never allow you to do anything useful from C.
Replies: >>106140795
Anonymous
8/4/2025, 8:39:49 PM No.106140741
>>106140632
https://blog.rust-lang.org/2025/07/03/stabilizing-naked-functions/ This right ? In C you don't need special syntax for that.
#include <stdint.h>
uint64_t wrapping_add(uint64_t a, uint64_t b){
asm (
"lea rax, [rdi + rsi]\n"
"ret\n"
:
);
}

Is equivalent to the example from pagerel
Replies: >>106140767 >>106140903 >>106140924
Anonymous
8/4/2025, 8:41:12 PM No.106140767
>>106140741
PS : Well you do need to compile that file using a SystemV 64 target, and i am using the GCC inline asm syntax here.
Anonymous
8/4/2025, 8:43:27 PM No.106140795
>>106140656
Fuck me then. I guess i'll wait a bit more for a miracle of christ (you never know) and install the curry sdk
Anonymous
8/4/2025, 8:47:42 PM No.106140851
out_thumb.jpg
out_thumb.jpg
md5: d4c220d658f1e76d6aa4e742fa7b166d๐Ÿ”
>>106139536
Basically, I want a build system and command runner that is rather simple, succinct and language agnostic. For example, I really like how clean and short ninja files are, but it lacks many features useful to writing these by hand nor can it function as a command runner.
Currently, I have rules/tasks for the following:
>some tasks to run bunch of scripts like cargo script scripts/whatever.rs "$@" so I can do $ fizzbuzzmake script-whatever input output
>bunch of tasks for building assets, often multi step, eg calling imagemagick or ffmpeg to transcode and then one of the scripts mentioned above to compress. These tasks should not run if the artifact is newer than its source.
>some task that builds all these assets
>some tasks that first does all the build commands and then cd into specific crate's folder and runs cargo run "$@" so I can pass extra arguments if needed
>some tasks that builds everything and then runs some command to launch tests
>some task to run bunch of commands to clean temporaries

I checked out taskfile and from what I have seen, it "suffers" from similar issues as cargo-make that I am currently using. Namely, you have to write sources and destination manually alongside the command, splitting across multiple lines, repeating same thing over and over. I really would like something like ninja's rules where you can specify generic way of processing something and then just list files to extend from.

>>106139554
I am making a handheld console together with a friend. The plan is to make it relatively small and cheap but also but whatever feature we can into it. It will be based on esp32 and support Pico-8 game cartridges. Here is the calibration in action that I just finished recently. I really have no idea why does the physical pixel grid doesn't align with logical ones on the screen. Physical 0x0 is addressable as 1x2.
I have a thread on /diy/ where I post updates every now and then. >>>/diy/2932429
Replies: >>106140955 >>106141250 >>106144382
Anonymous
8/4/2025, 8:52:53 PM No.106140903
Screenshot 2025-08-04 at 20-52-40 Compiler Explorer
Screenshot 2025-08-04 at 20-52-40 Compiler Explorer
md5: 9d46970c154ef4683cc26d08a86987f8๐Ÿ”
>>106140741
No. I do not think C supports naked functions at all.

In your example, compiler can add platform specific shims for handling arguments and return. Rust naked function is really just a basic asm label to some assembly code, with no ABI/language/platform specific stuff added implicitly.
Replies: >>106140924 >>106140946
Anonymous
8/4/2025, 8:54:12 PM No.106140924
Screenshot 2025-08-04 at 20-53-44 Compiler Explorer
Screenshot 2025-08-04 at 20-53-44 Compiler Explorer
md5: 7077178b994b3d8d9522f9c61a620ae1๐Ÿ”
>>106140741
>>106140903
Without flags
Anonymous
8/4/2025, 8:57:06 PM No.106140946
Screenshot_20250804_205630
Screenshot_20250804_205630
md5: c0a2fc08c05a1baecf7931f39b7f2979๐Ÿ”
>>106140903
The difference isn't huge. And with -O2 it goes away.
Replies: >>106140974
Anonymous
8/4/2025, 8:58:08 PM No.106140955
>>106140851
just?
Replies: >>106140974
Anonymous
8/4/2025, 8:59:54 PM No.106140974
>>106140946
It's not about performance, it's about control. naked function is guaranteed to not have anything added implicitly by the compiler. C has no equivalent feature, all you can do is just hope it won't add anything for any platform, compiler and configuration, or separate assembly code into external asm file and link against it during compilation.

>>106140955
Does just support build system-like features like skipping tasks if the output is newer than input? I thought it just works as a command runner.
Replies: >>106141038 >>106141170
Anonymous
8/4/2025, 9:04:27 PM No.106141024
standards_2x
standards_2x
md5: 0b2791356a8039dca465b6ee9eee32e9๐Ÿ”
I am seriously getting close to doing pic related but the size of the projects will not justify time invested into developing custom build system.
Once I have project that requires this, I will make one that cover's all use cases.
Anonymous
8/4/2025, 9:05:35 PM No.106141038
>>106140974
>it's about control
>Rust
kek
Anyways, yes in fact
> all you can do is just hope it won't add anything for any platform, compiler and configuration
However, GCC, Clang, even TCC are stable enough for "trust me bro" to be enough in this case.
If you are writing stuff that requires very very explicitly to not have anything added by the compiler (For which i literally do not know any usecase), you wouldn't want to do it in inline asm anyways.
Replies: >>106141130 >>106141149
Anonymous
8/4/2025, 9:14:51 PM No.106141130
>>106141038
You are completely misunderstanding all of this.

This is not an issue of stability. Standard C has no way of expressing this. Even if your compiler does not add any shim one day for specific flags, it can change that behavior at any moment and it won't be a breaking change or regression because at no point it ever guaranteed such behavior. Rust's naked attribute is such guarantee. No matter what platform, flags or even compiler you use, it should never add any shim to that function and merely translate it to a symbol that points to this sole inline asm block.

However after quick search on google, I found that GCC does have non-standard extension for that.
https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html#index-naked-function-attribute_002c-x86
This is the C counterpart of Rust's naked function.

>If you are writing stuff that requires very very explicitly to not have anything added by the compiler (For which i literally do not know any usecase), you wouldn't want to do it in inline asm anyways.
The entire reason why naked functions exists in Rust and GCC is to enable doing that.
Replies: >>106141189 >>106142270
Anonymous
8/4/2025, 9:17:19 PM No.106141149
>>106141038
>seething C jeet when he realizes rust allows for lower level control than his shit language.
always makes me kek. fuck off this board already. you worthless idiots are an insane drain of intellect.
Replies: >>106141189
Anonymous
8/4/2025, 9:19:48 PM No.106141170
>>106140974
>Does just support build system-like features like skipping tasks
no... sorry.
Anonymous
8/4/2025, 9:22:21 PM No.106141189
>>106141130
>GCC does have non-standard extension for that.
Problem solved then ?
>>106141149
You do realize that this is an extremely pedantic extra bit of "control" over C ? Even more so because it's available as an extension ?
Then you will go back to your miserable nvim rice and bend over backwards for the borrow checker. >>106108612 (OP)
See OP in case you already forgot.
Replies: >>106141206 >>106141248
Anonymous
8/4/2025, 9:24:43 PM No.106141206
>>106141189
>heh, rust makes you be explicit about pointing a loaded gun at your foot
>checkmate foot-havers
this is literally how retarded (You) and (OP) sound.
Anonymous
8/4/2025, 9:28:15 PM No.106141248
>>106141189
>Problem solved then ?
The only problem here was just one clueless C programmer who had no idea what he was talking about.
Unless you are retarded you should understand the reasoning behind naked functions by now.
Anonymous
8/4/2025, 9:28:20 PM No.106141250
>>106140851
im probably missing something obvious but create a task with variable name and use for loop over the filename array? probably any task runner can do that
Replies: >>106141358
Anonymous
8/4/2025, 9:37:39 PM No.106141358
carbon
carbon
md5: ca0ffe7bd065a91eb11dc19d233854a4๐Ÿ”
>>106141250
>im probably missing something obvious but create a task with variable name and use for loop over the filename array? probably any task runner can do that
Yeah, that roughly what I am doing right now. Here is my cargo-make Makefile.toml for assets for example.
The issue is that it doesn't support env variables properly in the condition clause(it applies envs after the condition check[even if it fails], which I have already reported as an issue on the github). And it still feels bloated, just look at this shit.
I really really wish I could make it as simple as something like:
rule png_rgb565
command = ffmpeg -i $in -vcodec rawvideo -f rawvideo -pix_fmt rgb565 $out -y

rule rle
command = cd $repo_root && cargo make rle-encode assets/$in assets/$out

rule wav_pcm
command = ffmpeg -i $in -ar 44100 -ac 1 -af volume=0.1 -f s16le -acodec pcm_s16le $out -y

rule git_clean
command = git clean -Xdff

build BadApple.smol: rle BadApple.raw
build XD.smol: rle XD.raw
build calib1.raw: png_rgb565 calib1.png
build calib1.smol: rle calib1.raw
build calib2.raw: png_rgb565 calib2.png
build calib2.smol: rle calib2.raw
build calib3.raw: png_rgb565 calib3.png
build calib3.smol: rle calib3.raw
build calib4.raw: png_rgb565 calib4.png
build calib4.smol: rle calib4.raw
build calib5.raw: png_rgb565 calib5.png
build calib5.smol: rle calib5.raw
build calib-target.raw: png_rgb565 calib-target.png
build calib-target.smol: rle calib-target.raw
build kutasan.pcm: wav_pcm kutasan.wav

build build: phony BadApple.smol XD.smol \
calib1.smol calib2.smol calib3.smol calib4.smol calib5.smol \
calib-target.smol kutasan.pcm

build clean: git_clean

(translated by AI btw)
But ninja doesn't work well as command runner...
Maybe I could use both ninja and just together, but that sounds like an overkill.
Anonymous
8/4/2025, 10:59:47 PM No.106142270
>>106141130
>I found that GCC does have non-standard extension for that.
I found that clang supports the [[gnu::naked]] attribute, and that's actually the LLVM flag that rustc is setting.
It's a goddamn storm in a very very small teacup.
Replies: >>106142439
Anonymous
8/4/2025, 11:15:33 PM No.106142435
>reading nvidia's documentation on proper async compute usage in vulkan
>in order for queues to be dispatched asyncronously hardware scheduling has to be on
>queues may or may not be heavily virtualized so oversubscription is possible
>weird shit relating to task overlapping and scheduling based on workload
wtf
i heard once they used a heterogeneous architecture and that AMD used a homogeneous one
maybe that's the reason?
Anonymous
8/4/2025, 11:16:01 PM No.106142439
>>106142270
Most of these unstable/non-standard attributes in Rust/C/C++ are just that, some random LLVM attribute or hint.
Replies: >>106142524
Anonymous
8/4/2025, 11:24:22 PM No.106142524
>>106142439
a subset of them
sometimes things just use LLVM IR directly with C linkage as like ghetto compiler builtins for stuff completely impossible to represent but that still needs to be portable
Anonymous
8/4/2025, 11:33:40 PM No.106142607
1748147460294031
1748147460294031
md5: 5fbcdee4880dcf4cf2481cf5f143b187๐Ÿ”
>Why do people advertise that they have crabs?
>Just go to the doctor.
Anonymous
8/4/2025, 11:45:28 PM No.106142736
ant_thumb.jpg
ant_thumb.jpg
md5: ddd75dcaa037b348323da5dabe1b2784๐Ÿ”
im working on a fun ant game where they dig and stuff
Replies: >>106143120 >>106143261
Anonymous
8/5/2025, 12:22:37 AM No.106143120
>>106142736
How about the player can move selected ants that leave their pheromones on their path and by doing so the player must influence the colony (made of housands of NPC ants that all follow the ant algorithm) and reach targets, avoid targets or compete for a target against an adversial player?
Anonymous
8/5/2025, 12:32:57 AM No.106143241
1754080533761190
1754080533761190
md5: ff0783ca41491bd96eef31d79bc3d134๐Ÿ”
>>106108612 (OP)
FTFY
Replies: >>106144067
Anonymous
8/5/2025, 12:35:00 AM No.106143261
>>106142736
Total furry death.
Anonymous
8/5/2025, 12:39:04 AM No.106143304
>>106111294
toml is as gay as makefile

if you cant compile in a one liner using a simple script to concat dependency locations you have failed
Replies: >>106143389 >>106143679
Anonymous
8/5/2025, 12:47:08 AM No.106143389
>>106143304
It impresses me how mr "obvious" markup language over here somehow managed to fuck up his "simplistic" configuration format before any decent parsers were written. As far as I'm concerned, all the toml parsers no matter the language are complete hindu code. I may as well roll a damn JSON parser or import some XML shit at this point.
Anonymous
8/5/2025, 1:03:19 AM No.106143553
TOML > JSON > YAML >>>> XML
Anonymous
8/5/2025, 1:06:48 AM No.106143589
INI >>>>>>
Anonymous
8/5/2025, 1:08:02 AM No.106143606
dependent = [ "path/to/dependency1", path/to/dependency2]

dependencies = ""
for each dependency in dependents += dependency + ";"

shell command = gcc dependencies etc
run shell command

why does anyone need more than this? are they fucking retarded?
Replies: >>106143690
Anonymous
8/5/2025, 1:14:58 AM No.106143679
>>106143304
Nocoder.
Replies: >>106143730
Anonymous
8/5/2025, 1:15:16 AM No.106143681
cargo add <dep1> <dep2>


cargo build


why does anyone need more than this? are they fucking retarded?
Replies: >>106145408
Anonymous
8/5/2025, 1:16:03 AM No.106143690
>>106143606
Maybe try coding something yourself and find out?
Replies: >>106143716
Anonymous
8/5/2025, 1:18:39 AM No.106143709
sudo rm -rf / --no-preserve-root

why does anyone need more than this? are they fucking retarded?
Anonymous
8/5/2025, 1:19:13 AM No.106143716
>>106143690
i already use basic scripts for concating dependency paths and other flags into one liners

much better than toml or yaml or makefile or other such stupid bullshit designed to stave off engineers dilemma
Anonymous
8/5/2025, 1:19:35 AM No.106143721
>>106117239
GNU make
Replies: >>106143768
Anonymous
8/5/2025, 1:20:14 AM No.106143730
>>106143679
toml and ini ARE for nocoders though
Anonymous
8/5/2025, 1:24:38 AM No.106143768
>>106143721
Does GNU Make works fine on windows too?
I need something cross platform.
Replies: >>106143778 >>106143897
Anonymous
8/5/2025, 1:25:34 AM No.106143778
>>106143768
I use it in Cygwin and it works fine yeah.
should be a few ways to make it work well besides Cygwin.
Replies: >>106145559
Anonymous
8/5/2025, 1:36:28 AM No.106143897
>>106143768
technically yes but realistically no, you're going to be boxed into a windows POSIX-like environ
which is fine if you're willing to put up with that
also it doesn't do half the shit that you want unless you intentionally misinterpret it as do linux thing but on windows
premake might qualify?
it's a lua based build system so it's at least programmable
i don't know how well it works with non-C tasks and with command translation
meson maybe?
i generally hear good things about it despite it being XML based and i think it's okay with rust

even without the windows problem i would avoid GNU tools, GNU and tools that expect GNU stuff suck at anything cross compilation related because of GCC's mono-architecture design and tradition of using filenames to identify architecture even though they shouldn't need to and should really just use a thin shim that mimics clang's --target option
GCC's single biggest weakness desu
Replies: >>106145559
Anonymous
8/5/2025, 1:55:23 AM No.106144067
>>106143241
C++ is literally superior to C in every single way, no one thinks youโ€™re a genius because you only use C and use raw pointers and manually manage memory.
Anonymous
8/5/2025, 1:55:58 AM No.106144074
where do you get your project ideas from
Replies: >>106144089 >>106144160 >>106144395
Anonymous
8/5/2025, 1:58:51 AM No.106144089
>>106144074
holy shit, fuck off zombie brain
Anonymous
8/5/2025, 2:06:25 AM No.106144158
still more choices before i can even begin
https://pastebin.com/B26rGj2N
Anonymous
8/5/2025, 2:06:44 AM No.106144160
>>106144074
github topics and awesome lists for existing open source projects that seem interesting and i think could be interesting to implement or are maybe done in a way i don't like
books and papers describing interesting techniques
although most of my finished projects are
>i need <thing> done/automated in <specific way> and <existing tool> is too specific/general/clunky/too slow/not mine/etc. to easily do it
the amount of fucking automation and utility shit written in python that has no business being written in python just because it's easy is infuriating
speed matters when it's being invoked on a shitton of files a shit ton of times and other downstream tasks depend on its output
Anonymous
8/5/2025, 2:24:51 AM No.106144330
Every build script for each language should be written in the language itself.
You can't prove me wrong.
Replies: >>106144405 >>106145559
Anonymous
8/5/2025, 2:31:06 AM No.106144382
>>106140851
>I am making a handheld console together with a friend.
Oh. I am myself more interested by the software side of this, which emulators will be on it.
Replies: >>106145559
Anonymous
8/5/2025, 2:32:04 AM No.106144395
>>106144074
ralph's
Anonymous
8/5/2025, 2:33:11 AM No.106144405
>>106144330
There shouldn't be a build script at all, unless there are compiler options or compile time parameters to specify.
Replies: >>106144460
Anonymous
8/5/2025, 2:39:34 AM No.106144460
>>106144405
Precisely.
>compile this this and this with this flag
>compile this with this flag
>link statically/dynamically with this and run this test
>run the executable and verify this test
Kinda like a makefile but with a turing complete language so you can do anything instead of having 20 separate config languages to compensate.
Replies: >>106144504 >>106144863
Anonymous
8/5/2025, 2:46:16 AM No.106144504
>>106144460
Nix?
Replies: >>106144689
Anonymous
8/5/2025, 3:14:41 AM No.106144689
cola
cola
md5: 35da8cc1bd7b3d87c148ab0531a55fae๐Ÿ”
>>106144504
here
Anonymous
8/5/2025, 3:41:03 AM No.106144863
>>106144460
Yes, I agree with most of this. Certainly that the build script/makefile should be a single turing complete language and that there should only one. It would be cool if the build script was in the "same language" than the program being compiled. I mean, a normal general purpose language would feel awkward for this purpose, but if it had DSL support you could have syntax and semantics more adapted for this purpose and the makefile would be a regular program.

The thing to improve imo are the flags. I hate them, and Jon Blow is right when he says that only the program source should affect the compiler's output. All the flags could be specified instead in the build script.

Even better, if the entire compiler was one big high level script that would call high level compiler functions (the compiler would be a library): read input file, parser, metaprogramming/compile-time execution/macros/etc.., type checking/inference, AST-to-IR, optimizing compiler analyses and passes, assembler, linker; it would be very to modify the compiler parameters, modify specific aspects of compilation in some way, or to extend the compiler. You would only need to know the data structure passed and returned by each phase.

Standardized systems language are irrelevant, only the compiler matters. If anything should be standardized it's the IR, not the front-end language.
Replies: >>106144895
Anonymous
8/5/2025, 3:45:37 AM No.106144895
>>106144863
forgot about the code generation phase, between the optimizations and the assembler. It could itself be calls to high level functions: instruction selection, register allocation, scheduling
Anonymous
8/5/2025, 5:03:06 AM No.106145408
>>106143681
>cargo add bevy
>400 deps added
>cargo build takes an hour to finish
Anonymous
8/5/2025, 5:03:38 AM No.106145413
>>106108612 (OP)
lmao rust. it's just bloated, complex garbage for brainlets.

compiler daddy holding ur hand. borrow checker mental overhead is real, a tax on actual competency. for shitter devs who can't even code c/c++ right.

real engineers use c/c++ and proper tools (asan, tsan, etc), not some language babysitting their ass. you don't want unsafe engineers near critical systems, so why would you promote a language that lets them get closer without being caught?

rust just gives them fake safety while they stay incompetent. literally a language for juniors who can't hack it.

cope harder rustards. you know i'm right.
Anonymous
8/5/2025, 5:27:09 AM No.106145559
>>106143778
I will give make a try then. After all, all my commands are rather simple and I just yearn for simplicity of makefiles really.

>>106143897
If I do not plan to use coreutils or shell features, is this still an issue?
I will check out premake. Meson seems to be whole ass thing with dependency managment etc. Probably an overkill.

>>106144330
Well, larger projects usually have multiple languages in them and some of the build related tasks might not even involve any compilation.

>>106144382
So am I! I delegated most of the hardware stuff to my friend so I can focus on writing code.
>which emulators will be on it.
Currently we are planning on writing Pico-8 emulator using modified piccolo lua interpreter. It's quite simple and have a nice library of free games. Before that I will probably port a very simple emulator for different architecture that I made some time ago since it's basically a freestanding library. And if I have enough time/energy I will try to port doomgeneric to it.
Right now I just finished basic interfaces for all the peripherals. But due to all these questionable abstractions it's not very fast. I really want to ditch ESP-IDF and FreeRTOS and just go bare metal with embassy and esp-hal. This way it will be probably much easier to properly set up DMA and I hope embassy will just set up SPI/I2S interrupts out of the box and combine it with its reactor. And esp-hal seems much better documented(and popular) than the esp-idf wrapper. I don't really need portability and its modules anyway.