[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 / qa] [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]


File: Bugur.jpg (55 KB, 640x360)
55 KB
55 KB JPG
At least Rust have a usable std and stl, unlike C++
>>
how about a language spec then, ESLbro
>>
>>101213807
It's in the work anglo bro, thanks for correcting my bad English
https://blog.rust-lang.org/inside-rust/2023/11/15/spec-vision.html
>>
File: elektrokot-painting.jpg (47 KB, 661x603)
47 KB
47 KB JPG
>>101213592
>At least Rust have a usable std and stl, unlike C++
sounds like cope.
for neither of the above being C
>>
>>101214488
C is worthless toylang that's unusable without breaking the standard
>>
>>101214488
libc is especially unusable
>>101214556
not really true either. which extensions do you consider mandatory?
>>
>>101213875
didn't they disband?
>>
File: C-gigachad.jpg (50 KB, 500x500)
50 KB
50 KB JPG
>>101214556
books are for faggots
real men learn from reading code
>>
>>101214569
>which extensions do you consider mandatory
all of them, C is a worthless featureless shitlang without every tool that can enhance it, and even after you polish shit, all you have is a polished shit
>>
File: dagoth-ur.jpg (21 KB, 240x320)
21 KB
21 KB JPG
>>101214569
>libc
totally agree
its fucking trash
its written as if every project you do has to run on a mouldy potato
i use it pretty much for raw-ish syscalls and thats it
>>
File: cuda-dev.png (104 KB, 1365x1024)
104 KB
104 KB PNG
>>101214589
>all you have is a polished shit
thats where tyoure wrongh kiddo.
what you do with C is a direct refelction of your own skills
>>
>>101213592
>using any libraries
retard
>>
>>101214589
alright, I'll give you another try, please write something of substance this time.
which extensions do you consider mandatory?

>>101214601
>its fucking trash
eh, I don't dislike it per se, I just feel it's a little limited or dated, such as missing native utf8 support, signals being underdeveloped, and standard threads and atomics being... certainly something
>>
File: kot-signal.jpg (4 KB, 250x248)
4 KB
4 KB JPG
>>101214649
kinda self defeating, isnt it?
>wanna do project fast, so uses libs
>but chooses mid-level languages instead of something actually engineered towards that usecase.
>>
>>101214581
>t. dwm user that never wrote a line of C in his life
>>
File: sudo.png (215 KB, 1600x2000)
215 KB
215 KB PNG
>>101214705
i hate it with all my might bc i take its existence as an insult
the standard shit should have had intrinsics written into it behind ifdefs.
it is a fucking scandal that you can accelerate everything string related by merely assuming your strings are padded with 8 zeros.
which isnt the standard operation of C bc the assumption is "either you work in embedded or youre on your own"

well, then fuck you right back, libc.
>>
>>101214770
SSE2 brute force string search is more than x3 faster than libc, cniles are literally terrible at programming
-----------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------
string_view_find 4444 ns 4438 ns 157301
strstr_find 6853 ns 6845 ns 102242
sse2_strstr_find 1910 ns 1908 ns 366984
>>
File: gandalf.jpg (83 KB, 406x450)
83 KB
83 KB JPG
>>101214792
yep.
but C-ultists know this shit and thats why they dont use the libc.
>>
>>101214810
all C code uses libc, and garbage like malloc and free
>>
>>101214814
I bet you can't explain why malloc is garbage
>>
File: crab-roast.jpg (86 KB, 683x459)
86 KB
86 KB JPG
>>101214814
you dont need to.
and you seldom need something more powerful than the ol trusty malloc

theres really not much to gain using mmap over malloc when you bulk allocate. which you do if your iq is in the 3 digits...
... which youre ARE doing, right anon?
>>
>>101214831
low IQ interface, just like the entirety of libc, implementation is not even worth talking about when it fails at the essential
>>
>>101214841
>bulk allocate
yeah you're right anon, I just just let malloc call mmap behind the scenes, after all I'm not more intelligent than you
>>
File: elvis-laugh.jpg (258 KB, 1024x1024)
258 KB
258 KB JPG
>>101214842
>rustranny speaks about interfaces
a lack of self-reflexion is sign of sub 80 iq
>>
>>101214863
is rustranny in the room with you right now? Considering rust allocation patterns mimic malloc/free due to babyduck syndrome
>>
>>101213592
ok but stop posting cartoon children
>>
File: hardest-prison.png (359 KB, 474x521)
359 KB
359 KB PNG
>>101214857
>yeah you're right anon, I just just let malloc call mmap behind the scenes, after all I'm not more intelligent than you
>ill do things manually bc reasons

autism is a hard retardation indeed
youll onanize how you spent the past three days optimizing malloc
when i just allocate chunks of 1M and divide the run costs by 128000.
>>
>>101214901
>chunks of 1M
dunning kruger at its finest
>>
File: kernighan-on-c-2.jpg (65 KB, 850x400)
65 KB
65 KB JPG
>>101214914
ok
tell me how?
>>
>>101214914
>inb4 silence
its gonna be silence, isnt it?
>>
>>101214922
I just use mmap, and I never need to reallocate, because I'm not low IQ.
>>
>>101214952
i never reallocate.
and beyond a certain size, all that matters performance wise is that your data field is page-aligned.
and even that loses any meaning when you work with 1meg at a time
but yeah, thats x86shit

>I just use mmap, and I never need to reallocate
and this is fucking retarded in 95% of usecases, mr i memmap the whole system memory and let the os stand in for a lack of skill
>>
>mremap
this mentally ill nocodeshitting tranny keeps hallucinating this every single time, while I never used mremap in my entire life
>>
>>101214952
but malloc just calls mmap for large allocations?
>>
>>101215031
kek i thought it was another schizo who mmaps all available memory
>>
>>101214770
>either you work in embedded or youre on your own
well yea, that's pretty much the modern use case of C
>>
>>101215037
yes, malloc has no usecase when I can just call mmap myself
>>101215052
>you're a schizo if you do things correctly
ok mr tranny, don't forget to call free 3 billion times before exiting process.
>>
>>101215054
yeah, but its still comfy when dealing with things you wanna make go fast
im building tools for fintech purposes
i do this for my own consumption.

theres a database system
the basic data is in human readable form so theres high perf parsing too
theres a quasi scripting language
theres lots and lots of low level numbercrunching

and C is comfy as fuck for all that.
i dont even have a usecase for generics because i compose my functions by inlining them
in fact, i rely a lot on the ability to explicitly control what gets inlined and when to organize my code and not lose on performance.

but thats extended C, bc you need compiler instructions for that.
so if by C you mean vanilla C, then i guess youre right. (never worked with embedded yet)
>>
>>101215063
>ok mr tranny, don't forget to call free 3 billion times before exiting process.
bulk allocation is the exacty opposite, retard
you allocate a block
preferably in an arena
and then distribute pointers to said memory space to whatever youre "allocating"

but the allocation proper happened only once
so for a hundred thousand distributions you free only once.
you fucking autismo dweeb

stop taking ritalin
it activates napoleon complex in you
>>
>>101215140
you said you allocate in 1MB blocks, dumb tranny, 1MB is only enough for fizzbuzz, but it makes sense.
>>
>>101215151
its the easiest thing to parametrize in the world
an arena bulk allocator is something like 50 lines of code in C.
>>
>>101215166
>50 lines
wow anon, you're such amazing programmer, but I can align a pointer and return it to the user in 2 lines though.
>>
>>101215170
yeah but you have to have extra infrastructure to keep track of the older blocks to make it a proper arena.
i use a linked list bc i really dont give a shit.
you destroy your arena once you leave a context, so why should i care?
>>
>>101215151
>but it makes sense.
btw
its called "profiling your code"
or rather why you do it:
if something takes up 0.0000...00000% of your runtime, its really not worth optimizing.
thats where you wanna go full comfyness with your interfacing
you can abstract everything you can down to one line of code and completely remove that part of the code from your attention once youre done with it

when you work with C you really have to use your brain or you end up with fucking bolognese with fresh basilic leaves and parmeggiano
>>
>>101215063
>yes, malloc has no usecase when I can just call mmap myself
yes it does, as smaller allocations will instead use premapped process pages
>>
>>101215099
>in fact, i rely a lot on the ability to explicitly control what gets inlined and when to organize my code and not lose on performance.
I suppose you could achieve this via ifdef'd inlines, although I do understand why you'd want to reach for extensions.
but fear not, as attributes have finally arrived in standard C
>>
>>101214739
He is correct, though
t. embedded engineer
>>
>>101213592
>usable std
>mem::align_offset is not even guaranteed to work and can instead randomly fail
lol, lmao even
>>
>>101215581
>ifdef
admittedly i suck at macros
but how could you leverage that with inline?
bc the latter is not a hard directive, rather like a permission for the compiler to actually inline.
'doesnt guarantee that the compiler will.

i guess thats why attributes are a thing of their own, even in the newest standard. theyre a hard directive.
i think things do be like that bc computation vs size considerations gradually
went from favoring the small size part of the equation, when today the balance goes the other way
+ obv it appears that inlining as organization of your code completely throws off the heuristics of the compiler.
>>
>>101215193
>older blocks
oh no no no, here dimwit goes overcomplicating a big array again with his mentally broken linked list
>>101215569
I already have premapped pages
>>
>>101215710
>yeah its such a big array, the user will nev... Segmentation fault (core dumped)
also youre locking out 8kb of your cache for bullshit.
thats 8kb less code or useful data
you fucking autist
>>
>>101215731
>hallucinates 8kb out of nowhere
>>
>>101215743
ngl i did
array of 1000 pointers.
for ~1Gb with 1M blocks
>>
>>101215743
>>101215752
anyways
you solution doesnt scale. at all.
so it sucks for anything serious
>>
File: 1719461486084071.png (353 KB, 640x727)
353 KB
353 KB PNG
>>101214901
deep pic, bro. better ones have those metal bars, the worse ones have glass plates. because of the air flow inside of the fridge, you know... the bars are better. real deep
>>
>>101215764
doesn't need to scale when it's at maximum performance from the get go, keep coping tranny
>>
>>101215785
>doesn't need to scale when it's at maximum performance from the get go, keep coping tranny
a "hello world?"
wtf?
seriously
provide me one non-meme application that you wouldnt want to scale with the available hardware
ill wait

>>101215772
kek that escalated quickly
have a you
>>
>>101215824
>mmaping total ram somehow doesn't scale with total ram
incredible dunning krugery
>>
>>101215858
>have to go through more data than available ram
oom -> ack
>>
>>101215867
this never happens
>>
>>101215881
because you only write fizzbuzz
>>
>>101215703
>'doesnt guarantee that the compiler will.
no, but neither do attributes unless you go for
always_inline
(which even then is not a guarantee).
or do you go for always_inline that often that this would make a difference in practice?

>i guess thats why attributes are a thing of their own
do note that the standard defines only a couple of attributes, most are still implementation-defined.
but then again, the neat thing about attributes as per C standard is that they are not to alter the behaviour of the C abstract machine
>>
>>101215887
because I don't care about poorfags who try to load 10GB files on their 2GB RAM thinkpads
>>
>>101215895
>you go for always_inline that often that this would make a difference in practice?
thats what i do
and empirically, it werks as advertised.
it inlines, always.


>the neat thing about attributes as per C standard is that they are not to alter the behaviour of the C abstract machine
they better dont
it would mean changing what C is at the core, no?
>>
>>101215900
youre fucking retarded
you never tackled a problem where youre misison oriented.
as opposed to shovelware fizzbuzz tier related
>>
>>101215936
>muh mission oriented slopware
doesn't even have either malloc nor mmap to begin with, it has full control of hardware, it has access to full memory as one contiguous array, wow it's just like what I do already in all of my code either way, that must be humiliating to find out to you, nocoder.
>>
>>101215958
>my code
buggy pajeetware.
>>
>>101215973
very rich coming from a tranny that uses linked lists in memory management
>>
>>101215924
>it would mean changing what C is at the core, no?
depends on what fucked up attributes people would come up with, I suppose.
maybe they already exist outside the standard, but I the gcc manual on its own has like 100 pages on attributes
>>
>>101215980
stfu, worm
you dont even know what the words youre using actually mean
>>
>>101215990
>on its own has like 100 pages on attributes
and thats exactly why i dont know them all...
i just use what i need.
usually whenever i need an extension to the C language, theres an attribute for that
>>
>>101215990
>>101216019
*or a pragma
>>
>>101214705
>eh, I don't dislike it per se, I just feel it's a little limited or dated, such as missing native utf8 support, signals being underdeveloped, and standard threads and atomics being... certainly something
So basically C is good if you're ok with taking the shittiest code known to man and pretending it's not that bad after all. That matches my experience actually
>>
>>101216059
no
C is good if you like working with your own libs
bc libc is pretty trash
>>
>>101216086
>making everything from scratch
>in language with no abstractions
dimwittery is unreal
>>
>>101216059
>>101216086
*and kinda misses the point of using C in 2024 to begin with
>>
>>101216092
yeah.
its insane how you zoomies are illiterate

speacialized solution vs generalist one.
the reason why reinventing the wheel is sometimes a necessary evil
>>
>>101216112
you can make a good specialized solution without grinding your dick off with mentally ill garbage interfaces that are created due to C's deficiencies
>>
File: cheetah-laugh.jpg (8 KB, 250x250)
8 KB
8 KB JPG
>>101216136
>nuh interfaces
by using libraries?
>>
this tranny doesn't even understand what xhe has been spoonfed, incredible
>>
>>101216170
regardless who this was destined to, ad homonem is a gay form of concession.
and a pretty unsafe one at that
>>
>>101216019
>and thats exactly why i dont know them all...
you're a phony, then!

>>101216059
how did you come to that conclusion? I said the stdlib was a little lacking, but C libraries in general are excellent.
>>101216086
I wouldn't limit myself to self-implemented libs, there's so much out there:)
>>
>>101216086
>C is good if you like working with your own libs
It's not a coincidence that out of all those "just use C without libraries" people, exactly zero of them ever produced a GUI program with proper international text support.
Also, probably 90% of C programs use bad implementations of things like hashmaps, because if you have an actual problem to solve, you probably want to just think about that problem and not waste your time typing in well-known algorithms for already solved problems. You reuse whatever basic hashmap you have laying around and move on.
The reason why C and C++ people "like working with their own libs" is because they've only tried using C and C++ libraries and they've found that they're invariably pieces of trash, taking hours of meaningless troubleshooting to get them to build at all, and they're all bloated as fuck because they have to include their special snowflake versions of hashmaps (or even strings! lmao)
Presented with that, of course everyone concludes that you have to write your own libs.
But in a language that's even just a little big better, most of those issues disappear, and suddenly you realize that you can just use a generic hash table from the standard library, or some functions to split utf8 clusters properly, or whatever, and it's really not a big deal and actually saves you time.
>>
>>101216255
>muh GUI
lol, lmao, none of them ever produced any program ever, cli is too hard for them
>>
>>101216254
>you're a phony, then!
kek i just i ill kms then

>I wouldn't limit myself to self-implemented libs, there's so much out there:)
thats not what i do
i just avoid the libc specifically

ofc i use the sdls and such
and i still use the libc for a ton of things
like i use math's implementations of sin/cos etc
i use the os handles
but wahts performance-critical is usually homebrew.
like stringops.
like half of the math lib.
the really heavy weight lifting i do i do it on the gpu but thats definitely NOT the libc...
>>
>>101216255
>nuh gooey
pretty much everything that ran before 2000.
the rest is retard webshit noises, im sorry
>nuh utf 8
it werks in "higher level languages" bc you have a layer of abstraction of which makes em "higher level languages" to begin with
im fucking speechless

>>101216329
group cope therapy?

>tranime picrels on the log
/lgbt/ webshitters need to go back
>>
> C programmers making writing your own string library from scratch a fucking rite of passage
> language is only relevant as C++ is more of a clusterfuck than a hoarder’s basement

That being said, programming in C is weirdly pleasurable, it’s as if you’re a medieval monk copying philosophical texts and adding your own footnotes or something.
>>
File: fremen-gosling.jpg (326 KB, 1600x1617)
326 KB
326 KB JPG
>no async
>some bloated community framework is now mandatory in every project
lmao
>>
@101216440
low IQ tranny obsessed with "high level" and "low level", lmao my language has both because it's not a toy
>>
/lnd/ larping nocoder daily
>>
>>101216560
>That being said, programming in C is weirdly pleasurable, it’s as if you’re a medieval monk copying philosophical texts and adding your own footnotes or something.
it goes away quick
once you have your lib or you work with an existing codebase youre working with a high level language like any other
>>
>>101216571
>*angry retard noises*
i accept your utter and irrevocable concession
>>
>>101216708
>once you have your lib or you work with an existing codebase youre working with a high level language like any other
delusional beyond any belief
>>
>>101216743
>ad homonem wo argument
seething.
>>
>>101213592
Kinda. It's pretty barebones by design - the developers learned from C++ that standard libraries don't age too well.

But in Rust, it's easy to use third party libraries, unlike in C++, where that is a massive pain in the ass that complicates the build process for everyone who wants to build your shit.
>>
>>101216787
>using makefiles is le hard
>adding -lLIB to LDLIBS is le hard
ok dimwit
>>
>>101216386
>like stringops.
>like half of the math lib.
absolutely fair

>the really heavy weight lifting i do i do it on the gpu but thats definitely NOT the libc...
:D no, most certainly not
>>
>>101216816
>t.dunning kruger forte
gl accounting for all the distros people will want to build your sw on
>>
>>101216843
the only people who build software are gentoo users
>>
>>101216816
>Makefiles
That excludes the compiler for the most popular desktop OS. Why do you think the complexity of CMake is needed?

Also, this still doesn't help you actually install and locate the libraries, which ranges from "it's kinda easy" when it's a popular library and in your OS' package repos to a fucking nightmare of you having to compile barely documented garbage that relies on ancient libraries that your distro doesn't even package anymore.
Which will happen to your direct dependencies too, eventually.

It doesn't seem like you've ever worked on any sizable project.
>>
>>101216887
fair counterpoint.
>>
>>101216895
my code doesn't compile on irrelevant systems, sorry
>>
>>101216934
It's okay, I haven't valued your opinion in the first place.
>>
>>101216946
sour grapes
>>
File: rust_logo.png (97 KB, 2048x2048)
97 KB
97 KB PNG
>>101213592
I spit on your face, you stupid bitch.
>>
File: plug it.png (36 KB, 640x640)
36 KB
36 KB PNG
>>101217039
uh oh boypussy is leaky again, time to plug it up
>>
>>101213592
The only thing rust has going for it is the async functionality beats c++ coroutines and it’s less verbose than c++. Other than that the borrow checker is an absolute nightmare and why everytime I have rust project do I have like 20 million dependencies I have to download it’s literally insane.
>>
this thread is anti russia propoganda and belogs on pol
>>
File: rust.jpg (161 KB, 778x1190)
161 KB
161 KB JPG
>>101217053
>>
This entire thread genuinely reads like 3 pajeets (or badly written bots) inadvertedly arguing among themselves thanks to the lack of poster count about the most banal, inconsequential shit in modern software dev.
>>
>>101216255
use absl scrub
>>
>>101216440
>it werks in "higher level languages" bc you have a layer of abstraction of which makes em "higher level languages" to begin with
>im fucking speechless
So it's good that that this extremely basic thing isn't supported in a standard way because it's a "layer of abstraction"? That's literally it? Not even trying to explain if there's any downside to that layer of abstraction, just a principled stance against any kind of abstraction?
I respect the anti-tranime sentiment but this seems like a retarded opinion to have.
>>
>>101219603
yes, cniles are low IQ, they cannot fathom that abstractions are 0 cost when implemented properly.
>>
File: nobrain.png (4 KB, 505x572)
4 KB
4 KB PNG
>>101219636
>>
>>101219603
>>101219636
Abstractions are a crutch for novices who can't make performant code
Real programmers always target bare metal, they never use abstractions, that's why they only write in C
>>
>>101219819
so true, writing add(a, b) is so much better than a + b, the former is also faster because um because well trust me bro
>>
>>101219856
The code that you write is not necessarily exactly what implements it, so don't guess. Measure. Really.
It's easy for your assumptions to be wrong, so measuring (probably including with different compilation options) stops you from uttering things that make you look (even more) like a know-nothing moron.
>>
>>101219603
>extremely basic
>cant write it himself
pick one.
>>
>>101220740
I don't need to measure something that is literally equivalent code, dimwit.
Abstractions are good, you're low IQ, there's nothing else to say.
>>
>>101213592
whats wrong with the C++ std?
I don't use C++ but I'm dabbling with learning it.
What makes it so bad?
>>
File: 1719786923914.png (18 KB, 282x424)
18 KB
18 KB PNG
>>101213875
https://github.com/rust-lang/spec
>created 8 months ago
>have not written anything except for the title "Introduction"
>3 days ago they added some "builder" for a document that they have not even started yet
lmao this is a joke right?
>>
>>101220979
It's improving. That's all that really matters honestly. But it use to be bad. Good example was the SwissTables talk about how bad the std::unordered_map was (at least in GNU).
>>
>>101220979
> rust compiler is like yo mama, she annoying and fat but she got yo back
> C++ compiler is like yo dad, he say yea to everything and then leave ya to go get milk when shit hit the fan
>>
>>101214581
>C: jump to definition often takes you to a header file and you can't see the source without cloning whatever library you're using separately
>Rust: jump to definition takes you to the implementation every time
You're making a strong case for using rust
>>
File: freedom.jpg (138 KB, 800x600)
138 KB
138 KB JPG
>>101220979
That is commie propaganda, C++ is far superior to rust. Simple as.
>>
>>101223941
> language is so shit that it has multiple Turing complete languages within itself but will still segfault and UB like a bear on cocaine
> puts its logo in front of the Murican flag and makes an argument worser than a wedding dress site chatbot
> “Commie propaganda” when even the US government recommended the use of modern, safer alternatives like rust

I’m sorry, Uncle Sam needs you shipped to Alaska’s one building town asap for the concentrated amount of bs that would revive even Allosaurus from extinction
>>
>>101216571
meant for >>101216440
>>
>>101221737
Last time I looked there was a lot happening on Zulip
>>
>>101224326
Anon... the US government is communist. The Soviets won the ideological Cold War.
>>
File: stop-teaching-c.png (394 KB, 1276x702)
394 KB
394 KB PNG
>>101228060
war?
what war?
https://en.wikipedia.org/wiki/Rolls-Royce_Nene#Service_use

1946/47- several months after the "iron curtain speech", an era when air superiority is everything
and nukes can only be delivered by air

the brits gave the jet engine technology to the soviets to CREATE air parity.
otherwise the ivans are stuck with shit, ersatz german engines which arent suitable for operation due to their ridiculously low lifetime.
without this transfer of technology there would have been no soviet union.
>>
File: sushi.png (182 KB, 340x340)
182 KB
182 KB PNG
>>101213592
C++'s STL is okayish if you don't take into account the tremendous usage of templates and macros that obfuscate compiler warnings/errors.
At least, it got better with concepts and requires clause which made arcane techniques like SFINAE pretty much useless.
>>101213807
this
Rust sill doesn't have a proper specification independent of rustc. What a meme language.
>>101215895
>>101215924
Compilers probably know better than you when to inline.
>>101216255
>The reason why C and C++ people "like working with their own libs" is because they've only tried using C and C++ libraries and they've found that they're invariably pieces of trash, taking hours of meaningless troubleshooting to get them to build at all, and they're all bloated as fuck because they have to include their special snowflake versions of hashmaps (or even strings! lmao)
Blatantly false. People write their own libs because the existing ones are not suitable for the particular case they are working on. That's essentially why most game studios use their own implementation of containers which rely on gpu parallelization instead of using the STL.
>But in a language that's even just a little big better, most of those issues disappear, and suddenly you realize that you can just use a generic hash table from the standard library, or some functions to split utf8 clusters properly, or whatever, and it's really not a big deal and actually saves you time.
Alternatives to C and C++ usually provide higher-level abstractions that simplify development and reduce the risk of errors at the cost sacrificing most of the fine-grained control over performance and optimization.
>>
>>101228508
Compilers probably know better than you when to inline.
>dont inline a wrapper with 1 (one) loc inside
no, they dont.
they dont.
>>
>>101228508
>>101228525
like i wrote
the core issue is that whether you inline or not depends on the balance of memory use vs computation cost.
the compiler cannot know where you put the fulcrum.
>>
>>101228525
>>101228553
Compilers can accurately measure the size of a function and its call overhead to determine whether to inline it or not.
I am not saying that they never struggle to inline functions with complex control flow or that they never apply suboptimal inlining. In most cases though, unless the profiler tells you otherwise, I believe it is generally wise to let the compiler handle it.
>>
>>101228625
orthogonal to what i just wrote.
theres more considerations to size vs ops than performance alone.
like the context itself.
OS time sharing throws a wrench into things bc you have to account for the fact that the cpu has to move between contexts.
that means moving between programs.

in order to limit un/loading instructions into the cpu the programs are kept deliberately small.
which means less inlines than there would be in a case where optimal performance of your program is all that is considered.

there might be an obscure flag just for that that but in my philosophy, if a learning a tool takes longer than writing the function you need from it,
you better write the function yourself.
improves skills, sometimes you invent something.
corporate hates that attitude but fuck corporate.
im unhireable anyways.

still, ill ask chud gpt whats the flag i should use, if thats a thing.
now that chud gpt is finally search engine-tier.
ill run some benchmoorks to see if im in the right.

w/o said theoretical compiler options inlining is bad tho. at least for my usecase.
>>
>>101228625
theres actually quite a few flags i could play with
but then i am basically manually controlling the inlining thing.
i will play around with this, but its basically what im already doing, only with extra steps. parametrized. and obviously less granular then a hard always_inline directive
>>
>>101228625
What compilers look at to determine whether to inline is the size of the function, basically. What I care about is how much the size of the function goes down after inlining and optimizing. Even if the function being inlined is a massive 3000 line beast, if there are enough optimization opportunities when inlining, then I want the compiler to do it. The compiler does not think in these terms, and probably never will (though it could maybe get some heuristics for this, the cost of a bad heuristic would be massive). But I know what optimization opportunities will be exposed, and can tell the compiler.
>>
>>101228508
>Compilers probably know better than you when to inline.
yeah, probably. which is why I just use inline, not always_inline
>>
>>101216568
here's your async bro
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r9.html
>>
>>101230232
this shit gave me a migraine
i didnt really analyze it but i bet you could remove 75% of the handles in it if you reforge the metal model
>>
>>101230312
*mental model
>>
File: foxy_protester.jpg (327 KB, 1483x1351)
327 KB
327 KB JPG
>>
>>101230232
Not reading all that
t. https://go.dev/tour/concurrency/2
>>
>>101231811
>not reading all that
>here read this instead
lel
>>
>>101231811
still, i read it.
go has concurrency done right
>>
>>101214611
>GPU keeps crashing
driver bug, not my problem :^)
>>
>>101231811
>>101231853
(cont.)
but they have the luxury of baking conc. into the language.
c++ had to have concurrency grafted onto it.
still, im sure c++'s conc. could be streamlined
>>
Another year has passed, and that's another year I have been ignoring Rust. Has it imploded yet in any more spectacular failings?
>>
>>101231912
no, it's getting bigger and bigger
>>
>>101231912
No, the "is-odd" crate isnt popular enoguh yet.
>>
>>101220979
It's bloated beyond belief. Vast majority of it is either deprecated or was already dead on arrival. The only useful part is a narrow, ever changing slice that still leaves a lot to be desired.
There is a reason why huge, 3rd party libraries like BOOST are so popular among C++ programmers. And the difficulty of managing multiple dependencies is only half of the story.
>>
>have to make a state machine in rust
>kms
>>
>>101232624
you seem to not know the language then. it's very nice with pattern matching and enums. useful engineering patterns
https://cliffle.com/blog/rust-typestate/
>>
Aren't you kids still using Ada?
>>
>>101233553
ada larpers couldn't keep up the act because they get disproven by facts every time
>>
>>101232624
What do you find hard about it?

>>101233553
Weaker guarantees and SPARK is unusable for general programming.
>>
>>101233849
Struct states are different types so you can't pass them around or match against them. Wrapping all states in an enum is tedious to work with.
>>
>>101234198
implement traits for the structs. sounds like you don't know how to write a state machine at all
>>
>>101234198
That's static typing for you.
Use polymorphism via traits or use one general type for the state.
>>
I used to have nothing against rust.
Until today, when I needed to install a simple python library on my phone.
What should've been a simple pip install turned out to take like an hour of me figuring out I needed to install rust and then wait for it to download 2 fucking Gb of shit and then compile the thing on my phone leaving all the crap behind.
If I understood correctly the problem was the library developer didn't add a wheel for my phone's architecture because I have the same library on my pc and I didn't have this problem when I installed it there.
Could you guys please sort this out?
But also, who thought it was a good idea to have python/npm style dependency management but for a compiled language? That's insane!
>>
>>101235159
>downloading a library on my phone
no one serious programs on a phone
>>
>>101235351
I wrote the program on my computer to use on my phone. The library is one of its requirements.
It's all working as intended now but it was a pain to set it up.
Of course if I knew about this issue in advance I would have chosen an alternative library.
>>
File: 1715076873909425.gif (2.98 MB, 600x338)
2.98 MB
2.98 MB GIF
>>101214556
Ask me how I know you're a tranny.
>>
>>101214874
Source?
>>
>>101234705
>>101234869
I'm probably going to have to do that.
I don't like how traits force the same function to be on each state.
>>
>>101236267
You can have default stub implementations and/or methods on structs and downcast them when needed. Check std::any::Any.
>>
>>101236267
Sounds like you haven't thought through any of your problem. You should write code far more often than you compile it
>>
>>101223189
>Muh misconfigured editor is a language issue
>Muh strawman
>>
>>101214914
Byte alignment and chunk sizes, cmon bro
>>
>>101213592
C++ got added and then immediately removed from the linux kernel for being garbage
Rust meanwhile is still going strong.
>>
>>101237656
Could be stronger. I think it's still at the point where they could toss it out tomorrow without losing any mainline end-user functionality? So keeping it is low-cost.
Keeping C++ had a higher cost because it could infect any part of the codebase, unless I misunderstood that experiment



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