[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / 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


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


There is no c standard library. It's all compiler internals. What a bloated dogshit language. Even tcc implements these builtins. What a joke. I'm fucking PISSED I've been lied to
>>
Standard libs are bloat
>>
>>106440443
???
purity spiral?
why WOULDNT you want compiler intrinsics? (abstracting from the fact varargs exist bc of asm-level manipulation)
>>
>>106440457
wrappers for syscalls are nice for beginners
also portability. if one needs it
>>
>>106440461
Why not a fucking __builtin for printf fagwad. You already have $ARCH for any nontrival c program
DEBUGABILITY, PORTABILITY, MAITENCE, COMPLEXITY. If it's just code it's just code. The less magic bullshit in the world the better.
>>
>>106440443
based
I simply don't like reading __
>>
>>106440483
>If it's just code it's just code
its all *machine code. nuances

are you gonna bark at pointers too?
bc these are also an abstraction, y'know...
a compiler intrinsic if you will
>>
>>106440491
That's part of the langauge. There are things that SHOULD be part of the language those things should go in the compiler. THING THAT AREN'T PART OF THE LANGUAGE SHOULD STAY OUT!
>>
>>106440522
varargs are also part of the language
bc the standard lib is defined in the standard ¯\_(ツ)_/¯
i certainly dont mind it
i suck at asm and thats why i do c (never bothered to learn asm properly)
>>
>>106440522
also if you go with vanilla C youre missing out on low hanging fruit performance
like force inlines
which are great organizational tools for code clarity too
you can extract all your spaghetti from more complex loops at zero runtime cost
>>
>>106440491
If you know assembly you know what pointers compile to, if you try to read any code that use va_list you have to go read your compiler source to figure out what it's doing.
>>106440550
The standard library is not part of the language retard. It's a library, it's in the name.
>>106440564
Useless shit. Compilers can never affect more than 10% of your performance.
>>
>>106440522
also cpu intrinsics are not standard
and while you could just go with -march flags for hot loops id rather vectorize the code myself
>>
>>106440574
>>>106440550 (You)
>The standard library is not part of the language retard. It's a library, it's in the name.

^das retarded, otismo
stadard lib is why c is portable in the first place
look it up im not gonna spoonfeed you

>>>106440564 (You)
>Useless shit. Compilers can never affect more than 10% of your performance.
this is also, retarded. perhaps even more

let me rephrase that for you:
>avx2 never affects more than 10% of your performance
>>106440577

now shut the fuck up and go back to your code
>>
>>106440595
Amazing. Everything you just posted was wrong.
>>
>>106440631
>didnt even look it up
proof autism is a hard retardation
holy fuck youre slow
and retarded

total autismo trash recycling
>>
>>106440636
RETARD!
>The c programming language STANDARD
You fucking retard. Not the language. Go be braindead trash elsewhere please.
>>
>>106440636
>>106440595
>implying c is somehow less portable when you don't use the "stadard lib"
Retard alert
>>
>>106440659
>#include <stdarg.h>
holy mental retard
youre not even internally consistent

go play with legos or something
>>
>>106440678
You are just too retarded to understand the point. Again, give a single coherent argument for any function internal to a compiler I'll wait. And no "I don't know how to write it" isn't an answer. What's next you want all of stdlib inside a driver? kill yourself.
>>
>>106440706
no, i understand it very well
but you lack mental flexibility and your brain segs on basic levels of abstraction
not in the programming sense, conceptual abstraction

youre worthless
go play with legos, or count some matches
>>
>>106440713
Waiting. Why don't you tell me why stdlib isn't in the compiler, why don't you tell me why it's not a driver. If you can figure out simplicity maybe you'll be able to write real code one of these days.
>>
>>106440720
waiting for what?
>why isnt the sdtlib in the compiler
why would it be, mong?

floor is yours
>>
>>106440491
If you're project doesn't use pointers you don't need c.
>>106440730
BECAUSE NOT EVERY PROJECT NEEDS STDLIB YOU RETARD
>>
>>106440742
>digression
>strawmen

see, there was nothing to be addressed
if you have fuck all to say, shut the fuck up
>>
>>106440753
>digression
The entire point of the thread, why did you click on it if you couldn't understand it. Now fuck off.
>>
>>106440759
fuck your thread
i won kek
>>
>>106440769
>>106440595
Learning "compiler hints" is an unnecessary waste of headspace, a compiler is a tool, not a crutch for you to ignore real programming. Either the compiler should handle vectorization automatically and stay out of my way or not support it at all. In reality these hints only matter on a very very small number of cases as it will usually succeed automatically. Further proving the uselessness of compiler internals.
>>
>>106440794
>>106440595
And again. Memory is 100-1000x times slower, no matter how wide you go you aren't getting more than 10% free performance from a compiler.
>>
>>106440794
nono
not compiler hints
immintrin.h
it maps to asm very closely

anyways if you limit yourself to vanilla c ur gae and you're code will be slow
i, for one cant live without force inlines
c turns into a high level language
fukken python and shit
>>
>>106440808
>immintrin.h
That uses built-ins prove it doesn't I'll wait.
>>
>>106440829
>That uses built-ins prove it doesn't I'll wait.
who tf cares?
sizeof is an inbuilt
>prove me your code doent use it
whats the purpose?

what matters is the assembly you get and the means you used to get there
>b-but purity spiral
a thing for autists, tranies, and reddit
>>
disable builtin and linking libc
build glibc and musl(in case one stops working) as part of your project and static link it
>>
>>106440877
Static link what? musl won't build without builtins OBVIOUSLY. The correct response is to copypaste these builtins out of tcc into the std library implimentation and a builtinlibrary when not defined by the standard, then to simplify tcc/gcc/clang.
>>
ship your own syscall interface
become ungovernable
>>
>>106440720
With some compilers, parts of stdlib can be compiler intrinsics. Functions like memcpy or memset for examples.

va_args is a standardized shorthand for messing about with the stack, which would otherwise need to be done with assembly language. Check out how longjmp works for more stack oddness. Standards don't cover everything, the way they're implemented can be implementation specific.
>>
In case you were wondering this is how va_list is defined in plan 9
typedef char* va_list;
>>
>>106441218
Makes sense, variadic functions are such a rare case, even while debugging, that I'd doubt it's worth the hassle. And in the extremely rare cases that it does you can just convert them to fixed functions.



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