#LOW LEVEL PROGRAMMING BE LIKE
1 messages ยท Page 1 of 1 (latest)
the evolution of every programmer who finally finds what he is good at when he is a child. i am not smart. i just found what i was good with at a young age.
used it
ITS NOT A WAY TO BRAG. ITS JUST A FUNNY WAY TO SHOW HOW USEFUL C PROGRAMMING CAN MAKE U
IF U LEARN IT WHEN UR YOUNG
i did it when i was 12
and i am not smart
by isolating main code i dont mean using functions
i mean using processes and by memory bugs i mean a huge set of memory bugs
This is usually not low-level programming
If you're making an interpreted language, with or without bytecode, it's not really low-level
If you're making a compiled language, you'll surely be passing asts into llvm to generate the assembly for you
Especially if you want someone to use your language
but i am making a higher level language for people that choose high level programming
i am making change
i can help the do low level stuff if i want to but i wouldnt recommmend a user to use those options
the point of this language is to make writing programs scalable
usually programs are hard to scale in developement
i just tried to make it easier and more automated
i kinda tried to automate most of the low level details of software by giving the user processes that will do the job for him
high level programming be like
This is still not what people would conventionally consider low-level
the point is that its suppose to automate most stuff that people hire others for
making software easier to make
and more cheap
also its not gonna replace anyone cuz someone will still need to write code for it
but the code will be much complex because the easy part is already automated with the build in process options i gave it
its a iterpreted language
made in C
high level programming is bad but mine is not like other high level languages
also it isnt replaceable by AI cuz the complexity of the tool made by my tool will increase
Complex code is hardly a benefit
You should reconsider why high-level languages are bad
I do not think this is necessarily false, I think that you should rethink your justifications
Currently, what I'm seeing is thta you've not done high-level programming, so you don't know how stuff really is in software written in high-level programming languages
i did python, perl, web dev
js, html, css in web dev
also django in backend
Have you tried writing that in C, then?
I know web dev is hard
But writing it in C will not make it easier at all
well i am not saying that high level languages are useless. what i am saying is that solely basing ur life on it
is useless
its not worth it
i use python a lot my self but its not my main thing
its just when i need to do something that isnt a proper product
Ah, I think you're phrasing your point incorrectly, then
You should be saying that programmers should be exploring lower-level languages
i am phrasing my point from a career point of videw
they should make low level languages their main thing
then use high level languages along side them
but they are long lasting and its fun to do high level stuff if u know C
Most software that you'll be writing will be in js, ts, python, whatever
or C++
I fail to see how that is a benefit of C or C++
not true in my case
It's more of finally knowing the benefits of high-level languages after suffering through them
i write the base in C and write python, etc on the top of it
Are you talking about libraries?
You mean you're writing a library, and creating an FFI for python?
i am talking about a C program that acts like a central unit
to all the sub processes
i use this design in my code
when ever i can
That sounds like needless complexity
Unless
The C program is a server
And your sub-processes are clients
but flexible
and helps me fix the hastle of many errors
the C server basically does of the automation
of a admin
while i sit back and watch
its sort of similiar to bash but implemented in a lot more faster, efficient, portable, and modular way
So you've just created a macro?
Come on
Not all code needs to be extremely fast
Writing it in python will yield fast-enough code for most cases
its a central program that is gonna handler other programmers. its sort of a programming language that is interpreted at run time. also the input part is not fast but the interpreting part is fast
And it's more portable, too, since you don't have to compile anything
it should be
Let me ask you, then
but u cant make a central program that watches over ur scripts, tcp servers, AI bots at the same time
makes them do stuff for each other
can you???
Are you going to pay a python dev to learn C or C++ just for minimal performance benefits?
You can, though
no i will going to expect him to learn my tool which barely as 10 keyword and the keyword names can be changed
its modular
TCP servers use C, you're not writing that, either
i did write that
You can, but why would you
yeah just stick components in
its easier and much faster in my case
also i can learn how tcp works
that way
from a low level point of view
this is 1000% true
the code is barely 350 lines
not because it's the easiest or anything
Well, then, why don't you write the linux kernel too
It's 350 lines because you're using linux apis
but because the shit ur gluing together is usually a wheel made by someone who knows 10x more than you, has 100x the time spent on it, is not only tested with exhaustive unit tests and battle tested in prod... and has eyes on it from lots of people, security audited, stuff like that
i am gonna try that once i reach to a specific level of knowledge
Danm
Good luck
respectable
well its a process oriented programming
thanks
kernels are a huge undertaking though
so many different things you need to learn
ok yknow nocode tools like webflow?
thats why i am waiting to learn more before i go into kernel dev
yknow why they don't need code?
it's because they wrote all the building blocks that can be glued together
they designed them to be glued together
Ah, right, also, if you expect someone to come in, and learn the DSL, I'm actually quite certain they'd quit instantly
mine is more flexible
and better
they made the lego bricks to make them easy to glue together
press x to doubt
and is aimed to help processes interect
we have a language for this
it is called shell script
in a sense that i for example have a process that can basically print, write stuff to a file, etc
this is cool though https://en.wikipedia.org/wiki/Process_calculus
In computer science, the process calculi (or process algebras) are a diverse family of related approaches for formally modelling concurrent systems. Process calculi provide a tool for the high-level description of interactions, communications, and synchronizations between a collection of independent agents or processes. They also provide algebra...
But you're not all programmers
highly recommend reading for anyone that has no life
but mine is for actual projects
the thing is that mine one is all in one tool
You could also use python
so is golang
python does terribly at parallel processing imo
All programming languages are more or less all-in-one
That's true
if u make a process named io that does printing, input, printing stuff to file and taking input to file
similarly with inherently single threaded languages like js and lua
Rip
like they do have multithreading libraries! but idk if they ever reach anything resembling dedicated language support
I actually have no clue how green threads work to make them faster than hardware threads
they are just userspace threads implemented in the language itself
Intuitively, hardware threads should be faster, right?
Yes, but there's an overhead, isn't there?
green threads dont have to save & restore stack i think
yeah but hw threads must have more overhead
But, doesn't that mean that the CPU does that implicitly?
But it's built into the hardware
idk ask google
Rip
maybe its not the hw threads that are expensive but rather the os threads
keeping track of pid/ppid, scheduling, and the like
Ah, that's true
and also cleanup and virtual memory management
whereas i believe some green threads have a pool of os threads
But that means that green threads should do much better relative to Windows than Linux
so i guess they avoid thread construction/destruction costs
dont quote me on this XD
ive never looked into this very deeply
ur better of googling this
Green threads will always be one of the greatest inventions in multithreaded stuff along with virtual memory
To me, at least
Rip
You are so wrong
they feel like the same thing
C just fulfills assembly
then ig you don't know how C or assembly works. You do make sure your code has no UB right?
you do know what UB is right?
there are so many "C programmers" who dont care about correctness
UB is just a cool term for unde fined behaviour lilguy
also i mostly focus on making my code perfect
just look at my fucking code and see it urself
i dont want undefined behaviours
i make sure that my code is right
hence i use as much semaphores and implement as much cocurrnecy as possible
i literally spend a whole night checking weather my code works or not
this code dosent work and i spend 1 week on it and this code is a code that is meant to make processes cocurrent
in the exact way i want it to be
its a small code but i can copy past and change it to add it into any project i want
or modulize parts of it
also watch ur tongue beforeu say that i dont care about correctness
i spent hours on a singleline thinking of the best use case for multiple alternatives
i may be a bad programmer but not a programmer that dosent care about correctness
my basic function in the project is to ensure nothing fails
i literally dont touch a single line knowing that i have a chain that if i change then i have to spend time on optimizing the rest for that specific use case. this dosent apply to high level parts but only to the basic blocks of it
i know how much a removing return 0 from a child process fucks the program hence its my job to ensure it dosent happen
like its my dream job
i like fixing these bugs
um
is this supposed to ever terminate
it just runs forever
it's also completely unreadable
yeah no it's complete garbage, i don't think you understand processes or concurrency at all
it dosent
because of a bug
it is supposed to wait three times
for three child processes to post
imitating the rendevose(some wierd name like that) pattern
the pattern is a cocurrency pattern
what do u mean?
i dont think you know how fork() works
idk man
that i need to basically upload it and ask some other developers that might solve coccurency in other languages
my english is bad
so i might do some mistakes in my explaination
only the child process that isnt 0
aka the parrent process
is supposed to fork
i did it for simplicity
cuz it was simpler and faster that ways
i wanted to avoid if statements
specially nested if statements
also that part of the code
so... all the children fork??
isnt meant to be copied
only parent forks
all children just continues
that's wrong
fork() returns 0 to children and pid to parent
yeah
tahts the fucking point
only parent forks
as much as he wants
this code forks twice
but the parent forks twice
why dont u get it
also this part isnt even essential
the main part is after it
u know what ur a dumb fuck
oh sorry
u were right
sorrry
i forgot my code
if you want the parent to fork twice it should be
pid = for(); if (pid) { fork(); } else {}
hilarious
do you always call people dumb fucks? not very polite eh
i forget how my code worked
it happens
so what
i mixed up the sequence
in the explaination
but the point is that the goal is achieved either way
which is one process is suppose to sort
and add extra stuff
while the rest just add there own parts
thats the whole fucking code
thats the goal
it dosent matter weather its child parent or what ever the fuck it is
just one fucking process is suppose to sort
while the rest dont
@meager hatch u get me u fuckwit?
if by meds u mean ur mom's educational donation of sex
to middle schoolers
@meager hatch why do u want to make me angry?
y?
no a high schooler
well that explains the childish behaviour
u fuck wit
ur just making me angry
i am stuck on a bug
while pipeling ls to grep using a fifo
cuz fopen is blocking when used with a fifo
so i chose a fifo
i didnt use open cuz i just didnt feel like i wonna
right now i just wonna finish the project
then spend a month optimizing it
i know u cant but u still wonna fuck my brain
the code is working while i send a fprintf(stdout, "data");
and take it using scanf
but dosent work after using exec
i guess its either a really really rare bug
which hopefully its not
or its just me doing a small mistake and mixing small details up
yeah i guess its forgeting the file
cuz its FILE*
not int
maybe like just a high level guess from my side
but even then it dosent make sense
cuz i am using fileno() in dup
dup2
like tf is wrong with my life. every piece of code i write fails cuz of bad luck.
i dont whats wrong
im burning in fraustation cuz i saw a dream in which i made this project one year ago. at that time i saw the project as a terrible idea and as reinventing the wheel but now i personally need this tool in every part of my life
i fixed the code
the code was in the fucking execvp call
i mistakenly fucked that part of the code
i guess
i didnt exactly fuck it up
but over estimated the flexibility needed there
for all usecases
i am proud now
also i am using stderr frequently cuz i just want to and i know its not orthodox but the code was just a testing code hence its name tester.c. it wasent suppose to print anything
the code isnt exactly working so i am still working on it
but i think i am close this time
hopefully
yeah
i am just unlucky
my code failed despite the fact i did no mistakes in it
like the functions worked right
everything did
but still it just didnt work
i emailed linus torvald about the semaphore issue, pipelining one because the issue was that both showed no errors
literally no errors
the pipelining one worked without exec
but didnt work with execvp
like wow
what a luck
it is as if i am paying for someone else mistake
while i dont know the root cause which is probably either a library, a bug in my computer, or some thing else
like it can be anything except for my mistake
lol cant even tell if youre trolling at this point
In the mailing list?
why?
on gmail
not funny lil guy
i am gonna spend the whole night today redesigning my code to use pipes instead of files and to only use files to store permenant data
this stretagy with require me to define init functions
also i didnt respond cuz there were guests in my room
hence i couldnt use my computer for a long long time
and i will remove the semaphore causing the bug
in my code and instead use read to a pipe as a semaphore
maybe that would make it a bit better
Good argument.
However,
thats unfair and rude
idk bro wahtd you do D: