moth
md5: 8b533c3957b507ace6925a95608c733e
๐
What are you working on, /g/?
Thread Question:
We can all probably agree that programming shouldn't be 'clever', but anyhow what's a clever thing you've done?
Threadly reminder.
Also compilers are too stupid to *not* do clever things.
>>105889001 (OP)>waiting for idris>no moth gf to land on my handfuck this life
>>105889001 (OP)99% of moths go for 1% of hands
fucking bullshit
Keep your head down, focus, learn and be better. Our time will come.
>>105889045I read this 3 times and I've been able to confirm that it's unspecific what the fuck you're talking about.
What are you talking about. Memory in general?
Apparently C is "safe" because it's explicit. It is not whatsoever. The compilers tell you less than almost everything else in existence including whether a block of ints are 16 or 32 bits a piece.
Someone tell me if this is completely retarded or if Rust has a terrible borrow checker in a way that's specific to Rust and isn't just a common thing. "Everyone else" is 2 people.
Reposting:
Give me opinions or insight about make/cmake/other
Give me opinions or insight about gcc/clang/llvm/other
>>105889001 (OP)Most moths will land on anybody's hand so I don't give a shit honestly I have more important things to do.
>>105889238I'm not going to say that you can't enjoy CMake if you legitimately use it and can't see anything wrong with it then I hope you never touch a computer again.
A person that says "eh it does the job" is probably the same person writing C++ and I pray to god they never work with anything where an error could pose a safety risk to a real person.
>>105889139Get murdered, scum.
shots fired against CMake, let's see if anyone steps up to bat
So far anon has made solid points against CMake, but we yet have anyone stepping up on the field
Well it seems like traditional make is taking the lead so far unless someone steps up we seem to have a clear winner here
The only solid point you'll get is a shotgun blast at point blank range as a camera captures your loss of consciousness for posterity's sake.
BLAM! Into the face, a shotgun blast from out-field.
Were they pro-make or pro-cmake or something else entirely...? Unclear now, we're reviewing the footage
Thread is a schizo Make vs Cargo circlejerk again so IDC about reposting this.
What's a meme technology you always wanted to try but never really had a reason to do? When i started i was more or less fascinated with the things you could do with ImageJ, namely weird fractals and shit. You could script this library with jRuby, but i never got into it cause i was lazy. Nowadays, there's little point for picking that up. Babashka does the same use case jRuby could do for me but doesn't need a JVM process to run. And i can use that library directly from Clojure or even a jshell script if i ever wanted. Another one i never got around to test was Elm. Everyone was sucking its dick for a couple of years and then just died. Speaking about that, what the hell happened with that?
>fractals
I don't mean to be too math here, but really? lmao
>>105889378Integer-based software rendering via SIMD.
I am checking out Cosmopolitan C.
>has C with a static custom libc
>has C++ with no libstdc++ (C with classes and templates)
>setting up a Makefile for lilypond
what kind of makefile have you gotten fun with?
Or are you miserable?
>>105889378Elm is done in terms of development. Evan doesn't accept open source contributors to avoid bloat and wrecking his vision, has no corporate sponsors reliably paying him, and is working on meme database technology (https://acadia.engineering/). Spent years giving talks on "the economics of programming languages".
You can use it if you want but it won't evolve any further (and it's not flexible enough like Common Lisp to practically insert things in the language itself) which for some people is horrible and they leave.
>>105889544So what you're saying is that Evan is an autist whose vision is such garbage it doesn't even convince other autists to use his language.
>>105889727He did convince a sizable number of autists of The Elm Vision/Architecture (tm). He just got bored of doing the actual hard work of stabilizing the ecosystem while also being such a control freak that didn't accept any help from others.
t. autist that liked Elm and got butthurt when Evan fucked off to shill his new meme tech to more deep pocketed suckers.
FWIW Gleam seems like a promising successor, but I'll wait a few years to see if they'll do the same rug pull.
COMPUTY COMPUTER!!!
Typed into serial terminal on GNU+Linux, displayed with custom risc-v cpu
>>105890189I seriously need interrupts and timers now tho.
Time for a REAL OS
I'm really concerned about a few things, honestly
>>105890189Hi, I'm worried but I suspect you're okay
I miss my garage with the couches and random friends of friends sleeping, and a couple computers and Henry's stolen Tempest console, the endless horror movies on the jank TV
>>105890189Jesus fruitcake Christ, Hanz, learn how to type on a fruitcaking keyboard.
working on my API docs generator. it takes a type descriptor used for binding native type to JS, and generates a Sphinx docs template, so I can fill it out later. that way I can generate and keep track of changes to my API docs automatically. it's probably overkill, but since I had all those descriptors anyway, I decided to give it a try.
>>105891418>he needs to differentiate between signed and unsigned values rather than simple operand sizesCode as a platform, eh.
>>105891418>we're still reimplementing sml signatures and structures decades later
>>105889001 (OP)Threadly reminder
>try to build chromeos using official documentation
pigweed-utils-0.0.1-r263: GN_ARGS=pw_build_PYTHON_BUILD_VENV="//local:empty_build_venv" pw_protobuf_compiler_GENERATE_PROTOS_ARGS="--no-experimental-editions" pw_protobuf_compiler_GENERATE_PYTHON_TYPE_HINTS=false pw_env_setup_CIPD_ARM="//" pw_env_setup_CIPD_MSRV_PYTHON="/usr/bin/python3.11" pw_env_setup_CIPD_PYTHON311="/usr/bin/python3.11"
pigweed-utils-0.0.1-r263: ERROR at //pw_build/python.gni:183:32 (//pw_build/python_toolchain:python): Unknown function.
pigweed-utils-0.0.1-r263: filtered_python_deps = filter_labels_exclude(
>try to report it
I hate americans so fucking much
qrd
md5: c63fceca9ee852e9f6ec5ffe6a975861
๐
>>105891879filter_labels_exclude is apparently part of google's gn meta-build system
>>105891937Sure, I don't really care where it belongs. These fucking monkeys claim to provide something that doesn't even build using their own specific documentation.
Google was mistake.
class DeferStack {
public:
~DeferStack() {
while (!actions.empty()) {
actions.top()();
actions.pop();
}
}
void push(std::function<void()> fn) {
actions.push(std::move(fn));
}
private:
std::stack<std::function<void()>> actions;
};
and then
class C {
DeferStack shutdown_actions;
// other stuff
C() {
if (!LIB_init_thing(m_something))
throw std::exception("couldn't init thing");
shutdown_actions.push([&] { LIB_destroy_thing(m_something) });
// repeat for all resources
}
// ~C() {} <- no need for this
};
Is this advisable?
>>105892155>no contextno clue, its acceptable
you should probably delete the copy constructor
>>105892233also im reminded theres no top & pop method
>>105892155>c++0/5, see me after class
>>105891496unsigned is all you need
>>105892251>Segmentation fault: core dumped
>>105889442Cool, i have to mess with this someday
>>105889544Same reason all Wirth projects failed, Oberon is high quality shit but he's too much of a sperg to stick to something so it's DOA.
>>105892328Jealous you're not as good a programmer as me? It's okay lil bro you'll get there one day.
>>105892347A shotgun shot to the brain will fix you for good.
>>105892347It's amazing how you can turn such a trivial task into something complicated and act like you're good at anything but being the reason every C++ project takes hours to compile unless you own a whole datacenter dedicated to nothing but compiling.
>>105892372>>105892375Mmmmm sweet sweet tranny tears so delicious
>>105892391Try to keep that thought as thousands of bits of your brain matter physically dislocate and fly across the room, destroying your consciousness forever, and having millions of actual human beings sheer in unison as another chud is rightfully executed.
>Try to keep that thought as -- ACK!!!
Keep those tears coming
>ACK!!!
Yes, those will be your last words before eternal darkness engulfs you and your remains will be processed into fertilizer.
@105892155
@105892233
@105892240
@105892250
@105892251
@105892260
@105892262
@105892328
@105892347
@105892372
@105892375
@105892391
@105892408
@105892429
@105892471
Samefag.
>>105892260that's a (You) problem
>>105892574Wrong. It's a (You) problem, because I know what operand sizes are.
>>105889378>What's a meme technology you always wanted to try but never really had a reason to do?there is none; i just don't start with the technology
i have an opposite, goal-oriented approach: i think of things i want to make, then research what potential technologies would let me achieve that, and only invest time in them if i'm committed to the goal
>>105892640That explains so, so, SO much.
>>105892589but I do too
>append_u8>append_u16>append_u32>append_u64
>>105892708You just mentioned "unsigned", as in, "unsigned int".
>>105892719always 32 bit on the correct and relevant hardware
>>105892774>32 bit unsigned ints Only Numberlets think this is enough. You might as well play with an 8 bit machine too, if we're bring out grandpa's toys.
>>105892819t. fizzbuzz requiring 128 core CPU
>>105892856>only 128 cores>thinks he can run fizzbuzzlmfao @ ur life
>>105892719you misinterpreted, you chose the interpretation where I was wrong. biased much?
>>105892923Nah, you're just failing to save face.
>>105892155I don't like that it uses dynamic allocations. If LIB_destroy_thing() checks for nullptr (as it should), just call all of them in destructor, no need to overcomplicate things.
>>105892934>>105892969This is internet foreplay and these anons are jerking off and preparing to have sex with eachother.
>>105893019@grok is this true?
>>105893047Yes. Imagine the smell. #MechaHitler
>>105893019I only issue lethal loads to anons.
>>105893059Listen, I'm not up to date on all the gay lingo. Please just restrict your issuance of lethal loads to your own bedroom, this isn't Grindr.
>>105893081Nope. You and him deserve lethal loads to the brainsteam, issued via shotgun.
>>105893017I like the clarity of having creation/destruction side by side so you can clearly tell at a glance that you've got everything matched up correctly. malloc; defer { free }; type thing. Having a big chunky destructor that you've gotta make sure you're calling everything in the correct order for is vastly inferior.
>>105892155This is just RAII with more steps
>>105893095If you're a murdersperg rather than a homosexual then this becomes even more confusing. What is the purpose of babbling out your fantasies of violence in public? Nobody is going to shoot anybody else in the brainstem with a shotgun for not having whatever opinion it is that you have on whatever niche topic. You're just impotent and clownish and nobody looks at you beyond pointing and laughing. $5 says you spew these fantasies in part because you're the sort of person who can't even hold eye contact with someone else when talking, let alone take any physical action. Do you enjoy looking stupid in public? Do you think anybody is intimidated by the fantasies of a spergy retard who can't make eye contact and order his chicken nuggies without stuttering? What do you think you're achieving here?
>>105893164Autists can't deal with violence. It makes them give up.
>>105893171Tell us more about how much your uncle abused you at night.
>>105893164anon you're talking to a teenager
>>105893122its literally equivalent destructors are always called in reverse order of construction
>>105889001 (OP)>clever thingtree node packing
typedef enum {
KD_INODE_X = 0b00,
KD_INODE_Y = 0b01,
KD_INODE_Z = 0b10,
KD_LEAF = 0b11,
} KdNodeType;
#pragma pack(push, 1)
#define KD_LEN_BITS 32
#define KD_IDX_BITS 46
typedef struct {
union {
struct {
uint64_t len : 32;
uint64_t : 32;
uint16_t : 16;
};
struct {
uint16_t : 16;
uint64_t : 16;
uint64_t obj_idx : 46;
uint64_t : 2;
};
};
} KdLeaf;
typedef struct {
union {
float split;
struct {
uint16_t : 16;
uint64_t : 16;
uint64_t lchild_idx : 46;
uint64_t : 2;
};
};
uint8_t rchild[]; // adjacent in memory
} KdInode;
typedef union {
struct {
uint16_t : 16;
uint64_t : 62;
uint64_t type : 2;
};
KdInode inode;
KdLeaf leaf;
} KdNode;
#pragma pack(pop)
>>105893226Reread my post slowly.
>>105893209Now why would you attempt such obvious projection, hm?
>>105893243I accept your concession.
>>105893251>not answering the questionNo, no, the acceptance is all mine. :^) Personally I hope your orifices never healed properly.
>>105893241it is so side by side that it is literally overlapping
>>105893122Then use unique_ptr to manage the library resources. It's easy to provide custom deleter that will call the library cleanup function.
>>105893338And if it's not tied to an m_something? i.e. pairing SDL_Init with SDL_Quit?
>>105889727He did convince a lot of autists and a lot of codemonkeys.
The problem is that the codemonkeys NEED a language that I MUST UPDOOT or else it's DEAD. Work for free. That burned him out.
>>105889974He wants to make Oracle money and live from Elm which is impossible.
Gleam does have a corporate sponsor as the author is an employee.
>>105892262It's money. Wirth kept churning out things searching for The Right Thing, over seething online about money for a decade.
>>105893405what does money have to do with anything
>>105893903If you're autistic enough, nothing.
But Evan wants to get paid for working on Elm instead of being a wagie and having Elm as a side project, and users AND COMPANIES won't pay when there's free alternatives. Companies at best pay you bounties to add what they want, not what the language should have. Or they pay you for business features or consultancies.
I miss the maidposters. This thread is worthless and boring without them.
>>105894068You should leave with them.
Anyone know how I'm supposed to program everyday for hours on end? I woke up at 11am and its now 8pm and I haven't programmed yet and I need to take my nap before going to the gym. My day is already over. This is the second week in a row now that this has happened. How do people have time to program all day?? I need to complete a project by the end of this month. Its so over for me.
>>105894204what did you do with that 9 hours? why dont you skip gym if this is important to you?
>>105894204first step is to sit down and start everything you need for programming
if you're doing other things, you're not programming. that might be obvious, but that's how time just passes by without you doing any programming
>>105889453>libcinto the trash it goes
https://www.youtube.com/watch?v=9nRr3R9gEb8
>>105894081You should suck farts out of a snorkel. You should be strapped into the snorkel fart mask 24/7 and you should never be allowed to breathe normal air again.
>>105895214Don't let the door hit ya where the lord split ya.
>Zig has a new async IO model
>you pass IO around
ALL ROADS LEAD TO THE IO MONAD
ACCEPT IT
>>105895229I'm too busy adding farts to the gas pool so you and your whole family can be continuously strapped into inflatable full body fart suits. Nobody with your genetics is allowed to touch air that isn't mixed with shit ever again. You will become a new race of bubble people, interbreeding with your sisters and mom to form a new slave race of fart goblins who will live in shit and serve their betters (literally everybody else) forever.
>Sent from my iPhone in Tel Aviv
>>105895266How else is a functional language supposed to handle anything at runtime
>>105895278I just love that Maidposters are dead now or whatever.
>>105895013They made mmap into a posix mmap which calls mmap on Linux and virtualalloc on Windows, you don't have to use dlmalloc.
>>105895303Then clearly there aren't enough farts in the gas pool.
>>105895266total haskell victory
>>105895317I can hold my breath for ten minutes.
>>105895372Then I will fart continuously for eleven.
https://pastebin.com/F2D6Kuay
>>105895581 (me)
this is how usage of it works btw: https://godbolt.org/z/sx7ad5PvT
>>105893164NTA (thank god). They probably have some mental disorder that makes them think violence is ok and that their acts are """justified"""
I never thought a Cnile would be more mentally warped than a rusttroon, but regdump schizo proved me wrong.
Violence is, and always has been ok, autist.
What do you code in? Not just language, but language paradigm, language version, coding style, etc
For me, it's pre-standard C++
>>105895704nice selfie you idiot
makes you look like a dork lmao
I'll make you repeat that while you digest your own vocal cords. No, I don't care.
!!! PSA !!!
/dpt/ is infested with homeless schizophrenics and the governance (jannies) are useless as per usual.
Please resist the urge to engage with the feral spammers. It is unsafe and you risk contract their diseases. In order to identify them, look for:
1. malloc/mmap sperging
2. registry dumping sperging
3. bitch replying without quoting (passive-aggressive effeminate activity)
4. screeching at the thought of someone doing something for fun
Thank you! Please use /dpt/ to engage in actual programming discussion
>>105895785thank you hatsune miku
>>105895785>/dpt/ is infested with homeless schizophrenicsso /dpt/ is Detroit?
>>105895813The difference is that /dpt/ never had any value.
>have been trying to make a videogame from scratch in C++ for the past 2 or so years>keep restarting the project every week or so because I'm unsatisfied with how each attempt turns out>still haven't made any gameIs this the textbook definition of a "Sisyphean task"?
>>105895827>implying Detroit is even worth a damnAnon, I...
>implying Detroit is even worth a damn
Was, autist-kun. Funnily enough autists are known for having issues with time and space, too.
>>105895785The problem is that the schizo ruins discussion in this thread no matter what, no matter how much people try to avoid him.
>>105895899Never saw anyone actually try to avoid him.
Luckily that's a (You) problem.
desu if the regdump schizo advocates for violent acts they should happen to him first, as an ironic downfall caused by his own hubris
>>105895899Yes, but I find it much easier to ignore when some retard isn't rolling around in the mud discussing fart snorkelling with him.
He rarely replies directly and never contributes anything useful. Just ignore and warn newcomers to do the same.
But they won't, because you can't even recognize me. That's what makes violent acts so awesome.
https://en.wikipedia.org/wiki/Narcissism
Damn guys, I can't tell which loq quality posts are his, how does he do it?
I mean, I am the very best.
>>105895960This is not narcissism, this is confirmed https://en.wikipedia.org/wiki/Receptive_aphasia you know, literal brain damage.
>>105895860no, it's just being hindered by perfectionism
you need to consciously switch to a "just get stuff working" mode
only once you make significant progress in functionality, you can then do your refactoring and rewriting, but do only one pass/attempt. then leave it as is and work on adding more functionality
>>105896004thanks for the tips anon
Another thing that might be hindering me though is my stupid ass ADHD and clinical anxiety making me unable to "sit still" with a project, as well as making me always second guess my actions and think I made my project irreparably shit (i.e I believe I use awful coding practices, or have a bad codebase structure from the start), or just doubt my own abilities
>repeating the word "aphasia" over and over again calms down the autist
>>105895860detroit used to make good cars and awesome pizza. /dpt/ started off as a boring circlejerk and devolved into a mental asylum
>Aphasia is typically caused by brain damage, often from stroke or head injury, and is not a sign of decreased intelligence. While there's no cure
Damn, that's so sad.
>devolved into a mental asylum
True, but I can't just leave without turning the autists into fertilizer first.
>>105896044>detroit used to make good cars and awesome pizzaSource?
>>105896054Everyone pour one out for regdump schizo's canon TBI
>>105896070https://en.wikipedia.org/wiki/Automotive_industry_in_the_United_States#The_Big_Three_automakers
https://en.wikipedia.org/wiki/Detroit-style_pizza
>>105896087Damn, it's real
Well I'll be damned, Detroit actually used to be good
Honestly, for me this thread is just the /gedg/ waiting room whenever the /gedg/ thread gets archived and no one bothers to start a new one for a while
And I hate it here
>be me
>have an old C library I wrote
>decide to convert it to C++ and add some features
>get halfway through writing lexer for new library
>reading original C code as an implementation guide
>realize my C code is better than my C++ code
>scrap the project, just update the C project instead
idk what I was thinking
>wah wah waiting room
Have you tried going outside?
>>105896163Lead by example.
>implying it was ever gone
>nvidia's asynchronous vulkan queues aren't even guaranteed to be asynchronous without hardware scheduling turned on and they don't actually correspond to anything real and you can trivially oversubscribe to them
gee thanks
so why are you advertising them
>>105895945Right now he isn't posting because he is tied up in the fart dungeon connected to the fart snorkel. His nuts got stapled to a stack of papers and he is huffing the farts as we speak. Time for the stink, time for the breeze. You may thank me now.
>he is tied up in the fart dungeon
I feel sorry for whatever autist you caught in your contraption, but it ain't me.
>>105896776Silence, fart slave. If I want your opinion will ask you for it after blasting 40PSI worth of ass gas down your snorkel and into your fart filled stink lungs.
>Silence
Or else? Are you gonna turn the poor autist into fertilizer? You have my support.
*ahem*
Program in C-style C++.
That is all.
Mostly Programming indie games these days, more of a freelance/contractor these days. Sometimes program and do game design for some personal projects on my spare time.
>>105897457It's amazing how incompetent you sound.
>>105897457It's amazing how competent you sound.
>>105897503It's amazing how incompetent you sound, too.
Are you a Programmer? Or a Coder?
>>105897513It's amazing how angry you sound.
>>105897523It's amazing how autistic you sound. But then again detecting emotions is yet another difficulty for autists.
>>105897610>more angry-sounding and passive-agressive writingCope, seethe, mald, etc
>more autistic screeching full of projections
Keep'em coming. We all know your ilk knows no shame.
for me, it's posix c and ksh. simple as that.
>>105897686>muh projectionRich of you to accuse others of projection btw lmao
>incompetent schizo was so shocked by my words he couldn't make another post basically saying "ree autism bad" with an attachment of screenshots of his own past self-own posts again
I win.
>autist doesn't understand it's not projection if it's the truth
And that's why we used to put autists into freak shows and exposed them to noise and flashy lights that triggered their true selves, so that society quickly learned that autists were no better than disobedient slaves who had to be beaten within bloody inches of their lives - a practice that is in dire need of a revival. I can't wait for the hours upon hours of footage to be uploaded to Youtube that will show autists having literally all teeth beaten out of them before being forced to pick them up and throw them into the bin, with noncompliance meaning that they will be forced to eat their own eyes on national TV.
Attached.
>>105897766>Attached.>there is no attachment>incompetent schizmo is truly incompetentAgain, I win.
>>105897766And if they like their own eyes too much we will fixate them on gurneys, rip their eye lids wide open, and then play flashing lights and loud noises directly into their brains for literal days, until they bite their own tongues and die. Then we'll force the families to clean up the mess, with a smile on their faces, because it's all on national television. Noncompliance will be met with forced removal of the skin with potato peelers.
>he doesn't understand what attached meansWe already knew that you were an autist who deserves to be tortured for the amusement of normal people, there is no reason to dig yourself deeper.
>>105897819>More raging from the incompetent schizmoBtw I think that if the violent acts you fantasize about were to even happen, you'd be the subject of them, not your "autismo" boogeymen (who are more based than you will ever be mind you)
Nah, I know where to aim to put my consciousness into a place where no autist can reach it. I also know where NOT to aim, so that I can inflict as much suffering before the consciousness in question escapes MY reach.
>>105897943>incomptent schizmo is also delusional>and he's still maldingKeep crying pussy. You will never be a real programmer. No one will use your cringe overoptimized registry dumper.
>incompetent autismo is still projecting
And sorry, but your flat affect doesn't hide your fear.
Anyways, now that I made regdump schizo irrationally angry after using some of his own lingo and talking points against him, think I'll check out of this thread given that /gedg/ is back.
Ciao. You're all welcome.
(You) me when he finally offs himself (in minecraft)
>I made regdump schizo irrationally angry
Oh god, the delusions incompetent autismos who're good for nothing but torture that would've made Mengele blush.
>he pronounces char like "charmander" instead of "care"
>he pronounce bin like it rhymes with skin instead of "bye-n"
>he pronounces sudo like "pseudo" instead of "soo doo"
>he pronounces enum like "ee-numb" instead of "ee-noom"
>he pronounces struct like "strucked" instead of "struckch"
>he thinks his opinions matter so much no one will print them out and wipe his arse with it
You thought wrong.
>>105892520newfag, welcome. plz lurk moar
do modal editors like nvim still use escape codes to control the screen? or is there a more modern way I'm not aware of?
>>105897963I recently found out that there's commercial registry dumper, must be humiliating.
>>105899769And yet you can't even explain how they work, so why haven't you run in front of a train to make every single person in this world happy?
>>105900117I explained, but certain wernicke's aphasia patient around here wouldn't get it, and I cannot blame him, nobody can, such level of brain damage can only be pitied. Though lately I haven't seen him ITT, he hides himself way too well in these totally organic meltdowns that are all not him.
>he is literally making shit up
And that's why we will put every single autistic person into the equivalent of a modern day concentration camp, where us normal people can monitor them 24/7, and donate to develop new torture methods whose only job it is to inflict as much pain and suffering upon literal non-humans. Every single second of their continued existence will be filled with public pain, public humiliation, and public death.
It's a brand new world, and I can't wait to make autists suffer in it. And because they are selfish subhumans who will never kill themselves they have no one to blame but themselves - no, the torturers don't count. They are going both God's and the nation's work, and they deserve our unending support and devotion.
>>105889001 (OP)>I crave the forbidden lamp, brother.
>>105900403>nooo doctor, PLEASE, CHANGE MY DIAGNOSIS!Sorry tranon, wernicke's aphasia is already hard to diagnose, when it is, it's pretty much impossible for it to be incorrect.
>muh DIAGNOSIS
Luckily autism is really easy to detect. All one has to do is punch you in the chest and then force you to describe your emotions; if you take longer than two seconds you are not human.
>>105900580Post arm, then we can talk about why "I didn't even notice you trying to punch me" is a correct response.
>I didn't even notice
Have fun dying a painful and elongated death then. The audience will be delighted to see your before and after pictures - first full of autistic pride, then a bloody rump without arms and legs carelessly discarded on the floor, blood splatters everywhere, empty eyes, and holes in the skull where we directly injected random chemicals into your brain, all paid for by viewers' donations.
Have we confirmed or denied that Terry is still with us?
>>105889001 (OP)>We can all probably agree that programming shouldn't be 'clever'I disagree.
>>105889001 (OP)I was given an unappealable three day ban for "off-topic" posts in this thread. If you are the short cocked, low IQ zoomer janny who did this, I want you to know that I am just going to disregard your ban. I refuse to be singled out for being "off-topic" in a thread dominated by an unmedicated schizo who only makes off-topic posts.
Fuck you, suck my balls. Resign in shame and kill yourself in penance.
>>105900984Reminder: the schizo ITT IS the janny. If you ever have any doubts, just look at the catalog of /g/
Noob here, I'm trying C++, after using GC languages in the past
I have a class with a destructor method. I have an array of objects of this class, then I loop over this array, to print something about each object.
The destructor gets called twice. I think I know why. I think it's making a copy of each object for the loop, right? When each loop finishes, it destroys the object copy made for that loop. Then when the program finishes, it destroys the array (calling the destructor for a second time). Is that right?
How it feels to end my copilot session when he keeps making the same error over and over and hallucinates that he wrote it correctly
>>105902236Okay never mind, I just asked ChatGPT to get some answers about this, and yes my style of loop was creating a copy for each loop. I was doing this:
for (Car car : cars)
But apparently it's better to do this, so you don't create a copy of each object when looping (and the const means you can't accidentally modify the object while you're using it):
for (const Car &car : cars)
>>105902219I was hoping this mess would rotate and we could get a proper Daily Programming with Tohru going. Why did you save it?
>>105902505I just googled "Tohru" and it's some weirdo anime freak garbage
Thank fuck I saved this thread.
>>105902598>she doesn't know about the science foundation for maids
>>105902427Good now do const auto& car and you'll be writing idiomatic sepples.
>>105903050Even though auto const& car
>Try to build Clang from source in Visual Studio
>Windows crashes
Can't make this shit up
>>105903310Please be a good cucksoomer and download the mystery prebuilt binaries, sir.
I write return(value) because I think it looks cuter
>>105903310clang on visual studios is pointless because address sanitizer won't trigger your debugger (it will just terminate itself) and it won't work with vcpkg because clang-cl cannot combine address sanitizer + /MDd flag (vcpkg does not have a flag for changing the runtime, release builds / static debug builds work I think), and also msvc and clang-cl use a different address sanitizer DLL with the same name.
I use clang-cl for cfi-sanitizer and ubsan with unsigned overflow/underflow just for fun however.
Should I still learn c++?
I want to get into gamedev
>>105902427>I just asked ChatGPTWhy didn't you ask ChatGPT what he thought of this post instead of /dpt/? Fuck off
>>105904221*shrugs*
people in this thread are going to tell you to code your own engine, but if you went to /vg/agdg/ they would tell you to use unity/godot.
lots of games are more about content than code, and the list of games that you CANNOT make with an engine like unity/godot is very short, and like 80% of the game released on steam are made with unity.
so if you think you are an ideas guy, go for an engine, if you are willing to spend 10-100x more time to do something more technically impressive, go for C++, but when I say technically impressive I am not saying that your game will be technically impressive, I'm just saying it's technically impressive that you are even able to finish a game, because almost nobody actually finishes a game (if it's 3D), they usually only finish the engine part. If it's 2D, anything is fine, using an engine might annoy you a little bit since they probably have a ton of built in mapping / collision tools and stuff, but nothing is stopping you from writing your own structure to the engine and basically do the same thing as an engine dev inside of godot/unity.
Also if you want people to mod your game, unity is just easy to reverse engineer and people can just mod it if they felt like it, and C++ is actually terrible for multi-lingual people, it's a huge pain in the ass to get more than just English in your game, while engines just make it a built in feature.
>>105904221I think all programmers should know c++, because it gives you a good perspective on how the program actually works. People who started on python have a hard time grasping stack and heap and why they are leaking memory
>game devLearn how to draw, 3D model or play music
Programming doesnt matter as much anymore, and youโll have to use game makerโs or unreal 5โs own language anyway.
>>105904425>I think all programmers should know c++, because it gives you a good perspective on how the program actually works.This but C
>>105904381Thank you for writing that reply anon.
I did played around with godot/unity as of late and made a couple of complete games with them. I was thinking about making a pretty simple game to begin with, because every single time that I start to think about making a game, I hate that I don't even know what goes under the hood and the general architecture that goes behind the game. I'm not against using an already existing game engine to make a game but I just want to know how gamedev works, If that makes sense.
For example how do game engines render stuff or how does an animation state even works that sort of thing and I feel like all of those structures have been implemented on c++ or c.
>>105904425Any good resource that I should check out to learn a bit more about c++? I know that stackoverflow has a "Book guide on c++" so not sure if I should use that instead.
>Learn how to draw, 3D model or play musicI know almost all of those aside from for music.
>and youโll have to use game makerโs or unreal 5โs own language anyway.I know that UE5 has it's own flavor of c++ to it but I just want to know how does gamedev even works, feels like it might be a good thing to know and have
[auto]
auto<auto> autObj[auto] = {auto, auto, auto};
[/auto]
>>105904762the main interesting part of engines that is pure black magic is the shading part.
the convenient part is the mapping / physics / component system / and all sorts of plugins, it's complex but really simple / not necessary in a 2D game.
putting triangles on the screen + animations is a really basic part of the engine, it really is just copy the data from the 3d model file and put it into the graphics API, the actual code is a clusterfuck because engines support 100 3d model formats and 100 graphics backends, but boil it down to just 1 model format and 1 graphics backend, that's potentially just a few hundred to a few thousand lines of code to get a 3d model animated in a game (depending on the libraries you choose).
The engines should provide a way of being able to just dump raw vertices + texture UV coordinates into the game, that's not much different than doing it from scratch, and you could make a whole game using just that raw API in theory.
>>105904834uhh are you retarded?
you forgot static constexpr constinit [[nodiscard]]
i do not care for win32 gui programming
>>105904990Hmm interesting... I might have to read a bit more about it then before jumping into it
now I'm just realizing, should I move my questions to
>>105887296 instead? since it's not about daily programming anymore
But thank you so much!
>>105904425>I think all programmers should know c++, because it gives you a good perspective on how the program actually works. People who started on python have a hard time grasping stack and heap and why they are leaking memoryC teaches you everything you need to know about this and tacks on way less bullshit
Is Dr. Fuuzetsu still lurking here? ;33333
>>105906187he's busy having sex with nip qts (within the io monad)
>>105906250>within the io monadoh no... still a virgin I see (sex is a side effect)
>>105904527>>105905916C is like school in july
No. Class.
>>105889098All the hot girls use Rocq
https://greasyfork.org/en/scripts/368389-youtube-time-remaining/code
I've never seen this kind of code, what is this?
Anyone know how to stop procrastinating when it comes to programming? Its been 2 weeks since I set my goal to program at least 6 hours a day and I haven't even programmed 1 hour in the last 2 weeks. One of the reasons is because I want to use github to familiarize myself using github but idk where to start from or what program to create that isn't just something simple. Next to work something a company wouldcwork on.
>>105907034Put on a maid dress
Really good video if anyone is interested in how SPARK works in Ada: https://www.youtube.com/watch?v=tYAod_61ZuQ
>>105902256americans dont know what this means
>>105907770replace it with an anime pic
>>105907034adhd
sorry nona i have no idea how to fix it, i graduated uni and i still have the same issue
>>105907537how does this compare to like separation logic
>>105907034>>105908396Instead of planning a time frame, organize ideas of what you want to achieve. Distill it into small problems, and just try to solve them. The fact that you have the problems laid out in front of you is going to guide your actions. Everything else still distracts, but once you've tried solving a specific problem, planning happens naturally. I have adhd and I just decided I won't work regular hours. It helps that I don't have a schedule, since after I start I tend to hyper focus and lose track of time. Then it's just experimenting and seeing what works for you.
>>105908396>how does this compare to like separation logicProbably less powerful when talking about unrestricted pointers, but SPARK leverages off Ada's already strict aliasing rules and uses borrow checking for situations where it's needed. Explicit pointers aren't relied upon directly nearly as much in Ada as in C so I'm not certain if there are actual limitations in comparison.
>>105889045>Also compilers are too stupid to *not* do clever things.This is a dumb thing to say and could only have come from an extremely low-powered brain.
Weirdest question ever asked on /dpt/ but does anyone have pictures of bjarne stroustrup in his 20s and 30s, I want to see when his hairline gave out on him.
file
md5: f46d8ee83e778e5c86c0a8ec0e1b46aa
๐
>>105889001 (OP)>What are you working on, /g/?decided to start my own personal project and make a desktop app using electron and react. Probably not the best approach but I only have front end background so it is easier for me.
Also using Claude.ai as a learning tool to actually learn shit because I am tired of watching outdated youtube videos.
I wonder if i can make money out of it somehow but I doubt it, I am not business savvy and the project is more neet oriented anyways
>>105889001 (OP)Making a video game with Go and Raylib. It's been going well, learning lots of stuff. Just wanted to avoid complicated languages because a friend is working with me and he doesn't really have any programming experience. I will probably build my next project with my own language. It just isn't ready for that yet, so maybe next year.
>>105908906it maybe makes sense if you're a hyper-cnile and you're used to the compiler completely rewriting your program for you
>>105907777Itโs literally an american book
>>105911311americans can't read
>>105910366you aren't learning shit from claude or youtube videos, dont kid yourself
take a step towards real mastery of something in your life (for once) and get a book or just a language reference/docs and take the time to actually learn something meaningful
>>105911378So, how much money did you waste on books? And did the job you never have pay back for them?
>>105911716no money spent on books is wasted
>>105911716>buying booksMy chigga, are you under 15 or over 50?
>>105911904>>105911896A book is made from paper, good sir. If there's no paper in your hands, it's not a book.
>>105897610What a lonely sad existence going on 4chan just to angry post all the time.
>>105910225probably very early on, which allowed him to disregard whores, and put all of his vital energy into designing C++.
>>105911970Okay. You can spend 150 dollars on a โrealโ 5 kilogram paperback you will never read, or do what I did and read two dozen programming books for free on my phone on the bus for the same knowledge
>>105905035>forgot noexcept>forgot finalngmi
>>105904221yeah, C++ is a pretty transferable skill, so once you discover gamedev is a steaming pile of shit, you can use it to get a real job.
I got bullied last week for being a web dev so I bought an arduino and i am having a lot of fun. Thank u bully guy on here
>>105913233>Haha look at that guy he has a job!
>>105913233very cool, anon. what are you making?
>>105913450next week: arduino anon grows his own silicon crystals, and makes chips to fit in.
>>105913339This but unironically. Jobs are for losers.
>>105913467I've familiarised myself with all the components of the kit I bought. printed nigger on the lcd screen. made a retarded robot arm with some old KNEX toy parts. might try automating watering my greenhouse later if I can get a reliable soil humidity sensor
>>105913515>printed nigger on the lcd screenbased
>automating watering my greenhousebased^2
>reliable soil humidity sensorI keep hearing that getting one that won't corrode, seep aids into the soil, and give you cancer can be a challenge.
>try to build chromiumos using the official document
>doesn't even build
I hate google so fucking much
>>105913540for me it's
>consider building something from google>see depot_tools.git>droppedeverything they make is fucking cancer
Is anyone else here working a programming job that pays comfortably well but is boring as fuck otherwise? Iโve started to feel so in the last 2 months. How do you escape this trap?
>t. junior Python developer
>>105913562I am working a programming job that is fucking hard, pays meh, and makes me want to kms every single second of my conscious existence. thank god for alcohol.
>>105912661he's married with 2 children.
>>105913573The ones that are hard usually have the better exit opportunities. No pain, no gain. I feel stuck in comparison.
At least I hope youโre learning something useful unlike me. Probably embedded development.
>>105913562learn a new language and start a hobby project
I'm going to draw a rectangle and nobody here can stop me.
>>105911378>you aren't learning shit from claude or youtube videos, dont kid yourselfidk man but it has been pretty fun.
>>105912693^^reflexpr template<template<typename>,class,auto> template<> decltype(auto) pre() post(x: &x) f() override
>>105912693The pic makes no sense, you know?
>>105906889Sucks to write
Is there anything game related I can use C for besides fucking around in Quake's source code?
>>105914943>raylib>quake source ports>orx for 2d https://github.com/orx/orxSome game engines made in have C bindings around.
You could maybe even use godot with C because I think their scripting interface is used by C API.
chatgpt helped me find a memory leak in a public repo
i can now contribute and raise my standing
>>105914943this is exactly what they invented transpilers for
any code written by trannies can be transpiled into C and will run better
>>105913562>python developerBrutal, python devs get paid like shit.
>>105916041Although I donโt get paid like shit, the situation is a bit sorry for me
>>105914943zachtronics style game where you have to hack on a c compiler
>>105913562>programming job that pays comfortably well but is boring as fuck otherwisei used to have a job like that and i wish i could back back. it beats high paying but stressful
// Open file to search in
FILE *fptr = fopen(argv[1], "rb");
if (fptr == NULL) {
printf("Error opening file %s\n", input);
return 1;
}
// The variables we'll use to keep track of things
int counter = 0;
uint8_t buffer[512];
FILE *curr_out = NULL;
size_t bytes_read = 0;
// Main "reading" loop
while ((bytes_read = fread(buffer, sizeof(uint8_t), 512, fptr)) == 512) {
if (ferror(fptr)) {
printf("Error when reading from file %s\n", input);
break;
}
// Check if found a valid JPEG Signature Header
if (isValidJPEG(buffer)) {
// Close current file if open
if (curr_out != NULL) {
fclose(curr_out);
}
// Create new filename and open new file
char filename[50];
sprintf(filename, "%03d.jpg", counter);
curr_out = fopen(filename, "wb");
if (curr_out == NULL) {
printf("Error opening file %s\n", filename);
break;
}
// Write current buffer to file
fwrite(buffer, sizeof(uint8_t), bytes_read, curr_out);
counter++;
} else if (curr_out != NULL) {
// We're in the middle of a JPEG - keep writing
fwrite(buffer, sizeof(uint8_t), bytes_read, curr_out);
}
}
// Close files and free memory if needed
fclose(fptr);
// don't forget to close last file if it's still open
if (curr_out != NULL) {
fclose(curr_out);
}
return 0;
I feel like there might be something wrong in this working code.
The way I'm checking the .raw file to see if I found a JPG file is checking the first 4 bytes, which are always supposed to be specific values. But I'm only checking on the first four bytes of every 512 bytes block.
This is just an accommodation or for the sake of simplicity of the problem I was given to solve, right?
>>105914943Not going to lie, Carmack looks incredible for being almost 60
>>105892251>>105891496unsigned values instantly means defected code.
please always use signed values retards unless you're doing bit manipulations.
next
>>105916922>he needs my signature on all of my integers
I've written a corss platform filesystem header file for C doing conditional compilation like this, am i retarded? I could not find any useful one online.
Maybe i should use integers as return values but whatever.
// Example: file_copy
bool file_copy(const char* src, const char* dst, bool overwrite) {
#ifndef _WIN32
int src_fd = open(src, O_RDONLY, 0);
struct stat statbuf;
if (fstat(src_fd, &statbuf) != 0) return false;
isize src_size = statbuf.st_size;
int flags = overwrite ? O_TRUNC : 0;
int dst_fd = open(dst, O_WRONLY | O_CREAT | flags, S_IRWXU | S_IRWXG | S_IRWXO);
if (sendfile(dst_fd, src_fd, NULL, src_size) == -1) return false;
if (close(src_fd) != 0 || close(dst_fd) != 0) return false;
return true;
#else
BOOL res = CopyFile(src, dst, !overwrite);
return res;
#endif
}
>>105916981>BOOL res =>return res;i hate it
>>105917012i probably had more code in between there and forgot to clean it
Does AI code better than the average /g/entoman?
ohara.ai
>>105917744purchase an advertisement pajeet
im learning about mvvm, i think i have a somewhat clear picture of how it works, but one thing im not sure about is how an mvvm app handles global services like authentication, without using a dependency injection package an mvvm setup could look like
LoginView(
LoginViewModel(
UserRepository(AuthService, UserProfileService)
)
)
so if i want to authenticate the user on every screen, I would need to make it a constructor dependency on all the views that need it? like
FavoritesView(
FavoritesViewModel(
UserRepository(AuthService, UserProfileService),
FavoritesRepository(FavoritesService)
)
)
? i guess i should ask wdg since mvvm is more of a web/app development architecture
After fiddling around making a math formula REPL, I've realized that tokenization and parsing are easier than I thought
I think I might fuck around and make my own JSON-like, DSL, or scripting language (or all of the above)
Goodest NodeJS templating engine?
>for rendering HTML?
Nah, other server stuff.
https://github.com/banach-space/llvm-tutor
How do I actually integrate an LLVM plugin into CMake seamlessly though. I don't want this fuckass IR detour shit.
give me your favorite coding theme
>>105903050Fair enough thanks
>>105904270Glad I could make you seethe you pathetic little bitch
>>105919310>reddit spacekys gptposter
not a single fucking soul gives a shit about what you have asked gpt or what it has told you
if it wasnt for all the restrictions, gpt itself would tell you this (including to kys)
my system has a dbus service that segfaults
how do i manage to attach a gdb to that motherfucker, it ACKs itself on start and only when invoked as root by dbus
>>105919188 (Me)
lol well this works I guess.
>>105919700figure out if it has debug symbols, if it doesn't you're SOL
figure out how to get it to die when running it manually, good luck trying to attach GDB to a "running" process that dies immediately
are you sure it's killing itself? how do you know something else isn't doing it
>>105921141Looks like it's indexed improperly.
Notice how the vertices are still in the place of a car.
Keep up the good work lad. OpenGL is generally like getting kicked in the head.
>>105921639I wish it was OpenGL. I wrote an OpenGL renderer to make an editor for this game before I started a true decompilation, that looks perfect. Right now I'm trying to get their bespoke software rendering working.
should I use c++ module now? learned it a while ago, but intellisense was buggy with it
is it okay now?
>>105923442no use case unfortunately
hahahaha CLion works with msvc6
Even works with the lldb debugger
>>105893234you should be able to type that enum as : char.
Why all the bitfields?
>>105896343the PDP-11 had speculative execution, a MMU, caches etc. etc., your computer *is* a fast PDP-11.
The only thing it lacked is a massively parallel co-processor (a GPU)
>>105898316I say
/kษษ/
/bJn/
/su.dษw/
/i.num/
/strสkt/
so 2 1 1 2 1
>>1059070346h is way too lofty a goal if you don't even do 1h.
I'd recommend some kind of routine, eg
"every time I come back and sit down at my computer I will programme for 15 minutes".
And stick to that, the first and immediate thing you do is programme for those 15 minutes. Sit down a couple times over the day and you'll have programmed for an hour.
then you can scale up as necessary.
>>105923659>clangd HATES msvc6
It's been over a year since my last non-trivial (<1000 line) programming project. I feel like I've learned everything I've wanted to learn. How do I reignite the interest?
>>105903685I write sizeof *variable because it makes people afraid.
>>105903685fukkkk
now thats trany coded im gonna have to change my muscle memory
>>105903685>>105924278It's okay. It's actually Windows code style coded.
>>105916840this is utterly retarded, and all those comments make me think this was made by an AI.
Why are you checking the 4 bytes header every 512 bytes? Just do it once, and if it isn't a JPEG, early return.
Then you fseek back to the start, and copy the file contents to the output one.
Simplicity? This was way harder to read than it should. Don't do this kind of shit ever again
>>105916840Don't worry anon, your code is still in top 10% in terms of C code quality.
>>105924446pfew
but
with or without space?
>>105924521based
ive been taught right then
i had to follow a norm when writing c at school
>>105919547Glad I could make you seethe, you pathetic little bitch