#LOW LEVEL PROGRAMMING BE LIKE

1 messages ยท Page 1 of 1 (latest)

lyric kindle
lyric kindle
# lyric kindle

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

lyric kindle
#

i mean using processes and by memory bugs i mean a huge set of memory bugs

true hull
#

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

lyric kindle
#

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

lyric kindle
true hull
lyric kindle
#

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

lyric kindle
#

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

true hull
#

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

lyric kindle
#

js, html, css in web dev

#

also django in backend

true hull
#

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

lyric kindle
#

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

true hull
#

Ah, I think you're phrasing your point incorrectly, then

#

You should be saying that programmers should be exploring lower-level languages

lyric kindle
#

i am phrasing my point from a career point of videw

lyric kindle
#

then use high level languages along side them

true hull
#

No, they shouldn't

#

In the career point of view, rust and C and C++ aren't common

lyric kindle
true hull
#

Most software that you'll be writing will be in js, ts, python, whatever

lyric kindle
#

or C++

true hull
true hull
#

It's more of finally knowing the benefits of high-level languages after suffering through them

lyric kindle
#

i write the base in C and write python, etc on the top of it

true hull
#

You mean you're writing a library, and creating an FFI for python?

lyric kindle
#

to all the sub processes

#

i use this design in my code

#

when ever i can

true hull
#

That sounds like needless complexity

#

Unless

#

The C program is a server

#

And your sub-processes are clients

lyric kindle
#

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

true hull
#

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

lyric kindle
# true hull So you've just created a macro?

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

true hull
#

And it's more portable, too, since you don't have to compile anything

lyric kindle
true hull
#

Let me ask you, then

lyric kindle
#

makes them do stuff for each other

#

can you???

true hull
#

Are you going to pay a python dev to learn C or C++ just for minimal performance benefits?

true hull
lyric kindle
true hull
#

the AI bot code runs in C, and you're not writing that

#

Ah, I see

#

A DSL

lyric kindle
#

its modular

lyric kindle
#

thats the point

true hull
lyric kindle
true hull
#

Your goal as a software dev is to glue shit together

#

Not to reinvent the wheel

true hull
lyric kindle
lyric kindle
#

also i can learn how tcp works

#

that way

#

from a low level point of view

half phoenix
lyric kindle
#

the code is barely 350 lines

half phoenix
true hull
#

Well, then, why don't you write the linux kernel too

#

It's 350 lines because you're using linux apis

half phoenix
# half phoenix not because it's the easiest or anything

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

lyric kindle
half phoenix
#

respectable

lyric kindle
lyric kindle
half phoenix
#

kernels are a huge undertaking though

#

so many different things you need to learn

#

ok yknow nocode tools like webflow?

lyric kindle
half phoenix
#

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

true hull
lyric kindle
#

and better

half phoenix
lyric kindle
#

mine is similiar

#

but its process oriented

half phoenix
lyric kindle
#

and is aimed to help processes interect

true hull
#

I strongly doubt that

#

Maybe it's more flexible to you

half phoenix
#

it is called shell script

lyric kindle
#

in a sense that i for example have a process that can basically print, write stuff to a file, etc

half phoenix
#

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...

true hull
#

But you're not all programmers

half phoenix
#

highly recommend reading for anyone that has no life

lyric kindle
half phoenix
#

in that case it is called golang

lyric kindle
true hull
#

You could also use python

half phoenix
half phoenix
true hull
#

All programming languages are more or less all-in-one

true hull
lyric kindle
#

if u make a process named io that does printing, input, printing stuff to file and taking input to file

half phoenix
#

similarly with inherently single threaded languages like js and lua

lyric kindle
#

and other processes for cocurency,etc

#

ok bye for now cuz i have to go

true hull
#

Rip

half phoenix
true hull
#

I actually have no clue how green threads work to make them faster than hardware threads

half phoenix
true hull
#

Intuitively, hardware threads should be faster, right?

true hull
half phoenix
#

green threads dont have to save & restore stack i think

half phoenix
true hull
#

But, doesn't that mean that the CPU does that implicitly?

true hull
half phoenix
true hull
#

Rip

half phoenix
#

maybe its not the hw threads that are expensive but rather the os threads

#

keeping track of pid/ppid, scheduling, and the like

true hull
#

Ah, that's true

half phoenix
#

and also cleanup and virtual memory management

#

whereas i believe some green threads have a pool of os threads

true hull
#

But that means that green threads should do much better relative to Windows than Linux

half phoenix
#

so i guess they avoid thread construction/destruction costs

half phoenix
#

dont quote me on this XD

#

ive never looked into this very deeply

#

ur better of googling this

true hull
#

Green threads will always be one of the greatest inventions in multithreaded stuff along with virtual memory

#

To me, at least

true hull
meager hatch
lyric kindle
#

C just fulfills assembly

lyric kindle
meager hatch
#

you do know what UB is right?

#

there are so many "C programmers" who dont care about correctness

lyric kindle
#

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

meager hatch
#

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

lyric kindle
#

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

meager hatch
#

i dont think you know how fork() works

lyric kindle
#

i do u fucking idiot

#

the reason i elaborated was

meager hatch
#

idk man

lyric kindle
#

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

meager hatch
#

pid = fork()
if (pid) {} else {fork()}

#

this is your code

#

wtf does it even mean

lyric kindle
#

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

meager hatch
#

so... all the children fork??

lyric kindle
#

isnt meant to be copied

lyric kindle
#

all children just continues

meager hatch
#

that's wrong

lyric kindle
#

i mistakenly said child process

#

my english mixes stuff up

meager hatch
#

fork() returns 0 to children and pid to parent

lyric kindle
#

tahts the fucking point

#

only parent forks

#

as much as he wants

meager hatch
lyric kindle
#

why dont u get it

#

also this part isnt even essential

#

the main part is after it

meager hatch
#

um no

#

parent forks once, the child forks again

#

you mixed up the if/else

lyric kindle
#

oh sorry

#

u were right

#

sorrry

#

i forgot my code

meager hatch
#

if you want the parent to fork twice it should be
pid = for(); if (pid) { fork(); } else {}

lyric kindle
#

yeah

#

i see

meager hatch
#

do you always call people dumb fucks? not very polite eh

lyric kindle
#

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?

meager hatch
#

lmao

#

did you forget your meds today

lyric kindle
#

to middle schoolers

#

@meager hatch why do u want to make me angry?

#

y?

meager hatch
#

oh

#

you're a middle schooler?

lyric kindle
meager hatch
#

well that explains the childish behaviour

lyric kindle
#

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

meager hatch
#

Lol

#

You prob just suck

lyric kindle
#

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

meager hatch
#

lol cant even tell if youre trolling at this point

lyric kindle
lyric kindle
#

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

nimble tide
lyric kindle
#

i found the root cause of the pipe issue

#

it was that i wasent closing it

#

after using dup2

#

@meager hatch i fixed the bug without ur help

#

dosent it feel shameful?

#

that u were so useless?