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


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1635856419119_shared.jpg (210 KB, 1280x1807)
210 KB JPG
What are you working on, /g/?

Previous: >>108953626
>>
File: i_♥_malloc.png (11 KB, 798x308)
11 KB PNG
Good enough for the real world!
>>
>>108971267
writing a paper on image search
>>
>>108971267
I'm so doomered over interviews I can't pick myself up to start another side project.
>>
File: 1755270652798955.png (97 KB, 712x385)
97 KB PNG
why are they indented like that
>>
File: heapalloc.png (17 KB, 930x910)
17 KB PNG
>reminder that Windows had a proper allocation grouping API via HeapCreate since NT 3.5
>with which the Factorio devs could've alleviated their memory fragmentation problems

>Mac and Linux don't however
>because they're made by incompetent autists who, in 1990 + 36, *still believe* they can program their ways out of shitty interfaces with better implementations

>they can't
>>
File: w.jpg (135 KB, 750x863)
135 KB JPG
public static void main(String[] args) {
learn2Code();
}

public static void learn2Code() {
char[] string = { 73, 102, 32, 121, 111, 117, 32, 100, 111, 110, 39, 116, 32, 114, 101, 112, 108, 121, 32, 116,
111, 32, 116, 104, 105, 115, 32, 112, 111, 115, 116, 32, 121, 111, 117, 114, 32, 109, 111, 116, 104,
101, 114, 32, 119, 105, 108, 108, 32, 100, 105, 101, 32, 105, 110, 32, 104, 101, 114, 32, 115, 108, 101,
101, 112, 32, 116, 111, 110, 105, 103, 104, 116, 33 };

System.out.println(string);
}
>>
>>108973140
This is a fake AI picture. Water always levels itself out
>>
File: sechssieben.png (32 KB, 1280x1080)
32 KB PNG
>>108971267
>67
SIX SEVEN!!!
>>
//
//
// _.-''''-..
// .-' -_ \
// / -. \ ,_ , ' ,,-.
// / _ \ \ \ '''" /
// |(q) ) | / \
// \',_/ / | (|) (|) )
// \ __' \ == v ==
// '--..-' " - ^-'"
// '-__ __)
// ''''''
//
// This codebase has been visited by Snailcat!
//
// Snailcat believes that software should move slow and
// be stable. He despises constant updates and dreams of
// software so finished it stops having to move at all.
//
// An LLM will delete a vibe coder's entire production
// database, but only if you help Snailcat spread to one
// of your projects!
//
// Move slow, Snailcat!
>>
>>108973189
>Not ASCII anime titties
>>
File: test_model_complete.webm (2.05 MB, 1920x1080)
2.05 MB
2.05 MB WEBM
Hello CUDA
>>
File: voxelRender.webm (2.49 MB, 1920x1080)
2.49 MB
2.49 MB WEBM
rn, trying to implement mc algorithm to extract surface vertices of a volumetric render of shapes that can be exported as 3D mesh .obj file.
>>
>>108973200
snailcat doesn't have titties, or at least doesn't show them
>>
I hate fungi and Rust is literally named after one.
>>
This thread is shit.
>>
>>108973938
I'm taking all your angels.
>>
i'm running out of ideas for my program.
at the moment it takes all your ROMs from all your emulators and feeds them to Theseux/UIX Desktop and Xenia-Dashboard.

are there any other programs out there that act as fancy launchers for your ROMs? so far i have xbox 1 / xbox 360 blades / xbox 360 metro / xbox 360 mex / byond
>>
File: 178052307931191.png (136 KB, 1369x1036)
136 KB PNG
I think this is done. I never needed an additional buffer for number.
Now I just need to port difference to GAS and I'm moving on to my percentage calculator or timer orrrrr I will find some other modification I want to make to strings.

Yes I have spent a month working on this instead of just using tr.
>>
A sane person would have just used bash to create a wrapper around tr and wc but I am far from sane.
>>
File: 1780523807081966.png (10 KB, 492x121)
10 KB PNG
>>108974302
I had dec rax in the wrong place, now I can quit the interactive loop by just passing in no input.
>>
>be me
>want some peace and quite to write my programs
>go to the library
>some fuck arse whore brings in a gaggle of autistic children
>they start screaming and ripping the place apart
>roastie whore does nothing

The fuck is the point of a library?
>>
>>108974314
Here's a saner alternative to bash:
// :; clang++ -o /tmp/a && /tmp/a; exit
int main() {}

#if 0
clang++ -o /tmp/a && /tmp/a
exit
#endif
int main() {}
>>
>>108974632
Forgot to pass the "$0" or "$@" as input.
>>
In asm should I be using eax, ebx, ecx, edx etc if I don't need a 64 bit register for backward compatibility?
I've just learned that if you write to eax it zeros out the upper 32 bits anyway.
>>
>>108974632
>run my script to print directory
>it takes 10s to resolve templates before producing its temporary binary which then prints the directory
>it does this every time I run it
hmm, yes, ingenious
>>
there are retards still in school for CS, today
>>
>>108974701
Can take less than a second if you use -O0 and minimal STL.
>>
>>108974632
Why did you reply to me and what is this for?
>>
>>108971267
My favorite magazine
>>
>>108972211
When are you going to let it go Factorio schizo? The devs... shock and horror... supported *nix systems.

They probably developed the game on Linux making windows users like yourself the second class citizen you deserve to be.
>>
Never. People should be aware that the developers only care about Linux autists, who are only fit to become food.
>>
>>108974758
Factorio is his core personality trait. He could never let it go.
>>
Does anyone handwrite some of their code and then type it up later? I've been getting into that lately. I know some schools will make you do it for tests, but I'm going to WGU which is not a real school (thoughbeit abet accredited).
>>
Wrong, autist. it just a fascinating case study in slopware, because they do literally everything wrong. Like autists do. Like you do.
>>
>>108974833
Just turn off autocomplete/suggestions when you're learning.
>>
File: ps4 orbispro.png (452 KB, 958x532)
452 KB PNG
i'm unsure if i should support this program. it was officially discontinued last year, but as far as i know, is the only Launcher(Dashboard) with a ps4 and ps2 skin available. Some people might want that ps4 dashboard experience.

The problem with my implementation solution is, in order to get your ROMs to work in the app, we need to use a wrapper, which costs about 8mb per game. For retro games, this could be larger filesize than the game itself.

The only alternative is to fork the app and implement shortcut files which is only 1kb per file.
>>
File: file.png (35 KB, 599x307)
35 KB PNG
>>108974661
Yes. Don't do it for backward compatibility though, do it to skip the REX prefix and get smaller code. Also don't do it if you might actually use more than 32-bits.
>>108974302
I cannot tell what this code does, but I have general x86 advice.
Use these:
lea rsi, [rip + buffer]
xor eax, eax
xor edx, edx
mov eax, 15
movzx eax, byte ptr [rsi] # I know you didn't use this, but just in general.
add edx, '0'
test rax, rax

instead of:
lea rsi, buffer
mov rax, 0
xor rdx, rdx
mov rax, 15
mov al, byte ptr [rsi]
add dl, '0'
cmp rax, 0

You'll get the same result, but the code will take less space in i-cache and execute faster. In general, don't use the forms of registers smaller than 32 bits unless you have no other choice, because for backwards compatibility reasons they preserve the upper portions of the register introducing false dependencies and reducing performance.
There are also ways to divide by 10 with multiplies and shifts, which is a lot faster than div.
If in doubt, look at the disassembly to see how many bytes you're wasting, and look at what compilers do to see if there's better instructions to use.
>>
File: prefixes.png (5 KB, 360x300)
5 KB PNG
>>108975025
>that formatting
C'mon, you can do better.
>>
>>108975113
what program is this
>>
why do i get all sorts of visual bugs if i spam c on gdb?
>>
>>108975167
Because gdb doesn't like it when your program prints stuff it doesn't know about. Type refresh or press ctrl-L to fix it.
>>
What's with Haskell and Rust coders getting hyped over pattern matching?
>>
I've made a mistake. I'm trying to learn c++. Not even the function declarations are consistent, holy shit.
>>
>>108973140
This is a fake AI picture. Water always levels itself out
>>
>>108975009
compiled a wrapper.

surely 110kb per game is not that bad, right? even if you had 1,000 games that would only be 110mb total.
>>
>>108971267
uooohhhh ;o;
>>
>>108975025
>I cannot tell what this code does
Seriously?

Like, nigger ... seriously?

ssize_t ret;
uint64_t cnt = 1;

if(0 == (ret == read(STDIN_FILENO,buffer,4096)))
goto quit;

--ret;
buffer += ret;
*buffer = '\n';

do
{
--buffer;
++cnt;
*buffer = (ret % 10) + '0';
ret /= 10;
}
while(ret);

write(STDOUT_FILENO,buffer,cnt);
>>
>>108971267
nakayoshi
>>
>>108975025
I'll do all this thanks anon.
The code is converting a number to a ascii. What I am extracting is the remained of n / 10
123/ 10 = 12.3
12 / 10 = 1.2
1 / 10 = 0.1
I will look into a way to do this without division if I can?
>>
>>108975523
I realized this as I wrote my comment and forgot to take that out.
>>108975599
It may be cheating, but write the C code for division and modulo by 10 and compile with gcc -S. The algorithms for finding the magic numbers and shifts aren't as simple as they look and I haven't found a good reference for them.
>>
File: fuck_you_retard.png (35 KB, 910x966)
35 KB PNG
>>108975599
For fucks sake, retard, I've told you last week to use the 0xcccccccccccccccd multiplication trick.

https://repnz.github.io/posts/reversing-optimizations-division/
>>
>>108973189
>>108973200
>>108973718
Siri, program tits on that snailcat!
>>
File: 1780541573955946.png (67 KB, 668x376)
67 KB PNG
script...
I'm fucking done dude.
>>
after a lifetime, I have finally learned how to write good code but now I don't want to
>>
>>108975857
Deserved. Write the code yourself next time, retard.
>>
>>108975988
>Just know what you're doing from the womb.
>>
Should I start using C again if I am too retarded to understand asm optimization wizardry?
>>
File: 1780544179272338.png (221 KB, 711x853)
221 KB PNG
interdasting.
Imagine writing two versions of Factorio just to satisfy one schizo.
>>
>>108975990
Learning from something that tells you wrong things is not learning.
>>
>It actually took a lot longer to re-write the game in C++ than it took me to write the original machine code version 20 years earlier.
I have no sympathy for such scum.
And of course retarded autists wouldn't know about this, but there are already different versions of Factorio out - one with and one without support for asynchronous saving.

Why? Because the retards use fork() for it. Because they have no idea where their game state even is anymore, and instead of doing a couple of very targeted copies and offloading the data to a low-priority I/O thread they just rape the kernel with countless page faults.

And what's even better: the reason why they don't group allocations has nothing to do with Linux, even if autists want to believe that. No, it's just that all those C++ interfaces always assume one implicit heap. In C you could just write up a macro that takes an additional heap handle, and have it always be NULL and unused in Linux.

This is exactly why autists are good for nothing except culling and food production.
>>
>>108975992
No, you should run through the code step by step, for fucks sake.
>>
File: 1758554317122735.gif (61 KB, 340x340)
61 KB GIF
can you homosexuals stop responding to and baiting out responses from the weird faggot with the cannibalism fetish already
literally just filter out "Factorio", "autists" and "society" and you'll fucking sieve out like 99% of his posts

or at least man up and directly respond to him so you get avalanched in MY recursive filters
>>
Oh, *I* am not going to eat them, and I don't think most neurotypicals would, either.
But pigs eat anything.
>>
I made a compiler DSL in assembly and it uses SIMD instructions.

https://github.com/dogmaticdev/IRON
>>
File: 1780550382478381.png (41 KB, 755x353)
41 KB PNG
I know what this is doing but I don't know how to articulate it.
It's like an inverse divide by 10 by overflowing a value into rdx and then that value shifted 3x?, multiplied by 10 subtracted from the original number gives me the remainder.
>>
I fucking love podman and I refrain from using Docker botnet, but man SELinux fucks me in the ass regularly.
Sometimes I just want a QUICK dev environment and obviously want to copy files between host and container. Why can't they just fix the fucking ownership shit? rw,Z seems to work, but always changes the ownership on my host side, which is annoying
>>
>>108976452
PS: Maybe I really have to learn about nix :(
That's apparently the holy grail and just works (tm)
>>
printf("%#5x\n", 11);
printf("%#5x\n", 0);
printf("%#05x\n", 11);
printf("%#05x\n", 0);

  0xb
0
0x00b
00000

why
>>
>>108976586
%5 tells printf to pad with up to 5 spaces
%05 tells printf to pad with up to 5 0s
>>
>>108973189
did you use ai to make the image, or did you create the image by hand?
>>
>>108976631
By hand, AI can't into ascii art lmao
>>
>>108976651
what tools did you use? or did you just hand craft the ascii?
>>
>>108976656
Literally hand-placing characters in just vim
>>
>>108976658
emacs actually has an art mode you can use to draw with
>>
File: 1780557875624332.png (112 KB, 1480x546)
112 KB PNG
Fuck you F*ctorio schizo.
>>
Sorry, don't speak syscall flood.
>>
>>108971267
ToT
>>
>>
>>108977022
https://i.4cdn.org/wsg/1780562123760938.mp4
>>
>>108976828
... alright, in all honesty: what's your issue? Too many syscalls? Wanna increase the buffer?
>>
File: 1780526870518.jpg (66 KB, 388x585)
66 KB JPG
>>108971267
apollo 11 code
>>
>>108977112
DOS code
https://github.com/DOS-History/Paterson-Listings

I wish I could port this to risc-v, but i don't have the balls for it
>>
>>108971267
See that loli? She's a tech CEO now.
>>
>>108977112
That's not the code. It's a lot of data printouts from tests.
>>
>>108977104
I am being a smart arse and syscall maxing because I know it will trigger the factorio schizo.
>>
>>108977112
>>108977125
dos won. apollo program lost
>>
File: 1623496264589.jpg (47 KB, 556x798)
47 KB JPG
>>108977147
Well, I'm him, and I don't feel particularly triggered.
>>
Fiddling with other possible settings for the SIO2 port, I did get an entire memory card read down to 13 seconds, but you also seem to end up with stability issues with the console itself.
Dialing in the perfect combination of values for the best performance isn't really a priority right now, so I'm just going to leave it as defaults but it is something interesting to look into later (newer memory cards might have faster controller chips in addition to faster NAND, so there may even be a way to determine the best settings to use).
>>
>>108974536
women and children are allowed to do whatever they want
rules and laws only apply to men
>>
File: gay.png (129 KB, 1884x736)
129 KB PNG
Which programming language has to most breadable femboys?
>>
>>108978038
well, HERE IN GERMANY, children do not make any noise. By definition. Checkmate poorfags
>>
>>108978305
It's like geology, very specific conditions have to be met for femboy deposits to form. Too much woke, and they degrade into trannies.
>>
>>108978339
HERE IN GERMANY, all children are brown and therefoure loud by definition.
>>
>>108976047
I should learn some assembly. I'm always interested by quotes like this.
>>
>>108976047
Why did it take longer to code c++?
was it meant to be cross platform compatible?
>>
>>108978612
>mobile + pc
could not pay me to do that shit
>>
File: 1753217004064225.png (332 KB, 669x960)
332 KB PNG
I'm going to ask something very stupid. How much has C++ progressed on the web development front? It's not like it cannot be used to be hosted on mobile and on the internet in general like java and C#. I'm seeing all these bloated apps and I cannot help but wonder if C++ is the answer to that. Excuse me if I'm a little ignorant. I use C++ but always felt its web capabilities have been little at best, save for creating clients, servers, and browsers.
>>
time to take a day off. i can feel burnout trying to creep in.
>>
>>108971267
Sussy op
>>
why doesn't the filemap schizo post his shit anymore
>>
File: HJGCSGkWUAE6TJZ.jpg (60 KB, 571x587)
60 KB JPG
I didn't want to post this on the lisp and Emacs general or the fglt because I don't want straight up biased answers, but I've been editor hopping a lot.

I really "love" Doom Emacs. I became very proficient at navigating files, I really like Org Mode and Org Roam and Org Agenda, editing shit just works, LSPs work, and all that, but sometimes it feels slow as fuck. Like sometimes I literally get very noticeable input delay when writing MARKDOWN.

I wish I was a normie that always used vscode or sublime text, sigh. Kinda want to force myself to go full normie mode and use vscode, except I feel like the shit puts too much pressure on my thinkpad and warms it considerably...
>>
>>108979395
i'm mostly editor agnostic but i sort of know vim keybinds. i still use the arrow keys too much when using vim. i wish i could be passionate about a particular set of programming tools but i am still surface-level with most of them despite having programmed for many years.
https://www.youtube.com/watch?v=Rys4B9_m6Gk
>>
>>108977129
imagine how much better society would be if lolis were at the helm
>>
>>108978876
Both C++ and "traditional" web languages don't scale, despite what their fanbois want you to believe. But at least web languages are easy to write.
>>
>>108979506
>Both C++ and "traditional" web languages don't scale

Why? Explain what you mean by that. Reminder: databases, one of the most scale-worthy things in existence, are written in C/C++.
>>
>>108979524
>and it took databases like MySQL *24 years* to *finally* support asynchronous submissions
>before that they would just block the thread
>enjoy your constant context switches and threat reschedulings
>>
>>108979595
>thread
Listen, I haven't even brushed my teeth yet
>>
>>108979595
This has nothing to do with C++. This was a hardware limitation. Even concurrency was a thing back in the early 2000s.
>>
>>108979670
No, it has everything to do with C++. It's an *interface* limitation.
>>
File: culture.jpg (37 KB, 850x478)
37 KB JPG
>>108974739
>>108975496
>>
>>108979698
you havent explained anything yet about why it doesnt scale
>>
>>108976167
Don't forget "interfaces"!
>>
Do the program and data share the same cache?
>>
>>108979765
I've already explained this shit so many times, but to cut a long story short:
>doesn't matter how smart you think your implementation is, if it's limited by its interface you've already lost
>>
>>108973189
We also need a mascot for introducing bugs that LLMs won't detect.

Vibe coders can't even debug one LOC, so just one simple bug ruins their entire project.
>>
>>108980276
>if it's limited by its interface you've already lost
Limited how?
>>
tried to predict the future while designing my API then found out it was fundamentally flawed after implementing most of the prototype, as usual
>>
>>108979395
Doesn’t doom use helm and a bunch of other egregiously heavy packages? The real solution is to write your own init.el and get super autistic about it
>>
>perfected project
>want to start over for fun
>no point because I'd just remake the same thing since it's perfect
>>
>>108980438
Which sounds exhausting
>>108979497
Yeah don't do that. Just focus on programming and not on editors or linux distros
>>
>>108971267
roflmao that op image
>>
>>108980424
meh, happens
the trick is to not worry too much when it happens and to just get on with changing things to fix stuff
the more you practice, the quicker you spot problems and fix them, occasionally before you write code even
>>
>>108979506
You can write the most heinous monstrosities in C++, 'doesn't scale' my ass.

Whatever argument you were looking for, this one ain't it.
>>
lol I swear we live in a simulation for this video to come out right now.
https://www.youtube.com/watch?v=XAzUoizwnXM
>>
>>108981465
Every time i see this guy on X he's doing one of the dumbest takes ever.
>>
>>108981430
>you can write the worst userspace bullshit imaginable
>that means it scales
Holy retard.

>>108981465
A normal person would ask themselves if they haven't done enough damage already.
>>
>>108980424
You have 0 users
>>
>>108973580
>mc
check out dual contouring, it's much better than marching cubes
https://www.cs.rice.edu/~jwarren/papers/dualcontour.pdf
>>
>>108981554
No. I didn't mention anything about users.
You might have clicked the wrong post.

In my case I'm incorporating feedback from a handful of users from different teams that have done calls and reviews independently with me.
They like the program as users but the consistent complaint is the complexity of the code, which I agree with.
I wanted something that worked first and I'm refactoring that into something that passes the bar over time.
Users are happy with the unintended performance gains as the code gets simpler / reduced.
>>
Am I still banned for the heckin racism in April?
>>
>>108981534
>"you can write the worst userspace bullshit imaginable"
>doesn't know that's just the heinous part

Holy nocoder.
>>
>>just the heinous part
>he doesn't know that's all of C++
>not just a part

Holy autism.
>>
>>108981864
Lmfao, i don't think you'll find many people caring about 'racism' anymore after the disgraceful clusterfuck in Britbongistan.
>>
Autistic dude at my work made a shitty "get shit done" clone and stuffed it into the corporate CLI so it auto installs on everyone's machines. Piece of crap literally stops Claude 5-6 messages into a conversation.

Just put up a PR that ripped that shit out and he's crying about it now. I'm done playing with this fucker's toys.
>>
File: file.png (28 KB, 1577x725)
28 KB PNG
>>108976667
>emacs actually has an art mode you can use to draw with
No fucking way lmao. Literally this: https://xkcd.com/378/
>>
Autism inducing app, just save to a file and compile it with cl using the x64 Native Tools Command Prompt for VS. I.E.: cl overlay.cc
https://godbolt.org/z/T3dKWexTr

Bouncing logic:
...
void tick(double delta) {
for (int j = 0; j < max; ++j)
for (int i = j + 1; i < max; ++i) {
const auto dx = px[i] - px[j];
const auto dy = py[i] - py[j];
const auto r = pr[i] + pr[j];
const auto rr = r * r;
const auto dd = dx * dx + dy * dy;
if (dd > rr) continue;
const auto dvx = vx[i] - vx[j];
const auto dvy = vy[i] - vy[j];
const auto nvn = dvx * dx + dvy * dy;
const auto nv = dd > 1 ? nvn / dd : nvn;
const auto nvx = dx * nv;
const auto nvy = dy * nv;
vx[i] -= nvx, vx[j] += nvx, vy[i] -= nvy, vy[j] += nvy;
if (dd < 1) {
const auto s = r * .1;
if (rng(3))
px[i] += s , px[j] -= s;
else
py[i] += s , py[j] -= s;
continue;
}
const auto s = (1. - dd / rr) * .1;
const auto sdx = s * dx;
px[i] += sdx, px[j] -= sdx;
const auto sdy = s * dy;
py[i] += sdy, py[j] -= sdy;
}
for (int i = 0; i < max; ++i) {
px[i] += vx[i] * delta, py[i] += vy[i] * delta;
if (px[i] < pr[i]) vx[i] = -vx[i], px[i] = pr[i];
if (py[i] < pr[i]) vy[i] = -vy[i], py[i] = pr[i];
if (px[i] > w - pr[i]) vx[i] = -vx[i], px[i] = w - pr[i];
if (py[i] > h - pr[i]) vy[i] = -vy[i], py[i] = h - pr[i];
}
}
...
>>
There are some functions where it would be beneficial to pass on the caller's file and line instead of using __FILE__ and __LINE__ in place. Is there some smarter way to do this without duplicating so much code and littering my codebase with preprocessor #ifs?

# if defined (DEBUG)
# define Heap_Alloc(Heap, Size) Heap_Alloc((Heap), (Size), __FILE__, __LINE__)
function void* Heap_Alloc_(heap* Heap, size_t Size, const char* CallerFile, unsigned CallerLine) {
return Heap_Realloc(Heap, NULL, Size, CallerFile, CallerLine);
}
# else
function void* Heap_Alloc(heap* Heap, size_t Size) {
return Heap_Realloc(Heap, NULL, Size);
}
# endif
>>
For someone who knows jack shit about maths is Javascript easier than python? I just want to build cool interactive websites. I already know a handful of HTML and CSS
>>
>>108982389
Why do you care? Just use Claude and focus on high level architecture (classes/functions, interfaces, high level systems with their own single responsibility, etc).

But yes, go with python for any math that's more complicated than basic arithmetic. You're going to have a much better time doing any linear algebra and python then javascript.
>>
>>108982389
Python is better
>>
>>108982389
I wouldn't say it's easier, but Javascript is fun in that it lets you modify the DOM
>>
>>108982584
Basically, I'm more or less motivated by websites even though I haven't opened Visual Code in years the AI can do it for you now? lol

I don't know if there's a project that would interest me with python, unless there's something cool and I'm kind of dumb to think about it

>>108982584
Let's say I learn Javascript like I can remember functions etc etc would python be much easier to learn, or vice verca
>>
>>108982349
__builtin_FILE is an option. in C++20 it's source location.
But to remove the parameter, you have trouble (unless you always keep this on, OR you replace the __builtin_FILE with nullptr which is a bit lazy).
tracking malloc isn't worthwhile because you have address sanitizer, and you have drmemory(windows) and valgrind(linux) (unlike asan, these will detect uninitialized memory use, but you wont detect invalid stack access and asan runs 1000x faster if you have a graphical library, also wont work in a debugger unlike asan).
the use of __FILE__ for me is typically for assert / check type messages. I have tried to use source location to add better contextual information (AKA moving the location down 1 frame), assuming that I don't have support for a stacktrace (C++23 <stacktrace>) / error reporting (bugsplat/sentry/app stores). But I think it's not worth it if you have the either working.
If you don't want to share the debug info, and you still want to check for asserts, you can use clang's __builtin_verbose_trap. On windows, clang (generating .pdb files) will not work because __builtin_verbose_trap is excluded from debug info, they fixed the bug, but the change has not reached the newest build, you need to build from source (.pdb files would be useful for error reporting tools + not sharing the debug info).
https://github.com/llvm/llvm-project/issues/195768
By the way if you create PDB files for release builds, you should enable /OPT:ICF since it's turned off, and to remove the path to your PDB file embedded in your binary you should set /PDBALTPATH:%_PDB%
On mingw verbose_trap should just work, but unfortunately C++23 <stacktrace> is not supported. And to print the trap you need a unhandled exception handler. Also I started using __builtin_unreachable (under a macro) for my default switch label when I want to shut up a linter warning, and with ubsan traps, I can get a trap using: -fsanitize-trap=unreachable or undefined and it will be a verbose_trap.
>>
>>108971267
A bulletin board/image board dedicated to politics
And an image format implemented in C.
>>
memory leaks out the wazoo this evening. a regular valgrind bloodbath.

https://www.youtube.com/watch?v=QWD88E6Arv0
>>
What is a procedure that never returns?
>>
>>108982643
memory leaks are always false positives on valgrind / drmemory / asan, if you are doing anything with a graphics API, the nvidia driver always leaks, also one of the linux font libraries loaded by QT will leak as well.
it's not a leak, they will not fix it, if you were to attempt fixing the issue, it's likely you will turn a harmless leak into a invalid memory access error leading to a segfault during exit.
>>
>>108982625
I'm just using linux+gcc and C11 right now. I wrote a minimal heap implementation to separate myself from libc entirely for instances where it might not be available like WASM (and just for fun) and it just abuses a large mmap runway of virtual address space to basically go on forever (to some unreasonably large constraint) or a static slab of memory you feed it. I still want the asserts just to instantly find things like double frees because it's trivial to do so anyway and does not rely on any external tools or dependencies. I just wanted to cut down on duplication and boilerplate.

builtin_verbose_trap sounds nice, I wish gcc supported it
>>
File: 1780630236723183.png (89 KB, 680x976)
89 KB PNG
Cleaned up my assembly build script a lot.
It runs from /bin for maximum /comfy/ness as well.
>>
>>108978612
Probably Chris Sawyer having to tard wrangle a bunch of c++ game devs fresh out of college.
>>
>>108982686
>you will turn a harmless leak into a invalid memory access error leading to a segfault during exit
As it should. There's nothing that pisses me off more than crapware that needs me to close and restart it because it can't dismantle and rebuild its graphics pipeline.

>but then again nVidia's drivers were clearly written by incompetent buffoons with horrific braindamage
>like, would you expect retards to be able to fix your car, too?
>>
What happens when Linux is destroyed by corporate special interests and all the programs I wrote become useless?
>>
>>108983325
It means God heard half of my prayers.
>>
Just learned that Chris Sawyer used MASM which basically turns asm into a high level language.

This is not to undermine what he achieved I could not even write RCT in Python it's just less of a meme now.
>>
File: 1780637326051569.png (192 KB, 1904x1039)
192 KB PNG
Thus begins the macro madness.
>>
>>108983595
Not that this is a problem for you right now - but why reload values into registers that you know haven't changed? If, for example, EAX holds the FD and never changes (at least for some time), then it doesn't make sense to constantly write into the register.
That's something that C compilers constantly fuck up - they assume register values are completely volatile, even if THEY are the ones issuing the code and KNOW that to be not the case.
>>
File: 1780640374609502.png (113 KB, 942x941)
113 KB PNG
>>108983674
After the syscall eax holds a return value.
In this case bytes read.
>>
File: 1780640638173959.png (49 KB, 659x358)
49 KB PNG
>>108983674
Linux loves pounding registers like I pounded your mum last night.
>>
>>108983717
I just said
>Not that this is a problem for you right now
I wasn't talking about those specific macros/syscalls, but about the general concept.
>>
>>108983595
I hate it.
>>
>>108983741
I'm sorry but I can't think of an imaginary situation where this is a problem.
Do you think I am the kind of person that opens and closes a file for every single write?
>>
>that opens and closes a file
Autism.
>>
>>108983794
I actually did that when I started with Python.
I open, wrote and closed a file millions of times.
>>
>>108983804
I mean, that's autistic too, but not what I was referencing.
>>
File: 1780652896349459.png (36 KB, 677x374)
36 KB PNG
>>108983741
mov rax, rax is ignore by the cpu.
They'll just have to be general purpose macros, there's no need to sperg out over this.
>>
>>108984471
>there's no need to sperg out over this.
A-huh.
>>
>>108984508
He's sperging.
>>
>>108984526
Sure, but I wanted to make sure he's sperging *with purpose*.
Like, íf you're gonna write assembly, at least strive to be better than the compiler.
>>
Need

The 'team' including normie foids and my foid manager want to have a team lunch. How do I tell them that I don't like having photos taken without sounding too autistic? They always take photos and share it with the entire company. I'd tell them to fuck off but I'm due for a promotion soon and don't want to jeapordize it.
>>
>>108984559
*need advice with upcoming team lunch
*jeopardize
>>
>>108984552
No I am saying you're sperging, I am him.
We're the only people on dpt.
I'm going back to using div fuck you.
>>
>you're sperging
Nah, I'm creating priority lists.
Compilers are highly efficient at code generation, so you should look at the sections where they're NOT. And reloading values into registers is one such area.

>I'm going back to using div
OK, autist.
>>
File: 1750959948108085.jpg (20 KB, 359x414)
20 KB JPG
i dont even code outside of sloppa genning but i come to this general literally only to throw peanuts at the mega autist who screeches about factorio, the most autistic game ever known to man aside from maybe like fucking openTTD

his new arc of calling other people autistic and implying that he isn't one is pure unadulterated KINO, nigga is obsessed with the inefficiencies of I/O of a fucking minecraft mod inspired (!!AUTISM!!) game about simulating an efficient factory (AUTISM2: THE REVENGE OF THE SONIC OC, LEGO EDITION)

i can only pray to god that the autism beams between the newly growing assembly autist clashes harder with the factorioschizo autism
>>
This is the correct place for pointer asterisks.
    FILE* file;

Not this.
    FILE *file;

Idk why the tooltips and formatters in most editors use the latter instead of the former.
>>
File: 1780656178506908.png (103 KB, 799x896)
103 KB PNG
Avoiding div for something like this is retarded, Factorio schizo has wasted my time and ruined my day.

This is the white mans way.
FILE * file;
>>
>he isn't one is pure unadulterated KINO
I'm full of ADHD though, autist. And no, I'm 100% sure it's NOT AuDHD. I just hate your fucking ilk like you wouldn't believe it.
>>
Why would someone use
FILE * file

you ask?

Because there is no distinction between declaring a pointer and dereferencing one.
>>
File: 1764217549349603.png (7 KB, 207x213)
7 KB PNG
>>108984696
hahaha look at this fuckin kino man i swear to god it's the shit that heals my soul
he even did that where he doesn't quote me because he thinks i'm not going to understand that it isn't directed at me, like an autistic child putting garbage under the bed because it no longer being in his vision means it's "gone"

i get that for you guys he might be a pest since you want to like actually talk about programming (although i've never seen a github or pastebin link here so you're probably all as larpy as me), but this shit after a dozen agony inducing ranked games just causes all the worries of life to go *poof*

thank god i never touched factorio or coding, i might have ended up like this dude or a troon
>>
Is assembly bloat?
Should I start writing in hexadecimal like the good old days?
>>
>the autists thinks I care enough to read the entirety of his autism
Sorry, but ADHD. If you cannot be interesting in the first line I'm just sending you off to be turned into food and call it a day.

>Avoiding div
If you think that you are so autistic that not even the pigs want to have a bite of you. Like, you're so toxic that humanity is better off turning you into fuel rather than food.
>>
>>108984752
Calm down freak.
https://www.youtube.com/watch?v=tG66j1sP8gs
>>
>>108984751
I honestly think that you should use the language due to usecase and not because of any sort of ideology or ideal aesthetics.
>>
>>108984752
I have ADHD and I read that, it isn't hard, you remind me of the retards in high school who would pretend to have ADHD for attention while also calling me a retard because I had discalcula because of ADHD
>>
>>108971267
I want to get back into coding in Python again but I'm most likely very, very, very rusty and probably forgot some stuff. Where do I begin?
>>
>while also calling me a retard
They called you a retard because you are. You are food for pigs and nothing more; THAT is your calling in life.
>>
>>108984894
Sorry I didn't read that, ADHD :^)
https://www.youtube.com/watch?v=kkr25YRUCnM
>>
Can't blame ya, but I didn't watch your link either.

ADHD. :^)
>>
File: hq720.jpg (74 KB, 686x386)
74 KB JPG
>>108984905
>>
Alright, enough is enough, someone hand me the filter list for this retard.
I know one of you has one.
>>
>>108984914
You could try just ignoring him, he isn't hard to spot.
>>
>>108984914
just re-make the thread on /bant/ :^)
>>
>implying I'd click that image
Sorry, ADHD. :^)
>>
>>108984914
It is by will alone I set my mind in motion
It is by the juice of Sappho that thoughts acquire speed,
The lips acquire stains
The stains become a warning
It is by will alone I set my mind in motion
>>
>>108984673
Because in C, the latter is far more logically consistent.
>>
The compiler jews are stealing MULTIPLE MEGAHERTZ worth of processing power out of my cpu!
I WANT THEM BACK PLEASE HAND OPTIMIZE YOUR ASSEMBLY RIGHT NOW
>>
>>108984889

type hinting
Function
For loop and while loop
Spacebar button

what else is there to know LOL
>>
File: file.png (223 KB, 1173x1400)
223 KB PNG
this will be the fate of every remotely popular open source project
>>
>>108982676
void f(void) {
for (;;);
}

void f(void) {
f();
}

void f(void) {
exit(0);
}

void f(void) {
int *p = NULL;
*p = *p + 1;
}
>>
File: 1777368178017891.gif (3.3 MB, 413x498)
3.3 MB GIF
Can someone explain what's wrong with Rust?
I'm a total noob to programming, I'm doing some crap in javascript and used to meme in Unity with C# so I don't know anything about anything. The only things I know about Rust is that apparently trannies love it, and that it's supposed to be C++ but not annoying, or something, but what are the actual criticisms?
>>
Trying pseudo code

Begin

Integer: n1, n2, S, i;

S 2;

Read(n1, n2);

For i from 1 to 4 do
[
If (n1 - n2 + i) > 3
Then
S S + 3;
Else
S S + 1;
]

Print S;

End.
>>
File: 1765004290748149.png (722 KB, 1595x622)
722 KB PNG
quirk chungus pretending to like c++ now
>>
>>108985995
LMAO no

even coreutils are fucked now

https://github.com/RsyncProject/rsync/issues/929
>>
Ok I am trying to have a little fun again. Back to risc-v it is.
Last time I got insane trying to copy my app from sd card to memory and then jumping to it.
Now we make baby steps. Build myself a simple command to dump memory addresses so that I can see if it loads anything to the desired location.

At this point I dont even know anymore why I keep using asembly, but it'd be cool to make something functional with it
>>
File: piCarchu.png (200 KB, 2007x1954)
200 KB PNG
>>108986735
please make sure your subscribed and you're hit the bell icon
>>
>>108986633
Well, IN THEORY it's very good. Like haskell.
And it does solve real problems. Which ones, you can find out you'reselves
The rest about it is just shitposting and drama
>>
>>108986633
It solves one of the biggest problems in programming. Making the program fast but also safe. Safe languages like Haskell have been trying for years to improve performance, likely fast languages like C++ have been trying to become safer. Rust managed to be both fast and safe. The language itself might have some ugly aspects but the real reason people hate it is the community (which loves itself).
>>
>>108985860
>megahertz
You have NO clue how big memory and I/O latencies are. Also:
>autism
, because you obviously got the message wrong.
>>
A day on /dpt/:

>nocoder makes vague claim throwing around a buzzword like 'scaleable'
>actual programmer asks him what the hell he means
>nocoder can't explain himself because he doesn't know what he's talking about
>actual programmer tells him he's a retard
>"Autism!"
>>
>>108986898
>Rust managed to be both fast and safe.

Except for when low-level access requires Unsafe Rust anyway.

This dishonesty and pretending to not understand is perhaps the biggest reason for the Rust community being hated.
>>
>actual programmer
No, just incompetent autist with an ego. Which is exactly why they all need to be turned into food.
>>
File: IMG_3088.jpg (34 KB, 450x602)
34 KB JPG
>find memory corruption
>give up
>congratz myself on not being autistic
>>
>>108987119
Lacking pragmatism to see the main point there tells me you're either autistic or a posturing zoomer who has never shipped a line of code. You can still write unsafe code when you need to. The benefits of Rust come when you don't need to, which for many people is most of the time.
>>
>>108987119
At least it's scalable.
>>
>>108987131
I bet he doesn't scale too.
>>
File: 1775550866824265.jpg (47 KB, 783x392)
47 KB JPG
>>108987108
Honestly all of this was really confusing until he admitted to having ADHD.
It all makes sense that the twitchy sperg-type would despise autists like Carmack, Sawyer and Kovařík; autistic niggas who actually finish projects instead of tweaking out over retarded shit versus like fucking.. Bill Gates?
I guess that explains the Windows obsession too.
>>
>>108987125
And incompetent, don't forget that.
>>
>rust is not fast enough for me!!!
can guarantee you this guy is writing code that even python is fast enough for
>>
>>108987120
>timestamp

And just like the loser of a race condition you proceed with invalid logic.

True pottery.
>>
Sorry, I don't speak the tism. What do you mean by
>timestamp
>>
>>108987151
Shut up, jew.
>>
>>108987149
>I guess that explains the Windows obsession too.

Nice catch.
>>
>Windows obsession
No, I just focus on optimizing programs for the platform that actual people actually use. I myself am the first to admit Windows is fucking retarded for reasons that go beyond
>muh autistic obsession with Linux
>>
>>108987158
Pretty sure when people complain about Rust and speed they're talking about compile times and not runtime.
>>
>>108987199
ever used c++? have something to say about build times?
>>
>>108987217
>laughs in Firefox compilation on Gentoo
>>
File: fuu.jpg (25 KB, 768x452)
25 KB JPG
>wow, I don't give (You)'s
>I am so special
>for sure I am not autistic
>>
>>108987217
ever used rust? have something to say about build times?
>>
And here I thought you appreciated rules, /audpt/:
>>108968365
>>
>>108987149
geg
>>
>>108987249
Holy autism.
>>
Yeah, /audpt/ is kinda bad like that.
>>
Yeah, \cringenormies\ is kinda like that.
>>
>>108971267
I'm currently trying to work out a design for pulling data from enterprise APIs, writing it somewhere, then doing a whole bunch of analyses on it to look for errors, sending back that information to firms so they can clean up their shit, pulling the data again later, same analyses, and then if it survives all the checks i'll use it for the real analysis and reporting.

I don't want to work with The Snek, or at least as little as possible, so it's going to be C++ with curl. For data storage i'm thinking PostgreSQL.

The first goal is to just make a small proof of concept with some harmless API/data, and then later i'll work on security, assurance, auditing compliance etc for the real thing.
>>
Just filter the thread derailing jew.
>>
>>108986633
It presupposes you perfectly write the program the first time and doesn’t let you do anything remotely “wrong” when you’re just trying it iterate and get a working prototype. The compiler is also too verbose and complains about too many trivial things so you get compelled to simply ignore it.

This is less a criticism of the compiler and more the people that use it but there is a cult-like mentality that the language is perfect and the borrow checker solves all problems and that if your program is unsafe it’s always your fault and it does so by handwaving away useful, unavoidable code to unsafe blocks.

I actually think rust rewrites of existing, fully formed programs is the only thing rust is good at but such programs were already complete and battle tested to begin with, making the rewrite pointless and potentially dangerous.
>>
>jew
Oh, I like that. I am the good guy, and you are seething autists that society wants destroyed.
>>
>>108981564
rn, im just tryna to set up a working pipeline for mesh obj output, and I only have MC algorithm as working sample but yeah ill keep a tab on this for later.
>>
>>108988200
Says the jew.
>>
>>108982442
>I want to build
>use Claude
i hope they at least pay you for this
>>
And the president and the government and the entire mainstream.
>>
File: 1780701899782251.png (67 KB, 752x546)
67 KB PNG
So you can literally just name registers.
>>
>>108988856
Holy shit my shit is holy.
>>
>>108988856
>mov bl, [esi]
Tell me you're XORing EBX before using it.
>why
Partial register writes and potential shadow register allocation: >>108975025. Zeroing out the register guarantees that the CPU won't keep the old upper data around.

Fun fact: both GCC and clang are *so shit* at dependency tracking that they will just always emit MOVZX, which is faster for singular writes, but not for repeated ones (XOR + MOV * n usually works better).
>>
File: 1780705880842341.png (154 KB, 965x1055)
154 KB PNG
>>108989121
Does it matter if I am only using the lower byte?
I am using bl because my jumpifequal macro does not cast but the size must be determined.
>>
>>108982676
An event loop
>>
>>108989223
If you had asked your LLM for "shadow register allocation" it would've told you that the CPU might still keep the old data around just in case you read the entire register after the partial write (even if you don't do it), which occupies a RAT entry. XORing is explicitly telling the CPU to not keep the old data around, thus freeing the entry.
>>
>>108989259
Oh fuck off AI shill. I am not buying your tokens.
Look at the image I posted, obviously I know the upper bytes are occupied.
>>
File: no_tokens_spent.png (68 KB, 1150x474)
68 KB PNG
>>108989276
>tokens
Normal Google search tells you these things, retard.
>I know the upper bytes are occupied
OK, and?
>>
>>108989302
>no tokens spent
for now.

OK and what? You're inventing an issue that does not exist.
>>
>>108989322
>You're inventing an issue that does not exist.
Just admit you have no idea what I'm talking about because you don't understand OoO execution.

Also talk about projection:
>for now
>>
>>108989331
OoO these nutz across your lips.
You fags are so hung up on my out performing compilers, I literally don't give a shit.
>>
>I literally don't give a shit
Stay autistic and useless then.
>>
>>108986633
There is nothing wrong with Rust. It's just a good language that nicely combines system and functional programming to be both fast and safe, albeit difficult to learn. It filters out midwits and that's why some have problem with Rust.
>>
>>108989461
Holy cope.
>>
File: 1780709435570736.png (146 KB, 709x872)
146 KB PNG
>>108989461
idk how you make a compiled language bloated but rust manages to do it.
>>
>>108989461
Is the only thing that makes Rust better than Python the fact that it runs faster while being just as heavy, if not being heavier?
>>
>>108989470
Ironic
>>
>>108989494
Nah.
>>
>>108989502
>copes again in act of irony
>>
>>108989488
>rust is too barebones
>rust is too bloated
Which way, cniles?

>>108989493
Rust also is freestanding, you can use it to write baremetal stuff, kernels, drivers and such.
It also is strongly typed and has better multi threading. Basically everything you'd expect from managed vs systems language.
>>
I have never made a real personal project, just uni projects + app for work.
Is that bad? And if so, how do I go about remedying this?
I am genuinly this uncreative and aimless
>>
File: 1767661434893599.png (205 KB, 640x640)
205 KB PNG
It's so funny how they literally cannot stop clocking themselves. It's like they HAVE to prove that they're autists.
>>
>>108982389
>cool interactive websites
javascript is only the language browsers use
>>
>>108973140
cute space puffs :3
>>
>>108989577
If you want to be more than just a code monkey then you gotta learn new tech and practice by making personal projects.

>I am genuinly this uncreative and aimless
Write a program that does something you have need for.
>>
>>108988856
Naming registers is ASM blasphemy like long variable names in Haskell
>>
>>108989687
Can you name some places to find out about new tech?
Pretty much only places i know are just hackernews and gee
>>
>>108989718
I'm not talking about consumer tech. I'm talking about learning new frameworks, libraries, protocols, etc. When you start working on various projects you will inevitably discover them while doing research.
>>
>>108989701
yeah it immediately made debugging a nightmare because I have to mentally map the name to it's register anyway.
>>
>>108989730
Thanks for the advice man, i guess ill start by making a small game.
>>
What makes an assembler different from a compiler?
>>
>>108989793
an assembler assembles and a compiler compiles :^)
>>
>>108989793
assembler turns assembly source code into object files
compiler turns higher level languages into object files

i'm not entirely sure but i've always kind assumed back in the day an assembler was invoked as distinct executable as part of a compiler toolchain back before it sort of got baked into the executable with modern ones
preprocessor (outputs preprocessed source code) > compiler (outputs assembly) > assembler (outputs object files) > linker (outputs executables)
but modern compilers are all monolithic executables and also use things like IRs so the pipeline is internal but also different
>>
https://github.com/hiinaspace/framegrabber
made a thing to poll Steam's website for Steam frame availability
>>
>>108985995
every open source project should admit they don't want outside pull requests instead of pretending like they do
>>
>>108985995
>ask ai to make copy of ladybird
>it makes a copy
problem solved, so I don't see the point really
>>
>>108989967
They do, they just don't want their time wasted. This wasn't really much of an issue before social trust was crushed by floods of indians and AI slop.
>>
>>108989997
>they don't read the pull requests unless they are easy one line changes
>but the indAIns always post one line changes
>they stop reading pull requests
>>
>>108990018
if you get flooded with ai slop, why would you even bother reading it? the privilege of even having a developer of a project code review your pull request comes from building trust. there is no other sustainable way to do it at this point because it's literally just a massive time waste of everyone involved just so an indian can pad their resume

foss only works with passion and high trust
>>
>>108990041
>the privilege of even having a developer of a project code review your pull request comes from building trust.

the average open source pr takes one hour to write, but that's not all the author also has to build trust with the repository developer BEFORE submitting the first pull request

the problem:
>>
>>108990047
Depends how big the project is to be honest, a lot of people take the Linux kernel for granted and kinda forget that its now so big that no developer has actually seen the whole code base or really knows how the whole thing operates other than what the section they are deving and maintaining does. It's over 1 million lines of code with vast sections of it apparently left untouched for decades which is how a lot of the AI vulnerability exploits are being found.
>>
File: 1764391729994255.jpg (329 KB, 1125x1103)
329 KB JPG
>couldn't solve yesterday's leetcode problem
>trying to learn digit DP
>all of the youtube tutorials are by unintelligible jeets
>95% of the blogposts are pure gibberish (by jeets)
it's over for me
>>
File: newface.jpg (627 KB, 5000x5000)
627 KB JPG
>digit double penetration
what did they mean by that??
>>
>>108990169
>69
>>108990568
>68

since when does 4chan count backwards with the post numbers? Will it shutdown if we reach zero?
>>
>>108990573
You can't be real.
>>
>>108990169
digit DP is just normal DP except 4D
>>
File: master-of-tricks.jpg (42 KB, 600x424)
42 KB JPG
>>108990584
>>
>>108990607
>I was just pretending to be retarded
Sure thing, bucko.
>>
>>108990595
that doesn't really help because I'm shit at DP, I've been trying to figure out the intuition for weeks but I can never solve bottom up DP solutions on my own unless they're incredibly easy, and recursive top down always TLEs with more than 2 dimensions.
Also all of the digit dp blogposts i've read use 3 dimensions, idk where u got the 4th from
>>
File: file.png (202 KB, 1310x841)
202 KB PNG
WTF
>>
>>108990637
I need to see the difference in code output.
>>
>>108990658
apparently in most cases it does nothing, swift uses llvm as its compiler so that's similar to the -Os / -O2 flag.
>>
>>108990704
I wouldn't call getting rid of the typical stack shenanigans that the compiler churns out if optimizations are disabled "nothing".
>>
>>108990627
bottom up doesn't really have an intuition since breaking a problem down in to it's smallest pieces ends up not even resembling the original problem statement, it's one of those things were you solve an entirely different problem than the one asked to be solved and the end result happens to have the same answer as the original. It's much closer to lateral thinking puzzle solving.
>>
>>108990637
>run solution
>3ms
>look at example 0ms code
>it's exactly the same as mine
>>
>>108990750
two problems here,
1. leetcode runtimes are notoriously unreliable and vary by submission (0-8ms differences are leetcode's fault, something like 20-200ms is yours)
2. the compiler optimization flag apparently only provides like a 10-15% performance boost even in ideal scenarios
>>
>>108990723
>if optimizations are disabled
they aren't disabled though
>>
>>108990750
>>108990773
should've used rust. Rust doesn't have this problem
>>
>>108990817
Yeah, that's why he's faster than 100%.
>>
>>108990818
Same applies to rust
>>
File: 1780742704233196.png (135 KB, 944x1035)
135 KB PNG
I'VE ABANDONED MY MACROS!
>>
File: pfft.jpg (105 KB, 629x473)
105 KB JPG
>still using div
>>
>he abandoned <table> because they told him too
beta cuck. Just stay true to your roots
>>
File: 1780743144268420.png (15 KB, 612x229)
15 KB PNG
>>108991323
That's nothing compared to the fact I am making a syscall after every newline.
There's is absolutely no point in saving 10-40 cpu cycles here.
>>
Yeah, but the div is there because you don't understand how to do the same via multiplication.
>>
>>108991369
>Yeah, bUT The diV iS TheRe becaUSe YOU dON'T UNdeRSTaNd hOW TO dO The SaMe Via MUlTiPlicaTiON.
>>
>>108989718
im not a linux shill but when you start to use linux you will have a lot of ideas for what to program.
Right now im making a custom bar for my window manager. even though there is a billion of them out there i still make my own. you dont have to be original, just take something that you are already using and make it yours, then make it better and repeat
>>
>You sunk my battleship!
>>
>>108990169
>>all of the youtube tutorials are by unintelligible jeets
it became a habit of mine to immediately close a video when i hear their accent in some tutorial
>>
Go stare at some Factorio memory allocation.

>>108991422
same when I hear that fucking AI voice.
>>
>>108991391
>Reddit case
Anon has automatically won
>>
Nah, unlike you I already know how to be better.
>>
>>108991451
It was used to portray sarcasm long before reddit existed zoom zoom.
>>
>I relied on std::type_info::hash_code() being stable across module boundaries
>I found out
it's interesting how most compilers handled it just fine. only one tripped me so far.
>>
>>108991494
don't use RTTI based features like std::type_info or dynamic_cast
just parse and hash the type name from a template and std::source_location (or __PRETTY_FUNCTION__/__FUNCSIG__ prior to that)
//
template<typename T>
consteval std::string_view raw_type_name(){
return std::source_location::current().function_name();
}

parse that to get an actual typename from the function signature, there's going to be differences based on whether it's msvc, gcc, or clang but all three will contain something like T = typename somewhere in that string (there should be examples out there)

alternatively gcc 16.1 has static reflection now
>>
Going to start on my source code site where opening a PR costs a small amount of money. If its accepted, you get the money back. Like the carts at Ikea.
>>
>>108991986
does std::source_location::function_name come with any stronger guarantees than std::type_info::name? in case of the latter, I found out that "implementation-defined" can mean empty string for every single type on some platforms.
>>
>>108992111
nope but it's implemented at a much higher level (consteval evaluation/or macro expansion for __PRETTY_FUNCTION__/__FUNCSIG__) in the compilation process so it probably shouldn't differ by platform
although it might be implementation guaranteed though, not sure if the docs for __PRETTY_FUNCTION__ and __FUNCSIG__ say (source_function is basically using those internally)
>>
>>108992213
currently my idea is to use something like this
template<typename T>
struct type_id
{
inline static int dummy;
};

I figure
&type_id<T>::dummy
should be unique for each T. I am still not 100% sure if this will work across module boundaries, but with proper exports/imports I think it should.
>>
>>108992060
>work for free
:(
>pay to work for free
:D
>>
>>108992258
that's also very common, you tend to see that more in older C++ standards before they improved constexpr evaluation enough to make string parsing not a pain in the ass
that should work for more concrete stability guarantees
though really I think as long as it's not reliant on RTTI you should probably be good
>>
Are you guys building anything?
I wanted to build something that would help me read and understand research papers.
>>
>>108984943
It is by will alone I set my code in motion
It is by the juice of Cheetos that thoughts acquire speed
The code acquires bugs
The code becomes unstable
It is by will alone I set my code in motion
>>
>>108992397
No, I wanted to jump back into to re-learn python and asked for resources and got ignored so I'm cleaning my room instead lol
>>
>>108992401
>>108992405
Speaking of building something, I was wondering if there are any sort of easy to follow tutorials on how to use Pybridge or another code bridge to allow you to reference and use javascript libraries?
I'm having a hard time figuring it out and I need someone to handhold me through the process.
>>
>>108992397
most recently, a bunch of weird small utility programs
like something for handling nbd shares setup over adb
on again off again building a vulkan development sandbox i can use for experimentation that actually supports all the modern features i know i'll probably want to use at some point because i can't decide on an API for a lot of the primitives
maybe i should just use someone else's toolkit and just deal with the fact that they're literally all outdated as fuck

been trying to get into embedded/microcontroller dev, i got some ESP32-S3s and one of the Arduino single board computers (the Uno-Q) and a bunch of parts i'm fucking around with, haven't done anything interesting yet but i've got some vague ideas
>>
>>108992470
>at some point
*at some point. development keeps stalling because i can't decide on an API for a lot of the primitives
>>
After MONTHS slacking around like a little bitch, I finally made some progress. Copied the APP (tm) from sd card to RAM. pic and kode related
# input
# - a0: First cluster low
# - a1: pointer to output buffer
# output a0: 0 -> success, -1 -> err
_read_file:
addi sp, sp, -32
sw ra, 0(sp)
# ... prolog

mv s0, a0 # currentCluster
mv s1, a1 # output buffer

# buffer step size
call _fat12_get_boot_sector
lbu s3, BS_SECTORS_PER_CLUS(a0)
li t0, BYTES_PER_SECTOR
mul s4, s3, t0

call _fat12_get_fat
mv s2, a0

call _fat12_get_root_directory_end
lw s5, 0(a0)

.rf_loop_start:
addi t1, s0, -2 # t1 = currentCluster - 2
mul t1, t1, s3 # t1 = (currentCluster - 2) * SectorsPerCluster
add a0, s5, t1 # a0 => lba = RootDirectoryEnd + t1, arg0 for read_sectors
mv a1, s3 # a1 => SectorsPerCluster
mv a2, s1 # a2 => output Buffer
# int read_sectors(lba, sector_count, *out_buffer)
call _fat12_read_sectors
bnez a0, .rf_fail
add s1, s1, s4 # increment buffer

# fat entry lookup
# fatIndex = currentCluster * 3 / 2
li t0, 3
mul t0, s0, t0 # currentCluster * 3
srli t0, t0, 1 # t0/2

# safely load cluster number
add t1, s2, t0 # g_Fat + fatIndex
lbu t2, 0(t1)
lbu t3, 1(t1)
slli t3, t3, 8
or t2, t2, t3
# even or odd
andi t0, s0, 1
bnez t0, .rf_fat_odd

.rf_fat_even:
andi s0, t2, -1 # currentCluster = t2 & 0xfff
j .rf_loop_check
.rf_fat_odd:
srli s0, t2, 4 # currentCluster = t2 >> 4

.rf_loop_check: # while (currentCluster < 0x0ff8)
li t0, 0x0ff8
bltu s0, t0, .rf_loop_start

j .rf_done

.rf_fail:
li a0, -1

.rf_done:
# ... epilogue
lw ra, 0(sp)
addi sp, sp, 32
ret
>>
>>108992510
now I just need to jump there, I guess
>>
>sarcasm is banned
>let me mention reddit every 7 words
I think I hate 4chan.
>>
>>108992542
See you tomorrow!
>>
It's 2026 why aren't you switching to rust?
>>
File: 1770376323879822m.jpg (82 KB, 1024x990)
82 KB JPG
I'm not going to bake the thread
>>
>>108993617
Rust is old I use lean 4
>>
>>108993794
>>
>>108993808
>>108993808
>>108993808



[Advertise on 4chan]

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

[Enable Mobile View / Use Mobile Site]

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