← Home ← Back to /g/

Thread 106471332

219 posts 52 images /g/
Anonymous No.106471332 >>106471363 >>106471368 >>106471518 >>106471586 >>106471604 >>106471752 >>106472282 >>106472374 >>106472440 >>106472603 >>106472934 >>106474835 >>106476216 >>106476415 >>106476547 >>106476846 >>106477195
Buffer overflows and Rust
Why did people create an entire language with different paradigms instead of just doing this?
Anonymous No.106471349
User input is gay. If we were interested in what the user has to say, we wouldn't have learned to code.
Anonymous No.106471363
>>106471332 (OP)
>passed a random uninitialized pointer as const char* input,
>strlen segfaults
Anonymous No.106471368
>>106471332 (OP)
mental negritude
on a more serious note
grifts, licence replacements, political shit

also rust is supposed to do static analysis of your code
but the guarantees are iffy
Anonymous No.106471377 >>106471387 >>106471820 >>106472948 >>106473141
c++ should allow variable legnth arrays on stack. we should kill everyone who opposes this.
Anonymous No.106471387 >>106471419 >>106471427 >>106471527
>>106471377
wrong, dumb retard. VLA are almost always worse than fixed size arrays.
https://nullprogram.com/blog/2019/10/27/
sage No.106471414 >>106471422 >>106471490
>.cpp for no reason
>not taking '\0' into account
>mentioning rust to get (You)s
jeet bait
Anonymous No.106471419 >>106471422
>>106471387
Starting with this guy preferably.
Anonymous No.106471422 >>106471446
>>106471414
>>not taking '\0' into account
wrong, dumb retard

>>106471419
not an argument
Anonymous No.106471427 >>106471431
>>106471387
you contradicted yourself on the span of two phrases
Anonymous No.106471431 >>106471455
>>106471427
>dumb retard can't read
Anonymous No.106471446 >>106471454 >>106471455
>>106471422
(nta)
>not an argument
none needed

you said yourself that fsa are *ALMOST* always better
which means sometimes they arent

so why would you just bar vlas from c++?
>unreliable to sizeof which makes it gonfusing to austists
*facepalm* (i wish that wasnt the reason)
Anonymous No.106471454 >>106471464 >>106471465
>>106471446
>wall of dumb retardation
damn, cniles are absolutely retarded
Anonymous No.106471455 >>106471470
>>106471431
>>106471446
oh i can read
its just that youre mantally handicapped and dont even realize what youre saying
Anonymous No.106471464 >>106471470
>>106471454
> no argument whatsoever
ok, then youre trolling *shrug*
Anonymous No.106471465 >>106471470
>>106471454
Not an argument
Anonymous No.106471470 >>106471477 >>106471484 >>106471520
>>106471455
good thing I linked you a post from a (non retarded) cnile that demonstrates why VLAs are retarded.
Here is Linus Torvalds saying the same thing: https://lkml.org/lkml/2018/3/7/621
>USING VLA'S IS ACTIVELY STUPID!

>>106471464
dumb retard, try formulating an argument

>>106471465
correct
Anonymous No.106471477 >>106471479
>>106471470
yeah but i dont care now
you lost my attention
learn to talk to people
Anonymous No.106471479
>>106471477
>people
cniles are dumb retards
Anonymous No.106471484
>>106471470
Realistically you could just compare the stack pointer and handle accordingly but still i agree it's implemented like garbage in the language itself.
Anonymous No.106471490 >>106471547 >>106471917 >>106472190 >>106478239 >>106480810
>>106471414
C++ is jeet repellent. The only reason rust was invented was to prevent the jeetpocalypse of jeets trying to take over C++ codebases.
Anonymous No.106471510
>rust thread
man I thought that rust was finally dead or something, didn't hear from rust shills in months
Anonymous No.106471517
>int main()
that's IB
Anonymous No.106471518 >>106473046 >>106478251
>>106471332 (OP)
the problem is the refusal of the C committee to fix arrays. They should have been ptr+length instead it all turns into pointer when you pass it around and you loose the information you want. c++ has the same problem. The D creator suggest a long time ago how to fix the issue but no one cared.
Problems like these are why it was necessary to make a new language that could learn from past mistakes and move forward Rust with its explicit nature half succeeds. Zig, Odin, Jai, Beef etc. all learned from the same mistakes and tried to improve it so far but they don't want to push too much responsibility on the compiler.
Anonymous No.106471520 >>106471527
>>106471470
he doesn't give actual reasons he just says its le bad for his use case in the most seething way possible.
Anonymous No.106471527 >>106471553
>>106471520
see >>106471387
sage No.106471547
>>106471490
you should add the fact the kernel developers really love C++ to this very real manifesto
Anonymous No.106471553 >>106471627
>>106471527
aaaaaand looks like it's just more basedrage about le big bad buffer overflows
Anonymous No.106471586 >>106471598
>>106471332 (OP)
>Why check things once at compile time when you can check them a billion times at execution time
Anonymous No.106471598 >>106471723
>>106471586
>implying your program's data is always literals known at compile time
the rust community has serious problems with tech literacy levels
Anonymous No.106471604
>>106471332 (OP)
>Why did people create an entire language with different paradigms instead of just doing this?
Because of many other features and guarantees.
Anonymous No.106471627 >>106471653
>>106471553
cniles just can't stop fucking up
Anonymous No.106471653 >>106471660 >>106471724 >>106471864
>>106471627
and rust isnt a silver bullet
Anonymous No.106471660 >>106471741
>>106471653
those CVEs are not memory safety related.
dumb retard.
Anonymous No.106471723 >>106471741 >>106471910
>>106471598
The actual data is irrelevant if the compiler is able to prove that the program behaves well for any input.
Anonymous No.106471724 >>106471741 >>106471836 >>106471847
>>106471653
it's funny how rust is never used for any new project, it's all just rewrite x in rust, infact this is why rust is doomed, if you look closely all popular programming languages became popular because they were used to make completely novel software that changed industry forever, for C it was Unix, for JS it was the web, for Java is was enterprise applications, rust simply lacks it's niche.
Anonymous No.106471741 >>106471936 >>106478282
>>106471660
exactly, you imbecile
rust isnt a silver bullet

>>106471723
that is impossible
it is the halting problem, reformulated

>>106471724
~ more or less
amazon is using rust for its codebase i heard
servershit could be a niche for rust if it were a more mature, streamlined language
Anonymous No.106471752 >>106471758
>>106471332 (OP)
the compiler also handle memory leaks but yeh
there are safe functions in C, there is no need to use rust from program security perspective, and desu since its also shit in benchmarks there is no need to use it at all
Anonymous No.106471758 >>106471812
>>106471752
safe = runtime checks = slow
one just cannot have speed and correctness without a competent workforce
rust or c or with any language
Anonymous No.106471812 >>106471839
>>106471758
thing is that the rust parser is extremely slow and in C you have way better solutions.
you can write safe program in C that will outstand rust in performance and readability
Anonymous No.106471820
>>106471377
what is alloca()?
Anonymous No.106471836 >>106471848 >>106471975
>>106471724
Yes Rust is doomed, just 2 more weeks.
Keep us posted tomorrow in your next rust seethe thread.
Anonymous No.106471839 >>106471868
>>106471812
>you can write safe program in C that will outstand rust in performance and readability
im not sure about that
but also my working definition of "safe" makes rust an unsafe language

to me a mem-safe framework is a framework that has all memory related ops abstracted away, and taken care of behind the scenes
to turn c into something like that would mean runtime checks everywhere
so conditionals bonanza

to make c actually safe one would have to turn it into python, basically
or java. yeah, java sounds better, using python as comparison was exagerated

im not saying that we should, mind you. that would defeat the purpose of c in my opinion
Anonymous No.106471847 >>106471873 >>106471907 >>106471951 >>106472659
>>106471724
>it's funny how rust is never used for any new project, it's all just rewrite x in rust, infact this is why rust is doomed, if you look closely all popular programming languages became popular because they were used to make completely novel software that changed industry forever, for C it was Unix, for JS it was the web, for Java is was enterprise applications, rust simply lacks it's niche.
Can you name any totally new C project that isn't a rewrite that was made in last 5 years?
Anonymous No.106471848
>>106471836
keep pushing shit to people throat and people will just start to hate it.
imagine that
Anonymous No.106471864
>>106471653
None of these CVEs are related to the things in the plot you are replying nor the post before that.
Rust does prevent buffer overflows, use after free and such.
Anonymous No.106471868 >>106471885
>>106471839
>runtime checks
you don't need that.
all you need are functions like OP that handle memory overflow/corruption
just simple if statements
Anonymous No.106471873 >>106472081 >>106472096
>>106471847
theres actually quite a few
Anonymous No.106471885 >>106471923 >>106472647
>>106471868
>just simple if statements
that is
EXTREMELY litertally
a runtime check

youre literally checking a condition
during runtime
Anonymous No.106471907 >>106472081
>>106471847
these are more name-droppey
Anonymous No.106471910
>>106471723
Can it?
Anonymous No.106471917
>>106471490
I actually believe this. C++ is probably the most aryan language desu.
Anonymous No.106471923 >>106471963
>>106471885
but runtime refer to a running binary, you don't need to preform these kind of tests, just set the correct functions and that's it, its a fucking bloat
Anonymous No.106471936 >>106471971
>>106471741
>exactly, you imbecile
Then why did you post those two CVEs?
dumb retard
Anonymous No.106471951 >>106472081
>>106471847
C was invented in 1970s, it already developed everything that it was created for, you completely missed my point retard.
Anonymous No.106471952
Because of the useless O(n) computer cycles every time you want to copy a string?
Anonymous No.106471963 >>106471977 >>106472099
>>106471923
yeah, well
the clean and ethnically homogenous way of doing things is that you check your input once, at the entry point
if its a literal, the check is done by hand, by the programmer

problem is that if its a library that youre writing, you never know where the entry point is, in other words- where does data input enter your program
so you have to check everything, at all times
because that could even be a malformed literal

and thats a whole lot of redundant if statements
Anonymous No.106471971 >>106471977
>>106471936
>doesnt understand
>calls others retards
yeah youre flaming
go away
Anonymous No.106471975 >>106472044 >>106476603
>>106471836
>2 more weeks
?
it has been months since rust was kicked out of online hype train, they are already writing preemptive obituaries.
https://medium.com/solo-devs/why-no-one-is-talking-about-rust-in-2025-21d7e059fa49
Anonymous No.106471977 >>106472031
>>106471963
>so you have to check everything, at all times
wrong
https://wiki.haskell.org/index.php?title=Newtype
https://doc.rust-lang.org/rust-by-example/generics/new_types.html

>>106471971
dumb retard
Anonymous No.106472031 >>106472050
>>106471977
>more flaming
you expect me to read your brain vomit?
its simple
if you dont make a runtime check
you dont know if your data is malformed

so you check your entrypoints
fptrany retard nigger mongoloid made me repeat myself again
wow. such iq

now fuck off
Anonymous No.106472044
>>106471975
yeah bro just 2 more weeks and rust will be really dead for real this time. This Medium blog proves it.
Anonymous No.106472050 >>106472055
>>106472031
dumb retard, you make a newtype whose constructor checks if the input is valid. then you pass that newtype around and have a guarantee that the input is valid.
try using your brain next time.
Anonymous No.106472055 >>106472062
>>106472050
>you make a newtype whose constructor checks if the input is valid.
which is a runtime check

functional programming scars the brain
turns you into a mongoloid
Anonymous No.106472062 >>106472069
>>106472055
try doing a runtime check for your brain
dumb retard
Anonymous No.106472069 >>106472075
>>106472062
fine argument
but you were wrong in every one of your posts ITT, fptrany retard
Anonymous No.106472070
>passes_overflow_test
Anonymous No.106472075 >>106472080
>>106472069
the newtype pattern isn't functional programming, dumb retard.
also, are you the lamao faggot? you are just as retarded as he is.
Anonymous No.106472080 >>106472084
>>106472075
>digression
nothing is gonna distract from the fact youre a napoleonioan retard who cant even into basic logic
Anonymous No.106472081 >>106472086 >>106472187 >>106472187
>>106471873
>>106471907
>asking AI
Cnile humiliation ritual lmao

Also all of these are just rewrites

>>106471951
No you missed the point. As you have noticed your criteria is biased and has nothing to do with a language and everything to do with what time frame you are considering.
Anonymous No.106472084 >>106472091
>>106472080
>dumb retard can't into basic type theory
lamao
Anonymous No.106472086 >>106472093
>>106472081
>t. seething
>malding, even
show your hastable implementation, trany ret
Anonymous No.106472091
>>106472084
>digression
nothing is gonna distract from the fact you dont even know what runtime means
Anonymous No.106472093
>>106472086
let table = HashMap::new()

Let's see Paul Allen's hash table
Anonymous No.106472096 >>106472100
>>106471873
>TTS rewrite
>Webshit rewrite
>JD rewrite
>music player rewrite
>perlin noise rewrite
Anything new?
Anonymous No.106472099 >>106472116
>>106471963
Ultimately the problem is libraries. Hacks who can't code want to glue together libraries without having to think or understand anything. Any language after C is explicitly made for this purpose, that's why performance has been on a steady decline for the past 2 decades
Anonymous No.106472100 >>106472115
>>106472096
prove these are rewrites *shrug*
Anonymous No.106472115 >>106472125
>>106472100
NTA, there already exist software for all of that, yet some cnile had to rewrite it for no reason.

Also GNU/Linux is a rewrite too.
Anonymous No.106472116
>>106472099
the problem is big corpo
they want their workforce to be interchangeable drones to reduce dev costs
and this is why libs were created, and that portability was shoehorned into C

C didnt even have a standard for the first 10 years of its existence
Anonymous No.106472125 >>106472129 >>106472162
>>106472115
>redditspacing
also
>retarded non argument

then everything is a rewrite and the term has no meaning
Anonymous No.106472129 >>106472134
>>106472125
cope
Anonymous No.106472134 >>106472137
>>106472129
ur the one seething though
how bout you go back?
you'll end up with an ulcer
Anonymous No.106472137 >>106472145
>>106472134
seethe
Anonymous No.106472145 >>106472148
>>106472137
>n-no, u
pathetic
Anonymous No.106472148
>>106472145
cope
Anonymous No.106472162 >>106472184
>>106472125
>then everything is a rewrite and the term has no meaning
So you have finally realized how retarded your first point was. Good.
Anonymous No.106472184
>>106472162
thats your definition though
you just called yourself retarded, reddit
Anonymous No.106472187 >>106472216 >>106472258
>>106472081
>No you
This is your argument in nutshell btw
>>106472081
>your criteria is biased
my criteria is simple, languages like C, Java, JS etc all had their own niche, completely novel software which is backbone of modern IT infrastructure was developed using them.
What is Rust's niche? What new class of software has it brought to the world?
Anonymous No.106472190 >>106472192 >>106472201
>>106471490
> politics and shit
That guy just got mad he couldn't write shitty code in rust and wrote a manifesto huh
Anonymous No.106472192 >>106472201
>>106472190
no, rust is just dogshit.
Anonymous No.106472201
>>106472190
>>106472192
i mean, yeah
writing a manifesto just to say that seems kinda excessive, not gonna lie
Anonymous No.106472216 >>106472235
>>106472187
>What new class of software has it brought to the world?
fast and memory safe software
Anonymous No.106472235 >>106472240
>>106472216
>memory safe
yea yea ofc reddit
+1
Anonymous No.106472240 >>106472254
>>106472235
already fixed
Anonymous No.106472254 >>106472257
>>106472240
heres the repo
https://github.com/Speykious/cve-rs
someone run it

bc i dont believe you for shit
Anonymous No.106472257 >>106472278
>>106472254
PS C:\Users\nigger> cargo install cve-rs
Updating crates.io index
Installing cve-rs v0.6.0
Updating crates.io index
Compiling cve-rs v0.6.0
error: lifetime may not live long enough
--> C:\Users\nigger\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cve-rs-0.6.0\src\lifetime_expansion.rs:44:9
|
43 | pub fn expand<'a, 'b, T>(x: &'a T) -> &'b T {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
44 | let f: fn(_, &'a T) -> &'b T = lifetime_translator;
| ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b`
|
= help: consider adding the following bound: `'a: 'b`

error: lifetime may not live long enough
--> C:\Users\nigger\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cve-rs-0.6.0\src\lifetime_expansion.rs:54:9
|
53 | pub fn expand_mut<'a, 'b, T>(x: &'a mut T) -> &'b mut T {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
54 | let f: fn(_, &'a mut T) -> &'b mut T = lifetime_translator_mut;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b`
|
= help: consider adding the following bound: `'a: 'b`
= note: requirement occurs because of a mutable reference to `T`
= note: mutable references are invariant over their type parameter
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance

error: could not compile `cve-rs` (lib) due to 2 previous errors
error: failed to compile `cve-rs v0.6.0`, intermediate artifacts can be found at `C:\Users\nigger\AppData\Local\Temp\cargo-installfaIRF7`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Anonymous No.106472258
>>106472187
>my criteria is simple, languages like C, Java, JS etc all had their own niche, completely novel software which is backbone of modern IT infrastructure was developed using them.
Which is completely different from your original point and basically boils down to the realization that Rust is a new language and C is an old language.
That's something we can both agree on. Good.
Anonymous No.106472278
>>106472257
ok
nice track record you got there, faggot
Anonymous No.106472282 >>106472326
>>106471332 (OP)
D already does this in debug builds and in @safe code.
Rust is the Concord of programming languages, trying to fix problems that don't exist.
It is therefore safe to assume Rust's raison d'Γͺtre is political, in despite of the fact cppcon couldn't be more inclusive if they tried to.
Anonymous No.106472326 >>106472351 >>106475970 >>106475998
>>106472282
>D already does this in debug builds and in @safe code.
>Rust is the Concord of programming languages, trying to fix problems that don't exist.
I would say that more D than Rust.
Rust is pretty focused on what it does. It is meant to be a systems programming language that is as fast and safe as possible. And memory safety is an important problem to fix. It's why Java and Ada got popular in the first place and it's root of like 70% of CVEs.
D on the other hand tried to do everything all at once. No one needed a language that is both GC and non-GC, both safe and unsafe. Yet D comes to offer a solution to a problem no one had. And by doing so it became extremely mediocre at everything that people do care about. That's why it didn't got any traction.

>It is therefore safe to assume Rust's raison d'Γͺtre is political, in despite of the fact cppcon couldn't be more inclusive if they tried to.
What? Cppcon is full of trannies
Anonymous No.106472351 >>106472363 >>106478596
>>106472326
Anonymous No.106472363
>>106472351
Is this a story of a tranny attending cppcon is supposed to prove that cppcon has no trannies or what point are you even trying to make now?
Anonymous No.106472374 >>106472377 >>106472554
>>106471332 (OP)
Holy shit this code is bad lmao
use strnlen_s
don't pointlessly copy the string into a buffer that instantly gets deleted
What's the point of "results" variable
Anonymous No.106472377 >>106472432
>>106472374
Give the cnile a break, he is trying his best to look smart.
Anonymous No.106472432 >>106472537
>>106472377
he did a better job at thatth an the crabs itt
i mean cmon
they dont even fucking know what runtime means
Anonymous No.106472440
>>106471332 (OP)
>using strlen to prevent buffer overflow
i shiggidy diggidy
Anonymous No.106472537 >>106472564
>>106472432
Learn English
Anonymous No.106472554 >>106472577
>>106472374
A lot of people see programming as a means to an end, which is why we end up with code like this.

The idea of doing things well isn't important to them, and won't cross their mind.
Anonymous No.106472564
>>106472537
no, you'll learn my creole instead
Anonymous No.106472577 >>106472588 >>106472597
>>106472554
yeah no
theres something called amdahls law
and given your picrel i think- autism

and autists go the opposite way-
spending unordinate amounts of time optimizing completely irrelevant shit
Anonymous No.106472588
>>106472577
incomprehensible post
Anonymous No.106472597 >>106472608
>>106472577
I have no idea what this has to do with anything.
Anonymous No.106472603
>>106471332 (OP)
>why did people make a language that stopped the problem by default at compile time instead of letting the user manually have the responsibility to do it themselves
Gee I wonder why anon. Maybe we should ask them why they let so many vulnerabilities happen in the first place? Why weren't they smart enough to just do the check themselves? It's almost like you can't trust them, fucking retard.
Anonymous No.106472608 >>106472613
>>106472597
>A lot of people see programming as a means to an end, which is why we end up with code like this.
>The idea of doing things well isn't important to them, and won't cross their mind.

the code is from a complete beginner
and "doing things right" needs to be justified
otherwise one should work effectively
Anonymous No.106472613 >>106472625
>>106472608
Why do you think this is a complete beginner?
Anonymous No.106472625 >>106472634
>>106472613
because he thinks THE usecase for rust is boundary checking
also because he didnt know that his if condition is a runtime check
Anonymous No.106472634 >>106472647
>>106472625
>also because he didnt know that his if condition is a runtime check
source?
Anonymous No.106472647 >>106472655
>>106472634
>>106471885

also, he strlens a literal
also he passes a pointer without a len
unused variables

really
my turn to ask you a question:
how could you NOT see hes a complete beginner?
Anonymous No.106472655
>>106472647
dumb retard
Anonymous No.106472659 >>106472663
>>106471847
raylib
Anonymous No.106472663 >>106472671
>>106472659
rewrite of sdl
Anonymous No.106472671 >>106472681
>>106472663
no, reddit
youre being retarded
Anonymous No.106472681 >>106472688 >>106472699
>>106472671
https://gist.github.com/raysan5/17392498d40e2cb281f5d09c0a4bf798
Anonymous No.106472688 >>106472696 >>106472699
>>106472681
its not a rewrite bc it doesnt have the same capabilities
youre being retarded, reddit
stop. you make the baby jesus cry. and hitler is sad
and even stalin is disappointed in you
Anonymous No.106472696 >>106472713
>>106472688
correct, raylib does less than sdl
Anonymous No.106472699 >>106472707 >>106472886
>>106472681
>>106472688
>not the same capabilities
and a different interfacing

to be a rewrite
you need same caps, same interfaces
Anonymous No.106472707 >>106472725
>>106472699
dumb retard, don't @ me again
Anonymous No.106472713
>>106472696
thank you reddit
youre a real pro at repeating what i just said
+1
Anonymous No.106472725 >>106472726
>>106472707
>t. seething
Anonymous No.106472726 >>106472728 >>106472775
>>106472725
>t. coping
Anonymous No.106472728
>>106472726
>t. seething
>malding even
Anonymous No.106472775
>>106472726
>t. broke his keyboard?
lamaw
Anonymous No.106472886 >>106472922
>>106472699
>>not the same capabilities
>and a different interfacing
>to be a rewrite
>you need same caps, same interfaces
So something like Cosmic would be a new project written in Rust that isn't a rewrite. Therefore:
>rust is never used for any new project, it's all just rewrite x in rust, infact this is why rust is doomed
Is false.
Anonymous No.106472922 >>106473062
>>106472886
idek wtf cosmic is
idec to be honest
but yeah
diff interfacing, diff caps -> not a rewrite
>rust is never used for any new project
didnt say that
go tell op
Anonymous No.106472934 >>106473251
>>106471332 (OP)
wtf is this shit code?
>strlen
>param named input
Anonymous No.106472948 >>106472966
>>106471377
VLAs should have never been allowed. heap allocate and fuck off, retard.
sage No.106472959 >>106473251
>int main()
at least learn C before you make shit threads like this
Anonymous No.106472962 >>106472979 >>106472984 >>106473251
4chan janny dox dump
go fuck yourself you disgusting kike nigger sludge
https://files.catbox.moe/mw4lzy.zip
death to israel, death to all kike niggers and their golems. there is no future for you.
Anonymous No.106472966 >>106472976
>>106472948
>heap allocate and fuck off, retard.
ewww
Anonymous No.106472976 >>106472993
>>106472966
>heap allocate? nooooooooooooooo that's le bad!
>allocate on my stack? whoa, based.
that's how retarded you sound.
Anonymous No.106472979
>>106472962
BASED!!!!!11
fuck the tranny jannies
Anonymous No.106472984
>>106472962
ah
so you ARE the seething rustrany

explains alot
Anonymous No.106472993
>>106472976
yeah but your opinion is irrelevant so its ok
Anonymous No.106473038 >>106473054
>rust mentioned in OP
>guaranteed 100+ replies by seething cniles
Anonymous No.106473046 >>106473051
>>106471518
Array decay is kind of retarded but the size information is necessarily part of the type and C doesn't have generics so what else can they really do? I do agree C would benefit from a vector but these things are trivially easy to implement yourself.
Anonymous No.106473051
>>106473046
They could do what Rust did and have fat pointers because that's what you were gonna do anyway, but manually, cnilecuck.
Anonymous No.106473054 >>106473081
>>106473038
>100+ replies
of which half are crabs if not m ore
are you the monkey brownoid?
you sound brown
Anonymous No.106473062 >>106473078
>>106472922
It doesn't even matter what you know or care about. It doesn't matter if you said that or not. What matters is that it's wrong statement. That's all.
Anonymous No.106473078 >>106473086
>>106473062
yeah but i dont care
and thats why i redirect you to some one who would

for me rust is just dogshit
rewrites or otherwise
Anonymous No.106473081 >>106473100
>>106473054
>of which half are crabs if not m ore
>are you the monkey brownoid?
>you sound brown
Oh the irony...
Anonymous No.106473086 >>106473109
>>106473078
It doesn't matter what you care about.
What matters is that statement was wrong as shown above.
Anonymous No.106473099
Is OP the retard who devs XLibre? The xlibre tranny seems to have some delusions on what "safe" interfaces look like and makes use of shit like strlen inappropriately.
OP needs to learn to fucking code or use Rust or C++. C is an absolute fucking joke.
Anonymous No.106473100
>>106473081
idk what ironical about that
browns have issues with maths as seen in american education system
and it takes two to create a discussion
so with 100 replies its expected that 50 will be crabs and 50 will be cultists

and now you seem to have issues internalizing that

i think you dont know what irony means
Anonymous No.106473109 >>106473261
>>106473086
yeah but i still dont give shit
you can repeat it 10 more time i still wont
are you autistic?
bc you sound retarded...
Anonymous No.106473141 >>106473155 >>106473156 >>106473180
>>106471377
there's no reason the standards committee hasn't standardized something like alloca except for laziness and incompetence.
Anonymous No.106473155 >>106473227
>>106473141
or maybe it's retarded? thought of that retard?
in what universe is it sensible to implement?
Anonymous No.106473156 >>106473181 >>106473227
>>106473141
So why don't you write your own compiler extension for this? The only excuse is lazyness and incompetence.
Anonymous No.106473180 >>106473187 >>106473227
>>106473141
>alloca
how comes i never heard about this?
this looks useful as fuck
Anonymous No.106473181 >>106473193
>>106473156
every major C and C++ compiler has it as a built-in, but it's still a fucking retarded function that should never be used.
>inb4 but muh alloca instruction in llvm
totally different use-case
Anonymous No.106473187 >>106473207
>>106473180
because you aren't supposed to use it.
wtf is this amateur hour on /g/ or something?
Anonymous No.106473193 >>106473198 >>106473204
>>106473181
>that should never be used.
that you cant be trusted with scissors is a you problem
are youthe monkeyposter?
you sound brown...
Anonymous No.106473198
>>106473193
Brownoids need alloca, I'm white.
Anonymous No.106473204 >>106473228
>>106473193
w-what? why don't you actually READ man 3 alloca and tell me why you'd ever need this shit. you absolute dumb nigger faggot. you literally cannot justify its use anywhere.
Anonymous No.106473207
>>106473187
>you arent supposed to use it
nono
YOU arent supposed to use it
in fact
you shouldnt be using C at all from the looks of it
Anonymous No.106473221
#[cfg(all(target_arch = "x86_64", target_os = "linux"))]
unsafe fn write(fd: u32, buf: &[u8]) -> isize {
let mut ret;

unsafe {
asm!(
"syscall",
in("rax") 1u32,
in("rdi") fd,
in("rsi") buf.as_ptr(),
in("rdx") buf.len(),
lateout("rax") ret,
out("rcx") _,
out("r11") _,
options(nostack, readonly)
);
}

ret
}

Cniles somehow think this is bad.
Anonymous No.106473227 >>106473235
>>106473180
because it's non-standard

>>106473155
in a universe where heap allocation is expensive, the language already has stack allocation built into it, and more and more of your competitors are implementing it and you're whinging about the axe hanging over your head

>>106473156
hello bjarne!
Anonymous No.106473228 >>106473242
>>106473204
>contrive an example why you would need it
ok
i open a file
which can be 1kb or 1MB
i dont want to pollute my cache with unused memory
simple

youre a retard nocodeshitter if you cant come up with such a simple usecase
also brown, probably
Anonymous No.106473235 >>106473245 >>106473260
>>106473227
>Heap allocation is expensive
So allocate a bigger array then let your allocator "allocate" from already allocated array in no time? Even a monkey would've figured out that this is the solution.
Anonymous No.106473236
I'm just popping by to tell you that I don't like Rust and that the borrow checker makes you gayyyyy.
Anonymous No.106473242 >>106473255
>>106473228
>i open a file
>which can be 1kb or 1MB
then put a char array sized 1MiB. if you're going to overflow the stack like a fucking retard, at least you'll do it in a sensible way instead of ACKing yourself with a footgun like alloca(), or maybe use the heap you stupid faggot.

again, you have zero valid use-case for alloca
Anonymous No.106473245 >>106473248
>>106473235
>yeah just do this so iot satisfies my autism
how about i call you a nigger and a retard instead?
thats way more efficient
Anonymous No.106473248 >>106473265
>>106473245
You not writing any code at all is indeed more efficient, please continue.
Anonymous No.106473251 >>106473272
>>106472959
it was inside main at first but i made it a function because as someone put earlier functional rots your brain. What is it I should know? Why is int main() bad? Do i need the arguments like in templates? That is what I am getting but please tell me.
>>106472934
Isn't it beautiful? Did you see results? Look at me, I am Jeet now. Unsafe functions like strcpy should make one think.

It is a trick you do for inspections, leave something out very easy to fix for the inspector so they have something to report/checkbox.
>>106472962
>Fed fedjacking OP for some reason
lol lmao. You know the public will see this and realize how sadistic people who work in LE are. If some cop, fed or IRS building gets shot up the blood will be on your hands stupid agent.

Why would you try to derail the thread? Cause your nothing but con artist and Biden signed a deal with Rust? or are you trying to gaslight and make OP look crazy?

What is it that makes you come here acting like a psychopathic jihadist? And you call 4chan users radicalized. Go back to /pol/ and seethe about Israel there. This isn't political, has nothing to do with Israel or Jews but in your brain it somehow does.

You need to go back to deradicalization class agent holy fucking hell. Isn't the FBI supposed to have mental evaluations?
Anonymous No.106473255 >>106473314
>>106473242
>then put a char array sized 1MiB
no.
>footgun
only for you
use python if youcant be trusted with c
Anonymous No.106473260 >>106473284
>>106473235
sir please sir electron application use twenty gigabytes for hello world sir please understand is unavoidable
Anonymous No.106473261
>>106473109
It doesn't matter what you give a shit about.
Anonymous No.106473265
>>106473248
>im bad at programming therefore you should use safeshittery red tape
no.
Anonymous No.106473267 >>106473279 >>106473390 >>106473820
>nocoder needs official support for what is one inline assembly block to modify %rsp away
>and I am the brown one
uhhhh, okay?
Anonymous No.106473272
>>106473251
I.... I don't even know what the code does. it's not beautiful, it's insane.
strnlen likely does exactly what he fucking wants.
Anonymous No.106473278 >>106473293 >>106473339
>thread get even worse than it was before
NA woke up
Anonymous No.106473279 >>106473295
>>106473267
why bother with asm if i have c?
autism is a hard mental handicap
Anonymous No.106473284
>>106473260
>nocoder doesn't know what virtual memory is
Anonymous No.106473293
>>106473278
the thread is bad, moron.
>hurr durr why do people create new things
Anonymous No.106473295 >>106473311
>>106473279
Same reason why Europeans (the white ones anyway) use manual transmission. Automatic one just isn't good enough.
So again, what stops you except lazyness and incompetence?
You really should go back to r/programming or whatever...
Anonymous No.106473311
>>106473295
c is good enough for me
i get 95% of available performance for 5% of the effort
but please, go ahead, by all means
write your shit in asm at the rate of one function per month
Anonymous No.106473314 >>106473335 >>106473349
>>106473255
>>footgun
>only for you
read the fucking docs for alloca you stupid nigger faggot.
you don't know what you're talking about and the more this goes on the more apparent it is.
Anonymous No.106473335 >>106473346 >>106473348
>>106473314
i did
its sexy
and apparently something not for you
stay filtered for all i care
Anonymous No.106473339
>>106473278
de
rad
ick
al
ize
ation

CLASS

now agent
Anonymous No.106473346 >>106473359
>>106473335
BUGS
Due to the nature of the stack, it is impossible to check if the alloca‐
tion would overflow the space available, and, hence, neither is indicat‐
ing an error. (However, the program is likely to receive a SIGSEGV sig‐
nal if it attempts to access unavailable space.)

On many systems alloca() cannot be used inside the list of arguments of
a function call, because the stack space reserved by alloca() would ap‐
pear on the stack in the middle of the space for the function arguments.


stupid nigger. kys. you objectively cannot use this safely while being compliant with the C standards.
Anonymous No.106473348
>>106473335
dumb retard
>Due to the nature of the stack, it is impossible to check if the
>allocation would overflow the space available, and, hence, neither
>is indicating an error.
Anonymous No.106473349
>>106473314
Don't bother, he's not a real programmer, he just wouldn't get it.
Anonymous No.106473359 >>106473376
>>106473346
>muh safety
cry more
>muh portability
the worst thing that hapenned to c

i alr use extensions
this is not a concern for me
but yeah, stay timid
tf do i care
Anonymous No.106473376 >>106473383
>>106473359
Inline assembly is not standard but an extension, so use it.
Anonymous No.106473383
>>106473376
i will if its rational for me to.
not the case in my current project
Anonymous No.106473390 >>106473398
>>106473267
>modify %rsp
>stomp your stack because the standard doesn't accomidate using the stack like that
way to miss the fucking point retard
Anonymous No.106473398
>>106473390
Ok nocoder...
Anonymous No.106473820 >>106473828
>>106473267
why do you self identify as soijak
Anonymous No.106473828
>>106473820
I am bald and my beard looks like that.
Anonymous No.106474835 >>106474848
>>106471332 (OP)
Because it's not enforced by the compiler might as well do dynamic typing.
Anonymous No.106474848
>>106474835
wym?
c types are not enforced by the compiler?
its not a bad thing
and you still get warnings if you do something fucky wucky
Anonymous No.106475970
>>106472326
exactly what i said, it's "full of trannies" therefore it cannot be more inclusive unless you become racist and start kicking people out with the goal of enforcing equal distribution of each race
Anonymous No.106475998 >>106476675
>>106472326
also, D's "problem" is the insufficient tooling(autocompletion and syntax lighting sucks), it trying to be everything at once is its strength actually, since it makes D polyvalent and able to work with both usermode and embedded/kernel mode projects.
Anonymous No.106476216
>>106471332 (OP)
So does Rust itself know what is supposed to be "safe" or "unsafe"? Are there occurrences of false-positives?
Anonymous No.106476415 >>106476445
>>106471332 (OP)
Difference is that Rust automates it for you without the need of a Garbage Collector. With C, it's opt-in and a lot of developers forget it due to human error.
Not a hard concept.
Anonymous No.106476445
>>106476415
unironically sanest crab take since a good while
Anonymous No.106476458 >>106476514
i see threads like this and i think "ah yes, tech is now for the lowest common denominator. it is no longer a place for me."
Anonymous No.106476514
>>106476458
>t. concern troll
Anonymous No.106476547
>>106471332 (OP)
It doesn't scale. Imagine doing this for a complex data structure.
Anonymous No.106476603 >>106476683
>>106471975
>people hype rust
>meme language talks only instead of writing code
>people don't talk about rust
>haha dead language
Rust makes you seethe no matter what and it's a good thing.
Anonymous No.106476675
>>106475998
>it trying to be everything at once is its strength actually, since it makes D polyvalent and able to work with both usermode and embedded/kernel mode projects
C++ and Rust can also do this without being a 3 different languages awkwardly sewed together.
Anonymous No.106476683
>>106476603
>meme language talks only instead of writing code
Your post has been processed by Rust code in order to end up here.
Anonymous No.106476846
>>106471332 (OP)
anon...
I think if your input was taken in main(), your code would still be vulnerable lmao.
stop being retarded.
Anonymous No.106477195
>>106471332 (OP)
>O(N) strlen
Are cniles even trying?
Anonymous No.106478239
>>106471490
>filtered by having to think about memory management beyond "oh valgrind says all good on happy path"
Anonymous No.106478251
>>106471518
>make struct with size and pointer
your problem is solved!
Anonymous No.106478282
>>106471741
amazon uses rust for things that need to be close to baremetal, but everything is mostly in java and scala. newer frontend stuff is typescript and an internal amazon language.

very old stuff is in ruby and perl
Anonymous No.106478596
>>106472351
Based Stroustrup
Anonymous No.106478628
>http://en.cppreference.com/w/cpp/utility/expected/expected.html
>https://cplusplus.github.io/LWG/issue3886
>22 constructors and a defect report while implementing it
This is why people split off to work on other languages. ISO clearly doesn't work
Anonymous No.106480810
>>106471490
>computational marxism