what are you working on /g/?prev: >>106375242
trying to learn cpp, what to build?
>>106438646an llvm frontend
>>106438646same, im making a pong clone using SFMLnot really breaking new ground but i guess it is making me more comfortable with structs
>>106438646Begin with C# first
>>106438694
>>106438694I already know java
>>106438619>maid /dpt/ gets deleted>new /dpt/ still has a maidWhy do jannies bother to delete maidposts? Everyone using this board is a cute maid. That is who wants to even discuss these topics. Anybody both willing and able to talk about language/compiler design anonymously online is wearing a maid outfit. It isn't even secret anymore.
>>106438734i dont i just wear striped thigh highs the dress and apron is a pain to take off and put on
>>106438734dejiko isn't a maid you sperg
Stop talking about maids and ask the real important question:Have you ever jerked off to your or someone else code?
Going through https://clang.llvm.org/docs/ClangFormatStyleOptions.html trying to build a style that isn't terrible because all of the presets are garbageHard requirement is that indentation is NEVER dependent on the length of an identifier. Shit likeauto myLongVariableNameLooooooool = someFunction() .hahahaFuckYou();drives me insane.
auto myLongVariableNameLooooooool = someFunction() .hahahaFuckYou();
any good NEET lang?fun to write, don't care if usefulthinking J
>>106438755>she isn't a maid>she just likes wearing a maid outfit and engaging in maid activities like cleaning and heart hands and advanced Mathematics and Computer Science research and programming on her Maid Computer
>>106438881she's an alien catgirl princess that works in video game storelarping as a drawing is one thing but don't start pretending you're a math/CS wizard
>>106438881Reducing classic anime girls as just "maid" is as bad as people who reduce Astolfo as just "femboy"
How the fuck do I compute the minimum value of a signed integer type at compile time in C without invoking UB?
I'm learning how to use SIMD instructions so I am working on detecting the enabledness of those instructions so that I can use them for some data stuff i'm doing with 3d models, AVX could speed up parts of my program by a 8x, with more gains to be had by adding parallelization later if I need to
>>106439083stdint.hINT_MIN
>>106438958>>106438990I am being attacked by a weapon that plays a sound that causes depression. It vibrates my bones and causes depression. They play it from a machine, possibly located in space to cause depression. I would try to watch this show, but until the sound stops I can take no actions.
>>106439102okay now do __int128_t
>>106439083use std::numeric_limits or the INT_MAX macros, or limits.h/<climits>, or just roll it over from max like a real gamer
>>106439103We'll destroy those gangsters someday brother
>>106439106from stackoverflow...<code>static const __uint128_t UINT128_MAX =__uint128_t(__int128_t(-1L));static const __int128_t INT128_MAX = UINT128_MAX >> 1;static const __int128_t INT128_MIN = -INT128_MAX - 1;//or...std::numeric_limits<__int128>::max()</code>
>>106439103you may haveparanoid schizophrenia hello
>>106439159assumes two's complement
>>106439106noill do it when unsigned long long long becomes standard
>>106439178NTA but one of the two:Or you are doing something malicious her "OH HOW C BAD NOBODY SHOULD USE IT" like a rust evangelistOr you really have some mental issue like the other poster, to not only need it for __int128_t, but also care about two's complement as if any computer you are gonna ever touch will use one's complement or other in it's C implementation
>>106439201malicious here*
>>106439178if you know that it's a 128-bit signed integer then it's max should be 2^127 right, assuming we aren't counting the sign bit? can't you just precalculate and define the value?-2^127=-170,141,183,460,469,231,731,687,303,715,884,105,728
>>106439266is there a standard way to have a 128 bit constant in C?
How do you guys pick a project to focus on? For every project I’ve started and stalled, I started two more as a result.
finally used a cross-product today
>>106439735Have a clear goal and outline
>>106438619Removed a lot of unused CSS from https://ayasequart.org. Check it out. https://ayasequart.org/g/thread/106438619
>>106439751what's this girls' name?need to see if there's nudes of her
Do you move the code that's used once to separate functions? A concrete example, connecting Qt signals in constructor:connect(A, &A::foo, [this]{// a dozen LoC})connect(B, &B::bar, [this]{// a dozen LoC})
connect(A, &A::foo, [this]{// a dozen LoC})connect(B, &B::bar, [this]{// a dozen LoC})
>>106438619C++ gives me the ick, but it fits the criteria for my next big project.How do I get over the fear of shitty build tools? Which one should I use?
>>106438821OCaml is also a NEET language
>>106441286>Which one should I use?Meson. It just werks.
>>106438619lol, lmao evenhttps://lngnmn2.github.io/articles/philosophy-of-programming/
Tried my best to like Rust. Wrote a compiler and a basic terminal emulator in it. Took me about a year of weekends and evenings. Still don't like it.
>>106439751what is this
>>106439103The morning sun has vanquished the horrible night.
I am building a CLI app that will have a hybrid of a flag mode and an interactive mode. However I am currently second-guessing as I don't know which flags should also be prompted during the interactive mode and which should be skipped. Does any anon have any advice ? The flags that I am second-guessing are for verbose (showcasing detailed information), progress (for progress bar), count, and output to name a few.
>>106441670Your REPL should be able to do everything your CLI can. It is also good practice to design the REPL first.
>>106441670group your flags into two separate groups, one for control (output, verbosity, etc.) and another for batch processing (ie. whatever you will map to an option during interactive mode)whatever input you an use in interactive mode, add as a batch flag; whatever additional mode you need to set in the app, add as a control flag
An SQL query walks into a bar and walks upto 2 tables and says "Can I Join You?"
the query then accidentally drops the tablesthen it got fired and raped
Two bytes walk into a bar. The first byte turns to the second and says "I think I may have a parity error." The second byte turns to the first and says "yeah, you look a bit off."
is your computer running?then you better go catch it!!
>>106441286VS studio project for starting out.cmake if you plan on using emscripten.cmake is the worst build system but if you used any other build system, such as meson, I would be worried about resources (you will find lots of posts on the internet on cmake).I suggest using vcpkg for libraries, but this blog post has really shown that it's not all rosy (but this is still 10x better than building from source, prebuilt, or mingw packages or whatever).https://decovar.dev/blog/2022/10/30/cpp-dependencies-with-vcpkgdon't touch mingw, address sanitizer is the only way to debug C++.
>>106439090I think this post basically says just use the __builtin / (whatever msvc uses) check because it's fast enough for 99% of cases.https://github.com/robertdfrench/ifuncd-up
>>106442693The two tables reply:>Where do you think you are?>You are not like us.
I completed mutations and squashed more bugs. Now I am adding the other resolution types. Then I have to add compiler flags and built-in functions and write the manual. Possibly other tasks I am forgetting, but everything except resolution types and maybe writing the manual should be short. I am also considering reworking eMAIDS to work with MAIDS and Kurumi MaidCard III. That way it is an entire IDE for MAIDS and they can seriously program in it more easily with having to fiddle with vim and command-line arguments or similar. Attached is a screenshot of eMAIDS. It would need significant rework, so the effort might not be worth it. eMAIDS is written entirely in core Java 23, using swing.
>>106443093The maid is customizable. When compilation is successful you get a happy maid. When unsuccessful, the compiler fail maid. The theming and maids are also configurable and the themes can be serialized/deserialized so maids can create and share themes mlre easily. Here is one with Bocchi
>>106440943I usually just use lambdas for this:const auto callback = [this] = { /// dozen loc};connect(widget1, &Widget::signal, this, callback);connect(widget2, &Widget::signal, this, callback);
const auto callback = [this] = { /// dozen loc};connect(widget1, &Widget::signal, this, callback);connect(widget2, &Widget::signal, this, callback);
What makes a maid a maid? Is it the desire to wear the dress? The desire to program the computer and produce advanced Mathematics and Computer Science research? The huge boobs packed into the dress? What makes a maid?
>>106443555its the dress you retard what kind of question is this
>>106443591The most important question in all of Computer Science.
>>106443093>>106443145>white on magenta or whatever nightmare purple color why the fuck
>>106443779It is configurable. I just used that because it matches Maid Card colors.
>>106439090Reminder that SSE4.1 was implemented in 2007, SSE4.2 in 2008, AVX in 2011. Do not give a shit about non-AVX CPUs.>b-but what about my fellow chinkpadsMy T530 with a THIRD GEN intel CPU has AVX support. We are currently at intel CPU generation... Sorry, the naming scheme CHANGED after the 14th gen.Do not and I repeat DO NOT optimize for AVXlets. Do not add fallbacks for AVXlets. Do not compile for AVXlets.
>>106444081but then how will I run new software on my Pentium 3 or Athlon XP computers?
>>106444139>1999>2001>32 bitIt's time to let go. Send it to a museum to be put in a glass case.
any of you guys ever use AI to just make stuff for you? ive been learning C++ and Python for a while now and while the local model (Qwen 2.5) and Gemini both produce subpar c++ code, but it excel at Python code. Of course, the quality drops and errors increase with projects that exceeds about 750 loc but when it works, feels like taking a hit of crack.
>>106444701LLMs are nice for webtech and python, but sometimes I find myself doing thing manually instead of taking the time to provide context and correct the errors in the responses.The breaking point seems to be across-files for me, so I just use it when I already have a design in mind and want it to shit out a baseline impl for me to modify to my needs.
>>106444081If someone on apple tried to run the game with AVX + crossover, it would give an error unless they set ROSETTA_ADVERTISE_AVX.Also they need to have crossover updated in 2025, since people pay / pirate crossover once, they don't get updates.That's pretty much the only reason to not assume AVX is supported (manually check for support).Also I think for a simple SIMD implementation for a 3d math library, you don't need AVX, I think AVX is mostly for doubles in a 4x4 matrix? Am I wrong? That's what I see with jolt physics.Of course, you could get into the weeds of SIMD and maybe you could batch operations with a bigger register, but I would wonder if compute is even the bottleneck (physics and audio seem to be the main places where SIMD is used).
>>106444741>The breaking point seems to be across-files for me, so I just use it when I already have a design in mind and want it to shit out a baseline impl for me to modify to my needsyup, ive noticed that if keep everything in a monolithic file, it seems to do alright. this gives me a ton of hope as a newbie though. there's no way these tools will be replacing anyone
>>106444824LLMs, as they currently are, only fuel burning startups with a 1-man/grifter team. They can't replace junior devs (cheaper than seniors, future proofing, will climb the ladder), especially in bigger companies.LLMs are not the reason the job market is bad. It's because of greedy corpos wanting to switch to cheaper H1b. These people can stay for up to 6 years.
>>106443922why are your tohru images always night shifted?
Peti Charato
>>106444081> My T530 with a THIRD GEN intel CPU has AVX supportNot AVX2 which is the actual useful one.
>>106442806heh
>>106444139compile with -march=i486 and they can run on even older cpusyou dont "need" anything other than scaler integer and floating point for most software
Mutations are complete. Resolution types are 2/3 complete and the last 1/3 won't take long. I am trying to decide what built-in functions to include, so how long that takes depends on how many I decide the first release needs. How much math. Etc.>>106444955I don't know what this means.
>>106445537>compile with -march=i486but it's almost september
>>106442895Use Conan bro.
>>106442895I don't use window
>>106445765
>compiling for "CPUs" without most of AVX512
Can I get away with never writing constructors/destructors in C++ and just use RAII wrappers for everything
>>106446478Just use Java at that point.
>>106446478>Can I get away with never writing constructors/destructors in C++ and just use RAII wrappers for everythingHow do you create RAII wrappers without constructors/destructors? Do you mean unique_ptr<T, D> for everything?
template <typename T>concept MyConcept = requires(T t) { { t.resource } -> std::same_as<std::vector<int>>;};void foo(MyConcept auto bar){ bar.resource. // No vector intellisense/autocomplete here auto v = bar.resource; v. // Or here}Feels like everything past and including C++20 is just being treated as an afterthought. Did people just abandon this language or what?
template <typename T>concept MyConcept = requires(T t) { { t.resource } -> std::same_as<std::vector<int>>;};void foo(MyConcept auto bar){ bar.resource. // No vector intellisense/autocomplete here auto v = bar.resource; v. // Or here}
>>106445668Resolution types are done. Built ins are done. Compiler flags are probably next. Then the manual. Then some very heavy testing. Then release.
so this is my first ever program in C and im also very new to programming. The program is just a to do list thing. So far all it does is it takes input from the user, assigns it an ID based on it's position and writes it to a file. my question is this: the code is 117 lines. Is this normal for C? to me it seems a bit excessive taking into account the simpplicity of the program. What do you think?Code in next post.
>>106447376https://pastebin.com/V6RuBRqD
>>106447428also, forgot to mention, i tried doing everything from as scratch as possible, meaning using the standard library as little as possible (almost none)i'm sure that has something to do with the inflated line count but still 127 lines of code for a program lkike this seems excessive to me.
>>106447463>i tried doing everything from as scratch as possible, meaning using the standard library as little as possible (almost none)use open, read/write, close instead of fopen, fread/fwrite, fclose thenalso printf and sprintf
>>106447623and fputs, fgets, fflush, scanf
>>106447428Your functions do too much stuff. Almost everything prints stuff event though the name suggests it should just be writing or reading something from a file. You're effectively smearing a big main function across a bunch of functions to give the impression of organization. Try to factor your programs into a logical layer and a presentation layer.
>>106447463If you do everything from scratch, you can get quite a lot of code even for very "simple" things. That's why we have standard libraries. (If you were doing it without a standard OS, you'd have a lot more lines of code to do to write data into a file.)
In my testing tkinter/python actually executes faster than gtk4/c and qt6/c++.These toolkits have become so bloated an interpreted brahmin language is outpacing them.
Where are the other maids? I need to hear about 4096 in Forth and elliptic curve in C.
>>106447930What do you mean by "executes faster"? What kind of tests are you doing exactly?
>>106448020No new updates currently, I'm still deciding the changes to the public-key APII'll commit once I finish the signature and pkcs8 refactorsAfter a few more things I plan to make this version beta
>>106438619I heard templeOS can now boot UEFI using TinkerOS
>>106448449The time it takes to open the UI program. In GTK at least it's been getting slower and slower with each version. GTK3 and GTK4 take longer to open than tkinter.
>>106440686>>106441634idk it's some character this guy animateshttps://x.com/Wunkolo/status/1960414547199565894https://x.com/Wunkolo/status/1905543245909950548
>>106447769well i thought about doing it that way to be honest but that would just mean more functions and more lines of code.
>>106441601I read (kinda) the rust documentation. Felt like most of rust can be accomplished with C macros.Rust has an indelible aura of abomination.
>>106439751>wunkthat's the name i've been using in porn games for years, wtf
For MVVM/Clean Architecture. If I need to encrypt some data before sending it to an API, is that implementation detail or business logic? Should I encrypt it in the usecase or the repository?
working on a multiplayer terraria clone right now, all actions are synced over the server and two clients can see each other move and see modifications to the tilemap.
>>106451185that's sick
>>106451130>Should I encrypt it in the usecase or the repository?Well? Should a repository ever silently encrypt data? The name is telling you what it should do.
>>106448661I am excited to see it. It seems like larger maid projects run out of gas sometimes and I was worried it was abandoned.
been interesting in integrated information theory (IIT) so making some tools to visualise and change it in real-time :3
>>106452008Needs more maids
>>106452029I don't see how this helps my simulation
>>106452087This was extremely helpful. I like the maid border. Maybe the circles can also get replaced my maids somehow and it becomes EMD for maids?
>>106452087wdym? that image is just screams helpfulness
>>106447371Good Morning Dra/g/on Maids!Compiler flags are done. Manual is in progress. I am debating adding more pattern matching abilities to the built-ins so that the language approaches the same power level as SNOBOL4 but with nicer syntax.>>106448661It is nice to see you in /dpt/ again Sharky. I am hoping to see how elliptic curve is formed in C.>>106452087This version is better than this one >>106452008Thank you Dra/g/ons for reading my post.
i want to grind 2 languages that will be useful in the future career wise. python and rust? i dont think i want to learn too much and be a software dev but maybe could where i feel like python and rust would be good.
>>106444081outdated xeon users on suicide watch
Is there some script to update all my Qt connections from the old syntax with macros to the new one with function pointers?
>>106452642No languages will be useful in the future for careers. AI is going to replace all wagies.>but muh super special low level programming knowledgeGreat. You'll get an extra year before AI replaces you which people doing web development won't get. You still are not immune and programming is still not a long term career prospect anymore.
>>106452642python is a given but why rust? Why any systems language for that matter? 80% of people who learn rust then try to do webdev which is retarded.From your post, the only possible need would be c++ for game dev, but even then I'd tell you to learn C# or the godot langIt all depends on what> will be useful in the future career wisereally means
>>106452642Verilog and become an ASIC designer. There simply isn't enough open source HDL code out there to train an LLM on.
>>106452829>>106452839>>106452954yeah i shouldve been more specific. i think cloud stuff has a future. at the end of the day even ai is going to be using cloud to host what it writes lol. so scripting languages like python, some bash and ive heard that rust is becoming popular in cloud as well.
Codex is amazing. I can feel it stealing my job away
cleaning up a mess todayhttps://github.com/sky-cake/ayase-quart/commit/de8744466a8e16db8fb2cd5c66a96e910d52e03c
>>106454218>boards = form_data.get("boards")Avoid raising "KeyError"
>>106453009>i think cloud stuff has a future.I agree, but not for reason you stated. Simply because humans will be necessary "in the loop" for incident response. Whenever reliability and responsibility has a capital R and tolerance is higher with real time judgment being needed, AI will move way slower in replacing engineers. We'll still need to have some form of compliance and going all cowboy on deployment is going to be a recipe for disaster, so there's that. In short, any critical infrastructure, regulated fields (medicine, finance, legal etc), maintenance (telecoms, grids), people will remain essential.
>>106439090Your compiler should have a cpuid builtin.>AVX could speed up parts of my program by a 8xUnlikely. When you actually benchmark, the gains will probably be more like 15-20% over SSE2 for real work but compilers can be really bad about optimizing for anything higher than SSE2 since the costs/optimizations aren't tested as much. march=AVX2 may be slower than your baseline flags.SSE family feature support after SSE2 is not consistent and can't be relied on because a lot of AMD CPUs did not implement extensions. There are only a handful of instructions worth using as a lot of them are very slow, best to focus on what speeds up the implementation like the BMI extensions, popcnt, clmul, and so on.Focus on SSE2 as a baseline since that's what most languages target, x86-64-v1https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levelsEvery x64 cpu has SSE/SSE2. Then work on an AVX2 implementation if necessary, and AVX512 if you have CPUs that can run it but it's probably not worth investing in until we all have AVX10 chips. You can look into Google's Highway for ideas about dynamic dispatch.>>106444081This is plain wrong.AVX is practically useless without AVX2 and support for AVX2 is not widespread even with modern CPUs. I'm not aware of any dynamic dispatch that targets just AVX and wouldn't trust the assembly generated for a compiler that does that since it's so limited in what it can do.
>>106454379ohh, code review, thank you!In this case, boards is a mandatory key, so something should break if it's not in the form data. Why? Cus with asagi schema, each board is a table.Checks are done via wtform validation prior to this
>>106454467>AVX512 if you have CPUs that can run it but it's probably not worth investing in until we all have AVX10 chipsthis is wrong afaikAVX10 is the same as an AVX512VL instruction stream
>>106454513What's wrong about what was said? You don't have a CPU with AVX10, the first of them will be Nova Lake with 10.2. Widespread adoption of those CPUs will be another 10+ years.
>>106454479That's great, but in that case you are raising 2 different exceptions. ValueError if there is a value thats not a string/list_string, and KeyError is the value is not there. This will be confusing in the long term. Use .get which will return None. It will still raise the exception, but it will be a consistent exception in all cases.
>>106454547What's wrong about what you said is that we have to wait for AVX10 to care about AVX512 programming but that is just not true.All current AVX512 chips are AVX10 because they all implement AVX512VL.AVX10 is orthogonal with AVX512, and it's the same EVEX-encoded instructions. Nothing really changes when an "AVX10" chip comes out except maybe a chip that only supports a subset of the AVX512 features we're all already using. Rather than assuming all chips are 512-bit, a 256-bit chip may come out that produces an exception if you try to do 512-bit arithmetic on it. That's the only _real_ difference.You can write AVX512 code now and it will work on current AVX512 chips and AVX10 chip.AVX10 does not even introduce any new instructions, it just introduces better CPUID flag detection and consolidates the culture of what's already out there.Currently, 18% of steam users have AVX512.https://store.steampowered.com/hwsurvey
>>106454685>a 256-bit chip may come out that produces an exception if you try to do 512-bit arithmetic on itintel was btfo on that, 256 has been dropped
>>106454685>What's wrong about what you said is that we have to wait for AVX10 to care about AVX512 programming but that is just not true.I was suggesting focusing on widespread adoption before more niche targets. You're pedantically misinterpreting what I said as a general suggestion in a hobbyist thread.A beginner should start with SSE2 to learn to think in SIMD, and then work their way up to AVX2 and eventually AVX512. There's still such low adoption and high performance variability (throttling on older CPUs) of AVX512 CPUs that unless they have a server/HPC type application then there's little value in learning it.In the Zen5 benchmarks I saw, AVX2 is faster than AVX512 but uses more power. So AVX512 is more suited to power efficiency in data centers. There's little value in regular people writing AVX512 code today and the skills you learn now will easily be transferred to writing code for future extensions.
>>106455026>AVX2 is faster than AVX512NTA but that isn't really the case, but you have to be very compute bound to benefit from the extra vector width (the new instructions and masking are cool though)
>>106454467>compilers can be really bad about optimizing for anything higher than SSE2 since the costs/optimizations aren't tested as muchFor what reason? bad instruction selection? bad register allocation? bad auto-vectorization?
I've become so incredibly un-sharp over the years since I don't program like I used to.I come to you, hat in hand. What should I start doing to feel like I'm doing my best? Am I just getting old?
>>106455725we are all getting old.we will all be left behind.