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

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


Janitor acceptance emails will be sent out over the coming weeks. Make sure to check your spam folder!


[Advertise on 4chan]


File: 1358677227600.png (446 KB, 715x600)
446 KB PNG
What are you working on, /g/?

Previous thread: >>109460960
>>
>just look at how cryptic and advanced it is
So that's your fucking take? You can't be serious.
>>
>>109505781
i wrote an abstraction layer for opencl
theres a couple details to take care of, a couple more parameters to add, but its functional

it was actually fukken hard. the hardest part is to hide as much as one cans but still expose as much as possible
the game consists in balancing these two contradictory drives

if anybody wants it, i can post it
its error checked, sane defaults, you can hook your callbacks
although its still a wip
>>
>>109505790
Write a real program
>>
>autistic projection
And that's why normal people want to see you and your entire family up to two generations violently destroyed in front of national television.

>and for the record: I JUST finished writing yet another program
>no, without LLMs
>which is why normal people actively take PRIDE destroying your existence
>because your autistic projects mark you as a non-human for everyone to see
>>
>>109505826
... come on now: >>109492134
>>
>>109505899
no smart pointers to be found here
just containers for metadata, pointers to associated structures

look at the bottom: cleanup routines
>>
>>109505924
i didnt, schizofag
plus you cant really do otherwise if you dont want to completely maim the opencl execution model
you need distinct contexts because these are your "execution clusters"
you need distinct queues bc you have one per device in a context
you need distinct kernels because these are your "functions"
you need distinct buffers because these are your data

go have a wank and get some sleep
>>
>>i didnt, schizofag
>he did though
>also cannot follow the literally SIMPLEST of instructions
Typical contrarian autist detected: >>109505924
>>
>>109505946
ok, so youre mentally retarded on top of being a schizo.
were not all born with a functioning brain i guess
>>
>>109505924
>>
>>109505924
>i will stop replying now to look like a mature person who ignores your argument but i also dont want to look like i gave up. please dont think i gave up im leaving the argument for maturity please.
>>
>the contrarian autistic retard still cannot follow the literally simplest of instructions: >>109505924
>despite them being repeated multiple times
And that's *exactly* why neurotypicals want to literally hunt down and violently execute your entire fucking family. We see LITERALLY NO VALUE IN YOUR ENTIRE GENETIC MAKEUP; we take PRIDE in purging it FOR-EV-ER!

How much more do we have to make it clear you are NOT welcome here, you skinsuit robot?
>>
>>109505853
>I JUST finished writing yet another program
what does it do?
>>
>>109506000
It calculates your height based on your height
>>
>>109506000
Checked.
It splits four or five-hour-length YT videos into 10 minutes MP3 parts for my pre-2020 MP3 player, because FFing through that shit is miserable.
>inb4 doesn't sound very optimized
EXACTLY!
>>
Sure smells like mental illness in here
>>
>>109506050
Maybe, but why *specifically* autism?

Could've gone with everything.
Could've gone with psychopathy, or with schizophrenia, or with bipolar.

But it's specifically autism, and there's a reason for that autists literally cannot discern.
>>
>>109506061
>do unto others what has been done to you
i think i recognize that anon
>>
>>109505781
I am working on a rather interesting bug in a minecraft mod.
Ex nihilo adscensio is used mainly for skyblock, but also for other modpacks.
But it seems like if you place a barrel with water that is close to two transformation blocks that both take water as input, the mod (and game) crashes.
I will be fixing that today. It seems like the reason is that when transformation starts, the inputStack is set to null (so that it cannot be retrieved via a bucket)
But it never breaks out of the loop, so when the second transformation block is reached the recipe is overriden. Then in the update function it calls inputStack.getFluid, but inputStack is null, which causes the crash.

Also I spent 3 hours trying to find a program that can remove a block from mcregion and I ended uo having chatgpt write one using nbt package
>>
>i recognize that
>>109473526

>also typical autistic projection
>>
>>109506083
yeah i believe i do
>registryfag
are you still processing the culture shock of learning about amdahls law?
>>
>muh amdahls law
HOLY AUTISTIC PROJECTION:
>>109487896

YOUR ILK HAS NO RIGHT TO ROAM THE EARTH!
Total autistic genocide NOW!!! No, SERIOUSLY! I don't mean this in an abstract sense; we should LITERALLY ROUND UP ALL AUTISTS AND GENOCIDE THEM WITH LITERALLY NO QUESTIONS ABOUT THE CONSEQUENCES!!!
>>
>>109506124
i already had the time to forget how much of an annoying retard you were

are you drunk or on meds?
maybe both?
>>
>>109506124
Like, HOW CAN AUTISTS BE ACTUALLY SO FUCKING RETARDED.
Like, you HAVE to be propped up by your fucking parents, don't you, because otherwise real fucking life would've eradicated you and your retarded, autistic, worthless selves.

Amdahl's motherfucking law.

You just visited a couple classes, memorized a couple buzzwords, and have been coasting on them ever since, didn't you.

At this point it's becoming clear that rules and laws only ever serve autists; if it wasn't for them your neighbors would've already taken """""care""""" of you.
>>
>>109506138
holy angry

it very flattering.
imagine someone being mad for 2 years straight because of one discussion they had with you
>>
can we exchange this guy with the /dmp/ schizo?
>>
>>109506319
>plot twist
>its the same skitzo
>>
AND HE SITS THERE, CODING FOR NOTHING

LA DA DEE LA DEE DA
LA DA DEE LA DEE DA
LA DA DEE LA DEE DA

HE'S HOMELESS, HE'S HOMELESS
>>
>get curious about sel4 again
>try to find some real life applications
>cant really find anything
>ask AI
>it gives me 6 times the same url
wow thank you AI. What a revolution
>>
>https://blog.rust-lang.org/2026/08/04/enabling-polonius-alpha-on-nightly/
>new more liberal borrow checker dropping on nightly
will this finally satisfy the C fags and their desire to write preposterous, unsafe code ?
>>
>>109507639
no
unsafe code goes fast
and preposterous code is how your create a timeless legacy!
>>
>>109507639
>>109507725
actually
this picrel may be more explicative in whats going on here
i use the __line__ macro because fuck typing individual values for ~60 positions
error codes are not continuous (notice the gap bw -19 and -30)
and array based shenanigans would be brittle in case of wild errors
using a switch statement allows me to flatten unexpected values into one output, safely, and with minimal actual typing
>>
>write some code and run into a wall
>send a snippet with some context to the clanker
>the clanker now tells me how suboptimal my entire thing is and instead of answering my question it rewrites the whole thing explaining how better its going to be now

it's over isn't it...
>>
>>109508825
nah, youre just not good enough yet to do better than a clanker
its ok, some day youre gonna pass that cap
>>
>>109508825
>tell clanker to do something
>it says it should not be done that way and implements it it's own way
>point out that the clankers implementation doesn't work in the environment which was described in the agents.md
>sorry sir I will roll back my changes and implement it like you wanted
Claude = Actually Indian
>>
File: 1757823305019951.png (83 KB, 1203x811)
83 KB PNG
what a horrible question
https://leetcode.com/problems/stone-game-ii/
>>
>>109509435
ONLY FOR HARD CORE GAMERS
>>
>>109506319
how about we exchange both of them for a banana peel and a piece of lint in a trash compactor
>>
>>109509618
the trash compactor would never agree to that
>>
>>109507639
so is this getting rid of RefCell?
That should be the #1 priority of rustoids
>>
>>109509683
crabs work best in a coconut milk based stew with curry.
yes, they should have nothing to do with programming.
>>
tried to boot templeos (again) on real hardware. I did have some address issues again. Couldn't solve them yet, but before I go entirely insane I tried to boot the CIA version (tinkerOS) which does work.
So the computer does work. Now it's time to figure out how to get the original templeOS booted myself.
>>
File: PXL_20260809_190623758.jpg (2.42 MB, 2268x4032)
2.42 MB JPG
>>109509991
someone forgot to attach the image
>>
File: wavegay.png (410 KB, 917x601)
410 KB PNG
Why are the people on the cpp discord so gay? They never pass up the opportunity to show off their lgbt love. I thought this was a server for coding
>>
>>109507844
you could just use an xmacro.
// usually the xmacro would have a identifier (extra parameter)
// so that you can make an enum (+easy stringify).
// The identifier would normalize the error with an enum,
// and it would let you use a switch statement instead.
#define OPENCL_CODE_MAP \
XX(0) \
XX(-1) \
XX(-2)
// and etc....

int error_code_converter (int error)
{
int i = 0;
#define XX(x) if(x == error) {return i;} i++;
OPENCL_CODE_MAP(XX)
#undef XX
// (print to stderr or crash for debugging)
return i;
}
>>
>>109510145
>
#define OPENCL_CODE_MAP \

*it's OPENCL_CODE_MAP(XX)
>>
>>109510143
The tech industry has an infestation problem
>>
File: coolioOS.jpg (3.89 MB, 4591x3131)
3.89 MB JPG
>>109509991
>>109510007
coolio. Now this CIA thing showed me the real addresses, I managed to change them in the kernel and booted my own distro.
But
DoDistro does the distro, not create an installable ISO :^)
So it live booted from CD. Gotta figure how to create a new ISO with the new addresses now
>>
>>109510440
And no one with the balls to tell them to fuck off. Same for the game industry.
>>
>>109507844
Pretty sure there already exists function to get string out of opengl error number.
Anyways for other such cases, this is what you do.
enum muh_error {
MUH_ERROR_0,
MUH_ERROR_1,
MUH_ERROR_END
};

static const char *muh_error_str[] = {
[MUH_ERROR_0] = "some gay error message",
};


static const char *get_much_error_str(enum muh_error err) {
if(err >= MUH_ERROR_END) {
return NULL;
}
return muh_error_str[err];
}

If you don't want to return NULL you can replace that with "N/A" string.
If you try to compile that with c++ compiler, well you are a mighty faggot.
>>
>>109507844
Is this a trick? This function is equivalent.
int _fn_sys_opencl_normalize_cl_error(cl_int error)
{
if (error > -20) return -error;
else return -error - 10;
}
>>
File: 1786308966972917.png (228 KB, 671x1044)
228 KB PNG
I have been bumping into this more and more often were the AI will straight up refuse to answer the question and shill sites instead.

Is this a sign the rent is due at google?
>>
>>109510495
what if you get error 666?
what if its -666?
i mean, yeah, its 2 more conditionals
and maybe i went overboard with my innate fear of conditionals
plus its an error management system
were beyond normal operation here, performance is irrelevant anyways

i still find it conceptually neat
a mix between an array and code
its... niggerlicious and briliant at the same time

>>109510453
its opencl
but youre still probably right
i tend to write code first, second guess... err... never, kek
the approach has upsides though
i do wtfever i want bc ive become a self sufficient wild animal full of bags of tricks
>>
>>109511016
If you ask the shatbot to elaborate it will answer.
But yeah there's a keyword or something that triggers the "call the MCP search tool".
Possibly the prototype for the next searchbar, replacing pagerank o algo.
>>
>>109510453
your code has a out of bounds access.
https://godbolt.org/z/ThnbdP6xW
PVS studio <source>:16:1: warning: V557 Array overrun is possible. The value of 'err' index could reach 1.
(note PVS studio was free but they ended it so your only option is godbolt).
You could have passed in MUH_ERROR_END into the array size to fix this, but you don't need the array since you can just accomplish the same result with a switch statement.
In C I mostly see xmacros because of this reason.
>>
Which looks better?
glo f = (\n=
r = 1
| n = r = n * @f n - 1 _
r
)

or this:
glo f = (\n->
r = 1
| n : r = n * @f n - 1 _
r
)
>>
>>109511405
>how to tell someone youre a vibecoder without actually saying it
>>
>>109511661
I'm not. I don't get it. I'm asking for help with a syntax design decision.
>>
>>109511721
the answer?
neither. if it only compiles.

the right syntax is something you can service while blackout drunk
because thats the closest equivalent to coming back to a codebase after a 6 months hiatus

comment everything.
and be turbo explicit in your naming
this way coming back to your own code wont take you 5 days
it will take you 5 minutes
>>
>>109511721
if you think im telling you to do something i dont do myself look at this <
and i dont work inj a team
and i didnt create this code with the intention of making my code public
this is how i work
because fuck reading code, actually
when i deal with something i wanna get right to the heart of the action
and thats why i comment shit
its like functions within functions

its like chapters, or bookmarks
>>
And so a new /dpt/ schizo has become known to us.
>>
>>109511405
glo f = n => 
r = 1
| n = r = n * f n - 1 _
r
>>
>>109511855
I'm pretty sure those are openAI's bots drowning all non-vibecoding discussion in shitposting.
>>
>>109511917
Perhaps, but this one's been around a bit, just hasn't gone full schizo til now. He posted an AVX text-to-float parser in another thread that I recognize from a while ago.
>>
>>109511855
>new dpt skizo
>bc i absolutely immolate you in the fire of my knowledge
i actually was here before you
you kinda ousted yourself bc you didnt recognize me

vibecoders have a general, you know
it kinda implies that you should fuck off back to your containment thread, you fucking cargo culmtist
>>
>>109511939
y you snitch on me, anon?
wtf
that was mean
>>
>>109511939
also lowercaser lives in all of us
lowercaser is not a person,
its an attitude
its a fait accompli
it is the actual state of things
>>
>>109511939
lowercaser is when you just dont care anymore
this is what lowercaser is
its not a person
its an attitude

theres plenty of lowercasers on /g/
>>
I rest my case.
>>
>>109512042
yeah you recognized me as a person
good on you
aaaand... thats where it ends
but you will never prevent people who dont give a fuck
from not giving a fuck
>>
soudns childish
but theres a more profound sense to that

>you cant make me deviate from my trajectory
>unless i choose to
or something of the sort
im bad at quotes
>>
youre making this into a "return of the king" situation
truly
i really dont care, as i never did

youre the ones drumming up the hype

i just wanna talk about c
and occasionally get b& for racism, mang
what the fuck?
>>
i am also open to work related propositions
but with one condition- i wont be working on 4chan
i can sell my ideas
but i dont want to harm anons
no way ill do that
fuck the rest, though
>>
no one cares retard. have some manners and stop posting so much, like 80% posts here currently are from your talking about yourself
>>
What should a c++ programmer be expected to know to be considered competent? This includes cmake/ ninja, systems programming, memory management, and anything important to being considered a senior. Not necessarily that you have to know all the syntax throughout all the versions.
>>
>>109512405
post in return, faggot
blame the aifags for making 90% of the board flee in disgust and righteous panic or something

fukken post something
or ill keep turnjing /g/ into my blog
and theres shit you can do about it bc its all tech related
+ i actually use c
so its not like i dont bring anything to the table, regardless

are you an aifag, seething that paople coalesce around the "nails that stick out"?
yeah, im sorry i have an informed opinion
maybe its just that you should do better?
>>
>>109512405
>>109512456
note that all the people and opinions are already here
what im doing is being just the thing that breaks a molecularly smooth surface
a point where already existing matter just happens to crystalize around

its not about me
its about anything that sticks out
im doing nothing
the sentiments are already here
the people are already here

if its not gonna be me
its gonna be someone else
>>
File: file.png (425 KB, 1166x968)
425 KB PNG
cute
>>
R8 my vibegodding.
#include <stdio.h>

const char *int_to_string(int n)
{
static char buffer[32];
snprintf(buffer, sizeof(buffer), "%d", n);
return buffer;
}
>>
>>109513181
well done sir, very goodful
>>
>>109496307
All those Solana niceties had to come with a price, in the form of Token 2022. It wasn't so complex of a change to support them after all, and it force me to redesign and improve how i handle the traits data and DB data. But still a bit of a pain, at least it's done now.
>>
Two codewars problems today and then working on some BQN. Need to figure out how to use bitmasks and check if the first character of an array is not punctuation.
>>
>>109513181
gorgeous good looks saar
>>
main = main

WOAH!
>>
>>109513181
Why 32?
>>
File: programador.webm (1.05 MB, 854x480)
1.05 MB
1.05 MB WEBM
Reminder that usability > code quality / performance

No matter how beautiful and/or efficient your code is, if it doesn't actually do anything practical for a user, it's useless and thus worthless code.
>>
didn't know /dpt/ had KDE devs
>>
>doing python
>have continually updated variable that is saving to a json file
>expect it to look something like a series of values like "a, b, c, d, ..."
>instead its just overwriting all the old data with the new value so it looks like "a" -> "b,b" -> "c,c,c" -> "d,d,d,d"
what do?
>>
>>109518171
use a better language
>>
>>109505781
I am a fucking fraud who has wasted most of my semesters studying systems engineering not knowning how to properly code and have depended to much on LLMs to do my assignments as has most of my peers on campus.
I want to actually get good, where do i start?
>>
>>109518171
i got it. you have to use the built-in .copy() function because its a referencing issue:
>dataLog.append(newData.copy())
>>
Trying to learn how to create a new distro from the man himself.
TIL: In 2016 all his kernel files still had .CPP extension and a lot of file names changed still. Damn, so it took him not 10, but 20 years to really build that shit.
So I still have a bit of time to do something similar
>>
>>109518206
wolfenstein clone in C + sdl
then html server, also in c
then whatever your specialization is to be
web stack, low level, graphics, whatever
>>
>>109519848
>then html server, also in c
hold up. nta, but how easy is that?
>>
>>109519862
its not easy at all, thats the thing
youre gonna suffer with async shit in c
using c makes it extra hard
but its a good level up in skills.
plus its an excellent exercise to work with parsing, and your os inter process communication
>>
>>109518206
>>109519894
cont.
and about the llm:
stop asking the llm for code beyond a minimal working example
ask it to go through each line one by one with you, and keep rpompting it until you understand whats going on
and when you debug, debug by hand, and ask the llm to help you only if you encounter an error you never saw before, or once youre really at a total loss
debugging is a skill one develops with experience, and it is not one to ignore
>>
>>109519777
It worked. Okay lets try it again on real hardware
>>
>>109519894
>youre gonna suffer with async shit in c
Isn't this just select() syscalls tho? and a simple scheduler.
Like I mean to get the absolute minimum async thing
>>
>>109519939
i wouldnt know the http server is a passage rite i have yet to go through myself
but ive messed around with sockets and duplex communications and shit becomes quite complicated very quickly
>>
>>109519939
ah, ive looked up what sits in an http server
a single threaded one is really a simple thing, youre right

its too simple. its more an exercise in parsing and elarning about http communication

i was working with the context of comms with an arduino, with an architecture of server/client where a server continuously listens to the metrics i was sending with a client that optionally was sending information back to the 'duino with the server synchronizing the whole thing
there, yeah, things become more interesting

what should we make the other anon do to force him to deal with threading and synchronization with io? whats a canonical exercise for that?
>>
>>109520097
>what should we make the other anon do to force him to deal with threading and synchronization with io? whats a canonical exercise for that?
I don't know.
You can blow up a http server to any complexity you like.
I am installing templeOS tho
>>
>>109520319
>I am installing templeOS tho
baste
me, im procrastinating on writing a config parser
i fucking hate writing parsers. its boring
>>
Erlang is the best programming language.
Learn Erlang.
>>
Fixing dumb shit because some fucker decided arbitrarily to change the format of the messages his code was delivering to us half way through the goddamn experiment.
Thanks a fucking bunch, shitbag, go sexually molest a hippo and kys.
Oh well, at least it just meant that the data in the DB was a mess, not that any of it got lost. Score one for me!
>>
>>109520410
holyC is. God told me I have to build an operating systems with it for my risc-v cpu.
But first I have to get templeOS running on x86 and build up my dev station for that
>>
>>109511405
Could you explain the syntax?
>>
>>109520406
I still need to write a C parser but I keep procrastinating by working on other things.
>>
>>109519939
If you use select() in the year of our lord 2020 + 6, you deserve to be shot.
>>
>>109520406
>>109520841
I could've already written a programming language myself and bootstrapped my own fucking shit.
But I am scared of it and I don't know how to come up with divine intellect programming languages.
So now I am trying to cheat and use holyC, but I will be confronted with one million more problems and drop it soon again anyways.
But at least it's a tiny step more of exploration
>>
>>109520876
I really have no clue what the goto is nowadays, but select just works and BACK IN THE DAY they used this to serve shit.
So it obviously still works and can be used for learning to understand the concepts of async shit?
But you just wanted to be edgy again. That's okay
>>
>>109520886
hmm, damn. As I said there will be one trillion problems.
Yesterday I tried to boot tinkerOS just to see if the hardware worked. It did fine https://github.com/tinkeros/TinkerOS
but I assume that is CIA ware, so I want to figure out myself how to get the real templeOS working.
I figured CD and HDD addresses, but somehow it now gets stuck at formatting the partitions. Maybe i'll stop for today. At least I did some progress.
Should get myself a spindle of 100 CD-R's lol
>>
>>109520886
I just want a C preprocessor that fixes some of the problems with C and adds some QoL. I’m not even going to bother generating ASTs. It’s supposed to be a small project and not drain years of my life away.
>>
>>109520895
poll(2) is the go-to, as you would know if you had read the first paragraph of the manual, schizo retard.
>>
>>109520895
select() has some pretty archaic limitations. For a """real'"" program, it's probably better and easier to use an event loop library that wraps poll/epoll or whatever.
But yeah honestly writing a server in C like that isn't that hard.
>>
im a compiler dev
but i would never ever test a basic feature outside of a very simple hello world
>>
>>109520841
>>109521010
hmm
so youre thinking about a pre-pre-processor, or you want to integrate it into existing tooling?
>>109520886
>But at least it's a tiny step more of exploration
sure, its always a different way of doing things.
and based off the shortcomings of holy c you will already have more information as to what you want in your divinely inspired language
>>109520952
cant help with that. im not an os guy; im more oriented in messing with gpus, and still in the process of learning
>>
>>109521025
>>109520895
btw, poll() was added to POSIX in 2001 and has been the go-to for cross-platform software ever since. Just how old are you, gramps?
>>
>I'll write my own language

You guys are the definition of neets. no productive capabilities at all
>>
>>109521204
what do you build then?
>>
>>109521204
@grok explain to anon what a "side-project" and "hobby" are
>>
>>109521240
@grok explain to anon what having a life is
>>
>>109521243
>my life is only about watching number go up
grim
>>
>>109521257
>watching *someone else's number go up*
from the sounds of it hes a wageslave
>>
File: screenshot.png (5 KB, 630x502)
5 KB PNG
I'm making an ASCII game.
And I've found a way for moving the characters n-times-per-second. I'm very happy with it:

// 60 fps
#define CHARW 9
#define CHARH 12
#define MOVMNT_PER_SEC (CHARW * (((time == 60) ? (time = 0) : (++time)) / 60))


I think I could use it for sprite animations too.
>>
>>109521257
>>109521301
I woke my own job, you retards.
>>
is there a more efficient way to calculate factorials in python?

this is what i have so far

from decimal import Decimal

def fc(num):
total = num
for x in range((num-1), 0, -1):
total = total*x
return int(total)

x = Decimal(fc(10000))
print(f"{x:.2E}")
>>
>>109521369
Use C/ C++ for more efficiency.
>>
>>109521365
sorry to hear that anon, hopefully the pajeets don't destroy it too bad
>>
>>109521369
Use C lol.
>>
>>109521369
you could put precomputed values for your factorial in an array then invoke them by index
such as:
factorial_array = [1, 2, 6, 24, ...]
def fc(num):
return factorial_array[num]

factorials beyond 20 are too large for a 64bit number to hold
>>
>>109513295
Spent the last 30 minutes debugging why my SOL code didn't detect or accredit a USDC payment. Turns out i feel int the very same trap i had already thought of sending to an ATA of an ATA. In my defense i thought Phantom was dumber and was asking for the ATA, as it gave some warning. But now i tested and disregarded their warning, and it all works.
Now that's 2/3, i'm left with Esplora integration then and i'll be done with the watching step
>>
>>109521103
pre-pre-processor technically, but it looks like I’m going to have go resolve the preprocessor before I can parse anyway, which either means passing -E to the compiler as an extra step before touching any input files or doing the work myself

the output will be a unity build with dead code elimination applied to reduce work for the compiler. not sure what to do about error reporting yet. I was thinking of appending file/line information at the end of every line, similar to what a preprocessed file already has. If that’s too annoying I could literally translate error line information from the compiler’s error output
>>
>>109521025
doesn't work on XP
>inb4 xp schizo
I don't use XP, but getting code to run on XP is a weird flex but we take those (not sure if XP already has a workaround to run modern binaries).
If you want a portable non-blocking API built on IOCP/io_uring, you should just use libuv. Probably doesn't work on XP tho.
>>
I ran out of ideas and I don't know what to make
what do I do to get inspiration and ideas
>>
>>109521692
>which either means passing -E to the compiler as an extra step before touching any input files or doing the work myself
i would go with the -E option. it would be redundant work otherwise, more code to get right too

>I was thinking of appending file/line information at the end of every line, similar to what a preprocessed file already has.
didnt know that. sounds inelegant as hell tho.
but now that i think of it
wouldnt -E do exactly that, then?
and if that information is present in the expanded file, could you just exploit it from there?
passing your files through -E really sounds like it would solve that part of the problem (im not thinking about other alternatives because you seem to imply your code ends up in one contiguous buffer at some point. you wouldnt need file information attached to the individual lines otherwise...)
>>
>>109521692
also another thing: why would you need to translate the compiler output?
you intend to work on the expanded files to do fixes? theyre gonna get "overwritten" though
if you work on the actual sources later then you would have to merge the changes you did to either
that sounds like avoidable complications, solvable with procedure, not even code
>>
>>109521369
>python
>for loop
You lost laready.
>>
>>109521692
>>109522109
aaah i think i get it
yeah, once you have done your changes, the compiler is gonna get fed expanded source files with additional stuff written to them
so all the lines are gonna be out of whack, right
>>
>>109521692
>>109522137
after a slight fink, i think you might want to translate compiler output to leverage the compiler's syntax verification
but im not sure how it interacts with your pre pre process
as far as i understand the procedure is
->expand
->run pre-preprocessor
and at this stage you would be catching errors related to your pre-preprocessor
and then compile

but how are you gonna catch an error that comes from your macro? the compiler wont have that information...
that would mean that youre gonna have to do compiler error msg translation regardless of how you deal with the error from your pre-pre-processor
>>
File: file.png (38 KB, 367x565)
38 KB PNG
>>109521853
Wow, this is really all the posix functions XP has? That's terrible.
>>
>>109522135
You are why 4chan sucks.
>>
>>109522222
nice digits
>>
>>109522222
GET
>>
>>109522080
>i would go with the -E option. it would be redundant work otherwise,
Yeah, except that means another pass and invoking a command to start an entire process when I already have the file in memory and everything. I might just try to make the lexer recursively expand macros in place.

>didnt know that. sounds inelegant as hell tho.
Maybe, but it wouldn't necessarily be unintuitive to use. With a single vim autocommand, I can treat the output file as a special case and redirect to the correct file and line almost automatically. But there might also be times when the preprocessed file is so difference from source that I would be forced to read it instead of the source. It really depends on what kinds of things the preprocessor will do for me; generate generics for example.

>>109522137
>the compiler is gonna get fed expanded source files with additional stuff written to them
so all the lines are gonna be out of whack, right
Yep. The preprocessor output will be a unity file reordered with automatically generated declarations, things like that. It's not going to represent the original source well at all.

>>109522199
I will do the absolute minimum error handling necessary to lex and do light parsing and let the compiler do all the heavy lifting. I'm not going to bother doing tons of error checking the compiler is just going to do anyway. I won't even need ASTs or need to worry about reordering operations by precedence, in fact, doing so would just make the output harder to read. If an expanded macro makes nonsense and the compiler raises an error, I guess I will just have to look at the preprocessor output directly in that case. It's not like macro errors aren't annoying even with conventional C. But in a best case scenario where I don't have to look at that output, I just realized I could pass the output to the compiler as a .i file and encode file/line info the same way a normal preprocessed file does so I could get correct line information that way.
>>
>>109522225
No. Stop using Python.
>>
>>109522392
Why?
>>
>>109522398
because it's slow, the thing you're already complaining about
>>
>>109522437
I don't care that it's slow. It lets me code fast.
>>
>>109522460
>It lets me code fast.
It actually doesn't. The thing that lets you code fast is the available libraries, not the fact that it's a scripting language or dynamically typed.
>>
>>109522478
I don't use libraries.
>>
>>109522488
All the more reason not to use python.
>>
>>109522496
Python is perfect without libraries since it comes with a huge batteries included standard library.
>>
>>109522564
I include standard libraries in my definition of libraries. libc sucks, it's one of C's biggest problems. Once you've made your own tooling, C is actually really fast to develop with, even for throw away script-like programs.
>>
>>109522584
>just remake libc to use C
Lmao
>>
>>109521369
from math import factorial

One of the major points of python is to use modules, because they leverage C/C++.
The python that you write is just the glue logic.
>>
>>109522591
(nta)
you dont use c for the libc, anon

>>109522363
good stuff. it really looks like encoding information into the i file is the way to go
the format really is easy to deal with
>>
>>109522623
I just don't use c.
>>
>>109522631
i know. you use paaaiton.
youre also a snarky faggot
>>
>>109521369
import math
math.factorial(n)


This invokes a call to a factorial function written in C.
>>
AI IS DANGEROUSLY INCOMPETENT.
>>
>>109522656
I know.
>>
should I learn common lisp or scheme?
>>
>>109522992
clojure
>>
>>109523168
why?
>>
>>109523227
it's almost objectively better than CL
>>
Did not have time to hit BQN today, will do it tomorrow, and also want to look into F# some more. Don't like the syntax that much, but it should not matter much after a few weeks. Runs better than ocaml on Windows.
>>
Ok I was almost burning out from this shitty project, so now I did let AI vibefinish my flappypong.
1 button per player. Press goes up. Release goes down.
Will see how good this is playable irl, but feels almost alright on keyboard. Gotta try around with the values a bit
>>
File: cock.jpg (3.52 MB, 3847x1990)
3.52 MB JPG
>>109524677
Will hopefully be played on these buttons, but since I don't have them at home anymore rn I am not able to test it.
Saturday is deadline, maybe I can be bothered to test it before again
>>
>>109524677
here with button indicators.
I might try to make it really like flappy, so when you press it jumps up a portion and you have to press multiple times instead of holding.
Will see
>>
File: 1739435724033309.jpg (29 KB, 720x725)
29 KB JPG
>I don't care that it's slow
Yeah, that's what makes you LITERALLY autistic and make normal people HATE you.

And you're probably proud of it, too. Which is exactly why normal people want to see your ilk brutally eradicated on national TV.
>>
Remember the last time I wrote a 4chan thread to Markdown converter?
>>109488975
It got updated
https://paste.rs/gpb29.py
Enjoy your scraper
>>
File: erm.gif (630 KB, 112x112)
630 KB GIF
>>109520410
Ermlang
>>
>>109524739
>I might try to make it really like flappy, so when you press it jumps up a portion and you have to press multiple times instead of holding.
this should be 5 minutes of code.
you just lower the player's paddles a certain amount each frame.
done.
>>
>>109524739
>>109525720
Uhm that's what I already do right now.
I think I am finished. It feels good, the vibe coded bot is okay and I'll see on the weekend if it's fun to play. Please don't steal my app idea. After this I could see myself getting back into app coding and doing this.

But my point was: Once you press the paddle goes only up a certain amount. Then you have to release and press again. That's how real flappy bird did it.
My current implementation: Pressed applies upward velocity, released applies downward velocity, but this works for now and I think i'll leave it like that. I should improve the buttons instead, because I think they might have a bit of lag. So I am considering going for a cable instead of wireless
>>
>>109525842
noice.
i would just make the amount you go up the same each press, regardless of how long the button is pressed and make the movements larger to make it more challenging to get the paddle at the right place at the right time, though

>going for cable instead of wireless
im not sure of the amount of lag were talking about here, but the wire/less thing shouldnt make much of a difference.
i would look into the software stack first
t. used to be a massive fps player
>>
File: PXL_20260729_160732045.jpg (1.71 MB, 4032x2268)
1.71 MB JPG
>>109525868
>regardless of how long the button is pressed and make the movements larger to make it more challenging to get the paddle at the right place at the right time, though
Yes this all sounds great, but reminder that the buttons I use are pic related.
I mean the contact point is always the same and you could figure it out, but I don't want to bring the normies in a fully bad mood.

And regarding the wireless: Yes it probably doesn't matter from a latency point of view, but the shitty protocol I implented 2 years ago was not intended for gaming. It sends only button evens (press, release) from one esp32 to another, which then sends these events over uart to the host.
They could get lost in the esp32 connection, because I think esp-now is not reliable. Tho, most of the time it should work. I am thinking too much because I want mah frens to have a perfect experience
>>
>>109525906
i looked things up and it wouldnt surprise me its the a in uart thats causing you problems
async meaning synchronization somewhere (its gonna be a year i didnt touch my arduino experiments, and these didnt go very far anyways)

maybe you have another uart channel you could use solely to receive inputs?
or maybe even better- maybe you could send voltage directly to your host, bypassing the protocol entirely?
>>
>>109525975
For the record: There are no real problems yet.
But since the event will take place in my moms garden, which is rather big and I don't know yet how far the buttons will be away from the actual display, I made everything wireless.
The UART connection is the least problem. That almost never fails. It's not even a 5cm cable going from the esp32 to my fpga.
And yes I was considering direct wiring. But then I'd have to run 3 wires for 2 buttons + GND.

I do have some other options, but all of that will be evaluated tomorrow. The wired connection with the least friction would be:
I already have a SNES controller input on my FPGA. That is working and not used right now. What I could do here: Have one Pi pico that literall just gets the current button states and sends them over rs485 to a different pi pico, which then just converts these states into the snes protocol. Done. I now have the button states in the software and just have to map them to certain snes buttons. The programming is like 30 minutes to an hour. But I am too lazy for the soldering right now, so I will evaluate tomorrow if I actually need that
>>
>>109526011
>And yes I was considering direct wiring. But then I'd have to run 3 wires for 2 buttons + GND.
(and with rs485 it's only 2 wires and I found a very long 2 strand wire in my moms garage, so I don't need to run 2 of them)
>>
>>109526011
heh, you seem to have everything figured out already.
and i wasnt thinking about the uart per se, i was more thinking about the code that would service a duplex over it, even, if in the end it is not what youre doing?

anyways, good luck for tomorrow anon
>>
>>109526011
>But then I'd have to run 3 wires for 2 buttons + GND.
You could use some common multi-wire cable in a non-standard way, eg. use a HDMI, VGA, Ethernet or whatever other cable, with your own pinout on both ends. Would just need a bit of soldering to make an adapter from the cable to your actual device's connector (that way you can still use the cable for its original purpose)
>>
>>109526218
Yes, I know. I just don't have one that is roughly 10-20m long, but that's what I usually do.
>>
File: IMG_1486.png (121 KB, 300x250)
121 KB PNG
WHY IS THE ADVERTISEMENT LAUGHING AT ME?
>>
>>109528493
Advertisement-chan is literally me
>>
if theres an unofficial API SDK library you can install and use, would this be better over your own generic API library you make?

I was thinking of using the python simple-salesforce api library
>>
>>109528562
WHY ARE YOU LAUGHING AT ME?
>>
>>109529520
If I told you, you would be laughing too
>>
>>109529365
It depends.
>on what
If you think you can do a better job than the people who made the SDK. And for that you need to be able to tell what the SDK does, and how you'd do it significantly different.
>>
>>109529365
if you are buying in to a platform or an ecosystem like that and not getting paid for it you're just fucking yourself over since you are investing most of your time in to memorizing specific arbitrary niche design choices that do not translate to other platforms, if you are getting paid then why even ask the question just do the easiest thing that takes the least amount of time with understanding that what you do now is ideally going to be somebody elses problem eventually
>>
>>109529629
>you're just fucking yourself over since you are investing most of your time in to memorizing specific arbitrary niche design choices that do not translate to other platforms
Holy.
Some things are universal across the board, like "memory is slow", "linear memory accesses are preferable", and "make sure prologues and epilogues are fucking worth it". And I have seen SDKs that were so fucking shit that they violated all three of these premises.
>>
>>109528493
>IMG_*
Maybe because you're a retarded vibecodeshitter that is addicted to actual programmer attention the same way women are addicted to male attention.

Yes, that was supposed to question your sexuality.
>>
>>109529782
Fuck you, projecting narc.
>>
It's not projection if it's true.
>>
>>109530206
It's still projection and your accusations against me are not true.
>>
File: fizzbuzzHIREMEPLSS.webm (665 KB, 1280x697)
665 KB
665 KB WEBM
Fuck, I posted in the wrong thread.
>>109531682
>Had to rewrite uart output, because I accidentally deleted the last one. Still works fine tho.
>One tiny step at a time. Now I somehow gotta build a risc-v backend for the holyC compiler so that I can program my soft-core running on my fpga from templeOS
>>>109531682 (You)
>Maybe finding an entry point on where to hack around with the compiler will be harder than expected.
>I JUST have to build some sort of translation layer from the x86 to risc-v output. That must be possible, terry didnt even use that many x86 instructions. hmm gn8 hitler
>>
Just spent some time playing with unix datagram sockets, and wow, they suck.
>server programming gotchas
>>bind won't work if there's a stale socket from before, so you have to delete it
>>but deleting it will still succeed if a program is actively using that socket
>>SO_REUSEADDR has no effect
>>recvfrom's socklen value is very important. Using sizeof(struct sockaddr_un) won't necessarily work in sendto.
>client programming has a big gotcha
>>sockets don't autobind a local address for receiving
>>so you can't receive replies at all without binding
>>using bind(fd, addr, 2) will get you an ephemeral address ON LINUX ONLY
>>need non-Linux? better get gud at making up random pathnames and cleaning them up when you're done. Also don't crash, or that temporary socket will live forever.
How many of these gotchas were documented?
>zero
>>
Maid
>>
>>109531992
>>bind won't work if there's a stale socket from before, so you have to delete it
Yeah that part was always pretty stupid. I assume it was some ancient legacy thing where they thought that was a good idea at the time.
>>recvfrom's socklen value is very important. Using sizeof(struct sockaddr_un) won't necessarily work in sendto.
Yeah, because of the weirdness of sockaddr in general, and they use the size to determine the path length.
>>using bind(fd, addr, 2) will get you an ephemeral address ON LINUX ONLY
Ephemeral addresses are kind of an IP thing, it's a bit strange to apply it to unix domain sockets of you think of it

>>need non-Linux? better get gud at making up random pathnames and cleaning them up when you're done
Depending on the application, you may be able to to use socketpair() instead and just sidestep the filesystem part.
You typically need to use a lockfile instead of the existence of the socket to determine if your program is already running, because that'll handle program death properly.
>>
>>109532061
How are lockfiles typically used to see if a program died? It can't delete the file itself if it crashes, and PIDs can get reused.
>>
>>109532144
If the program dies and is holding a lock, the lock will be released.
So by attempting to lock the file, you can see if someone is still there.

Not something a client would bother with, but having 2 instances of the server.
>>
I was productive yesterday working on my compiler. Today, I was working on getting employed but feel all doomer like no job will ever hire me because I'm too addicted to 4chan or something.
>>
I'm making a 2D rhythm game (think Guitar Hero) in C++ with SDL2. My levels are made with XML files. I assign each note an "appearTime" value. This value is equal to the time that the note plays in the song minus the time it takes for the note to go from the top of the screen to the "hit area". I noticed that it doesn't feel "in sync" unless I add about 100 milliseconds to all the note's appearTime values. Does that make sense? I'm using wired headphones, which in theory should have practically zero latency.
>>
I made a program in C that fucks your mom.
>>
File: file.png (83 KB, 467x1307)
83 KB PNG
>>109521612
Started with the actual frontend invoice pages, i had a rough one before to test, now these should more properly work. It keeps some slop kind of look, but i think that's due to the official Solana colors being like that, i thought they were more white and light grey-ish, but turns out that wasn't the case.
>>
>>109532654
It can take quite a few milliseconds (think dozens, even more in the worst cases) from your program trying to draw something to actually appear on your monitor for the user to see.
That's the reason basically every modern rhythm game has an adjustable offset for that.
>>
Did not write any code today, but I will tomorrow. Some Java and an array language. I want to get into MLs at some point. Probably F# or Scala. Realistically, I will keep working with Java as it usually has a few good libraries for whatever concept I am learning. I don't plan on making much, and mostly enjoy writing small functions.
>>
File: 1779700814480753.png (328 KB, 1478x1084)
328 KB PNG



[Advertise on 4chan]

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

[Enable Mobile View / Use Mobile Site]

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