← Home ← Back to /g/

Thread 105601261

370 posts 110 images /g/
Anonymous No.105601261 >>105608443 >>105608725 >>105613520 >>105613591 >>105617603
/dpt/ - Daily Programming Thread
What are you working on, /g/?

Previous thread: >>105570523
Anonymous No.105601329 >>105601627 >>105613354 >>105613441
Dumping registries.
Anonymous No.105601555 >>105601609 >>105601620 >>105610925 >>105613177 >>105613418
>be mathfag
>decide learn2code
>hear "grind leetcode"
>do medium problem "House Robber"
>check other's solutions for lulz
I can't even make sense of what others are doing. It's all For loops with whacky index manipulation or a shitwhack of if-then statements with recursion. Picrel mine, not the best but goddamn at least I can read the damn thing.
Anonymous No.105601609 >>105601626 >>105616823 >>105616897
>>105601555
Just naively solving the problem is not valid. You have to provide the optimal solution. Also forget about a tech job, people with 10 years of exp are still looking for jobs after a year since they've been laid off. The market right now has never been worse in history.
Anonymous No.105601620
>>105601555
what a horrifying "solution". I can definitely believe you're a mathfag.
Anonymous No.105601626 >>105601646 >>105601647
>>105601609
>Just naively solving the problem is not valid
It submitted just fine lol, 1ms execution. I'm already gainfully employed, I just wanted learn2code
Anonymous No.105601627 >>105601684 >>105604737
>>105601329
wtf am i reading and why are cniles so dumb
Anonymous No.105601646
>>105601626
>It submitted just fine lol, 1ms execution
Who cares, how does it compare to other solutions?
Anonymous No.105601647 >>105601684
>>105601626
The tester only checks wallclock timr, not big-O time nor space. For job interviews, even yesteryear when it was about how you think and not bullshit memorization, your ridiculous code would be a hard fail every time. But other than that the bounds are all they care about now.
Another consequence of their chrcker working like this is that in slower languages like python, it will sometimes reject optimal solutions because the runner was too busy for a second.
Anonymous No.105601684 >>105601716 >>105613551
>>105601627
Hey anon, uh............ I'll take a $5 Gordita Cheesy Crunch Box Supreme, think a medium Baja Blast will pair nicely too. thanks bro.
>>105601647
interdasting.
>your ridiculous code would be a hard fail every time.
well yea i'm no pro coder, but surely Memoization is a real technique code monkeys use yeah? Big-O time wise, it should be very fast. Probably sucks on space but who cares? Memory is cheap lol
Anonymous No.105601691 >>105603433
I've been interested in hlasm's lately but can't find anything actual and useful out there, just old stuff for hardware that doesn't exist anymore or the likes.

My interest is to explore the minimum abstraction level boundary that makes a program easily portable to different archs. My plan is to write a compiler that takes one hlasm program and converts the llasm from one arch to another. I want to determine which ops can easily be ported this way and which ones strictly need to be abstracted this way.

After that I want to explore emerging low level patterns and abstract them, but that's basically just macro facilities that even llasms like fasm have.

The idea concept for this exercise is to rething something like forth or lisp within the abstraction of register machines rather than lisp machines or stack machines.

So, any hlasm worth checking out or what?
Anonymous No.105601716 >>105601760
>>105601684
I'm not arguing against your memoization, actually I was impressed you even knew to do that. I laugh at your choice of... key... though.
Also a hint: python has an lru_cache decorator you can use instead of manually implementing memoization
Anonymous No.105601760 >>105601832
>>105601716
>python has an lru_cache decorator
sick, i'll take a look. thanks anon.
Tupling the list just seemed like the easiest way I could "hash" it without thinking too hard.
Anonymous No.105601832
>>105601760
You could also just use positional indices and use a subfunction for the inductive loop.
Anonymous No.105602677
Good evening, Ada kings
Anonymous No.105603433 >>105604528
>>105601691
Does LLVM IR not fit what you want? Also I would only focus on RISC, generating good CISC/x86 code just takes so much effort.
Anonymous No.105603538 >>105610303
>>105600898
>>105600967
Turns out the same thing without recursive types is just
typedef void *(*func)();

void *h()
{
puts("h");
return 0;
}

void *g()
{
puts("g");
return h;
}

void *f()
{
puts("f");
return g;
}

int main()
{
func k = f;

while (k)
k = k();

return 0;
}
that concludes today's retardation
Anonymous No.105604528 >>105605080
>>105603433
I actually have done a lot of playing around writing compilers and interpreters over the years. I've written some that directly output elf64, some that just emit nasm or gnu as programs, and I've toyed with llvm (both ir and through the api's).
The biggest problem by far with llvm is that it is so ridiculously unstable in a development sense. Every subpoint version radically changed ir syntax AND api syntax AND very often results in the api generating broken IR. Also because of such frequent changes it's nearly.impossible to find the right docs, since they can take their sweet time updating them sometimes.
It's very unfortunate because otherwise it has a good abstraction model, though limited to the infinite register abstract machine with ssa, and I'm interested in exploring other abstractions as well.
I know how painful it is to work with x86 but I know my way around at this point. Rather than these backend details, though, I'm trying to explore more around frontend design (so like with tools like llvm ir in that sense, but wondering if there's anything else out there. Used to be c-- but it's been discontinued a while ago), Also llvm ir is more designed as a compiler bsckend when I need facilities to define high level concepts to explore absteactions and their implications (simply through forking a project with a simple enough codebase is fine, too). Ultimately this is a "spiritual quest" to find the Grand Unifying Theory of low level programming on limited register machines.
Maybe llvm's abstraction is it, but I hope to find something "better".
Might just have to write a mini assembler with a simple macro system to get started though
Anonymous No.105604675 >>105605189
It boggles my mind how tricky it is to write a correct simple first fit allocator with coalescing in C. The cute diagrams don't reflect this at all.
What's even worse is that FP doesn't even solve this problem because it doesn't do pointer arithmetic and mutation of the heap or because "there is no need because we have a GC".
Anonymous No.105604737
>>105601627
Did you know that competency looks like arrogance from a pit? No, you probably didn't.
Anonymous No.105605080 >>105608027
>>105604528
I've messed around with using rustc as a library and it is also very picky about specific versions, same as you describe. I think there isn't a lot of interest in this because "universal assembly" is definitely slower than assembly which is tailored to a specific architecture, and people who are still using C/assembly are mostly chasing the best performance possible.
Anonymous No.105605189 >>105605470
>>105604675
Now you know why fixed-size bitmaps are superior.
Anonymous No.105605470 >>105605653
>>105605189
Do you know a good algorithm to efficiently search the bitvector for a hole? The naive way seems really slow.
Anonymous No.105605653 >>105606260 >>105616615
>>105605470
Fetch vector part.
Negate vector part.
Count trailing zeroes.
If there are none, goto 10.
If there are, see if the subsequent zeroes indicate enough space for the required size.
If they do, goto end.
If they don't, goto counting zeroes.
Anonymous No.105606260 >>105616615
>>105605653
Alternatively you can do a POPCNT first, to see if there are enough free bits in total.
Anonymous No.105606969 >>105607189 >>105610326
So this is the power of not using Rust
Anonymous No.105607189 >>105607395
>>105606969
>std::stringstream
Anyone here willing to argue that Bjarne didn't just want to make his own FILE* nonsense with blackjack and hookers and the same old nonsensical memory BS?
>inb4 you can set your own buffer
And how many people end up doing so?
Anonymous No.105607395
>>105607189
Probably the only real reason was so he could use the << brain damage.
Anonymous No.105607449 >>105607496 >>105607580 >>105607597
std::cout << "here1" << std::endl;
my_1000_line_function();
std::cout << "here2" << std::endl;


>here1
>line 65: 31288 Segmentation fault (core dumped)
Anonymous No.105607496 >>105608997
>>105607449
>1KLOC
Ah, to be young.
Anonymous No.105607580
>>105607449
>1000
Um, what about your 200 micro-functions spread around over several dozen files??
Your're never going to be a professhunul programmer that way.
Anonymous No.105607597 >>105609488
>>105607449
add more print statements.
Anonymous No.105607724 >>105608034 >>105608274
how much should i be reading other peoples open source projects as opposed to writing my own projects?
Anonymous No.105608027 >>105608171
>>105605080
That was my impression it's a pretty niche topic even among people interested in languages and low-level. But I think it just means the question has been underinvestigated and is worth revisiting.
In that semse C basically acts as a unicersal assembly language, yet llvm is still slower than what gcc produces. One layer of magic is of course all the ridiculous optimizations that came in ovee the years, but a lot of them, like lto, have been available outside languages burdened by the C standard for longer than they've been available in C. So the other axis is the balance of semantic expressibility: too high and the compiler struggles to translate it efficiently, too low and the compiler can't assume enough to apply optimizations, then you have to manually do platform-specific wizardry.
But is, say, C, really the right level, based on its achievable speed? Some llvm languages get close despite being higher level and despite the inherent llvm overhead. Forth is far simpler, retains basically assembler-like machine access, yet can be seen as being as high-level as lisp. Despite being limited by the stack machine model, it can be pretty fast, but not C speed on modern machines.
Lastly, it remains true that no matter what language you use, you will always have to write platform-specific code or rely on lubraries that do (i.e. beyond the language itself being platform specific as in specific assembler languages) such as through syscalls or some hardware communication like cuda.
Anonymous No.105608034
>>105607724
Only as much as required for inspiration for your own projects
Anonymous No.105608171
>>105608027
Haskell had pure functions since 90's, guess what C got in its newest standards and why it was faster than Haskell before it got ability to optimize beyond what it already could.
Anonymous No.105608274 >>105608336 >>105608413
>>105607724
You normally use them as reference, rather that just reading other people's code for no particular reason.
Anonymous No.105608336 >>105608376
>>105608274
Most code is shit as a reference unless it is provably state of the art.
E.g. luajit if you are building your own jit, Lemire's SIMD solutions for unicode, url parsing, json parsing, GCC if you are building your own compiler...
Anonymous No.105608376 >>105608383
>>105608336
Not necessarily in a grandiose sense like that.
Maybe you're writing a plugin for something, so you reference how other plugins work.
Maybe you're implementing a protocol/standard and see hoe other people handle some particular edge case.
Maybe you just want to know what some library function you're calling is doing.
Anonymous No.105608383 >>105608387
>>105608376
Why would I be writing a plugin for something?
Anonymous No.105608387 >>105608392
>>105608383
After posting that, I realised how hyper-aggressive it really was, and that I'm talking to the resident schizo.
Can you just kill yourself already?
Anonymous No.105608392
>>105608387
No I can't, now explain why I would try to bloat existing software that I chose to use because it is already perfect.
Anonymous No.105608413
>>105608274
>break project into discrete sub-tasks
>for each task, ""reference"" similar existing solutions
>project now finished
Anonymous No.105608443 >>105608491 >>105608496
>>105601261 (OP)
> LISP
> our language can do XYZ, and much more how cool!
> except we restrict almost 50% of performance of the actual hardware
Why is it considered a novelty? Anybody can make a super extensible language if you are just willing to ignore the nature of computers itself.
I like LISP macro capabilities, the ability to modify the language itself, the interpreted nature, etc but what's the point of these features if the actual primitives are 50% slower?
"State" and "Process" are two fundamental aspects of computers, treating "state" as some sort of boogeyman is a retarded concept.
> muh you can still use state
The moment you start introducing state in a lisp program, the entire paradigm starts to break apart, the language itself discourages it, which is a part of the problem.
And yes, resistance does matter. For example, Zig has this retarded concept that pointers can never be 0 initialized. You have to retarded if you think this is a good idea, and no introducing a specific syntax for 0-able pointers is not a solution because the language itself starts to break, if those are used. Same thing happened with const in c/c++.
Anonymous No.105608491 >>105608510 >>105608515 >>105608533
>>105608443
Lisp is compiled to machine code, not interpreted.
Good compilers like sbcl can achieve c speed in numerical code and roughly java speed elsewhere.
Lisp is actually better for low level than c is in many cases. There are several extensive reports about it from.various actors who used it this way in prod. Google is still a thing you know.
Anonymous No.105608496 >>105608523
>>105608443
States are the default way to do things in lisp. Haskell is not lisp. You don't seem to have any idea what lisp is.
Anonymous No.105608510 >>105608573
>>105608491
Again, being compiled has nothing to do with what I am talking about. The very name: "LIST"Processing language says it all. The catch is, memory is not a list, it's a sequence of cells.
So, if "I" as a programmer knows that an array is the "perfect" solution to the problem at hand, the language completely falls flat on its face.
And yeah, there might be some specific way in different dialect to implement that data structure, but then the elegance is lisp is gone. We are back at square 1.
Anonymous No.105608515 >>105608563 >>105608619
>>105608491
>c speed
4-8x c runtimes on benchmarks game.
it's a silly battle to fight on a planet that produces as much javascript and python code as ours.
Anonymous No.105608523 >>105608622
>>105608496
I assumed SICP is the goto resource for understanding the "philosophy" of lisp. And that book has entire chapters dedicated to why you should avoid using state, and only use at specific areas.
Anonymous No.105608533 >>105608628
>>105608491
> Lisp is actually better for low level than c is in many cases
Yeah, and the C code uses "linked lists" for every structure to make the comparison fair.
Even ignoring that, everything that you can write in LISP can be done at the same performance in C, if not faster. However, the opposite is not the case.
Anonymous No.105608563 >>105608581 >>105608596
>>105608515
> it's a silly battle to fight on a planet that produces as much javascript and python code as ours
> It's a silly thing to create good things, because everything else is slop.
Fuck off
Anonymous No.105608573
>>105608510
Lisp has native array support in the standard. Not only that but they can use unboxed elements, support multidimensional layouts, custom indexing and stride, slices, views and more.
You are a clueless backpedaling retard
Anonymous No.105608581
>>105608563
Well, that's certainly an interesting way to read that sentence.
Anonymous No.105608596
>>105608563
Daily reminder: if your C code depends on libc in any way, it's slop, and slow. Stick to JavaScript.
Anonymous No.105608619
>>105608515
Benchmark games is codegolf and only a few tasks are numerical. Notably regarding golfing, many programs are not updating for multithreading. In the singlecore comparisons, the averages are closer to 3x than 5x, suggesting this also affects lisp programs vs c programs as an example.
It's trivial to write the same numerical code on your computer and benchmark yourself. Though likely far beyond your capabilities.
Anonymous No.105608622 >>105608625
>>105608523
sicp uses scheme, not lisp
Anonymous No.105608625 >>105608636
>>105608622
sicp uses every possible lisp since lisptards are the distrohoppers of programming languages
Anonymous No.105608628 >>105608631
>>105608533
Lisp allows generating, compiling and executing arbitrary machine code so that isn't any more true than any of your backpedaling attempts so far. Cry more.
Anonymous No.105608631 >>105608643
>>105608628
Which still doesn't match C speed even after you annotated it to be less legible and more strongly typed than equivalent C code.
Anonymous No.105608636
>>105608625
No, it only uses a specific scheme dialect. It uses no other lisp whatsoever, nor any of their concepts, and barelt touches on concepts like lisp-1 vs lisp-2.
Anonymous No.105608643 >>105608658
>>105608631
Who said anything about annotation, schizo? Are you retarded on top of illiterate?
Anonymous No.105608658
>>105608643
I did, LISP is trash even after you make it more verbose than Java. Slower than Java too. Just give up, because I accepted your concession long ago.
Anonymous No.105608725
>>105601261 (OP)
Why won't Tkinter load on my Linux? I tried to fix it but it still won't work.
Anonymous No.105608997 >>105610185
>last post I made was >>105607496
>in the meantime people accuse one another of being the, quote-on-quote, "resident schizo"
>a.k.a moi

It's kind of like being Gestapo - no one knows if it's me or not. I like it.
Anonymous No.105609056 >>105609200
Filtering unnecessary info and cutting the file into bits made processing a lot faster. Probably a very simple and common thing to do but i feel like a genius for doing it just now.
Anonymous No.105609200 >>105609227 >>105609242
>>105609056
Wait till you find out how fast your program can be when you ditch JSOY format.
Anonymous No.105609227
>>105609200
sad;y every API in the world uses it. Even if i were to translate it into something else to make like easier i would still have to interact with it. jq makes it easy anyways.
Anonymous No.105609242 >>105609282
>>105609200
json parsing is actually much faster than storage nowadays. Of coursw binary purpose-specific formats are best, but json is a good format for small datasets. Very fast and not that large.
Anonymous No.105609282 >>105609351
>>105609242
JSON is parsed at 4GB/s+
Storage is 10GB/s+
Network is 50GB/s+
Fuck off nocodetranny.
Anonymous No.105609351
>>105609282
Your tranny incompetent handwritten parser doesn't count.
Anonymous No.105609362 >>105609509
>no code
A story as old as /dpt. Yes, it counts.
Anonymous No.105609462 >>105609629
For some context. The top is me doing my thing on a chunk of the big file and the bottom is doing the same directly on it. The big file is 750mb and a chunk around 1.1mb.
Anonymous No.105609472
>Gernab
Opinion discarded with prejudice, do not respond.
Anonymous No.105609488
>>105607597
King shit right here
Anonymous No.105609501
>no code
where's yours? you have never posted any of your code, probably because it would be relentlessly mocked by people who actually know what they are doing. I can't imagine a more worthless existence than yours
Anonymous No.105609509
>>105609362
I can't follow this argument. What's the claims made by both parties here and why are they disagreeing?
Anonymous No.105609545 >>105609580 >>105609621
It's very, very, VERY simple, nocodeshitter: you made the claim 4GB/s+ is slow, but you can't provide code that is substantially faster. Therefore, you lost, and in a just mongolian basketweaving forum we could vote on your IP being revealed so that we can remove you from the gene pool.

But unfortunately this is 4chan.
Anonymous No.105609572
>Schizo meltdown where they stop replying to posts
Is this related to some kind of troon thing? I've noticed that's something they do in other threads on here.
Having one mental illness, it's not a leap to think they have a 2nd, so I propose we refer to him as the schizo troon now.
Anonymous No.105609573
>Code that's substantially faster
You just mmap the binary file instead of using JSON. That simple. I expected more of you, but you're too mentally ill to remember that mmap does more than allocate memory.
Anonymous No.105609580 >>105609589
>>105609545
>Therefore, you lost, and in a just mongolian basketweaving forum we could vote on your IP being revealed so that we can remove you from the gene pool.
Are you seriously advocating for doxxing
Anonymous No.105609589 >>105609592
>no code
Another concession being accepted, nocodeshitter.

>>105609580
Yes. That would be absolutely great.
Anonymous No.105609592 >>105609603
>>105609589
That's against the rules dipshit
Anonymous No.105609596 >>105609604
What exactly confused you about
>But unfortunately this is 4chan.
?
Anonymous No.105609603 >>105609626
>>105609592
He's a moderator on this board, so no, it isn't against his rules.
Anonymous No.105609604
>>105609596
Then leave 4chan if you hate it so much lmao
Anonymous No.105609615
Nah. I seem to REALLY rustle jimmies just by being here.
Anonymous No.105609621
>>105609545
>Therefore, you lost, and in a just mongolian basketweaving forum we could vote on your IP being revealed so that we can remove you from the gene pool.
This should happen to you instead :^)
Anonymous No.105609625 >>105609631 >>105609885
That's the nice thing about votes: majority counts, not autism.
Anonymous No.105609626
>>105609603
If that were true he'd doxx everyone in one of his schizo meltdowns
(Assuming moderators have access to user IPs)
Anonymous No.105609629 >>105609648
Who is accusing who of what?
If you want i can do the same what i did in >>105609462 on two other systems, one with a weaker cpu than the other but same memory speed. To check if its bottle necked by CPU or RAM.
Is that what you are arguing about?
Anonymous No.105609631
>>105609625
The majority would vote against you, stop being delusional lmao
Anonymous No.105609646 >>105609650 >>105609664
>"stop being delusional", said the incompetent autist
Anonymous No.105609648 >>105609661
>>105609629
Your test is completely pointless, because you're using jq and not something that uses simdjson, jq is slow.
Anonymous No.105609650
>>105609646
I'm not any of the guys in that screenshot, but OK, keep being delusional
Anonymous No.105609657 >>105609673
>it's not me, therefore the message doesn't apply
How many times am I supposed to repeat the phrase "incompetent autist"? Just be honest.
Anonymous No.105609661 >>105609741
>>105609648
Wouldn't a slower program exaggerate the bottleneck? If anything it would be better to see where the bottle neck is this way, right?
Anonymous No.105609664 >>105609680
>>105609646
>He screenshotted an anon making fun of him and calling out his schizophrenia
Nice self-own you idiot
Anonymous No.105609673
>>105609657
Until you realize the phrase actually fits you more.
Anonymous No.105609680
>>105609664
>05.46
Go to bed, you fucking schizo.
Anonymous No.105609681 >>105609705 >>105609711 >>105610798
>he actually, factually thinks that's not my post
Obligatory "incompetent autist".
Anonymous No.105609701
>shit all over the street
>my presence on this feces filled public street seems to bother everyone for absolutely no reason, peculiar
Anonymous No.105609705
>>105609681
It isn't now :^)
Anonymous No.105609711
>>105609681
Nah. I ain't an "incompetent autist".
You're just schizophrenic.
Anonymous No.105609712 >>105609716
>the incompetent autist is delusional now, too
QED.

>my presence on this feces filled public street seems to bother everyone for absolutely no reason
OK, and?
Anonymous No.105609716
>>105609712
>reee you're delusional not me
Sorry. I make the rules. You're delusional.
>OK, and?
K pajeet
Anonymous No.105609721 >>105609731
>I make the rules
So where are the doxxing votes?

Retard.
Anonymous No.105609731
>>105609721
>reeeee I want to doxx my boogeymen
Get help
Anonymous No.105609737
>OK, and?
you are the outcast here, no one likes you and if it were up to a vote you would be exiled immediately. your violent fantasies about other anons here are meaningless when in reality you would be the first one to go.
Anonymous No.105609740 >>105609748 >>105609760
>reee I can't enable doxxing because then I'd be murdered in my face
QED. Again.
Anonymous No.105609741 >>105609769
>>105609661
It's not an exaggeration. And disks are too fast nowadays for 100MB/s json parsers.
Shitty chink laptop SMR HDDs that spin at 5400RPM can read at 100MB/s if file isn't fragmented.
Anonymous No.105609747 >>105609754
Oh, no. Incompetent autistic nocodeshitters don't like me. Stop the presses.
Anonymous No.105609748 >>105609755
>>105609740
>he actually, factually, wants to doxx and murder people
Oh look, the incompetent autist who calls others "incompetent autist" is a psychopath who belongs in jail.
QED.
Anonymous No.105609754
>>105609747
>He thinks he's a programmer and that his boogeymen aren't
>He actually, factually, screenshots his own posts still
Ok nocodeshitter :^)
Anonymous No.105609755 >>105609762
>>105609748
I'd post my IP as a joke but last time I did, I got banned for doxxing. Apparently I can't do that.
Anonymous No.105609758
>incompetent autist > psychopath
>because reasons
Anonymous No.105609760
>>105609740
Post a timestamped picture of your face. If you're proposing doxxing, surely you're open to doing it to yourself.
Anonymous No.105609762
>>105609755
That's because you're doxxing yourself lmao
Anonymous No.105609769 >>105609776
>>105609741
isn't the "select" part of the operation done completely in memory thus the bottleneck being either the CPU or RAM? Other programs that just delete some content of the file barley use any RAM which proves this i think.
Anonymous No.105609772
Sorry, I'm a psychopath. Rules for thee, but not for me.
Anonymous No.105609776 >>105609796
>>105609769
That's my point. Hardware I/O isn't slow anymore. CPU code suddenly matters. Yet at least 90% of code is written by K&R tier toddlers.
Anonymous No.105609784
No one would use a registry dumper program, nor would they care about performance in such a program, let's be real with you mmap schizo
Anonymous No.105609793 >>105609826
>Hardware I/O isn't slow anymore
A-huh.
Anonymous No.105609796 >>105609810
>>105609776
Doesn't RAM speed fall under "Hardware I/O"? Who cares if you have a fast CPU if it takes ages reading through the data because the RAM is slow.
If there is demand for it i could do a benchmark but i personally am not very interested in this and I'd have to stop what my computers are doing right now for it. But if it helps to settle things and if i could help i would.
Anonymous No.105609810 >>105609850
>>105609796
Is your RAM faster than 10GB/s? (2010 hardware)
Then your for loop over chars is slower than RAM. Next retarded question please.
Anonymous No.105609825
I propose that to put the regdump schizo in his place, we either stop responding to his delusional rants, or use his own words against him, calling HIM a "nocodeshitter"
Anonymous No.105609826
>>105609793
Also picrel.
Anonymous No.105609834 >>105610523
>calling HIM a "nocodeshitter"
And give me more reason to repost old images? Please do!
Anonymous No.105609846
just do not engage
Anonymous No.105609850 >>105609865 >>105609873 >>105609905
>>105609810
I have some computers with fast RAM and some with slow, same for CPU.
Again i fail to see why any sort of specific speeds are important if the question is were the bottleneck is. The question is "Is the CPU or the RAM bottlenecking the program?" not "At what speed does it run?"
Anonymous No.105609862 >>105609929
Premature optimization is the root of all evil.
If you're trying to optimize a CLI program that just dumps something, you're doing it wrong.
Anonymous No.105609865 >>105609905
>>105609850
What is "fast RAM"?
Anonymous No.105609873 >>105609905
>>105609850
Your code is always the bottleneck.
Anonymous No.105609876
>going from 16 minutes to 7 seconds is "premature optimization"
Please tell me you're unemployed. I'd rather pay for your NEET lifestyle that for you having to worked on potentially life-altering code.
Anonymous No.105609885 >>105609896 >>105609897
>>105609625
The bad thing you mean. Tyranny of the majorly retarded.
Anonymous No.105609889
https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize
Anonymous No.105609896
>>105609885
So what would the incompetent autismos have to lose then?
Anonymous No.105609897
>>105609885
Democracy used to be great when you had to be trained in military from young age and gain some discipline before you could give your opinion on anything.
Anonymous No.105609905 >>105609921 >>105609943
>>105609850
>The question is "Is the CPU or the RAM bottlenecking the program?
Also the answer is "its the server" in my case.

>If you're trying to optimize a CLI program that just dumps something, you're doing it wrong.
Yeah that is what i mean. Why should i care if my json parser can parse at 100mb/s or at 10gb/s if im only going to run it once and if the bottleneck is something else entirely. However if we just look at the json part we can still check if its the RAM or CPU that is holding it back.

>>105609865
More like "average" ram running at 3600mt/s. The slower systems are running at 2133mt/s.

>>105609873
If we just look at the json parser its the parser obviously. I think that is where this discussion started. "json being slow".
Anonymous No.105609906 >>105610167
>If you're trying to optimize a CLI program that just dumps something, you're doing it wrong.
I'll accept your concessions past, present, and future.
Anonymous No.105609921 >>105609943
>>105609905
>its the parser obviously
Yes. JSON is CPU bound.
Anonymous No.105609923 >>105609945
Anonymous No.105609929
>>105609862
I have a cli program dumping a peptide databsse (sqlite) to fasta. It takes 4h on the current database size after mild optimizations and using 12 threads. I could probably get it to run on about 10 minutes semi-fully optimized.
Anonymous No.105609943 >>105609984
>>105609905
Also in my case switching to file chunks instead of working on the raw file was not premature optimization as going from 8 seconds to 26ms for something that needs to be done almost 150000 times is a substantial time saving.

>>105609921
>Yes. JSON is CPU bound.
Yeah, that is something we could explore but instead anon asks for if my RAM was made before 2010?
Anonymous No.105609945
>>105609923
Actually wrong. The first is sarcasm, the second is fear.

Fear that one day I might actually be affected by your slop.
Anonymous No.105609958 >>105609960 >>105609966
Anonymous No.105609960
>>105609958
nta
got a sauce?
i wanna play around with that thing
Anonymous No.105609966
>>105609958
Wrong again. The first is malice.
Anonymous No.105609984 >>105609994 >>105610070
>>105609943
>my RAM was made before 2010?
This document was written in 2007, and Drepper was already complaining about memory speeds back then: https://people.freebsd.org/~lstewart/articles/cpumemory.pdf

What, do you think, was the purpose behind hyper threading in the first place?
Anonymous No.105609994 >>105610007
>>105609984
>purpose behind hyper threading in the first place?
wtf?
you say its bc of memory speeds?
Anonymous No.105610007 >>105610060
>>105609994
>Unlike a traditional dual-processor configuration that uses two separate physical processors, the logical processors in a hyper-threaded core share the execution resources. These resources include the execution engine, caches, and system bus interface; the sharing of resources allows two logical processors to work with each other more efficiently, and allows a logical processor to borrow resources from a stalled logical core (assuming both logical cores are associated with the same physical core). A processor stalls when it must wait for data it has requested, in order to finish processing the present thread.
https://en.wikipedia.org/wiki/Hyper-threading
Anonymous No.105610060 >>105610076
>>105610007
>inside the mind of an autist
lamao
thats 1% of the usecases for hyperthreading
>NOOOO THATS WHY HYPERTHREADING EXISTS IN THE FIRST PLACE
Anonymous No.105610070
>>105609984
I don't see him complaining in 2025, must be too poor to afford DDR5 RAM.
Anonymous No.105610076 >>105610091
>>105610060
List them.
>inb4 deflection and tumbleweeds, the trademarks of nocodeshitting /dpt/
Anonymous No.105610091
>>105610076
>autism is a hard retardation episode #123456789
how bout providing an additional execution context to maximize instruction throughput as, idk, stated literally everywhere, including the site of the people who developed the tech?
>no, id rather stick with wikipedia
Anonymous No.105610106 >>105610115
Yeah, I will.

Because at least I can link my sources. Can't exactly do that with schizophrenic revelations within a dream, now can you.
Anonymous No.105610115
>>105610106
>deflection
100% on topic
all you have yet to produce is tumbleweeds
https://www.intel.com/content/www/us/en/gaming/resources/hyper-threading.html
Anonymous No.105610125 >>105610132 >>105610135
>Two logical cores can work through tasks more efficiently than a traditional single-threaded core. By taking advantage of idle time when the core would formerly be waiting for other tasks to complete, Intel® Hyper-Threading Technology improves CPU throughput.
Concessions accepted and all that.
Anonymous No.105610132 >>105610167
>>105610125
Where does the memory speed come into play? I don't get what anon means by this.
Anonymous No.105610135 >>105610143 >>105610161
>>105610125
>theres no such thing as cpu bound
>theres no such thing as sequential opeations
autism = hard retardation
stop eating ritalin, it gives you the impression your opinions are worth sharing
Anonymous No.105610143 >>105610169
>>105610135
>>theres no such thing as cpu bound
>>theres no such thing as sequential opeations
but you were talking about memory speed a second ago and posted this to back you up. But it doesn't mention memory and now you are talking about something else again?
Anonymous No.105610161 >>105610178
>>105610135
ritalin is for adhd, not autism
until the dsm fucked it all up again, autism was indeed defined as retardation
Anonymous No.105610167
Your concessions have already been accepted:
>>105609906

>>105610132
If memory was as fast as CPUs there wouldn't be any stalling. There wouldn't be a need to check on another thread and see if data it has requested a couple hundred cycles ago has finally arrived, and if it can now continue executing. There also wouldn't be need for out-of-order execution to make loads execute as early as possible.

But unfortunately memory is NOT as fast as CPUs. And so all of these things exist.
Anonymous No.105610169
>>105610143
>attempt at discourse tactics
stop
accept the fact youre retarded and actually smart people find your attempts at manipulation highly offensive
---
YOU were saying how hyperthreading is a measure to improve memory throughput
it is completely retarded because your memory unit is separate from your hyper-thread so the best you could achieve is a sort of "latency hiding" and only if your code can be exacuted in a non-sequential manner

the ass end of the ass end of the side effects of hyperthreading
Anonymous No.105610178
>>105610161
yea i know but autismo dweebs take ritalin as discount cocaine and the effects are evident ITT
it makes even more retarded than they usually are
agressive
and exacerbates their immaure ego problem
Anonymous No.105610185
I love how actually autistic people can't even successfully match sentence and punctuation patterns: >>105608997
Anonymous No.105610197 >>105610204 >>105610221
why are you guys so petty and cant just reply like normal people. Giving your debate opponent (you)s doesn't mean that you lost but will make the chain easier for others to follow. Im not looking at this tab 24/7 you know. Got other things to do like write programs.
Anonymous No.105610204 >>105610212
>>105610197
because autists are literal developmental retards
kinda duh when you think about it
Anonymous No.105610212 >>105610244
Both of you should take a deep breath through the anus and re-conciser if this is really worth your time.

>>105610204
I admire the dedication to this topic and if they weren't arguing all the time i think everybody could learn a lot from them but this is just embarrassing.
Anonymous No.105610221 >>105610243 >>105610244 >>105610273
>>105610197
I answered you properly, didn't I?
I just don't bother with (You)'s if it's an incompetent autismo who's delusional enough to believe he wouldn't be voted out of the gene pool because he believes CPU-boundness actually matters (you don't hear him raving on about performance counters that add 100% throughput costs in truly CPU-bound scenarios, now do you?)
Anonymous No.105610243 >>105610682
>>105610221
You won't hear me raving about wintoddler issues, that's for sure.
Anonymous No.105610244
>>105610221
it takes additional effort to remove the you
>immature ego on full display
>>105610212
>i think everybody could learn a lot from them
by large theyre tryhards. walking man pages
you could learn the same from reading manuals

fyi most if not all ritualposts come from autists
desktops. tranime. consumergroids
if it wasnt for registryfag (whos posting itt), they would be wholesale worthless
and even registryfag is worthless wiothout a proper context
as evidenced itt he has a tendency to all sorts of cognitive biases
Anonymous No.105610268 >>105610295
>he has a tendency to all sorts of cognitive biases
Which are?
Anonymous No.105610273 >>105610292 >>105610319 >>105611254
>>105610221
>I just don't bother with (You)'s
You bother replying, anon. If you stop using (You)'s its over, you don't continue. You make some funny quote showing that the other is wrong or stupid and you don't do any more.
But you continue without (you)'s, turning the thread into a mess of loose shizoposts that leave everybody who is not following 100% from the conversation at a loss. It doesn't matter how right you are or how well you can explain things if you do this. You are at least as bad as the person you are accusing.

And ignoring your (you) fearing tendencies, why are you even debating with some anon about things only you care if you could instead put that knowledge to use and do something useful to yourself.
This is an anonymous basketweaving forum. Your "honor" is not at risk. You are not even namefagging.
Anonymous No.105610292
>>105610273
>You are not even namefagging.
You are not even namefagging, but are infinity gayer than they are*
Anonymous No.105610295 >>105610311
>>105610268
100% you were gonna hit me with that
immature ego = narcissism
but ill indulge you

-egocentric bias
-naive realism
-belief bias
probably confirmation bias too bc this comes hand in hand with belief bias

and most likely several others you didnt show ITT, or ones i didnt notice
Anonymous No.105610303 >>105612775
>>105603538
Those look like function pointers. Are function pointers really in C? Or is that C++?
Anonymous No.105610311 >>105610328
>>105610295
>egocentric bias
Well, yeah, I'm the best.

>naive realism
Sounds contradictory.
Anonymous No.105610319
>>105610273
>why are you even debating with some anon about things only you care if you could instead put that knowledge to use and do something useful to yourself
Why do you assume I'm not getting what I want out of /dpt/?
Anonymous No.105610326 >>105610839
>>105606969
Is
const Token& token = tokens.at(i);
A reference to an object? Is that C++?
Anonymous No.105610328 >>105610338
>>105610311
https://en.wikipedia.org/wiki/List_of_cognitive_biases
read up on this shit
introspection is the first step to efficient improvement
Anonymous No.105610338 >>105610355
>>105610328
Why would I want to improve if I'm already the best? You're not making sense.
Anonymous No.105610355 >>105610374
>>105610338
>fatal flaw of narcissism on full display
you can always improve but you rest on your laurels instead
you could finally learn what amdahls law is and what are its implications, for starters
Anonymous No.105610374 >>105610380
>>105610355
>amdahls law
I think you're the one with biases here.
Anonymous No.105610380 >>105610398
>>105610374
>no, u
also
wtf does picrel have to do with amdahls law?
>he doesnt know amdahls law
yeah i forgor
Anonymous No.105610398 >>105610408
>>105610380
Simply put: at some point adding more cores to a problem doesn't yield you any more gains. That's what my registry dumper understood from day one.
Anonymous No.105610408 >>105610415
>>105610398
yeah, thats sequential operations
you cannot optimize causality away
you dont need a reg dumper for that :/
Anonymous No.105610415 >>105610428
>>105610408
Then why suggest Amdahls Law?
Anonymous No.105610428 >>105610458
>>105610415
>what is an example?
also
we already talked about amdahls law in the past
it is something you vehemently oppose because it discounts your asm intellectual masturbation
Anonymous No.105610439
AL is ridiculously simple though
in a vacuum that idea wouldnt need a name of its own
but it turns out its a good idea to have a shorthand for it given how many people need to be reminded of that principle
Anonymous No.105610458 >>105610482
>>105610428
>it is something you vehemently oppose because it discounts your asm intellectual masturbation
What?
Anonymous No.105610466 >>105610492
This isn't even about programming anymore...
Anonymous No.105610470
Stuck on what to write so I'm gonna make my own IDE in C#
Anonymous No.105610482 >>105610523
>>105610458
we alr spoke about that
a while ago, maybe you dont remember...
we butted heads about the usefulness of optimizing every single last piece of your code

thats where amdahls law intervenes
>if you completely optimize away a function that accounts for 1% of the runtime, you saved 1% on your runtime
>but if you optimize a function that accounts for 99% of your runtime to run 50% faster, you then gained 44.5% of your total runtime
and the conclusion
>instead of fighting for the last percentiles, just move onto your next project. its pointless outside of academical pursuits
Anonymous No.105610492 >>105610508
>>105610466
softskills.
id argue that some of them are even more important than hardskills themselves
Anonymous No.105610508 >>105610529
>>105610492
No its just sad desu
Anonymous No.105610523 >>105610555
>>105610482
>we butted heads about the usefulness of optimizing every single last piece of your code
Yeah, doesn't ring a bell. My stance has always been that I don't expect people to go down the same insane optimizations that I do (because that's supposed to be the job of the compiler, even if they completely suck at it and will likely always suck at it) *except for memory*.

>its pointless outside of academical pursuits
I don't think so. I now have an AVX hexdumping algorithm I can use in all sorts of other applications: >>105609834
Anonymous No.105610529
>>105610508
>amdahls law is not programming
>organizational knowledge doesnt intervene in project management
bc you cant follow.
thats sad indeed
what a tragic waste of potential
Anonymous No.105610555 >>105610565
>>105610523
>>its pointless outside of academical pursuits
>I don't think so. I now have an AVX hexdumping algorithm I can use in all sorts of other applications
maybe i misspoke
but i classify that as "academic pursuit"

getting better at your art through exploration classifies as academic pursuit, no?
like inventing stuff and such
maybe writing a paper about that in the future?
is the cutoff when you make a paper out of it?
anyhoo
this was a pleasure
but i have groceries to do (alcohol. i wanna drink and i have no reason to not to. cya later)
Anonymous No.105610565 >>105610588
>>105610555
>maybe writing a paper about that in the future?
Oh, you mean like my primers?
Anonymous No.105610588
>>105610565
yeah i guess
people write papers on the most mundane, useless subjects
your primers while not in the usual format
at least have some substance to them
that would count as academic papers in my book

aight
im off
that porto is not gonna buy itself
Anonymous No.105610682
>>105610243
Yet I had to mention it before you do. You're just reacting.

Like an LLM.
Anonymous No.105610770 >>105611165
Just woke up from a nap, did regdump schizo's billionth melty end yet
Anonymous No.105610798
>melty
>>105609681
Anonymous No.105610812
OK, melty's still going on then, got it, kek
Anonymous No.105610839 >>105613994
>>105610326
a const ref is just taking some block of contiguous memory and interpreting as a whole, so yes, it's an object, but it doesn't necessarily have all the baggage that comes with oop like contracts and interfaces and polymorphism
tokens.at is just a bounds checked version of tokens[i]
Anonymous No.105610925
>>105601555
>be mathfag
An array language (such as uiua) might give you some entertainment and, looking at your solution, an itch to compress your code as much as humanly possible.
Anonymous No.105611165
>>105610770
you may not like it but this is what peak coding performance looks like
Anonymous No.105611194
Still 50x faster than optimized python code
Anonymous No.105611239 >>105611249
Balls on the walls, /dpt/.
How many of you pronounce it "go-dot", and not "goh-doh"?
Anonymous No.105611249
>>105611239
god oat
Anonymous No.105611254
>>105610273
>you could instead put that knowledge to use and do something useful to yourself
because he is, using his own words, incompetent (he's one of the easiest posters to filter due to his limited vocabulary and talking points, just a tip to everyone...)
Anonymous No.105611301
>another delusional autismo post
Yawn.
Anonymous No.105611738
Too much C# messes with a motherfucker's mind
This is C++ btw
Anonymous No.105611789 >>105611946 >>105611996 >>105612058
I don't use C because it has fgets and I'm not gay.
Anonymous No.105611946
>>105611789
more like fgetaids
Anonymous No.105611987 >>105612129 >>105612134
Are there any guides on how to design data structures or functions in a higher level language like C# when interacting with lower level C functions?
I've got to wrap a C library but it's the first time I'm doing so and I'm not sure what good practice is
Anonymous No.105611996
>>105611789
>I don't use C
>I'm not gay
Impressive. One massive contradiction in less than ten words.
Anonymous No.105612058 >>105612130
>>105611789
then you must use getline() or a getchar() wrapper.
I am glad that you are not gay and that you are a white man.
C, Go, and Hare are your homes.
Anonymous No.105612129 >>105612375
>>105611987
Very general guideline: think in terms of data; what data are you sending to C? What data do you expect to get in return?
Once you have that covered, write some convenient usage code first, then use that to write a wrapper that uses all the sugar that C# offers.
Anonymous No.105612130
>>105612058
>hare
fuck off drew
Anonymous No.105612134 >>105612375
>>105611987
you write a structure that's clean and usable in your high level language
you write a structure that's efficiently created and aligned with your C library's structure
you write some code that translates between the two forms - usually no real need for design patterns, it could just be a pair of methods in your high-level class that translate to/from the raw form. the "from" method could actually be the constructor of that class
Anonymous No.105612201 >>105612389 >>105612409 >>105612477 >>105612495 >>105617192
What are you guys even writing? So many people say they code but i never understand what or why.
As for me, Im writing utilities for my local booru.
Anonymous No.105612375
>>105612129
>>105612134
Thanks for the tips lads, I appreciate the help
Anonymous No.105612389
>>105612201
when im motivated i write fintech shit
when im motivated but burnt out from my main project i mess around with opengl

but its gonna be a good while im not motivated
since i found out about hoi4 to be more precise (dont ever play this game. ESPECIALLY if youre comfortable with a spreadsheet)
Anonymous No.105612409 >>105612635
>>105612201
Are you seriously expecting autistic, incompetent, delusional nocodeshitters to tell you what they're doing? Deflection is all they're good at. It's why their initial gut reaction to the idea of voted doxxing was refusal.
Anonymous No.105612477
>>105612201
mostly enterprise java software for work (good morning sirs)
Anonymous No.105612495 >>105612745
>>105612201
I'm reverse engineering an old DOS racing game I liked as a kid.
Anonymous No.105612635
>>105612409
>he's still advocating for doxxing
Anonymous No.105612669
Anonymity was always a mistake anyway.
Anonymous No.105612728
Get a room you two
Anonymous No.105612744
I don't know where he is. :(
Anonymous No.105612745
>>105612495
neat
Anonymous No.105612746
Can't think of a project
Anonymous No.105612758
Considering making an OS. Is this a good idea?
Anonymous No.105612762 >>105613138
is it worth the effort to configure neovim for c# dev or should you just use visual studio
Anonymous No.105612775 >>105612819
>>105610303
Yes, C has function pointers
Anonymous No.105612819 >>105612869
>>105612775
any language with pointers has function pointers
Anonymous No.105612843 >>105612875 >>105612889 >>105613168 >>105613473
Should I commit to learning Rust in full? I know a bit of it, but am hesitant to use it as much as I use C/C++ and C# because of the Rust community and how bad it is
Anonymous No.105612869 >>105612932
>>105612819
Except Rust. Function pointers are a PITA to pull off in Rust
Anonymous No.105612875 >>105613177 >>105613418
>>105612843
Couldn't make it to the second post in this thread, could you?
Anonymous No.105612889 >>105612921
>>105612843
I am on the same boat about the community. I feel like this gets talked about in this thread daily.

However I did comit to learning Rust. I have a physical copy of the book and are like 80% into it, and I could say that I'm far more experienced in Rust than in C++, despite still being kind of a newb.
I just try to ignore the community and think about the possible future oportunities for Rust, that's just me. I kinda want to go to Rustconf as well but ugh idk, that might be tranny fest.
Anonymous No.105612921
>>105612889
I mean, I suppose the most mature way of looking at things is to take the choice depending on how good the language actually is. Is Rust actually a good language overall? Is C++ really a bad language? Is one more powerful than the other?

I kinda want to focus on systems programming stuff with maybe some backend shit so Rust was a better choice than Go and C++. But honestly, I desperately need a job so if I were smart, I guess I should have chosen Typescript or Python. That's just me.
Anonymous No.105612932
>>105612869
Nice "functional" language
Anonymous No.105613138
>>105612762
If I were going to write in [proprietary language] I would just use [proprietary software] designed to facilitate that language, but that's just me
Anonymous No.105613168
>>105612843
No
Anonymous No.105613177
>>105612875
>>105601555
?
Anonymous No.105613354 >>105613418
>>105601329
daily reminder that I can't read
Anonymous No.105613418
>>105612875
>>105613354
But >>105601555 is the second post/reply.
Anonymous No.105613441 >>105613545
>>105601329
>He uses ChatGPT to reaffirm his own biases/beliefs
How embarrassing
Anonymous No.105613473 >>105613493
>>105612843
I've got a different perspective - I'm going full rust and full chud.
Anonymous No.105613493 >>105616383
>>105613473
This honestly we should all start "resisting" Rust's community wokeness. Just program in Rust and fully ignore the community and CoC
Anonymous No.105613520
>>105601261 (OP)
What are dependencies?
Anonymous No.105613545 >>105615351
>>105613441
Now that you mentioned, it makes the image pretty funny
Anonymous No.105613551
>>105601684
Hitler did nothing wrong.
Anonymous No.105613591
>>105601261 (OP)
Deleted many lines of code today.
Anonymous No.105613994
>>105610839
Is it C++?
Prince Evropa No.105614059 >>105614129 >>105614178
Lol I'm Aryan. I'm your master. And if you attack me I swear to God I will fuck you and your family up when Christ comes back. I'm going to be so fucking rich in the coming Age of Jacob.
Anonymous No.105614062
Is raft the easiest consensus algorithm to implement? I did some very basic research on the topic and holy fuck I hate that I flunked my distributed systems classes in uni. This shit's cash bro.
I'm planning to use zig for this.
End goal is I want to build a distributed database(with consenus backed by raft) with a basic dialect of sql.
I feel this could keep me busy for a month.
Prince Evropa No.105614129
>>105614059
https://www.youtube.com/watch?v=QmYyh63pqwI&list=RDQmYyh63pqwI&start_radio=1
Anonymous No.105614178 >>105614221
>>105614059
>steppe retard claims superiority while worshipping and invoking the names of semites
nobody gives a fuck about you mudblood. you abandoned your ancestors, the only fate awaiting you is a graceless death leading to timeless oblivion.
Prince Evropa No.105614221
>>105614178
Seething codejeet.
Anonymous No.105614274 >>105614290
SHIT that came out of my ass
what if i fork https://github.com/nwg-piotr/nwg-clipman
For xclip clipmenu since https://github.com/cdown/clipmenu/issues/196 will never EVER happen
Prince Evropa No.105614290 >>105614315
>>105614274
https://www.youtube.com/watch?v=GmS6fe2IxZA&list=RDGgmFC8y8q3k&index=2
Anonymous No.105614315
>>105614290
What the fuck is this horrid abomination? Jeets are niggas now???
Anonymous No.105614499 >>105614511 >>105614552
Learning C++ using VSCode. How do I remove the inline argument names in the editor?
Anonymous No.105614511 >>105614524
>>105614499
https://stackoverflow.com/questions/48123237/remove-parameter-hints-box-in-visual-studio-code
Anonymous No.105614524 >>105614575
>>105614511
Unfortunately not it. They're still there. I'm talking about the 'str' and 'val' text in the screenshot. Fuck it I may as well use vim
Anonymous No.105614552 >>105614585
>>105614499
look at the settings of whatever extension you're using that does that
Anonymous No.105614566 >>105614670
Do you just target the latest .NET version (9.0), or the latest .NET LTS version (8.0)?
Anonymous No.105614575 >>105614700
>>105614524
you're looking to disable inlay hints, not parameter hints.
Anonymous No.105614585
>>105614552
Well, clangd is the culprit. I'll look into that. Thanks
Anonymous No.105614670
>>105614566
.net 8 reaches end of support before .net 9
Anonymous No.105614700
>>105614575
This did it, thank you
Anonymous No.105615178
Thoughts on pygobject?
Startup is a few milliseconds slower but after that there is no latency at all.
Anonymous No.105615351
>>105613545
And the best thing is that it works.
Anonymous No.105615390 >>105615667
>haven't used c# in years
>have to use it for something
>question marks everywhere
???
Anonymous No.105615667
>>105615390
Something to do with nullables, no clue cuz I'm forced to be a .Net Framework boomer
Anonymous No.105616383 >>105616614
>>105613493
And use AGPL
Anonymous No.105616614
>>105616383
No half-measures:
https://plusnigger.org/AGPL-3.0-only+NIGGER.txt
Anonymous No.105616615 >>105616808 >>105617469
>>105605653
>>105606260
I have an idea of an alternative algorithm, based upon this observation:

Let's say that in the bitvector 1 represents free and 0 represents allocated, you can easily find a sequence of 3 bits in a single word by doing:

uint32_t bitvec = 0b111001111011011100;
uint32_t x = bitvec;
x = x & (x >> 1);
x = x & (x >> 1);

printf("0b%032b\n", bitvec);
printf("0b%032b\n", res);

0b00000000000000111001111011011100
0b00000000000000001000011000000100


The position of the 1s give you the start of a sequence of 3 bits. If x is not 0 this means that there is at least one sequence long enough and all you have to do is count the 0s at the start.
The other good thing is that the number of shift/mask operation doesn't have to be in O(n) for n bits, it can be in O(log n).

You can find 8 consecutive 1s by doing:
x = x & (x >> 1);
x = x & (x >> 2);
x = x & (x >> 4);


SIMD could be used to do this several 4/8 uint64_t words at a time. If the words are proecessed 64 bit at a time, the overlapping is easy to handle for contiguous sequences of <= 32 bits one bits, it gets more annoying for sequences longer. At least it should be fast for small allocation 256 bytes if 1 bit represent 8 bytes) and that's what matters.
Anonymous No.105616808 >>105617199
>>105616615
>Let's say that in the bitvector 1 represents free and 0 represents allocated
Zero is the default bitstate for memory returned by both Linux and Windows. You'd set memory that has just been cleared, which is nonsensical. Furthermore you can do the same with an OR, NEG, and TZCNT:

x = x | (x >> 1);
x = x | (x >> 1);
x = __tzcnt_u64(~x);
if(x == sizeof(x) * 8)
{
/*Handle no free slots.*/
}


>SIMD
How do you find the position of the free slot through SSE/AVX? There are no bitcounting instructions, and bitshifts either only happen on whole bytes and are limited to their 128-bit lane, or happen on bits and are limited to 64-bit integers.
Anonymous No.105616823 >>105616842
>>105601609
> people with 10 years of exp are still looking for jobs
Skill issue. Move to a third world country where life and prostitutes are cheap.
Anonymous No.105616842
>>105616823
>just move to Pulse
I'll stay in Cocoon, thanks.
Anonymous No.105616897
>>105601609
I haven't had this problem. I don't do faggot leetcode solutions either, I just solve things the straightforward way that's easily readable and maintainable. Maybe that's your problem.
Anonymous No.105616952 >>105617058
Ok faggots. I've been pissing around with the compiler for the meme lang I'm using for my project (golang) and disabling bounds checking slices like 30% of the runtime duration of my program. Should I automatically default to doing this or is it le bad because of some safety autism that's not really my problem?
Anonymous No.105617058
>>105616952
Read the machine code.
Anonymous No.105617192
>>105612201
I'm trying my hand at implementing a tree how I could do in an array language: without pointers
With that theory I want to implement my first bitch-basic interpreter for a PL, for fun and to bury that one todo entry for good.
The theory is instead of having nodes hooked up via pointers, I could just have those nodes in a depth vector.
Finding the deepest nodes becomes merely a task of searching for the maximum depth, instead of chasing pointers.
Now, I admit to being a codelet to the point that my progress is being bottlenecked by me being unable to figure out whatever's wrong with this function responsible for validating the input to the program:
#include
#include
void vcharset(char *s, int sz) {
char const *vcp = "0123456789+-*/"; char const *chr = s; int notfound;

for (;*chr;++chr) { notfound = 1;
for (;*vcp;++vcp) {
if (*chr==*vcp) { notfound = 0; }
}
if (notfound) {
printf("Invalid char \'%c\'\n", *chr);
return;
}
}
}

int main(int c, char **a) {
vcharset("0123456789+-*/", strlen("0123456789+-*/"));
return 0;
}
// output: "Invalid char '1'"

Any help is appreciated.
Anonymous No.105617199 >>105617258 >>105617267
>>105616808
>Zero is the default bitstate for memory returned by both Linux and Windows.
Obivously the bitvector would have been memset'd duing initialization. The page could have been used for another purpose and be dirty.

>you can do the same with an OR
That's true, it's the same algorithm except for the bitwise not at the end.

>How do you find the position of the free slot through SSE/AVX?
It maybe can't be completely done using SSE/AVX but a good part can. You would do the and/or + shift using packed SIMD instruction and then do pcmpeq, pmovsk into a GP register and check if it is 0. If it's is 0 you load another 128/256/512 bits and continue searching for a slot big enough, otherwise you find out which packed word contains the a free slot, do the shift and adjust the position accordingly.

I haven't yet thought about the very last part. Maybe it's possible to do something smart here but even with the naive solution using SIMD would still be a big benefit. If you have 64KB of memory segmented in 16 bytes, that is still 512 bytes of bitvector. It's going to take a lot of iterations if the free slot is at 350 bytes of bitvector.
Anonymous No.105617258
>>105617199
>otherwise you find out which packed word contains the a free slot, do the shift and adjust the position accordingly
>do the shift
the bit counting
Anonymous No.105617267 >>105617322 >>105617414
>>105617199
>The page could have been used for another purpose and be dirty.
Since you're not reading what I'm writing I won't do either.
Anonymous No.105617322 >>105617335 >>105617366
>>105617267
>bitshifts either only happen on whole bytes
https://www.felixcloutier.com/x86/psllw:pslld:psllq
Anonymous No.105617335
>>105617322
*PSRLDQ
Anonymous No.105617351 >>105617432
saars what c++ book
Anonymous No.105617357
im making a weather widget for android because all the weather widgets are fucking dogshit bloat slow and full of ads and irrelevant information. my hand has been FORCED to code.
Anonymous No.105617366 >>105617387 >>105617422 >>105617469
>>105617322
>or happen on bits and are limited to 64-bit integers
That's what quadword means.
Anonymous No.105617387 >>105617400
>>105617366
AKSHUALLY word size is processor specific and varies
Anonymous No.105617400 >>105617469
>>105617387
Intel uses the term "word" for 16-bit values for backwards compatibility reasons. Double words are 32-bit, and quad words 64-bit.
Anonymous No.105617414
>>105617267
>you're not reading what I'm writing
>accuses me of doing what he does
ok? end of discussion then
Anonymous No.105617422
>>105617366
Also, checking those bits is *really* slow. You're simply better off filling four volatile GPRs with the values and performing each series of calculations out of order, than to mess with AVX => GPR transfers.
Anonymous No.105617432 >>105617537
>>105617351
>c++ book
Why do people insist on reading books in an era where you can just go on github and read raw source code?
Anonymous No.105617469 >>105617484
>>105617366
>>105617400

>>105616615
>SIMD could be used to do this several 4/8 uint64_t words at a time. If the words are proecessed 64 bit at a time

Since you're not reading...
Anonymous No.105617484 >>105617497
>>105617469
HOW DO YOU GET THAT INFORMATION OUT? Jesus Christ!
Anonymous No.105617494 >>105618156
the simd schizo is ALWAYS here
and he's ALWAYS posting simd and octal
i wish he would \033 FOREVER
Anonymous No.105617497
>>105617484
>schizo rambling
Anonymous No.105617505
And that's why we need voted doxxing.
Anonymous No.105617537 >>105617545
>>105617432
because a book will teach you in a month what would take you 6 months of practice to learn by yourself just reading code?
I'm not talking about beginner books that spend three chapters explaining what a float is.
Anonymous No.105617545
>>105617537
>because a book will teach you in a month what would take you 6 months of practice to learn by yourself just reading code?
it's actually the reverse but keep lying to yourself
Anonymous No.105617603 >>105617667
>>105601261 (OP)
I'm currently updating an older mmorpg to x64
Anonymous No.105617667 >>105617685 >>105619195
>>105617603
everquest updated to 64 bit a couple years back

it fixed nothing and actually introduced tons of new bugs (which were ignored) and overall degraded performance
Anonymous No.105617685 >>105617698
>>105617667
>everquest devs are completely incompetent and should all be murdered
Good thing I never bothered with MMOs in the first place.
Anonymous No.105617698 >>105617733 >>105617751
>>105617685
well, you missed out, 1999-2006-ish the MMO scene was kino

absolute garbage in current year, tho
Anonymous No.105617733
>>105617698
Nah. People don't change, and most are walking garbage only other walking garbage would ever miss.
Anonymous No.105617751 >>105617761
>>105617698
loved me muds in the 90s, sadly the only ones still around are pay2win and/or weird furry shit...
Anonymous No.105617761
>>105617751
>muds
Anonymous No.105617941 >>105617956 >>105618123 >>105618188 >>105618248
Yikes
Anonymous No.105617956 >>105618188
>>105617941
Sheesh
Anonymous No.105618123
>>105617941
Yeah, the NT kernel only understands UTF-16 and ASCII.
Anonymous No.105618156
>>105617494
>octal
I understand my intelligence intimidates you, and I love it.
Anonymous No.105618188
>>105617941
>>105617956
kek I've been using the ansi functions this entire time, luckily I doubt there's any real performance penalty to one time shit like setting a window title
Anonymous No.105618248
>>105617941
Downright elegant compared to setting calling 4 different functions to set the WM_NAME and _NET_WM_NAME and WM_ICON_NAME and _NET_WM_ICON_NAME properties on unices, and then the window manager having to sort this shit back out.
Anonymous No.105618569 >>105618580 >>105619204 >>105619912
I notice there was significantly less schizoing the past few days. Did something happen?
Anonymous No.105618580
>>105618569
they made up <3
Anonymous No.105618600
Wrote a shared library that fucks with $HOME to unfuck my home from garbage program trash.
Anonymous No.105619031 >>105619171 >>105619403
Confession: Almost a month ago I resolved to learn c++ and I installed winsys2/gcc, cmake, vcpkg, etc but couldnt figure out how to get vcpkg to work properly so I just dropped it and I keep telling myself I'll get it working and start developing the program I want in c++ but I never do because the setup is such a pain
Anonymous No.105619171 >>105619190 >>105619214 >>105619235
>>105619031
Have you considered installing an IDE that has everything in itself so you just open it, create a project, write some code and press 'build'? Ignoring all cniles' cargo culting about plain-text editors and compiling from the terminal because the whole topic of build management, you can shove into a bucket separate from actual programming.

Many years ago, I disliked Java mainly for some difficulties when setting it up (OS installation was cursed and JRE/JDK just didn't want to work properly). Now I can just install Eclipse IDE and am ready to go.
Anonymous No.105619190 >>105619252 >>105619264
>>105619171
>Compiling by typing "build"
:|
>Compiling by moving your mouse pointer over "build" and leftclicking
:OOOOOOOOOOOOOOOOO
Anonymous No.105619195
>>105617667
>it fixed nothing and actually introduced tons of new bugs
the only real benefit of upgrading to x64 is the increased memory space. I am also running into new issues during the upgrade process. However, I will say that in the long run having more addresses available outweighs the introduced issues, given that you deal with them of course.
Anonymous No.105619204
>>105618569
You called?
Anonymous No.105619214 >>105619227 >>105619252
>>105619171
I have VS but I really fucking hate how hulking and cumbersome it is, with 99.9% of features that Im never going to use
But at this point I dread troubleshooting this shit so much that I think I'll just use VS
Why cant it just be simple like Go or Python
Anonymous No.105619227 >>105619295
>>105619214
If you hate needless complexity why are you even learning C++ to begin with?
Anonymous No.105619235 >>105619300
>>105619171
when you start getting compilation issues in your IDE and you don't know how the underlying stuff works you will have to do double the work to figure out how to fix it

in other words: to use an IDE you need to be competent with the "primitive" tooling
Anonymous No.105619252
>>105619190
It's not just typing vs clicking to start an action - IDEs do all the build setup and dependency resolving automatically (or at least you'd expect them to do that)

>>105619214
>with 99.9% of features that Im never going to use
I suspect it's because you never cared to learn any of the features in the first place
Turn on a "tip of the day" function (I think VS had it?) and check out an action or two, over time the IDE will do almost all tedious work for you, so you can focus just on your actual coding problem and not busywork
Anonymous No.105619264 >>105619276 >>105619282
>>105619190
uh huh, now show us the compiler flags that you had to read a 500 page man page to figure out then compare that to right click on your project and click "Properties"
Anonymous No.105619276 >>105619291
>>105619264
>you had to read a 500 page man page to figure out
Why do retards always make up imaginary scenarios to get mad about?
Anonymous No.105619282 >>105619657
>>105619264
Your retardation reminded me of a video where a guy optimized mario N64, first thing he did was enable optimizations, because retarded OG dev pushed debug build with no optimizations to production.
Anonymous No.105619291
>>105619276
It's not imaginary, but it's also a fair point. Programming isn't easy, you have to know a lot, or you will end up retarded like him. And unfortunately it's illegal to beat retards for doing things they shouldn't be.
Anonymous No.105619295 >>105619616
>>105619227
speed, UI frameworks, and it looks good on my resume/portfolio
Anonymous No.105619300 >>105619312
>>105619235
I disagree
First, the "primitive" tooling is extra overhead to learning the language itself. Especially for beginner/learner programs, there really shouldn't be anything an IDE would have trouble to resolve by itself
Second, if there are any compilation problems (that aren't just syntax/common errors - those are highlighted immediately), IDEs nowadays are smart enough to either resolve problems themselves with a "clean" action, or at least give a message informative enough to pinpoint the problem (or give a keyword/sentence to search on the web in - in which case, only now you'd be down to the same spot as with the "primitive" tooling)
Anonymous No.105619312 >>105619321 >>105619348
>>105619300
it's unfortunate that soulless NPC such as yourself who has no recollection of his early life has an opinion about learning things from knowing absolutely nothing, because if you were human, you'd remember that you started from learning how to reproduce sounds your worthless parents were making and didn't start from trying to write essays with abstractions over everything that are beyond your comprehension. Worst of all, the way human speech works is still likely beyond your comprehension, you fucking animal.
Anonymous No.105619321
>>105619312
ok
Anonymous No.105619348 >>105619365
>>105619312
You sound mad that you lost.
Anonymous No.105619365
>>105619348
See, this is what I mean. Let's dissect the brain damage required to write your post.
>You
Already starting from accusation and likely, projection, not good.
>sound
Early onset schizophrenia.
>mad
How would you know if someone is mad just from text + when you spend all your life indoors without ever observing real human emotions?
Anonymous No.105619390
>more word vomit
Yup. Definitely mad.
Anonymous No.105619403
>>105619031
your problem was trying to do this shit all in windows
it took me about an hour to get an ubuntu virtual machine spun up, VS code installed, cmake/gcc/etc all installed, and got a program building and running from the VS Code ide
switch to linux my man
Anonymous No.105619415
>boot up jeetcode
>section is trying to teach you about topic "XYZ"
>sample problem
>has absolutely nothing to do with "XYZ"
>takes 3+ hours to finish
>marked "Easy"
i fucking hate this
Anonymous No.105619616 >>105619625
>>105619295
Just be aware that with C++ on your resume, you'll most likely get job offers revolving around C++, so even more of the mess you're currently in but even more advanced/bizarre
If you want a job that won't make you want to kill yourself (at least because of the language), I'd recommend Java. It's a pretty low-nonsense language, and even if there's some really retarded legacy Java code, it's still going to be much easier to unfuck than retarded legacy C++ code
Anonymous No.105619625 >>105619683
>>105619616
Unfuck this.
Anonymous No.105619657 >>105619682
so i was looking at how C23 added functions for popcnt, tzcnt, and lzcnt. why only those? could have really used add/sub/mul with overflow checking. gotta use the builtins to ensure that the compiler does not fuck up (division)

>>105619282
>retarded OG dev pushed debug build with no optimizations to production

the compiler was not stable yet, and they did not want to risk their launch title being a buggy mess
Anonymous No.105619682
>>105619657
Nice cope bro, you know that you can test your program for stabiliity right after compiling it, right?
Anonymous No.105619683 >>105619688
>>105619625
Ok, what's fucked with it? Other than it overwhelms and scares the fizzbuzzer and regdumper, about which I can't really do anything.

Anything above [MVC Action] and below [DAO] is literally Not My Problem™.
Anonymous No.105619688 >>105619776
>>105619683
Now it's your problem. :)
Have fun.
Anonymous No.105619776 >>105619874
>>105619688
>update library to newer version
>if doesn't help, report issue to library maintainer
>if fix needed ASAP, get source from the library repository (or decompile - Java has a few good decompilers) and patch it myself
Wow, so difficult
Anonymous No.105619874
>>105619776
As I said, have fun. :^)
Anonymous No.105619912 >>105619930
>>105618569
it was a disaster 24 hours ago wdym
Anonymous No.105619930
>>105619912
>it was a disaster
Only for those who never mattered.
Anonymous No.105620385 >>105620632
How does one design a horizontally scalable chat app? I honestly can't quite figure it out. FIrst of all, if users were to connect through WebSocket, a mapping of user IDs to WebSocket node ID is needed. I assume one can use Redis with the "Redlock" distributed locks algorithm for that. But can Redis really handle millions of keys? Seems unlikely. Next, we probably want to have group chats too, I'm really not sure what to do here either.
Anonymous No.105620632
>>105620385
>horizontally scalable chat app?
relay servers
Anonymous No.105621070 >>105621125 >>105621178
It's so tiresome.
Anonymous No.105621125 >>105621147
>>105621070
>safe
>Doesn't check for NULL before deref
This is this LLM shitcode, right?
Anonymous No.105621147 >>105621160
>>105621125
Anonymous No.105621160
>>105621147
What if I don't want to have to scream HOME every time?
Anonymous No.105621178 >>105621195
>>105621070
How likely is it that the next four bytes go into unreadable memory? Because one optimization you can do is
return *(uint32_t*)s == *(uint32_t*)"HOME" && s[4] == '\0';
Anonymous No.105621195 >>105621199
>>105621178
Never happens.
Anonymous No.105621199 >>105621251
>>105621195
Well, then there you go.
Anonymous No.105621251 >>105621285
>>105621199
No thanks, I'll stick to safe and secure
[[gnu::always_inline]]
[[gnu::hot]]
static inline
bool
is_home_union(char const* name)
{
static const union
{
char string[sizeof(uint64_t)];
uint64_t integer;
} home = {.string = "HOME"};

uint64_t block;
memcpy(&block, name, sizeof(block));

return (block & 0xFFFFFFFFFFULL) == home.integer;
}
Anonymous No.105621285 >>105621329
>>105621251
Your code reminds me of picrel.
Anonymous No.105621329 >>105621356
>>105621285
I do not concern myself with the illiterate.
[[gnu::always_inline]]
[[gnu::hot]]
static inline
bool
is_home_union(char const* name)
{
if likely(name[0] != 'H')
{
return false;
}

static const union
{
char string[sizeof(uint64_t)];
uint64_t integer;
} home = {.string = "HOME"};

uint64_t block;
memcpy(&block, name, sizeof(block));

return (block & 0xFFFFFFFFFFULL) == home.integer;
}

This small change is not slower for when it does match, and is faster when it doesn't (very often).
Anonymous No.105621356 >>105621393
>>105621329
Enjoy your MOVABS.
Anonymous No.105621393
>>105621356
I'm enjoying you seething but not having any code to post.
Anonymous No.105621491
>retard projecting again
Anyone surprised /dpt/ is dead? Me neither. You get what you fucking deserve.