← Home ← Back to /g/

Thread 106289603

328 posts 128 images /g/
Anonymous No.106289603 >>106290131 >>106290425 >>106291527 >>106291980 >>106296824 >>106297481 >>106297811 >>106299088 >>106303663 >>106304073 >>106305144 >>106310994 >>106311497 >>106318183 >>106321458 >>106322699 >>106329402 >>106330089 >>106332625 >>106336799 >>106337118
/dpt/ - Daily Programming Thread
What are you working on, /g/?
Previous: >>106245679
Anonymous No.106289682 >>106290207
sorry automatic_purpose_ but there is currently no support for windows XP or newer
Anonymous No.106290131 >>106290226 >>106290335
>>106289603 (OP)
Good Morning Dra/g/on Maids!

I am posting in the Maid Computer thread, then will begin rewriting the 4Chan codebase to use modern PHP and have extensive Maid Card support, and fix as many problems as I can find using static security scanners. Hopefully this will result in higher janny tolerance for maids.

Does anyone who looked at the codebase have suggestions? The rewrite will be released to Public Domain as Maidsuba.

Thank you Dra/g/ons for reading my post.
Anonymous No.106290207 >>106290241
>>106289682
Based Windows 9X supporter.
Anonymous No.106290226 >>106290406
>>106290131
why not modify vichan or use another imageboard that isn't PHP instead of fucking with that?
Anonymous No.106290241 >>106290322
>>106290207
windows 2000 is better and my programs still support it
Anonymous No.106290322 >>106290367
>>106290241
What about Millenium Edition? I had that one at the time.
Anonymous No.106290335 >>106290406
>>106290131
>Statically verifying PHP
lmao, just rewrite it in a proper language
Anonymous No.106290367 >>106299592
>>106290322
nt > 9x
Anonymous No.106290406 >>106290489 >>106290503 >>106290741
>>106290226
I am hoping that once Maidsuba is posted, that a lot of people will scan it and see it at least is nicer and more secure than current 4Chan, and tell janny about it and janny will use it, because it is nicer and more secure than 4Chan, and also that janny will stop banning for Maid Cards because they will be directly integrated into the site and the tools janny has that have to make moderating them easier. I am trying to start with the code they already have so there is some familiarity. I think it is less likely it gets used if it is from something else. Also, since it is a rewrite I will make it Public Domain so janny doesn't have to worry about licenses and can make any modifications she wants later.

>>106290335
I also don't like PHP and this would be my preference, to remake it in Java, but I would like a chance it gets adopted so the Science Foundation software is upgraded and maids and jannies don't have conflicts because Maid Card is more transparent and easier to moderate for janny. I think this is more likely if I do not radically change the stack. Just replace old with new and run a big amount of scans. Even if the result is not perfect, I am sure I can do better than having it built on an ancient version of PHP.
Anonymous No.106290425
>>106289603 (OP)
Agreed, nerds should learn their place as producers of EXE's
Anonymous No.106290489 >>106290769
>>106290406
what are maid cards?
you should try to convince 4chan to use kotatsu the buggy scheme imageboard used by 4taba(dead)
my reasoning for this should be obvious so i will not elaborate
Anonymous No.106290503
>>106290406
>making a containment board for jannies
Fucking based.
Anonymous No.106290569 >>106295471
Today I'm going to try to figure out indirect drawing so I can draw a scene with a single draw call.
Anonymous No.106290741 >>106291219
>>106290406
>stuck in the maid card idea forever
Anonymous No.106290769 >>106290900 >>106291219
>>106290489
An idea to embed code into images that he doesn't give up about after years instead of making something else
It's obviously flawed in size, idea, and the risk of someone embedding illegal stuff in the images, so it pretty much got the maid culture banned from the site
Now he's on a delusion that they will upgrade the site to use them instead of simply making somrthing else
Anonymous No.106290900 >>106290923 >>106291219
>>106290769
like that steganography userscript or more like koikatsu cards
either way rewriting old PHP will surely get this implemented
gambatte
Anonymous No.106290922 >>106290971 >>106291543
any french anons should give this vid a watch
https://www.youtube.com/watch?v=qv1uJQW-Cpc
Sebastian Lague quality but only got 300 views.
Anonymous No.106290923 >>106291219
>>106290900
He wants like koikatsu cards to share code using them instead of some git site
Would be fine if he just made his own site or something, like a package repository of maid cards, but he insist in posting them here
Anonymous No.106290958 >>106299107 >>106321792
constexpr const char* const f(const char* const p) const;
Anonymous No.106290971
>>106290922
i speak french but too lazy to spend 40m on it
Anonymous No.106291141 >>106293183
>>106287204
The nyu keyword is reserved for preprocessor directives and meta-statements (only #include is supported so far):

#include "hal_emu.nyo" nyu
#include "fmt.nyo" nyu

var numero: word[50]
call fmt_decimal numero, 1234 nyo
call prints "Num: " nyo
call prints numero nyo
Anonymous No.106291219 >>106291326 >>106291380
>>106290741
You need distribution to distribute.

>>106290769
>It's obviously flawed in size
There are limitations, yes. Everything has to be less than 4MB, and it inflated images/binary data rather than compresses it. But if you are just sending text, like uncompiled source code, then the compression is quite nice. I was able to fit a KJV Bible which was over 4MB into a card with an image of Tohru and post it and the whole thing fit. So, if your source code is 3 times the length of the Bible, you might need a different tool.

>idea
The idea is to share advanced Mathematics and Computer Science research via uncompiled source code, directly on my Science Foundation. I tried making a "visible" version where I literally write the code out in tiny font on the image, and then read it mechanically, but this failed a test, which was to be able to put Sharky's libmaid library on it, because that is a real world example of a large maid project, and it couldn't do that. Kurumi MaidCard does that with enough space left over that I could use an image of Sharky as the Maid Sticker and post the whole thing with space to spare.

>and the risk of someone embedding illegal stuff in the images
Expanded janny tooling solves this.

>so it pretty much got the maid culture banned from the site
It getting conflated with /cumg/ got it banned. The problem was coomers and pedos on a blue board, not maids discussing counting.

>Now he's on a delusion that they will upgrade the site to use them instead of simply making somrthing else
I will upgrade the site.

>>106290900
>steganography userscript
Maid Card did not use steganography and was not for data hiding and was unrelated to /cumg/. I also upgraded Maid Card itself and wrote an actual spec for the format so now it works more like a VCS with commit/branch/merge/etc.

>>106290923
I wrote a web server for it in Java, but I might not release it because it uses HTTPS and this protocol should be replaced, not encouraged.
Anonymous No.106291326
>>106291219
>Expanded janny tooling solves this.
The jannies won't use it, the same way they banned cumg instead of using their extensions

>I will upgrade the site.
Took a big hack for them to update ghostscript, nobody will put your code in the site

>I wrote a web server for it in Java, but I might not release it because it uses HTTPS and this protocol should be replaced, not encouraged.
Make it HTTP-only then?
Anonymous No.106291380 >>106296326
>>106291219
>it uses HTTPS and this protocol should be replaced
I will solve this sometime, probably after having the elliptic curves I want in libmaid
Anonymous No.106291527
>>106289603 (OP)
I want to make a Halo franchise map modding tool in C/C++. Is there any website or some resources where I can see the offsets of where tags or content is located in the map or can someone get me started for someone who is sort of a beginner?
Anonymous No.106291543
>>106290922
https://i.4cdn.org/wsg/1755445615467071.mp4
look at them go
Anonymous No.106291696 >>106291949
>Decide to look at a general every once in a while
>It's just tranny shit, almost nothing to do with the general topic
Every single time.
Anonymous No.106291908
Anonymous No.106291936
>Decide to look at a general every once in a while
>Trans sisters writing superior code
Every single time.
Anonymous No.106291949 >>106292147
>>106291696
>go to maidposting site
>go to dra/g/on maid board
>go to /dpt/ - daily programming with tohru
>it's full of maids discussing advanced Mathematics and Computer Science research
>get mad about maidposts
Anonymous No.106291980 >>106292127
>>106289603 (OP)
I don't have anything to sink my free time after work. Help plz. I do Cshart for my day job.
I want to do something different at home. Or even Cshart is fine.
I just want to work on something. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Anonymous No.106292127 >>106292192
>>106291980
Your assignment is to write the most efficient spigot algorithm for Pi you can, in any language of your choosing.
Anonymous No.106292147
>>106291949
>muh maidposting site
Le heckin Tohru in the sticky status? 2023? 2024? 2025? Maybe next year?
(You) lost. (You) are a mentally ill avatarfag loser, eli.
Anonymous No.106292192 >>106292340
>>106292127
>spigot algorithm for Pi
First of all what the fuck is that? and second, fuck maids.
Anonymous No.106292340 >>106292510
>>106292192
What do you have against maids?
Anonymous No.106292506
Why is janny like this?
Anonymous No.106292510 >>106292546
maidniggers are the jews of /dpt/
the schizo that was aggressively shitting up the thread for months until barely anyone else posted? maidniggers deployed him
it's no coincidence of this phase change, that the schizo just went away and shortly after the maidniggers started making abundant posts about their avatarfag cult

>>106292340
for starters, avatarfagging is against the rules
Anonymous No.106292546
>>106292510
Are you sure you're not the schizo?
Anonymous No.106293155
Fun detected.
Anonymous No.106293183 >>106295528 >>106296326
>>106291141
why is that nyu even needed?
Anonymous No.106294103 >>106294235
Learn Haskell.
Right nyow.
Anonymous No.106294235
>>106294103
but I already knyow Haskell
Anonymous No.106294377 >>106294428 >>106294750 >>106294755 >>106294790 >>106294998 >>106297717 >>106300919 >>106309608
>volume-control.sh
>vol-ctrl.sh
>volume_control.sh
>vol_ctrl.sh
>VolumeControl.sh
which one for a one off script?
Anonymous No.106294428
>>106294377
vctrl and forget what it does
Anonymous No.106294750
>>106294377
volume.sh
Anonymous No.106294755
>>106294377
script.sh
Anonymous No.106294790 >>106294809
>>106294377
a.out
Anonymous No.106294809
>>106294790
test3
Anonymous No.106294949 >>106298446 >>106301394
new to Windows programming
>OLE
>COM
>Win32 API
what's the difference?
Anonymous No.106294998
>>106294377
sneed (formerly volume).sh
Anonymous No.106295471
>>106290569
Couldn't do this with the API abstraction library I was using so now I gotta start over.
Anonymous No.106295478 >>106295564 >>106295567 >>106308149
this benchmarks the compilation of a C project with various compiler modes
average of 10 runs
one can observe a progressive degradation of build speed by merely switching to c++ and its successive language standards
this is without any use of STL
Anonymous No.106295528
>>106293183
>why is that nyu even needed?
In this case there is no syntactical ambiguity, but in the future I want to add multi-line macros, which will need a delimiter.
I'll simply end all preprocessor directives with nyu, for coherence.
Anonymous No.106295564 >>106295626
>>106295478
what point is it trying to prove? you are compiling a C program using C++ compilers
Anonymous No.106295567 >>106295626
>>106295478
Template instantiation, figuring out where to put and call destructors and have exceptions support take a toll (all things available without #include).
Anonymous No.106295626 >>106295680
>>106295564
an evaluation of the impact on my build times if i were to hypothetically move to some sort of "orthodox" sepples in a future project
>>106295567
this was with rtti and exceptions off, ctor/dtor not used, and very minimal use of templates to emulate a small number of uses of _Generic
Anonymous No.106295680 >>106295775
>>106295626
There's also name mangling and C++'s type system demanding a more complex (and slower) typechecker, for things like overload resolution.
Anonymous No.106295775
>>106295680
so contrary to sepples claims i'll be paying for what i don't use
these benchmarks demonstrate it. so i'll pass
Anonymous No.106296041
Sepples sucks but it's the only viable programming language.
Anonymous No.106296326 >>106296344 >>106296480
>>106293183
>>106291380
>maidposters discuss programming projects
>janny nukes about 20 maidposts
>maidposting continues
>maids are discussing compiler design
Why does janny even try to stop maidposters? Basically everyone in this thread is wearing a maid outfit right now. We all know this. It isn't even secret anymore. Read the room, janny. The walls are covered in moe decorations, the bookshelves are filled with Computer Science books, and every table has maids politely discussing their research. Whatever you though this board was, it isn't that. It is virtual maid cafe, because that's just naturally who posts here the most, because that is who is naturally most drawn to the topic.
Anonymous No.106296344 >>106296376
>>106296326
The problem is Eli insisting in embedding code into images and derailing unrelated stuff
Anonymous No.106296376 >>106296477
>>106296344
What was derailed by discussing a programming project in the daily programming thread? No Maid Cards were even posted in this thread. All that happened was he discussed adding the format to his yotsuba rewrite.
Anonymous No.106296477 >>106328922 >>106331969
>>106296376
He probably got banned to have all those posts deleted
I have seen his posts removed for two reasons: one when he says "bad thread post maids" in random threads, and the other when he insists with the embedded stuff

He wasn't just talking about making koikatsu-like cards for his own imageboard, he was saying this was going on 4chan and he wants to make tools so the jannies can inspect the maid cards (?)

There's a billion other maid themed projects to be maid, and ways to make the maid theme cozy
In the past, jannies would ban derailers from the maid threads and the people calling them "tranny", the maid cards with embedded java code he posted were deleted without the thread being deleted, then he got banned, but he kept insisting on it

There's zero reason to pick a fight with the moderation since maid-themed programming projects is on-topic and actual maid projects threads are rarely deleted
But now maids are stuck in a limbo since all that he does is insisting on the same thing over and over when it's not working in any means
Know that before the moderation deleting them people rarely tested his programs since it's such a weird and shady-looking way to deliver code
There's also the number theory ramblings that don't go anywhere, as if he's a human ChatGPT hallucinating

This annoys me because I genuinely like the maid theme, but it's now just another "side" on drama wars, cultural fiefs
Anonymous No.106296480
>>106296326
fuck off eli
Anonymous No.106296806 >>106299681 >>106299693
Jai will dethrone sepples.
Anonymous No.106296824
>>106289603 (OP)
I'm just overplanning how to overengineer and overoptimize my project and its infrastructure in my head without ever actually getting things done
Anonymous No.106296866 >>106296960 >>106297047 >>106302289
i know this is a longshot since most people don't know haskell, let alone use xmonad, but i'm at my wit's end here
i'm trying to call a function unGrab defined in the module XMonad.Operations
i'm not insane, it's right here in the source: https://hackage.haskell.org/package/xmonad-0.18.0/docs/src/XMonad.Operations.html#unGrab
i have, at the top of my xmonad config file, import XMonad
so i ought to be able to just call the function unGrab which is exactly how they do it in the tutorial: https://xmonad.org/TUTORIAL.html
but calling the function gives me a variable out of scope error
and even if i try to import the function directly with import XMonad.Operations (unGrab) i get an error saying "XMonad.Operations does not export unGrab"
please for the love of god someone help me
Anonymous No.106296960
>>106296866
You might have more luck in textboard or lainchan, those seem to have more people using languages like these
Anonymous No.106297047 >>106297850
>>106296866
XMonad exports XMonad.Operations and XMonad.Operations exports unGrab, so "import XMonad" or "import XMonad.Operations (unGrab)" should work to make unGrab visible.
You sure you are using XMonad version 0.18 and not getting XMonad through some transitive out of date dependency?
Anonymous No.106297050
>get back to a personal project after leaving it for a few weeks
>can just resume work without refamiliarization due to clear abstractions and clean code, and having notes what was planned next directly in the IDE
sirs you can't imagine how much I love OOP
Anonymous No.106297481
>>106289603 (OP)
Spent a while getting multi media support up and working for web and desktop client. Finally got to that stopping point mentality "this is finally where I wanted it, now I can focus on that other area" and then it suddenly hit me I didn't take the client side AES encryption into account. So I don't know what the fuck I'm going to do yet, but I know if you have the local AES auto encryption setup on the desktop client it'll probably break multimedia. So I gotta figure out how the fuck I'm going to fix that.
Anonymous No.106297717
>>106294377
Ctrl+Scroll Lock shortcut
Anonymous No.106297811
>>106289603 (OP)
I'm taking an online Python learning course. Today they covered lists, methods, and references.
Anonymous No.106297850
>>106297047
christ you're right i'm on xmonad 0.17. i assumed i was on 0.18 because it kept barking xmessage warnings at me for using the "deprecated" version of unGrab from XMonad.Util.Ungrab
this is what i get for using debian i suppose
Anonymous No.106297887 >>106301333
You ever rewrite libraries yourself just so that you can understand what the underlying principles of them are and why they are written the way they are? I'm doing that currently for a C data analysis library.
Anonymous No.106298446
>>106294949
this is exactly the type of noobie questions that AI is made for.
But if you want a book to pirate, I took this screenshot from "Windows 10 System Programming"
Is it a good book? dunno, I only have part 1, you need part 2 for the COM chapter. Same guy wrote "Windows Internals", doesn't include COM stuff, but it's all about the kernel.
Anonymous No.106299047
Trying to make my own implementation of Adlib for TempleOS using HolyC from scratch without complicated clusterfucked
Anonymous No.106299088
>>106289603 (OP)
this guy is so incorrect he loops back around to being based
Anonymous No.106299107
>>106290958
>mutates p anyway
Anonymous No.106299592 >>106299748
>>106290367
NT was released in 1993...
Anonymous No.106299681
>>106296806
no it won't
I understand the hype when we had were Jon Blow's motivational speech, but after actually seen what it looked like in the leak...
Anonymous No.106299693
>>106296806
no it won't
I understod the hype when all we had were Jon Blow's motivational speeches, but after actually seeing what it looks like in the leak...
Anonymous No.106299748
>>106299592
https://en.wikipedia.org/wiki/Windows_NT?useskin=vector#Releases
Anonymous No.106300919
>>106294377
volumectl
pretty much every command line program abbreviates control as ctl, not ctrl
Anonymous No.106300926 >>106301799
What's a good book on data structures and discrete structures? I've got a class on them but the university textbooks look trashy.
Anonymous No.106301196
>failed to run custom build command
>process didn't exit successfully
>Error: Too long output directory:
>Shorten your project path down to no more than 10 characters (or use WSL2 and its native Linux filesystem). Note that tricks like Windows `subst` do NOT work!
How is development on Windows even real lmao
Anonymous No.106301333
>>106297887
No, I just look at the code
Anonymous No.106301394
>>106294949
As with most MS crapware, it does very little help to try and explain what something is in order to understand it. Since their design decisions are usually completely arbitrary and not based around some kind of intuitive notion of a system you just have to use them according to their prescribed incantations and observe their results.
Anonymous No.106301799
>>106300926
CLRS
Anonymous No.106302108
Deciding what to code is now harder than coding it. I can't think of a single profitable idea.
Anonymous No.106302145 >>106302261 >>106302534 >>106302909 >>106303621 >>106319793
Turns out comparing enums in python is slower than just comparing strings.
so like
if token.type == 'symbol':

is faster than
if token.type == Token.SYMBOL:

I mean I know its python but come on
Anonymous No.106302167 >>106302275 >>106302452 >>106319802
assuming x == 5 {
print("X is set to 5");
} conversely x == 7 {
print("X is set to 7");
} conversely x == 9 {
print("X is set to 9");
} otherwise {
print("Value of X is unknown");
}

Thoughts?
Anonymous No.106302261 >>106302401
>>106302145
Don't know if it will make a difference but I think enums are meant to be compared with the 'is' operator.
Anonymous No.106302275
>>106302167
Too lazy to write it out since I'm at work but in Haskell this is a MultiWayIf.
Anonymous No.106302286
I'm gonna write c with classes and put "c++ expert" on my resume and there is nothing you can do about it
Anonymous No.106302289
>>106296866
what version of xmonad are you using? unGrab was added in v0.18.0
worthless janny filter flagged the github url as spam so i cant post the exact commit
Anonymous No.106302401 >>106302458
>>106302261
Just used timeit and yeah it makes no difference
Anonymous No.106302452
>>106302167
I like this syntax. If you are making a language, I would also like it if you modified your operators slightly so that whenever you are checking conditions, x = 5 means x == 5. Or just use something other than = for assignment operator so = can always mean equality.
Anonymous No.106302458
>>106302401
That's a damn shame, thanks for reporting your findings.
Anonymous No.106302534 >>106302555 >>106303569
>>106302145
is that an int enum or a string enum
Anonymous No.106302555
>>106302534
true
Anonymous No.106302909 >>106303569
>>106302145
>comparing enums
hashtable lookup + integer comparison

>token, type, symbol
what's the characteristics and goals of your language?
Anonymous No.106303569 >>106303598 >>106306223
>>106302534
its just "Enum" from enum. Tried the same timeit code with "IntEnum" and no difference

>>106302909
>what's the characteristics and goals of your language?
Uh its just a C compiler for my homebrew architecture. I've posted about it here before. I was just trying to refactor the parser to use enums instead of strings for the token types. Now my tests take 50% longer lol so I'm a little irked (still only takes ~0.15s to run 30+ tests)
Anonymous No.106303598
>>106303569
>its just "Enum" from enum. Tried the same timeit code with "IntEnum" and no difference
int enum is the default, so you basically replaced int enum with int enum
Anonymous No.106303621 >>106303769
>>106302145
Have you tried doing
if token.type.value == Token.SYMBOL.value:

instead?
(it's not a recommendation, I'm just curious to see the result)
Anonymous No.106303663 >>106303713 >>106306647 >>106307650 >>106308100
>>106289603 (OP)
This isn't 100% wrong tho, the actual file or program you're looking for doesn't need to be obfuscated behind 20 links while the code/fork/etc. tabs are out in the open
Anonymous No.106303713 >>106303787
>>106303663
do you go to a butcher's and raise a shitstorm that all the meat there is raw and you just want a medium cooked steak?
Anonymous No.106303769 >>106303976
>>106303621
Wow that's about twice as fast. still not as fast as just comparing strings

So at a million iterations each, the timeit results are
>just strings
~0.20s

>token.type.value == Token.SYMBOL.value
~0.46s

>token.type == Token.SYMBOL
~0.90s
Anonymous No.106303787 >>106304023 >>106304039
>>106303713
more like the butcher hiding the meat in a bag behind several containers and having the skin, feet, snouts, etc. easily accesible instead
Anonymous No.106303976 >>106304087
>>106303769
It's because for string constants with the same value it does not have to compare the actual strings. I forgot what was it called in programming languages that implement this but:
>>> a = 'asdf'
>>> b = 'asdf'
>>> a is b
True
Anonymous No.106304023 >>106306440
>>106303787
It's github, the code is the meat
Anonymous No.106304039 >>106306308
>>106303787
github is just SVN-ized git (ie. a centralized repository)
git is a version control system for source code, not a distribution system for releases
Anonymous No.106304073
>>106289603 (OP)
based picrel
fucking nerds
Anonymous No.106304087
>>106303976
interning
Anonymous No.106304737 >>106304797 >>106305001 >>106306629
Working on recreating 4chan in the gemini hypertext protocol. Can post and reply to threads and comments in text, and can add a custom ID using x509 client certs (which will append part of the cert hash for uniqueness purposes).
Anonymous No.106304772 >>106306642 >>106310807 >>106318349 >>106328100 >>106332877
are these any good?
https://de.humblebundle.com/books/ultimate-c-developer-masterclass-packt-books?hmb_source=

the previews look very dry
Anonymous No.106304797
>>106304737
can't be worse than the real one, good luck anon
Anonymous No.106305001
>>106304737
can it do a multi-input form instead of one input at a time?
can it at least do a textbox instead of single line text input for the post body?
Anonymous No.106305144
>>106289603 (OP)
>make a fucking .exe file and give it me
woa bro calm down, here's a link to my payment page. that'll be $19.99 plus tip
Anonymous No.106305353 >>106305561
>What are you working on, /g/?
Game tree search: expectimax with alpha-beta pruning, but there is one outcome per chance node that might eventually loop back to a previously visited chance node. So I have to return 2 parts: a known value + a loop object which consists of P(loop) + a canonical key for the node it loops back to. then i can resolve the loop when it gets back to the chance node the loop goes back to with conditional probability and solving a linear system of 1 equation and 1 variable. On the way back up to that loop i might encounter MAX or MIN nodes that run into loop objects but after drawing many diagrams i've set it up so that every max/min node that encounters a result with a loop object will be comparing 2 of the same loop object so they can ignore the loop object and compare only the known part. then alpha and beta have to be bounded by the max/min value of the loop component* the loop probability. current problem is i need to get memoization/caching working again because right now it might cache loop objects which would be stupid and they might not resolve properly. going to see if i can put results with loop objects in the cache with the hope that by the time we visit them again, the loop component will also have a fixed number in the cache, so when i look that up in the cache i can resolve it to a constant.
Anonymous No.106305561 >>106305610
>>106305353
what're you going to use that for?
Anonymous No.106305610
>>106305561
Finding the optimal strategy for a tabletop game from a magazine published in the 1980s. It has mythical creatures that fight each other by rolling dice. However, these fights happen on a world map, so I also want to make AI that can make tactical decisions on a world map - probably something something influence maps but I haven't gotten there yet. But first I need to make a battle success odds calculator so that AI will know what battles are worth fighting.
Anonymous No.106305785 >>106306014 >>106306629
>What are you working on, /g/?
Getting second core to work in my gayming console prototype.
I also improved how framebuffers are handled and wrote cpu heavy animation to test how does the system perform under heavy load.
Anonymous No.106306014 >>106306491
>>106305785
And here is how it looks
Anonymous No.106306223
>>106303569
>my homebrew architecture
as in something implemented on a fpga? I hope you do not mean a regular bytecode VM by that term
Anonymous No.106306308
>>106304039
>github is just SVN-ized git (ie. a centralized repository)
It's as centralized to how you work as you choose to make it. You can push code there and to other git repos as well; github can mirror other places.
Anonymous No.106306440
>>106304023
So is putting code on github just programmer circlejerking or is the code meant to be run and do something useful somewhere?
Anonymous No.106306491
>>106306014
That's pretty cool actually.
Anonymous No.106306629 >>106307250
>>106305785
>>106304737
>people actually working on interesting projects
when did /dpt/ get good again?
Anonymous No.106306642 >>106310389
>>106304772
>packt
lol
just read K&R and then Modern C
after that just dive into whatever field you want (drivers, OSdev, Unix API, Win32 etc etc)
Anonymous No.106306647 >>106306948
>>106303663
if there are no binary builds then it is likely the project is not aimed at random tech illiterate people
Anonymous No.106306948 >>106307023 >>106307233 >>106307540
>>106306647
I'm aware, but the ones that do have binaries are often obfuscated and hidden instead of being the first thing you should see (because 99% of people going there want the executable and not the raw ingredients)
Anonymous No.106307023
>>106306948
you're trying to assign some malicious intent that isn't there

if the authors really didn't want their application to be easily downloadable and executable, they could just not provide any released binary downloads at all
it's not obfuscation or hiding if the authors just don't bother going out of their way to make a binary download the first visible thing on a source code repository
Anonymous No.106307233
>>106306948
>click releases
>suddenly all binary builds are listed in front of me for convenience
wa-la
Anonymous No.106307250 >>106311792
>>106306629
It got good when the maids started coming back.
Anonymous No.106307540
>>106306948
>99% of people going on github want the executable
no
Anonymous No.106307650
>>106303663
this
they should just make a github page to present the software and provide direct download links
using the repo for this is just lazy and they don't care
Anonymous No.106308100
>>106303663
The Sherlock thing is a Python script therefore making an executable is too much pointless work. Distros come with Python and installing it on Mac/Windows is three clicks.
Anonymous No.106308149 >>106309427
>>106295478
That's actually really dope
Can you link to the repo
Anonymous No.106309427
>>106308149
project is not public yet, but I can paste you the scripts if you want
i'd be interested to look at other people's results
Anonymous No.106309608
>>106294377
volume control_333-final use this one.sh
Anonymous No.106310389 >>106310735
>>106306642
>K&R
isn't that out of date? it came out in march 88 and is almost exactly a year older than I am
Anonymous No.106310416 >>106310485
Newfag here, what am i supposed to use between Bazel and CMake?
Anonymous No.106310485 >>106310988
>>106310416
Meson
Anonymous No.106310522 >>106329364
Any of you use offline documentation viewers? How does Kiwix compare with Zeal docs? For what i can see Kiwix does the same thing but has more data sources.
Anonymous No.106310735
>>106310389
>isn't that out of date?
nope
>it came out in march 88
ksh88 also came out that year and still all command shells are based on it
Anonymous No.106310780 >>106311184
redpill me on modern C/C++ build systems
is cmake still the way to go or is there a new modern alternative?
Anonymous No.106310807
>>106304772
All obsoleted by LLMs.
Anonymous No.106310988
>>106310485
meson is the gnome of buildsystems
you'd better not have special usecases
Anonymous No.106310994 >>106310999 >>106311074
>>106289603 (OP)
I havent met anyone else who uses Geany
Anonymous No.106310999
>>106310994
only on the raspberry pi because pretty much anything else runs like shit
Anonymous No.106311027 >>106311147 >>106311977
I'm currently looking for a junior position.
I don't use AI much and I've turned off copilot because most of the time the output is just flat wrong,
but how much is AI actually used by developers? is it frowned upon or does nobody give a shit as long as it works?
Anonymous No.106311074
>>106310994
It was my first IDE, probably wouldn't have made it in tech if I didn't have something this simple to start with
Anonymous No.106311147 >>106311751
>>106311027
fine for getting a quick overview and getting your feet wet on some topic you don't know
treat it as interactive documentation but always double check, make sure to make it think longer or search the web, specially if talking about a very recent topic.
don't ever copy paste code from it though
don't ever write code you don't understand
Anonymous No.106311176 >>106311776 >>106312655
redpill me on dev VMs
why do some people do all their programming inside VMs? specially when stuff like WSL2 exist now
just a matter of keeping your host clean? aren't you missing out on being able to fully utilize your CPU/RAM and GPU acceleration?
Anonymous No.106311184 >>106311312
>>106310780
GNU Make
Anonymous No.106311312
>>106311184
POSIX make
ftfy
Anonymous No.106311497 >>106312016 >>106312054
>>106289603 (OP)
can I use a 64 bit hash for type and atom interning in a compiler without having to check for collisions?
if not, can I use a 128 bit hash?
Anonymous No.106311751
>>106311147
so, pretty common sense type stuff, then
Anonymous No.106311776
>>106311176
Software developers are autistic midwits who love missing forest for the trees, and some of them autism about VMs.
Anonymous No.106311792
>>106307250
Do not lump me together with the tranny shitposter, thanks.
Anonymous No.106311977 >>106312433
>>106311027
buy an ad
Anonymous No.106312016 >>106321602
>>106311497
no you cannot retard, but what you can do is have a global hashtable that associate identifiers to unique ids. with that you can just compare the ids and you're guaranteed to not have a collision problem
Anonymous No.106312054 >>106321602
>>106311497
>without having to check for collisions
no, that only works for a perfect hash (which has to be of something <= 64 bits if the hash is 64 bits - assuming you aren't wasting space)
this is like asking if a 1L jug can hold 5L (inb4 pressure/state)
Anonymous No.106312433 >>106312481
>>106311977
I don't follow
Anonymous No.106312481
>>106312433
yes you do
Anonymous No.106312655 >>106314652
>>106311176
>Why do some people do all their programming inside VMs?
Because that's what Microsoft already wants them to do. What exactly do you think WSL2 is? A Javascript framework? You can't run docker natively on Windows, you need features present in the Linux kernel. Also Hyper-V being an slightly lower hypervisor level with convenient defaults doesn't erase WSL2's nature as a VM.
Anonymous No.106314500 >>106323049
Going back to C. FUCK C++.
Anonymous No.106314652
>>106312655
>acskually WSL2 is a VM!
No shit. The point of my post is about traditional VMs.
Anonymous No.106316627 >>106316808
rewriting autohotkey scripts in C++/Rust/Go because nu-anticheats don't like autohotkey
Anonymous No.106316691
My sugarmommy's husbands son just installed vscode and the kilo cod extension on my machine. it's over for you, nerds.
Anonymous No.106316808
>>106316627
build the macros into your keyboard like a real pr
>Rust/Go
never mind
Anonymous No.106317201 >>106317559 >>106318794
i must go, my people have called me
Anonymous No.106317559
>>106317201
kek
Anonymous No.106317595
Spent most of the past couple of days optimizing a code path I'd not thought about much before. Turns out it was a pain point in some cases. So far, I've managed to cut 30% of the execution time from just looking at a few key bits; not bad for a bit under 2 days work, especially as there's a lot of other code inside that test that I've ignored..
Anonymous No.106318183 >>106318199
>>106289603 (OP)
What C programming certifications can I get in order to get a good paying C programming job? I don't want to go to college.
Anonymous No.106318199 >>106318336
>>106318183
Certifications are for IT faggots. Either you have a degree or you have experience. Good luck getting any entry level job without a degree.
Anonymous No.106318336 >>106318529
>>106318199
Can I get a job with experience? What kind of degree do I need?
Anonymous No.106318349
>>106304772
I'm currently reading this book.
Anonymous No.106318355 >>106318370
does this make sense if I want to chain equality up the inheritance hierarchy?
struct Base {
bool operator==(Base &base) {
return key1 == base.key1 && key2 == base.key2;
}

int key1;
int key2;
};

struct Derived : Base {
bool operator==(Derived &derived) {
return key3 == derived.key3 && key4 == derived.key4 &&
static_cast(*this) == static_cast(derived);
}

int key3;
int key4;
};
Anonymous No.106318370 >>106318468
>>106318355
do you intend it to be virtual? if so keep in mind the types might not match
Anonymous No.106318468 >>106321586
>>106318370
I was thinking of having base be pure virtual, actually that seemed better since I could then call the derived comparison operator directly on my base and use RTTI to determine if I can cast and then only if I cast and the compare matches do I return true. I didn't do that because of 2 potential issues

1. lots of duplicate comparison logic if Base has a lot of unique qualities since it can't hold the comparison function anymore and all the derived objects must
2. I don't know what to do in the event a derived object is derived further while still needing concrete implementations of the parent, since it can no longer be pure virtual to use it
Anonymous No.106318478
Reverse engineered the data structures that a custom malloc implementation uses in a vendor's product
Most interesting part was seeing how they retrofitted 32-bit pointers into what was originally a 16-bit software since the product dates from the 80s

I did it so I could get my hands on the raw data that the vendor's APIs didn't let me access
Anonymous No.106318529 >>106319632
>>106318336
>Can I get a job with experience?
Yeah if you're 35 with 10+ years as a software developer no one give a shit if you have a college degree or not. If you're a zoomie you best be pursuing CS, CE, or EE. Though honestly I am not sure I can recommend it anymore, anything that isn't DoD-related is full of troons and jeets.
Anonymous No.106318794 >>106319501
>>106317201
>drawtrk3
>func2
>func3
>vs-studio
>2kloc source files
>no terminal in sight
and yet still manages to build something interesting
you don't need muh riced linux setup with + minimal nvim/emacs to be a good programmer
write code instead of worrying about the details
based beyond comprehension, you motivated me
Anonymous No.106319233
realistically speaking
how fast is msvc cl compared to mingw64 gcc when targetting Windows?
Anonymous No.106319501 >>106319783
>>106318794
Idk man I just do what I have done at work since forever. It does build and run in linux with a regular old gcc makefile but I do most of my work with msvc then just go make sure it isn't broken in linux.
Anonymous No.106319585 >>106319654 >>106319711 >>106325935
#include
#include
#include

#define MAX_DEFERS 1024
#define CONCAT_IMPL(A, B) A##B
#define CONCAT(A, B) CONCAT_IMPL(A, B)
#define UNIQUE(X) CONCAT(X, __COUNTER__)

static jmp_buf gDeferStack[MAX_DEFERS];
static int gDeferIndex = 0;
static int64_t gDeferReturn;

#define DEFER(X) \
int64_t UNIQUE(_) __attribute__((cleanup(defer))) = gDeferIndex; \
if (setjmp(gDeferStack[gDeferIndex])) \
{ \
gDeferIndex--; \
X; \
__asm__ volatile( \
"jmp *%0" \
: \
: "r"((void *)gDeferReturn) \
: "memory"); \
} \
else \
{ \
gDeferIndex++; \
}

static void defer(int64_t *pIndex)
{
int index = *pIndex;

if (index == -1)
return;

*pIndex = -1;
gDeferReturn = (int64_t)__builtin_return_address(0);
longjmp(gDeferStack[index], 1);
}

int main()
{
puts("start");

DEFER(puts("a1"));
DEFER(puts("a2"));

{
DEFER(puts("b"));

puts("c");
}

puts("end");
}

:^)
Anonymous No.106319632 >>106328114
>>106318529
I'm 33 with pretty much no programming experience. I have never had a job before.
Anonymous No.106319654 >>106319711
>>106319585
maximum cringe. the only runtime things required to implement defer are static jumps
Anonymous No.106319711 >>106319903
>>106319585
>>106319654
I think they were going to implement defer in C in C2y, but I don't remember if that actually passed yet.
Anonymous No.106319783 >>106319944
>>106319501
C dev job? based
I wish my country wasn't just the usual webshit, java/dotnetshit or SAPslop job listings
Anonymous No.106319793
>>106302145
Use static classes. Don't use Python enums.
Anonymous No.106319802
>>106302167
Too long.
Anonymous No.106319903 >>106321611
>>106319711
yes it's possible, but I'll never use a C standard newer than C99 myself so whatever.
Anonymous No.106319944
>>106319783
Some C, mostly C++ at work. Whiplash was written in C though so I'm keeping the decomp project pure C.
Anonymous No.106321458 >>106321974 >>106322441 >>106323577
>>106289603 (OP)
I'm building a little ray-tracer (no graphics card stuff, just using the cpu). So far it's been fun to make. I started it basically passing around all my vectors, tuples etc by reference but got pissed off with the inability to chain function calls due to this so I just changed it to pass pretty much everything that isn't the canvas by value instead. Unexpectedly it has doubled the speed of the program (pic rel down from 1s to 0.4s to render on my shitty system). My question is, is there a inflection point to where passing by reference is better than passing by value or is it just one of those things that you have to play around with?
Anonymous No.106321586
>>106318468
i imagine every implementation needs to be
T::operator==(const Base& other) const { ...
if (auto ptr = dynamic_cast(&other)) {
... compare this against ptr
}
}
you could have T::operator==(const T& other) const as another overload to simplify this, which could call T's superclass
Anonymous No.106321602
>>106312016
I don't think you understand, cue the image of small brain shouting.
Do tell me where I was talking about identifiers?

>>106312054
eh, collisions are unlikely enough for me to just ignore them. so I will
Anonymous No.106321611 >>106321781
>>106319903
you should, C11 was terrible, the newer ones seem to be better
Anonymous No.106321781
>>106321611
c11 did nothing wrong
Anonymous No.106321792
>>106290958
>memset blocks your path
Anonymous No.106321974
>>106321458

Also learning raytracing in C. Happy to hear that my "functional" and "use pure functions" mantras, won't hinder my code in future chapters.

> is there a inflection point to where passing by reference is better than passing by value or is it just one of those things that you have to play around with?

I guess it depends on the compiler optimizations, and on the size of the struct. Haven't thought of optimizations yet. Only now maybe "helping" the compiler by adding "const" to function signatures where applicable.
Anonymous No.106322136 >>106322423 >>106322539 >>106322677 >>106329364
How the FUCK do I finish a personal project? I have so many half-baked pieces of shit I'm starting to feel like a fraud even after 8 years of doing this professionally.
Anonymous No.106322423
>>106322136
just... keep going?
that's the literal advice, more helpful advice would have to be tailored to you more personally. why do you don't finish projects?
do you do the easy stuff first, and then lose interest once the more difficult architectural problems rear their head? do you lose interest outright?
Anonymous No.106322441 >>106325145
>>106321458
the inflection point usually is once the the structs get too large. problem with pointers is that it might hurt cache/register locality and optimisation opportunities, if the compiler can't prove that pointers don't alias, problem with values is that passing(ie copying) large structs might be quite expensive.
but speaking about optimisation specifics generally is quite difficult. do a perf record on your old pointerful code to find out where it accrued its excess runtime.
Anonymous No.106322539
>>106322136
Keep notes, so that you could take a break and then context switch back into doing project.
Anonymous No.106322549 >>106322581
Yo /dpt/ what keeps you motivated? I haven't done much programming for the last two years. After learning enough JS frameworks to start making some cool web dev projects I applied for a relevant job and even had a friend on the inside who handed my application to the hiring manager. I did a bunch of research on their website and goals. I came prepared with a demo demonstrating an overhaul of their website(it was pretty dated and amateur) had the answers for all of their questions. I still didn't get the job and my insider friend told me the group of managers that interviewed me all agreed I was the most qualified applicant. They decided to hire a family friend. They even implemented some of the ideas I gave them(The dead simple ones anyone could do) Ever since then I haven't had any motivation to program. I get cool ideas for projects and even decided to add rust to my stack. I just have no motivation to do any of the course work I have or make any of my ideas a reality. I have been doing cyber security and CTF which are borderline script kiddie stuff but it's engaging and fun. It keeps giving me ideas for tools/projects I could make. What keeps you guys going?
Anonymous No.106322581
>>106322549
>what keeps you guys going?
it's fun
learning is fun
Anonymous No.106322630
Y'ALL COWARDS WON'T EVEN BRING /prog/ BACK
Anonymous No.106322677
>>106322136
>How the FUCK do I finish a personal project?
work only on projects that will be used (either by you or someone else), don't write just for the sake of writing
Anonymous No.106322699
>>106289603 (OP)
This FAANG dev I know wants me to build more web apps with sockets but most web apps are never run by anyone and just site on domain using up my server time.

I would rather build niche C apps that only I can use and that actually solve a problem in my life. Maybe I'll split the difference and write web assembly.. What's the correct path?
Anonymous No.106322865 >>106322955 >>106327103
std::map myMap = {{"one", 1}, {"two", 2}, {"three", 3}};

Is there a way to return or access map keys instead of values? Like if I wanted to iterate through a map and assign the string and int to an object
Anonymous No.106322955
>>106322865
Map keys "have" to be const, you'll break the container by assigning to them. Extract the existing node, change it and put it back, so that it could be inserted to the correct place inside the tree.
Anonymous No.106323049
>>106314500
You will NEVER be a woman, you will NEVER be an embedded developer
Anonymous No.106323577 >>106325145
>>106321458
If it fits in a register (according to the ABI: https://www.agner.org/optimize/calling_conventions.pdf ) its more efficient to pass by value. Passing float vec4s by value should be fine since they fit in a single XMM register. Returning by value is also typically fine, again depends on the ABI, but on x86-64 the caller allocates the stack space to avoid having to copy the return value. Passing by value also let's the compiler make better aliasing assumptions, you can probably get close by annotating pointer arguments with restrict but this changes behavior if you did something like vec_add(&a, &a). Restrict is a can of worms but if you care about performance you have to use it: https://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html
Anonymous No.106325144 >>106325180 >>106326759
If C had metaprogramming it'd be hands down the perfect language. I'm trying to cope with clang plugins but they're very clunky.
Anonymous No.106325145
>>106322441
>>106323577
Awesome thanks for the info guys :)
Anonymous No.106325180 >>106325706
>>106325144
If C had metaprogramming, everyone would just waste all their time reinventing OOP instead of reinventing hash tables.
Anonymous No.106325268 >>106325301 >>106325346 >>106325408
Any opinions on C3, Zig, and Odin?
I'm falling into the tsoding mentality meme about recreational programming. And even if it weren't solely for recreation, I'm kind of interested in the idea of using a not so known program to try and do systems and/or game dev with. So I'm more or less interested in picking a memelang like the ones I mentioned, or sticking to either C or Rust.

Please let me know what you think.
Should I just focus on C++ and get a job?
Anonymous No.106325301 >>106325491
>>106325268
Odin is quite decent, and the best of the three.
Anonymous No.106325346 >>106325491
>>106325268
I also like Odin like the guy above. It's a nice language to use. Stays of your way, no complex build system, good stdlib with all the allocators you could need if you want to use them. If you try it just make sure you compile with 'o:aggressive' or you'll get shitty performance. Never tried C3 but it's on my list. Zig is changing too much for my likes to take it seriously atm. Maybe in a few years time it will be worth a shake. A lot of people like it though.
Anonymous No.106325408 >>106325491
>>106325268
>Any opinions on C3, Zig, and Odin?
They are like the myriad of JavaScript based languages. They exists only because someone thought "I can do this better" and nothing more. They do not solve any issue dire enough to justify learning language/abandoning current ecosystem and often get drag down by retarded opinions and design decisions(looking at you Adrew)

>And even if it weren't solely for recreation, I'm kind of interested in the idea of using a not so known program to try and do systems and/or game dev with. So I'm more or less interested in picking a memelang like the ones I mentioned, or sticking to either C or Rust.
Why even use C style languages then? Why not something more esoteric like niche functional languages, or maybe some modern APL-style language? This is going to be more interesting and teach you more stuff than making a game in a C v2.0.0
Anonymous No.106325491
>>106325408
>Why even use C style languages then?
I precisely want to try to stick to C style. Not interested in going too esoteric. After learning a decent amount of Rust, I'm not interested in anything else but C style.

>>106325346
>>106325301
Yeah I was leaning towards Zig but Odin seems to get more hype with less of the Zig cons like, being extremely far from 1.0
I will probably check it out.
Anonymous No.106325706 >>106325954
>>106325180
I just want #[derive(Debug)]
But not that shitty C++ version
Anonymous No.106325935
>>106319585
Is that part of a game?
Anonymous No.106325954
>>106325706
Write your own. C is easy to parse.
Anonymous No.106326759 >>106326865 >>106326905
>>106325144
>it'd be hands down the perfect language
You can't even make system calls in C, you have to call the libc wrapper.
Anonymous No.106326865 >>106327071
>>106326759
>You can't even make system calls in C, you have to call the libc wrapper
Did you expect the language to predict how every operating system in a certain architecture does system calls?
Anonymous No.106326905 >>106327071
>>106326759
why should there be a standard way to make system calls? what if there is no concept of a system call for the platform you're working on?
Anonymous No.106327071 >>106327121 >>106327132
>>106326865
System calls would look like function calls and the compiler would generate code using the appropriate conventions, just like any compiler backend would. Regarding the system call number, yes, it would specific to your particular OS and you program/library would use #ifdefs basically.
>>106326905
Then use #ifdef and do the appropriate thing for that weird OS. It's a good thing that some feature can't be compiled to a particular get because the alternative is to be forced to use the common demonitor for everything.
Anonymous No.106327091
*the common denominator
Anonymous No.106327103
>>106322865
yes but you shouldn't modify the key in a way that changes the order except destructively by removing it from the map with extract
Anonymous No.106327110 >>106327200
Let's say I have a 16-bit, unsigned program counter in C. I want to be able to branch within [-128, 127] bytes relative to that program counter. The one byte offset that I read in is treated as an 8-bit, unsigned integer. How can I accomplish this? Can I just cast the latter to a signed integer and add the two?
Anonymous No.106327121 >>106328070
>>106327071
>use #ifdef
That's an implementation detail.

The question is, how are you going to specify this in the standard. "Just do whatever is appropriate for the OS" is not how you standardize stuff.
Anonymous No.106327132 >>106328070
>>106327071
All that work in all compilers for what reason?
System calls are ABI specific, so there's no advantage in making something like syscall(3) keyword
Anonymous No.106327200 >>106327326
>>106327110
I never trust C implicit conversions, but it seems they just work.
Anonymous No.106327326
>>106327200
Wait, what. I meant to cast int8_t, not int16_t. But I guess it works both ways.
Anonymous No.106327711
movsx =/= movzx
Use pc + (int8_t)offset
Anonymous No.106328070 >>106328085 >>106328436
>>106327121
Preprocessing's #ifdef is an implementation detail, but you can have any other compile time conditional mechanism for the same purpose.
For exmaple, if you'd be writing a more or less system-independent wrapper for the the write system call and you have #ifdefs for several particular OS x architecture, you would write in each each branch syscall(....) but in each branch the number, order, type of arguments and system call number would different. The rest is left for the compiler.

For language standard. Syntactically, function calls where the identifier is "syscall" would system calls. There wouldn't be builtin semantics associated with it, at least not more than function call to externally linked functions. Instead, the would import a "header" (implementation details not important) that would contain all "function call" declarations for all the system calls, so that the front end can type check the system calls. However the type system should be expressive enough to express the fact that some system calls can arbitrarily mutate the memory and things like that.

I am aware this fuzzies the line between the "systems language" and the compiler but I think it should be that way. To me, systems languages are tools to produced compiled code by any means necessary, they shouldn't be considered as a "platform" in the Muratori, they shouldn't be considered as the product. The final product is the architecture and ELF compliant executable/shared object.

>>106327132
>All that work in all compilers for what reason?
Because your input program file and the compiler should be enough. You should be able to make bare system calls and not be required to call a system call wrapper and forced to link to an external library. It's fine in a lot of languages but not in a systems language imo.
Also, the compiler's input is really an IR and that IR should contain a syscall op. If the language doesn't have a syscall construct, the front end can't genrated a syscall IR op. ...
Anonymous No.106328085
>>106328070
... That's just wrong.
Anonymous No.106328100
>>106304772
just pirate it and skim through it.
Anonymous No.106328114
>>106319632
the job market will probably (possibly) bounce back before you hit 40. just hang in there anon.
Anonymous No.106328436 >>106328516
>>106328070
Makes no sense for the compiler to handle system calls that are different in each ABI instead of the operating system providing the library for it, each minimal difference would need an entire compiler update
Anonymous No.106328516 >>106329542 >>106330137
>>106328436
It's you that are not making any sense. You're essentially saying that the compiler should never generate system calls and that they should be instead written in assembly by the one making the wrapper. It may be ok for windows where the system call table isn't publicized but it's non sense for OSes with stable system call tables and ABIs.
Handling different ABIs is part of the compiler's job.
>each minimal difference would need an entire compiler update
You mean in the cases of OSes like Windows where they can change there ABI when they want? Even in that case, you certainly don't need to rewrite the entire compiler for dealing with this, this is non sense.
Anonymous No.106328730
I just came up with a neat portable, decentralized auth system. I feel like someone probably has done this before, but it's inspired by both bluesky's domain verification system as well as gemini's client cert identification system, but for the web generally.

You create a client certificate with a Subject of CN=username@mydomain.com. In Powershell:

New-SelfSignedCertificate -Subject "CN=username@mydomain.com" -CertStoreLocation "Cert:\\CurrentUser\\My" -KeyUsage DigitalSignature,KeyEncipherment -Type Custom -KeySpec Signature -KeyLength 2048 -KeyAlgorithm RSA -HashAlgorithm SHA256


Then get the thumbprint of that cert:

$> Get-ChildItem -Path "Cert:\\CurrentUser\\My" | Where-Object {$_.Subject -eq "CN=username@mydomain.com"} | Select-Object Thumbprint

# Thumbprint
# ----------
# 400E0A39A5E08DDFA30A0292A9C4EDFD40375F92


Then, in your domain registrar, you create a TXT record with the format

_identification.username.mydomain.com=400E0A39A5E08DDFA30A0292A9C4EDFD40375F92


A participating server would configure its TLS settings to request (or require) a client certificate. The browser would then challenge the user, and they'd pick the certificate they want (With Subject of CN=username@mydomain.com)

When then server accepts the connection (configured to accept all self-signed certificates), it would then send a TXT record request against _identification.username.mydomain.com and compares the thumbprint in the client cert it received to the value of the TXT record. If they match, the server can then attest that the user is, in fact username@mydomain.com, and allow the user to sign all content with that name, without requiring the user to create an account on the site. Portable identity across the internet! You can take it even further by storing PGP keys in a TXT record and allow E2E messaging with various clientside apps.
Anonymous No.106328922 >>106329008
>>106296477
>koikatsu-like cards for his own imageboard
not any of those anons or have any idea what the discussion is about but im really curious as to what these cards are. Is it some unique feature on a niche imageboard?
Anonymous No.106329008 >>106329376
>>106328922
It's a hentai game where you can download new characters in PNGs, their hair, personality, etc data is embedded inside of it
Pretty nice to just drag and drop them into the game
Anonymous No.106329020 >>106329031
Hello I'm anon and I'm a total fucking retard.
Anonymous No.106329031
>>106329020
Hello retard, well met.
Anonymous No.106329364
>>106310522
I'll answer myself. Kiwix's UX was garbage, their webview thing took ages to load anything and isn't practical to switch between pages. This was using a native .deb. Maybe is just not optimized for this use case. For offline programming documentation, i'll stick to Zeal.
>>106322136
Suffering through that right now, i want to get rid of many half assed Python scripts i've wrote over the years cause they require requests (which is basically abandoned) and also i ended hating this bullshit ecosystem.
Anonymous No.106329376 >>106329408 >>106329420 >>106329441
>>106329008
>you can download new characters in PNGs, their hair, personality, etc data is embedded inside of it
>Pretty nice to just drag and drop them into the game
so something like a QR code saved to a PNG file that works as a save file?
Anonymous No.106329402 >>106330229
>>106289603 (OP)
>What are you working on, /g/?
Coding bootcamps and projects that teach me Python, Data Science and AI to land a better job role

I'm learning the basics, then working on building projects, any advice?
Anonymous No.106329408 >>106329441 >>106339345
>>106329376
I'm not sure if it's embedded in the pixels or the metadata, but it's not visible in the image (which is just a preview of the character)
Anonymous No.106329420 >>106339345
>>106329376
NTA, QR codes are designed to be read by a camera. Games like this encode the binary data using steganography or just attach it as a metadata. They use lossless encoding so you do not need to make it resilient to noise and obvious like a QR code.
Anonymous No.106329441 >>106339345
>>106329376
>>106329408
Koikatsu stores serialized character data in a custom chunk, usually named ILLU or KoiKatuChara.
This chunk is zlib compressed with data such as Body, Hair, clothing, colors, textures, Personality, voice, traits, Metadata, etc etc..

The custom chunk is usually placed after the image data (IDAT) and before the IEND chunk.

A normal PNG viewer just ignores it, so you still see a valid image.
Anonymous No.106329542 >>106330076
>>106328516
MacOS system calls aren't publicized either and you have to go through libc or libSystem, otherwise your shit breaks.
Anonymous No.106329746
[script]
// ==UserScript==
// @name 4chan WebP/AVIF Converter
// @version 2025-08-19
// @description Automatically converts webp and avif images to png or jpeg
// @author Anonymous
// @match https://boards.4chan.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=4chan.org
// @grant GM_addStyle
// @grant unsafeWindow
// ==/UserScript==
[/script]
https://pastebin.com/yV6bEA3a
Anonymous No.106329762 >>106331323
// ==UserScript==
// @name 4chan WebP/AVIF Converter
// @version 2025-08-19
// @description Automatically converts webp and avif images to png or jpeg
// @author Anonymous
// @match https://boards.4chan.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=4chan.org
// @grant GM_addStyle
// @grant unsafeWindow
// ==/UserScript==

https://pastebin.com/yV6bEA3a
Anonymous No.106329872
Anonymous No.106330076
>>106329542
In this case it's fine, if the compiler doesn't know it doesn't know. I'm just saying that if the syscall table is known, then the compiler should be able to generate system calls directly.
Anonymous No.106330089
>>106289603 (OP)
I joined a nonprofit to setup a prosody server and the first thing they ask me is do you know docker
I said no
They said welcome aboard
Anonymous No.106330137
>>106328516
It does make sense to make those things as libraries instead of compiler code, since they have different maintainers and priorities
GCC is already massive as is, imagine including every single operating system ABI calls? All because someone doesn't want to use a library for some unexplained reason?
C is written to be ported easily to any architecture, not to sacrifice reasonableness in name of convenience, that's what C++ does
Anonymous No.106330229
>>106329402
>I'm learning the basics, then working on building projects, any advice?
Have fun!
Anonymous No.106331323 >>106331367
>>106329762
What language is that?
Anonymous No.106331367
>>106331323
It's javascript for a browser extension.
Anonymous No.106331565
we need a zawinski's law for vibecoding but instead of email it's machine learning
Anonymous No.106331660 >>106331916 >>106332157 >>106332226 >>106337137
I like Jai conceptually and the features it offers, but I can't get over the syntax. shit like
foo :: (a: type, b: type) -> type

makes me vomit. the types after var names and need for a colon (extreme colon use in general) is especially triggering. I get that it's better for the compiler but I will never not hate that format. Also the rabid use of auto (implicit). auto should never be allowed ever, what a cancerous keyword
Anonymous No.106331916 >>106332257
>>106331660
It's so that the explicit and inferred declaration syntax is near identical, just with the type absent. Compared to C++'s retarded declarations requiring a fake type auto for the declaration syntax to differ from assignment, it makes sense. There are many other retarded syntax design decisions in Jai, but I don't think name: type = initializer is controversial.
Anonymous No.106331969 >>106332101
>>106296477
You are probably correct that abandoning Maid Card is the pragmatic move to make. But then it raises the question, how do maids share software without it? I'm not sure what the last part of your post means. I have never seen maids post about culture wars issues. Most of them seem to not care about US politics at all and they usually only discuss programming or maids.
Anonymous No.106332101
>>106331969
>how do maids share software without it
Any git site would work, I prefer github since it's the most visible one
>about culture wars issues
Eli refuses github because it's owned by microsoft, but my point was that maids were slowly becoming another "side" of this board dramas
People start with the anti-janny populism, but nobody wants to fix the actual problem, which is pretty much a replica of culture wars with another clothes
"Cultural fief" is a modern internet pattern that people hardly notice, which is basically any minor disagreement becoming complete secession and hostility. I don't wanna point out examples that happened in the board to not trigger any specific group
Anonymous No.106332157
>>106331660
I understand the purpose for ::, but I don't like that it's necessary for things like function declarations which are themselves always necessarily known at compile time, so it's just redundant.

I'd rather just have a function keyword. Also -> for return type sucks too.

I don't see the problem with auto being baked into variable definitions in absence of a type though. Especially if the language is very strictly typed, which it is. That part is fine with me.
Anonymous No.106332226 >>106332263
>>106331660
>foo :: (a: type, b: type) -> type
Anonymous No.106332257
>>106331916
>I don't think name: type = initializer is controversial.
there should an explicit var or let keyword for declaring variables, it's easier to read than ":="
I hate := with a passion.
Anonymous No.106332263
>>106332226
the teacher?
Anonymous No.106332420
I believe it's possible to be really cracked at something but also having 7-8 hours of sleep per day + good friends to hangout with.
Anonymous No.106332512 >>106332605
Anon, How to retrieve pattern table list and number of pattern song in .mod music tracker files from scratch without 3rd party libraries using c?
Anonymous No.106332605
>>106332512
https://web.archive.org/web/20100921225940/http://io.debian.net/~tar/debian/xmp/xmp-2.7.1/docs/formats/Ultimate_Soundtracker-format.txt
Anonymous No.106332625
>>106289603 (OP)
I want to make a porn website
Anonymous No.106332877 >>106333250 >>106338144
>>106304772
Unironically don't read books about programming. I'm sick of stupid zoomer faggots at work reviewing my code telling me not to do this and that because retard Uncle Bob's book said it's wrong. Get your own ideas from experience.
Anonymous No.106333250 >>106333304
>>106332877
Your colleagues are tired of putting up with your idiosyncratic bullshit.
Anonymous No.106333304 >>106333423 >>106333740 >>106338152
>>106333250
Some fag asked me to delete all comments because the rest of his code doesn't have a comment and because it goes against Uncle Bob's "Clean Code" philosophy. Imagine, there are retards out there who actually think the average code has too many comments in it if it has any comments, because of a retarded book they read written by a hack. Only a zoomer who only worked on one project (which was the case for him) could believe that.
Anonymous No.106333423
>>106333304
This is pretty bad. Why don't you rewrite what the sections he wrote and replace his code by yours? That will make him understand.
Anonymous No.106333740
>>106333304
what was in the comments?
if you're just narrating what the code does, eg.
//assign the user
item.assign(user);
then the fag is completely right

comments should only explain purpose why something is there or done in a certain way, not just describe what the code does
Anonymous No.106334159 >>106334424 >>106334647 >>106334683
How do I go from a tutorial andy to building real software, not toy projects.(rust btw)
Trying to make anything impressive outside of web stuff feels pretty hard.
Anonymous No.106334424 >>106334539
>>106334159
>rust
fuck off tranny
Anonymous No.106334539
>>106334424
Arch as well... Sorry...
But actually I'm not a tranny, sorry.
Anonymous No.106334647 >>106335115
>>106334159
>How do I go from a tutorial andy to building real software
Pick a real problem to solve.
Anonymous No.106334683 >>106335115
>>106334159
A penectomy makes you into a Rust wiz
Anonymous No.106335115 >>106335294 >>106335726
>>106334647
That's the thing though.
Nobody needs a new browser, game engine, GUI for some random shit...
In my opinion, everything that the average user ever needed has been made a million times over by people who thought they could reinvent the wheel.

The way I see it currently is that all that is left is digging trough some obscure github repos trying to contribute by fixing bugs that require insane technical knowledge of not just programming but computer science concepts in general.

I thought of making a rust UE5/4 compatibility plugin but uh yeah that has also been already done(and abandoned)

>>106334683
Sorry I'm not trans
Anonymous No.106335294
>>106335115
My first actual Rust projects were graphics related. Things like renderers, raytracers, game of life, etc. Programs like this are more interesting to work with than basic CLI tools, while also being fairy small and self contained, no need to interface with the outside world except to display the result. They can teach you how to properly do multithreading and how to go fast, while also giving you nice things to look at. It's a good place to get comfortable with using Rust.
Anonymous No.106335726
>>106335115
>abandoned
sounds like that niche opened back up
Anonymous No.106335995 >>106336127
test "Increment":
func increment(x: var int)
{.Post: [x > `x@old`],
Pre : [x < int.high].} =
x = x + 1

func increment(x: int; cnt: int = 1): int
{.Pre : [x < int.high],
Post: [result > x].} =
x + cnt

var x: int = 1
increment x
assert x == 2

let y: int = increment(6)
assert y == 7
Anonymous No.106336127 >>106336213
>>106335995
1) collecting constraints
2) solving the constraints

https://en.wikipedia.org/wiki/Fourier-Motzkin_elimination
https://adriann.github.io/linear_optimization/fourier-motzkin.html
Anonymous No.106336213 >>106337063 >>106337127
>>106336127
Are you implying automatically generating constraints?
Anonymous No.106336799 >>106336866
>>106289603 (OP)
Does proper string & grapheme handling need complex compiler handling or is it just a library issue? Do programming languages that support utf8 (truly, not like java or js or C#) allow illegal unicode sequence?
Anonymous No.106336866
>>106336799
Handling utf-8 on code point level is easy and can be done with relatively short code that is future proof. That's all you need for 99% of cases, including validation.
Graphemes is when things start to require non-trivial code and tables that you need to update periodically. You mostly likely do not need to worry about graphemes unless you are trying to render text and/or write an editor.
Anonymous No.106337063 >>106337380
>>106336213
Not yet, I'm just thinking about it. The solving part is the easy part, it's just applying the algorithm.
The collecting part is the hard part. It would be easy for a pure functional language but for an imperative language with loops and mutation it's more complex. That's why I think transforming the loops into tail call recursion and eliminating the mutability with SSA (a variant of it in fact), it should become easy to collect the constraints. In theory...
Anonymous No.106337118
>>106289603 (OP)
this is a fair criticism of github, it was clearly made by an someone with no idea of good user interface design. this is why an engineer always needs a team. by yourself you don't realise how bad you are at some things.
Anonymous No.106337127 >>106337380
>>106336213
Yes. I thought you meant "Are you implementing".
Anonymous No.106337137
>>106331660
>:
>(
>>
Imagine needing to hit the keyboard 40 time to get 33 chars out.
Anonymous No.106337380 >>106338218 >>106338237
>>106337063
>>106337127
Yeah, I am just experimenting with pragma-based contracts like Ada. At some point I'll have a look at using Z3 for static proofs, but having dynamic ones is easy and nice.
>That's why I think transforming the loops into tail call recursion and eliminating the mutability with SSA (a variant of it in fact), it should become easy to collect the constraints. In theory...
I assume you would then only have to write the postconditions and have the preconditions generated with no need for loop invariants? This sounds extremely hard to do generally and, at the very least, I'm sure you'd need a language with very precise and strict semantics.
Anonymous No.106337503 >>106337699 >>106341423
https://youtu.be/xjQ-uQNEEpM IT WERKS
Anonymous No.106337693 >>106341639
Why doesn't the vscode C extension know about auto even when you set the standard to C23
This shit is retarded
Anonymous No.106337699 >>106337752 >>106337835 >>106338019
>>106337503
Don't get involved in any emu or reverse engineering communities. I've seen several instances where they doxx and push a lot of people to become an hero.
Anonymous No.106337752
>>106337699
Having bad opsec is a skill issue.
Anonymous No.106337835
>>106337699
>Don't get involved in emu or reverse engineering
Glowies get funnier everyday
Anonymous No.106338019
>>106337699
You know I tried at the beginning thinking I wasn't smart enough to figure out reverse engineering on my own looking for some help from more experienced people but the only people who have contributed to the project are 4chan /o/tists and randoms who just stumbled across it on github. Also the people in the reverse engineering chats think I'm some kind of wizard now who makes reversing look easy. Idk man. I guess the smart ones are too wrapped up in their own projects.
Anonymous No.106338144
>>106332877
>because retard Uncle Bob's book said it's wrong

Uncle bob is not just retarded, he should be jailed.
Anonymous No.106338152 >>106338224
>>106333304
>Some fag asked me to delete all comments because the rest of his code doesn't have a comment and because it goes against Uncle Bob's "Clean Code" philosophy. Imagine, there are retards out there who actually think the average code has too many comments in it if it has any comments, because of a retarded book they read written by a hack. Only a zoomer who only worked on one project (which was the case for him) could believe that.

Based.

I just got told that at a certain company, no comments are allowed (they use SonarQube to do the filtering).

What a bunch of dimwits.
Anonymous No.106338218 >>106338843 >>106340388
>>106337380
>I assume you would then only have to write the postconditions and have the preconditions generated with no need for loop invariants?
No it's like that, it's not a check point thing where at state X a predicate must be satisfied. Not really. The inequality would be part of the system so every single operation on variables is validated by the type checker.

The type system would allow arrays to have a size part of the type system. For example
struct array {
char *array[len] where len == length; // length being the field below
size_t length;
size_t capacity;
};

When you have the pointer struct array *myarray, the variabe size_t i, at the place in the function where you do array[i] for loading or storing, the variable i must satisfy the system of inequations: 0 <= i && i < myarray->length.
This function would type check
char array_at(struct array *myarray, size_t i)
{
if (i < myarray->length) { // no need to check >= 0 because size_t is unsigned
return myarray->array[i];
}
return 0;
}

because the expressions of the conditionals have been collected has constraints and you can't be in that branch and be out of bounds.
but this function wouldn't type check
char array_at(struct array *myarray, size_t i)
{
if (i < myarray->length + 1) {
return myarray->array[i];
}
return 0;
}

All this comes from ATS. There are a few presentations on youtube.
>I'm sure you'd need a language with very precise and strict semantics.
definitely
Anonymous No.106338224
>>106338152
brb writing an expensive book about the No Cargo Cults rule
Anonymous No.106338237
>>106337380

Concerning loops, I'm not super sure what's required but it doesn't involve something like transforming a loop computing a sum into a formula for example, it's much simpler than that. Also, if the constraints collected are more complex than linear relations, the type system bails and it would be the programmer that would need to prove that the program is well typed. That's where it gets ugly. Hopefully situations like that shouldn't be too frequent.
Anonymous No.106338843 >>106339174
>>106338218
These sound like subtypes, but apart from Ada very few languages properly support them properly without going overkill into concepts or similar. Arrays in Ada are:
type Array_Type is array(Positive range <>) of Integer;
My_Array: Array_Type(1 .. 8);

Where you can see "Natural" is already a subtype which must then be further constrained on declaration (the box <>). So, every Ada array has to have a subtype for its bounds which is then carried around as a fat pointer.
A lot of preconditions are just solved by subtypes and I think it is criminal that so many languages don't have them.
Anonymous No.106339174 >>106339193 >>106339315
>>106338843
>So, every Ada array has to have a subtype for its bounds which is then carried around as a fat pointer.
Ada can have safe array indexing and safe pointer arithmetic? That's what the type system I showed you also provides, except that it doesn't require hidden bound-checks behind the scenes. The type system verifies that the runtime conditiona explicitly written by the user guarantees there can't be out of bouds accesses. This means you have safe array indexing and pointer arithmetic without any overhead compared to regular C. It's beautiful.
Anonymous No.106339193 >>106339267 >>106339315
>>106339174
>without any overhead
>code overhead of proving everything to the compiler
Anonymous No.106339267 >>106339274
>>106339193
runtime overhead, the only overhead that matters
Anonymous No.106339274 >>106339315
>>106339267
>take C program that takes 3m to compile
>it now takes 3h
Anonymous No.106339315
>>106339174
Depends what you mean by pointer arithmetic. In the general case, there is no way to verify it so you have to have some sort of additional knowledge about it. You can use overlays in Ada to apply array semantics to memory, but anything to do with a pointer carries the caveat that pointer is valid and your assumptions about the memory block are correct.
>>106339193
>>106339274
You don't run static provers every time you compile, tard-kun
Anonymous No.106339345 >>106339784
>>106329408
>>106329420
>>106329441
I see, that is pretty interesting. I am guessing since there is data being strored sharing the image becomes an issue because "what if" said data that is stored is "malicious"? I have always wanted to build and set up an image board but I feel like stuff like that makes it a bitch to deal with.
Anonymous No.106339784
>>106339345
The data is almost surely not code but just serialized values of character editor's sliders, options, strings, etc. You only really have to worry about typical serialisation vulnerabilities like buffer overflows or invalid values.
Anonymous No.106340001
Next thread:
>>106339960
>>106339960
>>106339960
Anonymous No.106340388 >>106341220
>>106338218
no offense, but i don't think you've thought this through.
>i < myarray->length + 1
if you can't even handle this level of type invariance on bounds-checking, you've just got an overly complicated inexhaustive bounds-checker for arrays that's annoying to use.
is there a reason you're poorly reinventing dependent types rather than just implementing a dependent type system?
Anonymous No.106341220 >>106341230
>>106340388
>>i < myarray->length + 1
>if you can't even handle this level of type invariance on bounds-checking,
I have no idea what you're saying. This should fail type checking as expected because this is out of bounds.
if i == myarray->length, i is out of bouds
>inexhaustive bounds-checker
my description show that it's inexhaustive, quite the opposite
>is there a reason you're poorly reinventing dependent types rather than just implementing a dependent type system?
You are continuing to write bullshit based on misunderstanding. This type system is a subset of dependent types and it's perfectly fine, just because it's a subset doesn't mean it's incomplete or unsound. Since when do type system should be all or nothing?
I don't remember if dependent types are Turing Complete or undecidable but I think there is an issue with them being too powerful. For this reason they are not suited for a systems PL, compilation needs to happen.
Anonymous No.106341230
>>106341220
>my description show that it's inexhaustive, quite the opposite
*doesn't show that it's inexhaustive
Anonymous No.106341423
>>106337503
>bass brap sounds
Anonymous No.106341639
>>106337693
Use the clangd one