[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Final Solution to the C question

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 324
Thread images: 26

File: der_ewige_C.png (339KB, 387x550px) Image search: [Google]
der_ewige_C.png
339KB, 387x550px
So how do we solve the C problem, /g/?

New security holes keep appearing because of it.
>>
>>59093233
Just stop talking about it.
>>
>>59093233
We solve the C problem by euthanizing retard shills like you.
>>
>>59093233

I'm reading K&R so I can contribute to the C problem.
>>
>>59093233

You find languages that are better in each possible use case.

Good fucking luck.
>>
File: symbolics-ivory.jpg (1MB, 1645x1611px) Image search: [Google]
symbolics-ivory.jpg
1MB, 1645x1611px
>>59093233
Revive the Ivory processor, throw away braindamaged C machines.
>>
>>59093929
Rust
>>
File: purge.png (46KB, 462x448px) Image search: [Google]
purge.png
46KB, 462x448px
>>59094622
>>59094622
>>59094622
Fucking retards...
>>
Why can't we just ban every language but Java? Making only one programming language allowed makes programming more accessible as students only have to learn one language. Java is the most commercially viable language so we should just stick to it.
>>
>>59093233
They appear because it's used in critical shit.

Start using your favorite meme language instead and suddenly there'll be security holes too. Actually it will probably be even worse, because C has been around for so long, and thoroughly inspected many times, that its compilers are among the most reliable software on the planet.

And then maybe you'll realize C isn't the problem. The most secure language is the one no one uses. So if your meme language has no bugs, maybe start asking yourself the right questions.
>>
>>59094780
Die in fucking hell pajeet

A language is useful in some way, but not universal. Some projects needs OOP, others fucking doesn't.

When you learn algorithm and system behaviors, it's easy to learn the majority of programming language.

But if you are a fucking tech illiterate, yes it's hard to learn.

Tech illiterate like you must be ban.
>>
>>59094767
Really activated your almonds, havent I?
>>
>>59094835
>i was pretending to be retard, joke on you haha
>>
>>59094822
>What is english?
>>
>>59094780
Java was a step in the right direction but it has it's issues.

Rust is a leap in the right direction
>>
>>59094861
I meant it, rust is better than C
>>
>>59094867
>talk about programming language
>don't know how to english
you got me
>>
>>59093233
Replacing C's horrible pile of legacy codes with Rust's structured, well defined and package managed modules is the biggest challenge. The only reason why a trash like C is alive is because there are already so much written in this fucking trash.
>>
>>59093233
report spam anti-c threads
>>
>>59095154
C is trash, I don't feel like defending it anymore
>>
File: Smug Pajeet.png (293KB, 1131x1015px) Image search: [Google]
Smug Pajeet.png
293KB, 1131x1015px
>>59094822
Fucking codemonkey, I don't know the first thing about software development. I just know that /g/ hates Java and gets asspained about it since apparently being good with it is crucial to get a job. Thanks for the (you).
>>
>>59095109
nobody is interested in your C+ bastard child.
>>
>>59095401
https://www.rust-lang.org/en-US/friends.html
>dropbox
>canonical
>mozilla
>>
>>59095413
>They used our code to make one line of code
>FIRENDRS OF RUST

Nobody cares and I fucking mean, NOBODY
>>
>>59095438
>one line of code
severely doubt that they would ADD THEMSELVES to the list if they had written >one line of code
where the fuck did you even come up with that gimmick? is this how low one must go to defend C and C++, languages that are fundamentally unsafe and enable catastrophes like cloudscare?
>they should have checked the parser
rust wouldn't have let them overrun the buffer, even in unsafe blocks.
>>
1. Shame every C developer for being a danger to security
2. Uninstall Linux, install redox
3. Start a petition for banning C code, fining companies who use C code, taking down repos with C code etc.
>>
>>59093233
C is god's chosen language CIA nigger
>>
>>59094622
this
>>
>>59093929
literally tons in every of them
>>
>>59094822
then we should only allow JS. it can be OOP, functional, imperative, basically anything
>>
>>59093233
C and assembly are the only good languages, everything else is vulnerable NSA code monkey abstraction
>>
>>59094435
This. Even ancient machines like the Burrough B5000 got this right. Security from the ground up, NO EXCUSES.
>>
>>59094893
Its a slow, needlessly complex language that hides everything behind a black box. It will never take off.
>>
>>59095958
No it doesn't you fucking memer
>>
>>59095962
Great argument, you really got me there buddy. Maybe all you've used is Java so you think Rust abstractions are typical.
>>
>>59094622
>1 hour 24 minutes response time
The Rust Evangelism Strikeforce is getting slow.
>>
>>59095958
>needlessly complex language that hides everything behind a black box
t. C toddler
>>
>>59095477

Note:

Most of dropbox is written in Go. They replaced one part with Rust to improve it's memory consumption.

Most of canonical is written in C. No idea what they use rust for

Most of mozilla is written in C++. Only their research browser is written in rust and some minor parts of firefox.

The fact that 3 companies use this language in such a minor role is not evidence that this language is superior. Come back to me when millions of people are using critical infrastructure software written entirely in Rust.
>>
>>59093233
>So how do we solve the C problem, /g/?

Only let professionals write mission-critical C code.
Pajeets, "code academy" trash, "code artisans" and people straight outta those graudate meme images should find something else to program it.
>>
>>59096478

How do people become professionals if they're never allowed to write C? You just made C-developers extinct gg.
>>
>>59096543
>You just made C-developers extinct
That's the goal. C must die.
>>
C stands for cancer and it needs to die.

Almost all cases of security exploits found in Linux's code there is always some retarded mistakes that could have been prevented in Rust as the compiler checks thorough typesafety.
>>
>>59096477
>The fact that 3 companies use this language in such a minor role is not evidence that this language is superior.
the fact that it is a language that lies at the same level and speed as C and C++ yet is memory safe, concurrency safe and affords facilities usually seen in higher level languages
>>
>>59096477
Damage status
>Controlled
>>
>>59096550
>>59096555

> Let's destroy C in order to create more shitty brainlet devs which doesn't give a shit about what is really going on BECUZ MUH SAFETY XDDDD

Fucking faggots.
>>
>>59096591
What the fuck are you even trying to say with that nonsense, you autistic trash?
>>
>>59096591
>shitty brainlet devs
Rust is not a beginner friendly language, if you are new to programming choose Python or C
>>
>>59096543
>Only let professionals write mission-critical C code.
>mission-critical C code.


basically: practice is small projects, typical programming challenges, made-for-yourself C programs and userspace programs, mainstream kernels, cryptography libraries or compilers.

As Linus said "learn to program in C, not just bash your keyboard until it compiles (with warnings)".
>>
Ok lets have some real talk, what the fuck is wrong with C on a realistic level no memes allowed?

Also as a C noobie, I don't understand why there are so many broken functions in the std lib, seriously, I keep hearing conflicting arguments from everywhere saying that shit like scanf is broken malloc should never be used or whatever just lots of bullshit from both ends ("C is perfect" vs "C is fucking retarded")

My mind is full of fuck SOMEONE TELL ME THE TRUTH
>>
>>59096623
C is broken and it actually is full of undefined behaviors.
>>
>>59096623
C is neither perfect nor fucking retarded. It is simply obsolete.
Use D.
>>
>>59096616
>NOT mainstream kernels, cryptography libraries or compilers.

I starting to believe that FF trims my posts.
>>
>>59096638
Ex D fag here, D is certainly a better choice than C. However it followed some traits of C and inherited some unspecified behavior.

Thanks to C. I can even give you a proof right now right off my memory if you want to
>>
>>59096639
ok pajeet
>>
FUCK RUST
>>
>>59096452
"Maybe insulting Rust's target market will work"
Horrible strategy shill.
>>
>>59096666
Please do.
>>
C stands for cancer.

C.ucks will defend this
>>
>>59095529
>>59094622
Sorry buddy, but no.
>>
>>59096633
I dont understand, is this going to be changed in the C2xx release or whatever? why the FFUCK has no one changed this problem if its so big?

>>59096638
Stable release released 16 feb >2017

surely this programming language is full of fuck since its literally in its infancy? Why is it better than everything else supposedly? Not much on wikipedia
>>
>>59096678
import std.stdio;
void main(){
int n=99;
while (n!=2){
writeln("\n", n, " bottles of beer on the wall, ",
n, " bottles of beer.\n", "Take one down and pass it around, ",
--n, " bottles on the wall."); //<--this is unspecified unlike Java or C#
writeln();
}
writeln("1 bottle of beer on the wall, 1 bottle of beer\n",
"Take one down and pass it around, no more bottles of bear on the wall\n\n",
"No more bottles of beer on the wall, no more bottles of beer\n",
"Go to the store and buy some more, 99 bottles of beer on the wall.");
}
>>
>>59096724
It hasn't changed for the last 30 years, it will never change. For the years to come, newer concepts of computing will be introduced, newer security designs will be introduced but C will forever be stuck in the 80's
>>
>>59096727
If you notice, n-- and --n varies with compilers.
>>
>>59094884
Please do not post anymore. Rust is not even decent.
The fact that you unironically advocate for Java over Fortran, C, and Caml is proof that Rust users can't be trusted.
>>
>>59096753
So what the fuck does it mean, will it be eventually obsolete when devs say "fuck it no more of this bullshit" and system code/database shit will be written in another language?

And to fucking think that I bothered to start trying to get back into C in more depth

Fucking hell why cant there just be one programming language everything is fucking turing complete isnt it FUCK.

Every fucking language except for python seems like a meme but python is too FUCKING slow


AAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHH
>>
>>59095645
>C _isn't_ code monkey abstraction
>LLVM IR _is_ code monkey abstraction
I wouldn't be surprised if you've never even touched assembly, you underage faggot.
>>
>>59096794
The only reason it is still alive is legacy kernel codes are already written in it and nobody wants to touch that horrible pile of shit.

Why do you think Linux gets drivers later than windows?
Because Linus is a C purists and working with obsolete languages is fucking pain in the ass, specially if it's just not meant for modern programs.

But for now I would actually suggest that you learn a language that teaches you the basics of programming.

C is a good beginners' language. But if you hate C, D has a good book on programming and it's somewhat more decent than C.

Python is nice but you trade your performance with it. D is almost as much as productive.
>>
>>59096727
>>59096779
top kek. Not even Java has this problem.
>>
>>59096883
Binary expressions and function arguments are evaluated in strictly left-to-right order. This is similar to Java but different to C and C++, where the evaluation order is unspecified.

C.uck BTFO
>>
File: akarin ambiguous.jpg (450KB, 1000x900px) Image search: [Google]
akarin ambiguous.jpg
450KB, 1000x900px
>>59096848
I am actually a senior for my CS degree, I know how to 'problem solve' but its pretty funny because we haven't actually coded in a while now that I think of it, mainly my classes are all theory and shit, hardly done any programming since my first year.

I don't hate C or D, I acutally like the idea behind them because you can control things in fine detail. What I don't like is that theres so much broken shit so I see it as a piece of shit (ironically I don't know the language that well but the fact that people can argue over scanf being broken or not already pisses me the fuck off)

How good is D? Is it a meme or can I finally rest with no bullshit over broken subroutines such as scanf or whatever.

Jesus christ what a shit show. Tbh thinking of sticking with python and telling everything to fuck off cause I can't be fucked dealing with this
>>
>>59096913
that's not ambiguos, she's just sleepy.

stuff like scanf is inferior to D's readf, it's got some sort of sanitizing iirc. D is comfy as fuck but you always have to deal with a mental dissatisfaction that it's still chained to C trash.

Rust is not a panacea to all the broken mess that C gives you. However it's just better ootb with no fucking around.

This is how bad you have to struggle with C if you are making a mission critical C program.

I'm not even scaring you, it's just reality. You trade your time and productivity with a few milliseconds of performance boost in C

#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

extern int errno;
extern FILE *stdout;

int main(int argc, char** argv)
{
errno = 0;

int err = printf("Hello World\n");

if (err < 0) {
return EXIT_FAILURE;
}

err = fflush(stdout);

if (err < 0 || errno != 0) {
return EXIT_FAILURE;
} else {
return EXIT_SUCCESS;
}
}
>>
>>59097053
>C grade simplicity
>>
File: akarin angry.png (1MB, 1920x1080px) Image search: [Google]
akarin angry.png
1MB, 1920x1080px
>>59097053
How come no one has just stopped the bullshit and just made a new language from scratch that isn't super focused on a single thing.

Like I don't even know what the fuck to do anymore, I have autism when it comes to this type of shit so I need to pick the "perfect" language but I know well enough that no such thing exists and languages should be picked for the task at hand, but I have autism.

I would like to pick one language to "main", like I know the back of my hand, was planning on choosing C but to be honest learning it is a piece of fuck, K&R is supposedly garbage, language has stayed the same for 30 years as a person pointed out

what the fuck?

And now D has a basis of C

Why can no one just stop this madness and create something that has fine details like C but not complete fuck?

Im so angry right now
>>
>>59097172
They already did that. That language is C. If you made another bare metal language that's portable to every computer architecture, it would be exactly like C.
>>
Why is C faster than other languages? Doesn't it all just become 1 and 0s? What makes it faster than python for example?
>>
>>59094780
Usually, I'm defending Java, but what you're suggesting is downright retarded.
>>
>>59096913
Compared to C, D is pretty based (picture related), see also: https://dlang.org/ctod.html
One more thing I love about it, is that chars (and as an extension of that, strings) are inherently UTF-8.

Sure, it's not perfect, but in my opinion preferable to C by lightyears. It might be more broken than I make it out to be, but as long as you don't use C functionality from the core.stdc modules you should be golden, at least library-wise.
>>
File: IMG_20170224_095418.jpg (113KB, 857x1202px) Image search: [Google]
IMG_20170224_095418.jpg
113KB, 857x1202px
>>59097053
>>59097088
>>
>>59097293
- No garbage collection
- No array bounds checks
- No runtime type checks
- No OOP
- All control flow statements compile to raw machine instructions
>>
File: based d.png (64KB, 906x1081px) Image search: [Google]
based d.png
64KB, 906x1081px
>>59097300
Forgot picture desu
And if you don't have a C++ background instead of a C background, also take a look at this: https://dlang.org/cpptod.html
</shill>
>>
>>59097318
I'll admit thats fucking beautiful especially comparing it to what the bullshit would be in the C equivalent (which doesn't provide any useful information for it being 10x more complicated).

How are the compilers for D though? Is it optimized real well? How would you benchmark it against C?

Garbage collection?

Don't know anything about D
>>
>>59094435
from ARMv5E to present day has had an optional memory guard feature. it's literally a two extra instructions per alloc to completely mitigate overruns yet I'm yet to see a single OS utilize it.
>>
>>59094780
>>59094884

"As long as our hypothetical Blub programmer is looking down the power continuum, he knows he's looking down. Languages less powerful than Blub are obviously less powerful, because they're missing some feature he's used to. But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he doesn't realize he's looking up. What he sees are merely weird languages. He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub."

I pay my bills and live comfortably, and most of what I write is in CML, OCaml, Haskell, and Idris. Maybe I'm in an echo chamber, but it's a hundred thousand dollar a year echo chamber that doesn't involve me having to write or work with shit languages that I hate, so whatever.
>>
>>59096570
Most benchmark collections put rust as a bit slower than Go, desu. Certainly not as fast as C except in a small minority of cases.
>>
>>59096727
For 1 bottle of beer, it returns 'no more bottles of bear'. Not to get anal over one character being off, but ffs, that's why we're programmers.

Get your shit together. A person can read this and realize that it should say "beer" instead of "bear", but that's not how a fucking compiler or interpreter works, so get your shit together. I bet this shit took forever for you to debug, you sloppy bitch.
>>
>>59097368
D is a fantastic language, what is lacks is proper static type checking, memory safety is skin deep(you often end up using native pointers which can explode and wreck your shit just like C) and most importantly there are no fucking libraries, you need to reinvent the universe every time.

tbqh family, Go is the most fun alternative right now. What it lacks is bare metal access, it's too safe, but that safety is what also makes it so versatile for everything but low level programming.
>>
>>59097053
Gonna be honest, as someone who writes C every damn day, that C program is the stuff I dream of seeing every time I open some shitter's "C" library from shithub.

To this day, I've never seen code like that in the wild.
>>
>>59097575
In before some ML/FP advocate chimps the fuck out because you implied Go was safe despite the fact that you can bypass its type system.
>>
>>59095645
Better do the syscalls manually then you fucking faggot, lest you want someone to inject a phone home routine in your libc's malloc.
Or link a telemetry shared library like MS did with MSVC. Or just handle it on processor firmware.
>>
>>59097575
I never understood what the importance of static type checking was besides making it easier for the programming to sort out errors.

After a while don't you just get used to doing the correct thing? I come from a python background but I can still keep track in my head what variables are what type, making python statically typed wouldn't even make a difference to me besides having to punch a few more letters

>Go

Isn't that the google made programming language or some shit? What is it actually used for mostly? I don't want to use something produced by pure evil(Google)
>>
>>59097575
It's true that the libraries are lacking, but it's very easy in my experience to integrate with c/c++ libraries so there is at least some comfort to be found.
>>
>>59097575
>you often end up using native pointers which can explode and wreck your shit just like C
Can't confirm (but it's just my experience)

>there are no fucking libraries
There's a whole repository of libraries and useful utilities: https://code.dlang.org/
>>
>>59097620
Well D's type checking is enough in my opinion, D also has crazy powerful and highly usable metaprogramming facilities.
>>
>>59097620
Not that guy, but I'm an unashamed Go faggot

Go is good for quickly putting together webservers or services, and that's what it's mostly used for in industry. I'd also say it's great for manipulating binary data (easily better than C/C++, at least), but I doubt many people other than me use it for that very often. Also, it's compiled to native code, has great cross compilation support, and is statically linked, so it's really easy to deploy a Go program.

As for Google, at least Go is totally open source, so you can make sure the Go compiler doesn't add anything evil if you're autistic enough
>>
>>59097522
https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=rust&lang2=go
seriously?
>>
>>59097620
Static type checking is useful because it makes the memory layout for any given type, fixed. With a dynamic type system, any type casting is done at runtime, which means things get very complex when trying to debug why some value isn't what you expected it to be. In the case of static typing, the compiler can setup any casts as a fixed path that has predictable results and guarantees, also if any two types are incompatible you program wont compile and the tool(compiler) with a full map of the program can give you very clear messages as to why it wont work.

>Go
It was suppose to be a systems programming language like D, but it's now it's own class of "services language", it has very good networking libraries and concurrency primitives. Read up on channels if you want to try something new*(It's not a new concept at all but it's the least shit lang to try out green threads on).
>>59097660
thanks, haven't used D in years btw
>>
>>59097598
Hey, faggot, have fun trying to do anything with dependent typing when you just "bypass the type system". Look, if you can get shit done in Go, and your job requires it, then by all means, do it in Go and enjoy the fact that you're a shit programmer with a shit job that encourages you to do shit that is shit.

Trying to break the type system is a fun little jack-offy thing to do with newer, type-heavy languages, but shouldn't be something you're doing commercially. That just means your language is shit.

Go is fucking gay, and anything that you can't write as a proof in Coq or B Specification is pleb-tier.
>>
File: 1487213542874.jpg (64KB, 640x669px) Image search: [Google]
1487213542874.jpg
64KB, 640x669px
>>59097760
>>
>>59097695
>you can make sure the Go compiler doesn't add anything evil if you're autistic enough

Okay, but nobody in OpenBSD realized that there were FBI backdoors until someone who got paid to put one in pointed it out, even though it's open source.

Chromium faggots may disagree, but none of them have manually parsed the whole code, because it'd take all day every day for like a year straight. If the source is huge enough, and the tomfoolery is obfuscated enough, nobody is going to notice. That's sort of the point of obfuscated code, and it isn't just a hobby.
>>
>>59093233
Don't blame C, blame retaded programmers like you
>>
>>59097760
lmao, its only due to the context and the bit about writing a proof in Coq that gives away the fact that this isn't serious. You legitimately see this exact criticism all the time in Go-bashing threads
>>
>>59097803
Oh, I agree that it's totally unreasonable, but at least someone feasibly *could* do it.

Also, I'd wager that the GCC source tree is bigger and far more complex than Google's go compiler (as opposed to gccgo, which is severely behind anyway), but everyone trusts GCC.
>>
>>59097681
>>59097745
>>59097575

Reading through D's documentation, this is fucking amazing, whats the catch? Why does no one on /g/ talk about it? I'm actually shocked
>>
>>59097745
>"services language"

I haven't seen this term before, but it describes Go perfectly. It encapsulates both web servers and system tools that you want to be stable enough for redistribution.
>>
>>59097887
meme language.

C may be verbose, but that's because it's powerful
>>
>>59097904
Someone doing a talk about go said it a few months back, not sure if they coined it but it's certainly the best way to describe it.
>>
>>59093233
Nigga, this is the third thread in 3 days. What are you trying to accomplish besides
>$0.21 has been deposited in your account
>>
>>59095505
HolyC is the only god's language. Every other version of C is heresy. Burn the heretics!
>>
>>59093233
Make sure Pajeets are limited to webshit and Java only.
>>
>>59094780
fucking kill yourself
>>
>>59096706
why?
>>
>>59095958
>Slow
What are you smoking?
>>
>>59097053
Jesus christ Rust does more with

fn main()
{
prinln!("job done with no exceptions);
}
>>
>>59097172
>How come no one has just stopped the bullshit and just made a new language from scratch that isn't super focused on a single thing.
Rust, but as I said before, it's not really beginner friendly
>>
>>59094780
>Try to program a java virtual machine in java
>Have to run it in a jvm
>Moment of truth
>Run your java jvm in a java jvm programmed in java
>Computer freezes for a moment
>You open task manager
>Millions of JVMs
>Billions
>JVMs all the way down
>It turns out the universe is programmed in C
>You just caused a buffer overflow that destroys earth
>>
Rust is such a nice language. I wish they had easy to read books like D.
>>
>>59093233
C is fine, rustard
>>
>>59102169
see >>59096848


No one likes to touch that C shit anymore,
>>
Redox OS is the final solution, OP.
>>
>>59096477
>They replaced one part with Rust to improve it's memory consumption.
that sounds like a really really good advertisement for Rust
>>
>>59093233
>Language lets programmers do basically anything
>Retards allow buffer overflows to happen in their code
>"Hurr durr ban C it's insecure"

Kys Pajeet
>>
>>59094816
THIS. Programming errors are programming errors.
>>
>>59096794
>Fucking hell why cant there just be one programming language everything is fucking turing complete isnt it FUCK.
this is what C++ tries to be, the language that can do everything. As it stands it's a complete clusterfuck and most development companies continue to use a reduced subset of the language.
>>
>>59093233
None of these spectacular bugs passed an engineering process and branch test. The code was written by an autist without an overseeing process in all of these cases.
>>
>>59102356
>Language lets programmers do basically anything
No not really. See
>>59096727
>>59096779
>>59096666
why?
>>59096901
>>
>it's all C's fault!
>ban C!
>use muh favorite meme language!
>muh meme language is so much better and has no bugs!
>t. Code Toddler

* C is a slightly higher level abstraction of what's happening on the actual silicon made for the purpose of portability. When you say "ban C" you might as well be saying "ban assembly" or "ban binary microprocessors."

* The memory 'protections' in your meme language are not implemented in silicon. They are runtime checks inserted for you. Your binary contains your code plus code to watch your code written by someone else. They take time. They take memory. They often require linking other libraries. And they are subject to the same failures if their designers failed to anticipate certain conditions (which they always do). Because...once again...those protections are not hard wired.

* Many of the meme languages proposed as replacements for C have no possible hope of filling C's shoes in certain applications. Examples of some of the toddler shit I've read since Cloudbleed:

>they should have used Erlang
An interpreted language begging for injection attacks which is 50x slower than C on string manipulation because every fucking string is immutable and every fucking character is represented as a 16 byte struct (8 byte unicode point + 8 byte pointer to next struct).

>they should have used Java
Java. And its VM. Running in a 4K buffer. Just fuck my shit up.

>they should have used insert any functional programming language
FP requires immutability, which requires massive memory amplification, which could never, ever work for a parser with a 4K buffer plugged into a fucking server app.

And finally...
* Low level bugs are associated with C because C is used for low level shit. If we ignored the performance/cost hit and used your meme language for low level shit, then the bugs would be associated with your meme language because no language, compiler, library, framework, vm, or jit is perfect. They all have holes to be exploited.
>>
>>59102619
>Other compiled languages don't exist
C toddlers, everyone. Now post your proper C hello world.

>hard mode
Show some simplicity that you like to boast on.
>>
>>59102665
>Other compiled languages are perfect
>There are no holes in other compiled languages
>Other compiled languages can replace C in every single role
A code toddler, everyone.

Now tell us what single language you learned at Mommy Coder Camp.
>>
You brainlet nigger cattle don't comprehend that undefined behavior is a tool for good programmers to confuse and weed out the MIT niggers. Only a stupid CIA nigger would want their programming language to fill the gaps for them.
>>
File: 925766877926327952.jpg (181KB, 1280x720px) Image search: [Google]
925766877926327952.jpg
181KB, 1280x720px
>>59102703
>>There are no holes in other compiled languages
Not nearly half as much as C
>>
>>59102740
>[citation needed]

I bet you would be shocked at the number of holes in your favorite language if said language was ever put into the roles currently filled by C.
>>
>>59102356
>>Language lets programmers do basically anything
How can I have constructor and deconstructor in C?
>>
>>59102765
gets()
printf()
>>
>>59102619
I couldn't have really said it better.

At some point your tower of abstractions has to be linked to the ground somewhere. Your runtimes and VMs and interpreters have to be implemented in something. And that something won't be memory-safe to any extent greater than the silicon is. This is why people have been trying to replace C for decades and have never managed to do it.
>>
>>59102784
>production code is using gets() and printf()
>there are NO dangerous functions in ANY other language
Keep posting code toddler.
>>
>>59102841
>grasping at the straws this hard
lol C toddler
Enjoy no runtime type checks, and the lack of exception handling in "production code"
>>
>>59102776
Those terms are typically associated with OOP so I'll assume that's what you mean.

You'll probably cry that C++ is not C, so take a look at how Objective C did it in the early days. Because objC started as a pre-processor for C.
>>
>>59102740
>networking protocols are written in C
>C is responsible for the fuck-ups of pajeet abstractions of C
What did he mean by this?
>>
>>59102938
Classic C toddler damage control

"If you are a good player you'll never make a bad move" xD
>>
>>59093929
Java
>>
File: e7f.jpg (48KB, 600x578px) Image search: [Google]
e7f.jpg
48KB, 600x578px
#59102953 (You)
have fun writing FizzBuzz in Ruby all day faggot
>>
>>59093233
if you ignore it - it will go away
>>
>>059102976
have fun writing FizzBuzz in C all day faggot
>>
wtf just use Forth nigga
>>
>>59094780
Java encourages long identifier names which makes it hard to comply with the 80-column limit.
>>
>>59102908
>lol C toddler
>Enjoy no runtime type checks, and the lack of exception handling in "production code"
Keep posting. Every post confirms you're a code toddler.

* Runtime type checks add overhead to a function, both CPU cycles and space in RAM.

* Exception handling is often implemented in a way that is very costly. More than once, in more than one language, I've changed code to explicitly test for a condition and branch rather than rely on an exception handler because the condition was frequent and the exceptions were dragging down performance.

It might surprise you to know that I have been steadfastly against using C for some projects I've worked on (projects where I was part of the team that made the call before coding started). Use the right tool for the job. Higher level languages are often much better solutions.

But there are simply times when you have to be close to the metal and that's what C is for. Kernels, drivers, embedded applications, code that absolutely has to run as tight and fast as possible, RTC, etc.

It would be a shit ton of work to try and replace C with something that can perform equally well yet offers more memory safety, all to discover that there are STILL holes and STILL bugs and hackers will exploit them.

In fact, I would predict in the early days of such an effort there would be more because it takes time to fully understand and vet a code base.
>>
>>59095413
At least two of those are run by SJWs. Not that there's anything wrong with that. I'm a SJW myself, after all. I'm just pointing out that Rust is popular with SJWs. Just in case you didn't notice.
>>
>>59102665
<code>
#include <stdio.h>
int main() {
printf("hello world");
return 0;
}
</code>
>>
>>59096842
Assembly is directly using the instruction set of the processor. It doesn't get any more simple than that.

Assembly is the purest language as well, since even C is interpreted by the CPU into Assembly.
Assembly isn't a language as much as it is a simple translation that allows humans to more easily understand binary.
>>
>>59095640
It doesn't have TCO as standard.
>>
>>59102974
>"You find languages that are better in each possible use case."
>"each possible use case"
>hurr durr Java

You're going to run the JVM in resource limited embedded applications?

You're going to use a garbage collector in RTC?

You're going to use immutable strings when processing time and memory footprint are critical?

And which boots first? The JVM or the OS kernel?

>fucking code toddlers
>>
>>59096555
Most of those mistakes could also be prevented by using basic static code analysis tools. Seriously, dereferencing a pointer BEFORE doing a NULL check? Pretty sure you could even write a regex to find cases of that.
>>
>>59103055
>since even C is interpreted by the CPU into Assembly.
The cpu doesn't interpret C you tard. A compiler written for the architecture turns C into the assembly of the architecture, and then an assembler turns it into object code.
>>
>>59103106
And what runs the compiler?
A unicorn fart?
>>
>>59103045
>millions of exceptions
Truly, C experience
>>
>>59103135
The CPU runs the machine code of the compiler...
>>
>>59103140
care to point out wtf are you talking about?
>>
>>59103524
He doesn't know what he's talking about.
>>
>>59096612
C isn't ``beginner friendly" either, Pajeet.

>>59096623
Don't use scanf or gets in production code because they don't take a size parameter and therefore can't prevent buffer overruns if the input is larger than the buffer. fgets is a common alternative, however it has the annoying trait of reading newlines into the strings (which the previous functions ignore), which means you'll have to do extra work to strip out the newlines if you want it to be printable.

Malloc is fine, but if you need to zero-initialize the data, or are working with very large arrays, calloc is just plain better. Also you should never malloc a C++ class, since it won't cause the constructor to be called.

>>59097293
Python doesn't even run on your processor, it's interpreted, which basically means it's a file rather than an actual exe, it's just a file that directs the behavior of the Python interpreter. And even languages that do compile to machine code, some are easier to translate and optimize to assembly instructions than others. So while C and say Fortran both target the same CPU instruction set, the semantics of the language cause different machine code to be generated. It's like how you can teach a Russian and an Italian both to speak English, but the way they will talk will be different because it's influenced by the idioms and syntax of their native language.
>>
>>59096612
C is simple as a potato.
>>
>>59097475
What domain do you work in to be using those languages?

I'm happy enough with my C/C++ job but I do feel it's very "vanilla" and I honestly don't like C++ much.
>>
>>59103016

>80 column limit

Most retarded thing ever. We have monitors with more than 240p resolution now, fuck.
>>
>>59097318
All of those seem to be things already solved by C++ (except the struct initializations, which was actually provided in C99). I suspect people may shy away from C++ because of the enterprise OOP bloat reputation, but writing C++ in a minimalistic style ends up being very much like a streamlined C.
>>
>>59101741
Does that actually return an error code if the print function fails?

>>59102619
A lot of Rust's safety is done at compile time, so it doesn't cause a performance penalty. Of course, you can get the same advantage in C with static code analysis (only difference is that rust has that built into the compiler).

As for FP and immutability, that too involves optimizations during compile-time. A good FP compiler should find when variables are no longer needed, discard them, and overwrite them with new variables. Similar to garbage collection, but the analysis of object lifetime is done in advance during compilation - less thorough, but without as much runtime cost.

>>59102665
What compiled language do you suggest as a replacement? Go, D and Rust are claimed to be C replacements, but neither has succeeded in taking it's place, "compiled" languages targeting VM runtimes don't really count as alternatives due to the overhead, Fortran is mainly used for scientific computing and even in those areas modern C/C++ is competitive, Pascal is generally considered to be a clumsy chinese knockoff of C, PL/I is pretty much dead, COBOL is only used for business stuff and most people find it disgusting, ALGOL is only used for pseudocode, Ada is like the autistic girl C fucked who later gave birth to Rust, LISP and Hasklel have too much overhead for systems programming. That's pretty much all the common languages that compile to native code.
>>
>>59102784
>gets()
No one's forced to use it, you can do shitty and harmful code in any language. And there is a legitimate, safe, alternative: fgets, as well as gets_s provided by the C11 standard library. Granted, it's disappointing it took so long, but thte fact is, that problem can be fixed byjust adding a new library function, which has been done, no need to have to write a whole new language and have to rebuild an entire toolchain and reinvent the wheel.

>>59102776
You can basically implement them in C using structs and pointers (which is all C++ does under the hood), it's jsut not a built in part of the language.

>>59102938
>>59102953
>give 5 year old a gun
>he shoots himself
>WE NEED TO BAN GUNS TO STOP TODDLERS FROM SHOOTING THEMSELVES

>>59103938
>We
Speak for yourself.
>>
>>59103938
Just because we have higher resolutions doesn't mean anything. We're just displaying stuff with higher detail, but the space on a screen is still the same ie. the size of fonts in relation to physical size on screen. the 80 column limit or the alternate 100 column limit still allows stuff like being able to have split windows of two source files, or fitting IDE stuff around the code. It's also vastly more readable anyway, humans are better reading vertically rather than horizontally.
>>
>>59103940
>writing C++ in a minimalistic style ends up being very much like a streamlined C.

That's exactly what I learned when I switched from C to C++ about 20 years ago.

That's why I'm always so baffled when people say that C is "better" than C++. That makes no sense because every C program is (with possibly minor changes required) also a C++ program. Sure, there are plenty of bad programmers out there who write crap C++. But if you pick and choose C++ features conservatively and wisely, I found that C++ really can be just C with some extra conveniences added. But if you give in to fads and start using crap like SEH, then C++ turns to shit real fast. You need to be a naturally conservative and skeptical programmer in order to write C++ code in a style that will truly stand up over the years. It's worth learning that style.
>>
>>59105011
>LISP
>too much overhead for systems programming
You don't need to deploy the entire runtime on your target system, you silly goose.
>>
>>59105877
>But if you give in to fads and start using crap like SEH, then C++ turns to shit real fast. You need to be a naturally conservative and skeptical programmer in order to write C++ code in a style that will truly stand up over the years
Isn't this basically Linus Torvalds' argument about why he doesn't want anything other than straight C in the kernel? Because it's easy to write very bad, downright unmaintainable C++ code, and you can't count on having 100% perfect programmers?
>>
>>59103524
>>59103679

>>59097053
Dumb newbie C toddlers fuck off
>>
File: 1474844942473.png (103KB, 282x224px) Image search: [Google]
1474844942473.png
103KB, 282x224px
>>59093233
You are:
>an asshurt java/sepples programmer
>a rust shill
>posting the same shitty bait over and over
Choose one or more.
>>
>>59097318
>casting realloc
pls no
>>
I'm sure the same Internet flame war would be happening 40 years ago about useing assembly to do all the programming, if a forum such as now existed.

Sperglords would be frothing at the mouth about how ASM will never go away and how new languages such as C will never be good enough to replace it. Probably saying something like:

> ASM is perfect in all use cases, and is super safe if you use it correctly.

At the same time on the other side, there would be autistic screeching about how, C is the new way and will be the end all be all.

What I think you are all faggots and nothing of value will be gained from this thread.

Either find a way to make you self useful and contribute to the solution or, sit down, shit up and let the fucking grown men capable of addressing problem do there jobs.
>>
File: rindou m'lady.png (72KB, 170x255px) Image search: [Google]
rindou m'lady.png
72KB, 170x255px
>>59107459
>shit up and let the fucking grown men capable of addressing problem do there jobs.
M'lady
>>
>>59106986
At least he's not a dumb weebshit
>>
>>59102619
Well put sir. While I prefer c++ I have no illusions that Bjarnes insistence on c compatibility as much as feasible is because he appreciates what c is and does and philosophically just wants some oop window dressing on top.
>>
>>59103722
>C
>Not beginner friendly
I get it, little timmy you finally finished your C course. Even a 13 y/o knows C these days and that includes you
>>
>>59108139
If C was easy for beginners, why are there so many beginners writing terrible C code?
>>
>>59093233
Rust shills fuck off already, we have this thread every fucking day.
>>
http://www.tedunangst.com/flak/post/heartbleed-in-rust
>>
fuck you op

i love C its minimal and portable

I luffs muh kernel
>>
Real talk: I like the fact that I can use rust and not worry about segfaults. But it takes longer to do anything because I have to jump through so many hoops. It is quite verbose and convoluted to do simple things. Basically the results are usually better but it's annoying to use. I think this is going to hurt its long term adoption. Thanks for reading my blog.
>>
Wait, there are people who ACTUALLY and UNIRONICALLY think rust can even approach C in anything?
What the fuck happened lads? Did Mozilla start sending paid rust shills?
>>
>>59108719
>Did Mozilla start sending paid rust shills?
They don't need to. Developers are naturally novelty-seeking and will latch on to the meme of the month of their own accord. They drift away when it's no longer the new hotness.
>>
>>59096016
>present an argument with no basis in reality
>get called a jackass
>"wow great argument"
Fuck you're a thick cunt aren't you? Rust uses the same classic bog-standard "no-cost abtractions" (no runtime cost, some compile time cost) that C++ and several other languages have been using for 20+ years. Hiding everything behind a black box? Fuck off. Come up with decent arguments for once. There are at least a dozen solid arguments you can make against Rust but cunts like you never actually make them because you don't actually know jack fucking shit about shit.
>>
>>59108719
exactly, no language can possibly approach C in number of preventable exploits
>>
>>59093233
If machine learning can translate French to English, why can't it translate C to C++?
>>
>>59108772
See >>59108618
Have you actually used C or Rust? To do anything worthwhile in systems programming requires you to use unsafe blocks. It's garbage for systems programming. It's not fast, it's not necessarily safer, and it takes way longer to code.
>>
Fuck this rust spam; Why in the hell are you not using ADA?
>>
File: git_gud.jpg (38KB, 534x486px) Image search: [Google]
git_gud.jpg
38KB, 534x486px
As always the answer is currently C++. It may not always be the answer but shit, you can have it all.

0. 0 Indexed (fuck off lua, fortran, matlab, julia)
1. Runs everywhere
2. Great support by every build system
3. Best libraries for anything you could want except dumb shit like 2.5d pie charts or whatever NYT uses from d3.js
4. Runs C
5. Pajeets can just wrap everything in shared_ptr if they want Java
6. STL is bretty gud. Alternate implementations exist for sticklers
7. Beautiful syntax, No fucking dollar signs or bangs or whatever the fuck memeroglyphs they're using on tweeter these days
8. You get to use your C++ trump card in interviews

Main issues:
1. Compile times definitely a drag
2. Templates/type traits/sfinae is a little too fucking mystical when you get deeper than just float type overloads. Luckily some people bend over backwards for libraries like Eigen so they just werk they way you want.
3. No C99 runtime array size kek
>>
>>59093233
What problem? I don't C a problem.
>>
>>59108185
Because C is for beginners and appeals beginners to write code on it.

C is not a super secrit language, it's pretty fucking easy to learn
>>
>>59095503
Confirmed Rust is an SJW language
>>
>>59111645
Maybe this is why /g/ toddlers like to white knight their newbie language
>>
>>59105011
>As for FP and immutability, that too involves optimizations during compile-time. A good FP compiler should find when variables are no longer needed, discard them, and overwrite them with new variables. Similar to garbage collection,

You are already out of the running in applications like the one where Cloudfare was using C. It's not just an issue of memory amplification or garbage collection. It's the fact that data is copied when modified. Very safe, which is why even non-FP languages moved to immutable strings. Also very slow and CPU intensive.
>>
R u s t
u
s
t
>>
>>59102776
You make them
>>
>>59111414
>7. Beautiful syntax
Did you ever try to write a parser for C++, pajeet?
>>
>>59096591
>magical fantasy land where programmers who do it FOR FREE are also perfect and never make mistakes
>keeping in mind that paid programmers also end up writing bugs
Yeah, let's keep intentionally using a language that is a bigger deal when the programmer makes a mistake.
>>
>>59097475
>currently working on a tangled mess of legacy XSLT, rigid third-party proprietary languages and an in-house developed tool that's neat in theory but never gives useful error messages when you screw up
>could be working in functional languages for a living
Please teach us your ways
>>
>>59111645
It's not, this is why we keep getting "C developers" who write 200 lines of undefined behavior.
>>
>>59097522
>rust is slower than go
What are you smoking anon?
>>
>>59108618
>http://www.tedunangst.com/flak/post/heartbleed-in-rust
> Hey let me write/read to a file, that's Heartbleed right?

That article has the most retarded argument i have read in a while.
>>
>>59113881
Heartbleed was ultimately about information leakage - reading past a buffer via invalid bounds check is one way to do that, but not the only way, and if you think eliminating out of bounds errors will prevent things like heartbleed you'd be sorely mistaken.
>>
C++. C niggers/trolls need to die.
>>
>>59094816
/thread
>>
>>59114191
C++ is for Java pajeets that want to use Java under the prestige of the C name. OOP is deprecated.
>>
>>59096633
Behaviour which is defined to be undefined is not undefined behaviour.
>>
>>59115157
They aren't even really using OOP as it was conceived at Xerox PARC. C++ OOP is some monstrous bastardization of the concept. If you actually need OOP, use Objective C, Smalltalk, or CLOS.
>>
>>59102619
doesnt java have a huge issue with the vm being used for privilege escalation?
>>
>>59116768
C > C# > C++ > all
>>
>>59096727
File a bug report and don't do that then?
>>
>>59097887
It's supposed to be a systems programming language, but the standard library relies on a garbage collector, so if you don't want to use GC you may lose out on a large chunk of it (I'll have to do some research on what parts exactly someday).
They're slowly working on this, but until then I'm fine with just using it as a better C++, it's great to program in.
>>
>>59096727
Are you all dim or something?

---n decrements prior to the operation it is in.
n-- decrements after the operation it is in.

Surely this is common knowledge?
>>
If there are security holes caused by C doesn't it make more sense to just write better libraries to handle the things where the holes are found rather than creating some bullshit millennial fad language and call it the solution?

Plus, I'm sure there are vulnerabilities that will be introduced with Rust that just haven't surfaced yet because nobody really uses it.
>>
>>59117254
The problem is that no one seems to be able to write secure C code. Also even if you provide 100% safe libs you can still make mistakes when using them, so in the end your libs are useless. You also would have to trust all other libraries to be 100% safe. They aren't.
>>
File: f794fd52-62c1-11e4-_796648c.jpg (38KB, 620x413px) Image search: [Google]
f794fd52-62c1-11e4-_796648c.jpg
38KB, 620x413px
>>59097522
>mfw it's actually faster that equivalent C in some cases
>>
>>59116787
Java>C
>>
>>59117157
Fucking retard look at the output
>>
File: 219989645.jpg (298KB, 2197x1463px) Image search: [Google]
219989645.jpg
298KB, 2197x1463px
>>59117157
>the operation it is in
aka L-value and R-value
>>
>>59117431
>his language needs a virtual machine to operate
LOL
>>
By using it correctly.
>>
>>59114160
> Reading past a buffer via invalid bounds check
Did you even read the code the guy wrote? All he did was read/write a buffer within the buffer's bounds, then used that as an analogy for 'what if' out-of-bounds scenario... and then states that since Rust didn't read his mind on what part of the array is out of bounds then that somehow proves his point somehow??

This is a completely false dichotomy.
>>
>>59113448
>Yeah, let's keep intentionally using a language that is a bigger deal when the programmer makes a mistake.
>t. Code Toddler

The only reason it's a big deal when someone makes a mistake in C is because C is used for low level shit.

Why?

Because your "safe" JIT/VM/FP/garbage collected/meme language is either too slow or too bloated...or both...for those tasks.

If C was literally outlawed globally tomorrow those tasks would not fall to Java or Rust or whatever. People would have to code them in fucking assembler.

Got it?
>>
>>59117485
You what
>>
>>59118044
The fuck are you talking about?
>Rust has no JIT
>Rust doesn't run in a VM
>Rust is not designed around FP
>Rust is not garbage collected
How, exactly, is Rust unsuitable for replacing C?
>>
File: about_sandboxing.png (32KB, 641x241px) Image search: [Google]
about_sandboxing.png
32KB, 641x241px
C ain't the problem. No sandbox is the problem.
>>
>>59118214
>unmature
>hard to implement
>accessing memory needs to be wrapped in unsafe, most of the embedded stuff is just accessing the and mutating the memory
Yeah we should totally use rust or node or whatever as C replacement.
>>
>>59117687
Did you even read the fucking article?
>One might also consider one of the bugs CloudFlare found in their Go DNS code. “The catch was that our ‘pack and send’ code pools []byte buffers to reduce GC and allocation churn, so buffers passed to dns.msg.PackBuffer(buf []byte) can be ‘dirty’ from previous uses.” Oops.

An incorrect bounds check is NOT the only way to leak information. Note this as well:
>Apparently even malloc was too slow for OpenSSL.

Performance critical code often has to skip a lot of steps that are inserted for you in "safe" languages. And the "safe" languages are not actually safe. Do you know which language runtimes and libraries pool memory and do not zero write it before re-allocating it? It's a pretty common fucking optimization. But lets broaden the question: do you have any fucking clue what other overruns and mistakes might exist in the on-disk machine code generated by insert-meme-language-here?

No. No you do not.
>>
>>59094780
I refuse to have to install a fucking virtual machine for a microcontroller to merely blink a LED.
>>
>>59118331
>no sandbox
>for code meant to run in 4K buffers
>processing thousands of requests as quickly as fucking possible
>>
golang
>>
>>59097569
programmers make mistakes like this all the time. Join a mailing list of professional programmers from google. Half can't speak english.
>>
>>59118858
>google pajeets
>programmers
>>
>>59118796
just let it go, pike
>>
>>59118467
>And the "safe" languages are not actually safe
This. Not using a formal prover on your source is a big oversight for a "safety oriented" language.
>>
>>59121465
>Not using a formal prover on your source is a big oversight for a "safety oriented" language.
formal verification has the wrong safety/ergonomics ratio. It really bothersome to do something non trivial on them
>>
>>59093233

Use -Werror -Wall -Wextra because otherwise, people are too fucking stupid to write sane code and say "oh, it's just a warning"
>>
A bad craftsman blames his tools.
>>
>>59121515
Based Xavier 'Shitwrecker' Leroy and some Inria madmen do it for C. I don't see why a full team of big company-funded people working full-time on it can't.
I expect many "unsafe" stuff to pop at unexpected place as bugs as soon as (and if) Rust gets used seriously in big projects (which I obviously hope will happen, any interesting tech deserves its chance).
>>
>>59121558
My point is for something supposed to be "safer than safe", not using any sort of formal verification at all destroys all credibility.
>>
>>59121574

desu, I don't understand what this "formal verification" nonsense is. It's overly complicated for minimal gain with software. Unit testing and/or fuzzing (if that's your thing) is enough.
>>
>>59121540
this desu. Can we stop having this same fucking conversation weekly.
>>
>>59121540
>make shitty tools
>blame the craftsmen
The other tools work, retard.
>>
>>59121635
The issue is unit testing merely catches a very restricted subset or potential errors. This is fine if your program is non-critical code, but if you're building software that has 'guaranteed safety' as a feature, you simply can't avoid it. And it's complicated because safety is a complicated matter. But pretending you're building secure software without it would be like building only a rocket's shell and pretending it can reach Mars.
>>
>>59094816

>C has been around for so long, and thoroughly inspected many times

So its a fatal flaw of the language that can't be bugfixed. Expecting perfect humans to make up for the flaw in a tool is fucking backwards.

What if we actually replaced it with a meme language that is designed around mitigating the damage of human errors in the code then maybe they can be as thoroughly inspected and bug free as C no?

What a hell of a pipe dream though, turbo autist programmers are as unironically conservative as they come.
>>
>>59121540

Its amazing we got out of the Stone Age with this attitude still around.
>>
>>59121721
>What if we actually replaced it with a meme language that is designed around mitigating the damage of human errors
At the moment that's irrelevant because the critical code wouldn't be allowed out of an unsafe part of the code. That being said safety is indeed a property of the practice and not the tool. Static analyzers exist for C (and guess what, they're safer than any other language's compile-time safety check!), for some reason people don't want to use them, that's a issue with the mindset, not the tool.
>>
>>59121746
>make stone tools
>tools suck
>complain about it
>tools maker and retard craftsmen shrug you off, tell you to git gud
>you go ahead and develop better tools
>invent metallurgy and create metal tools
>leave stone age
>blown them the fuck out
You're welcome that we complainers got you out of the Stone Age.
>>
>make stone tools
>tools suck
>complain about it
>tools maker and retard craftsmen shrug you off, tell you to git gud
>you go ahead and develop rock tools
>call it metallurgy
>no one gives a fuck
fixed for you. should have attended that logic class, no wonder you can't write good C.
>>
>>59121817
I can write good C. I exploit buffer overflows for a living, I gotta know how to write good C. And that's precisely why I know C is shit.

It's funny how the only argument C advocates ever have is "you can't write proper C". But even they can't write proper C, because there always are buffer overflows in their code.

The problem here is clearly the tool, and good craftsmen are showing you your tool has a dent on it, but you're just ignoring it and making the entire Internet an unsafer environment with all those vulnerabilities.

That's the cold harsh truth and you can whine about how we "can't write proper C" all you want. Stay mad.
>>
>>59121772

>its not the tool's fault that master practitioners still get injured by it

Expecting perfect humans to make up for a tool is stupid. Making a better tool that learns from the lessons of the previous design is easier than expecting better humans.
>>
File: 1483495707318.gif (817KB, 326x300px) Image search: [Google]
1483495707318.gif
817KB, 326x300px
>>59121774
>you go ahead and develop better tools
>>
>>59121746
Sticking to old and deprecated shit just because of our pride surely wasn't how we progressed, anon.
>>
>>59121939
>I can't read
Yeah I give up.
>>
>>59095413
Dropbox is shit, firefox is shit now, Ubuntu gets shit on as the noobiest of linux distros. Quite the league of superfriends.
>>
There is proof you can in fact write safe C code ( seL4 ) which is mathematical proved to be safe.
>>
>>59094780
Holy shit thats the dumbest thing ive ever heard
>>
>>59094780
This is a perfect example of why java users should be gassed.
>>
>>59121970
The point is that it isn't deprecated.
C is still the fastest language if you're not writing in direct assembly. The analogy is less "stone tools should be replaced by metal tools" and more "You're trying to replace a quality carving knife with an electric one"

Other languages have lots to offer, but none of them beat the raw simplicity and speed of well written C. But that's the point, well written.
And let's be real here, accounting for buffer safety isn't hard to do. It's just frequently overlooked.
>>
>>59121887
but it is you who wine about C, not me.
also your analogies are all off, same as your logic.
good craftsmen don't shitpost on 4chan, they git gud all day. also nice move patting yourself on the back, you are very smart indeed, sorry i didn't realise it at first, now i do. now fuck off with your second-tier sophism arguments you dumb fuck. you not the first hyperider to want C dead, but it's the language Jesus spoke to his disciples, you can't kill it same as you can't kill Jesus.
>>
>>59122212
are you doing a terrible parody of TAD
>>
>tons of general threads
>people hating C
>no loli threads

I left this shithole for a year and it becomes even worst than /v/, incredible
>>
>>59121887
>I can write good C
there's no need to lie
>>
File: C_BTFO.png (58KB, 350x1075px) Image search: [Google]
C_BTFO.png
58KB, 350x1075px
>>59122185
>muh speed
>>
File: >C.jpg (45KB, 620x372px) Image search: [Google]
>C.jpg
45KB, 620x372px
>>59122362
>yfw C "programmers" are the Jeremy Clarksons of the programming world
>>
File: 1487196973769.png (109KB, 355x369px) Image search: [Google]
1487196973769.png
109KB, 355x369px
>>59122362
>Mir GLAS
>>
>>59093233
>blaming the tool instead of the one who uses the tool
That's like saying that guns kill people.
Instead of fixing the "shitty programmer" problem thousands of hipster languages with horrible syntaxes with barely any improvement over standard C are coming up.
Even if everyone programmed in Rust or Go security holes will always appear, maybe even more often than C because hipsters will write shitty code on the pretense of "it's an inherently safe language".
>>
>>59093233
>we
>the mentally ill
>animu tho
bwahahahahahahaha
>>
>>59121887
>thread contains multiple examples of similar errors in "safe" languages
>"It's funny how the only argument C advocates ever have is "you can't write proper C"."

>>59121939
>the authors of the code involved in cloudbleed were "master practitioners"
[CITATION NEEDED]

>>59122404
>Even if everyone programmed in Rust or Go security holes will always appear, maybe even more often than C because hipsters will write shitty code on the pretense of "it's an inherently safe language".
Fucking this. None of the code toddlers in this thread know that Cloudflare also found a potentially serious buffer leak in Go.

>MUH SAFE LANGUAGE!!!
>>
FORTRAN is the solution
4chan is for FORTRAN
>>
>>59118348
>unsafe functions need to be wrapped in unsafe
>>
>>59122362
>Python Numpy
>Something that is literally C abstracted inside of Python
>Faster than native C
Where did you get this benchmark from?
>>
>>59122469
#REKT
>>
>>59122459
i have weird interest in FORTRAN lately.
i think i might be learning it.
can you tell some good things about it?
>>
>>59122362
>no citation
>no idea what code was executing
>no idea how the code was written

Synthetic benchmarks can easily miss the point. Your solution to a problem in C will often be radically different than the solution in some higher level language because you can directly manipulate memory and optimize for the specific task.

Some test to see how fast a loop can write "op is a faggot" to a file in 20 languages has no relevance to the reasons why C is the choice for low level, tight, small memory footprint code.
>>
>>59122469
numpy is fortran with some c/c++
>>
>>59122484
>If I repeat it enough, I won't have to answer with logic
>>
>>59093233

We go back to C89
>>
>>59122546
>REEEEEEEEEEEEEE
>>
>>59122362
>>59122469
looks like https://github.com/kostya/benchmarks/blob/master/README.md#matmul
>>
>>59122646
>allocate an array of pointers to doubles
>calloc call for every fucking double
>free call for every fucking double
>"hurr durr C is slower"

There are better ways to do matrix multiplication anon.
>>
>>59122966
double indirection for that does seem super weird
>>
File: 1484255054717.jpg (37KB, 1024x672px) Image search: [Google]
1484255054717.jpg
37KB, 1024x672px
>>59096848
>C is a good beginners' language
>>
>>59093233
Use rust.
>>
>>59097522
Meanwhile in the real world, leaf, colenchyma, ripgrep and the xml parser all prove that rust is faster than C in practice.
>>
>>59097318
>Array of variable size

False, since C99, you can do int array[size];

>Struct initializations

False, C99 has designated initializers, tou can do struct S x = { .a = 5, .b = 3 };

>Comparing structs

How is that lengthy?
memcmp(&x, &y, sizeof(x)) == 0

>String concatenation

The D example hides a lot of implementation details about how the memory is managed.

Anyway these examples seems to be more about D constructs vs. C standard library. Nothing prevents you to write something a bit nicer to handle strings such as asprintf.
>>
>>59097293
Ridiculous amounts of work went into the development of the leading C compilers.
Actually, original C compilers were so slow that nobody could even use C at all at the very beginning.
>>
>>59123985
The memcmp doesn't work except in the case of POD.
>ctards in charge of knowing the language they shill
>>
>>59123318
That's right
>>
>>59124059
>ctards
C toddlers*
>>
>>59124059
>memcmp doesn't work except for POD
Except it does work for every kind of data, unless you mean comparing pointed areas too, in that case that would be extremely retarded as it would cause a big overhead.

>Rustards in charge of understanding C
>D-ouches in charge of writing programs
>>
>>59093233
>So how do we solve the C problem, /g/?
By ditching C altogether. Fuck C. C stands for cancer.
>>
>>59118467
So what you mean is that in performance critical code reusing a buffer is a common practice. Which means it doesn't matter which language you use in this case, since in such a scenario the definition of leaking memory at that point would be outside the definition of Rust's memory safety.

Ok, if so then I stand corrected. Thanks.
>>
>>59123973
>being this naive
Versus Rust you can pretty well bet that any speed differences come down to actual algorithm implementation (the human) or compiler optimizations.
>>
>>59125334
>does work for every kind of data
nope, do you even know C?
>>
>>59126880
what kind of data does it not work for
>>
>>59126922
the kind that has padding
>>
>>59126974
sizeof includes padding
>>
It's a good way to weed out incompetent programmers, probably the main reason you hate it too OP
>>
>>59126996
int is signed
>>
>>59127008
>It's a good way to weed out incompetent programmers
Name ONE programmer that has not produced security bugs. I'll wait

>Hard mode
Local Fizzbuzzer C toddlers such as yourself do not count
>>
>>59127913
>Name ONE programmer that has not produced security bugs.
But isn't that the point? Regardless of language security bugs are an issue.
>>
>>59127029
And?
>>
>>59128498
exactly
>>
>>59093233
Add a new debug mode that allocates new memory at the end of a page and trap if the page after the memory chunk has been accessed. This should catch most buffer overflows.

Alternatively prevent return oriented programming by seperating the call stack from the data stack. (unlikely, needs hardware support)
>>
>>59126727
Yes, I'm sure an optimal algorithm vs the same optimal algorithm proves a difference of performance in the algorithm and not the language.
>>
>>59126922
The kind that is not POD. You would know this if you knew how to read, or if you knew at least the first thing about C 101.
>>
>>59122491
I'd give you the /quickrundown/ but I'm on mobile. Look for BLAS to get an idea of how it look's like at a basic level
>>
>>59124059
>letting your language define the sematics of how a structure compares to another
>>
lmao who gives a heck you fucking autists
>>
>>59127008
Name a single competent programmer by that criterion. Protip: literally impossible.
>>
>>59128090
The point is that they're basically only an issue in C outside of information theoretical security which does not require good programmers nor special language features. For example, any and all security flaws that appear in java are merely caused by the jvm being insecure, and it is insecure because it's written in C and full of exploits.
>>
>>59129666
>this should prevent the programmer from knowing there's a buffer overflow so that he may deploy a dangerous program in the wild with not a chance to have ever encountered the issue during development
Ctards everyone!
>>
>>59130160
C in a nutshell really.
>>
>>59130322
Wat
>>
>>59130399
c toddlers everyone!
>>
>>59130042
>the algorithms are the same
[CITATION NEEDED]

>>59130291
>cloudflare found a similar critical bug in Go
>blogger demonstrated yet another in Rust
>"The point is that they're basically only an issue in C"
Why speak about something you do not understand?

>For example, any and all security flaws that appear in java are merely caused by the jvm being insecure,
A) Java could NEVER be used where Cloudflare used C due to performance and memory footprint issues.

B) Memory pooling for performance applies to Java just like any other language. And it would be trivial to bleed data with a bounds checking mistake using pooled memory in Java.

>and it is insecure because it's written in C and full of exploits.
You literally do not understand why this happened. You're just parroting the "C is bad" meme. I fucking HATE when people parrot memes and narratives.

Come back when you learn something.
>>
>>59130306
Are you retarded? This way the program will crash on a bufferoverflow with a SIGSEV because it accesses an unmapped page.
>>
>>59130845
>one bug in Go
>one bug in Rust
>millions of bugs in C
Sounds about right.
>>
>>59131082
No bugs in D though. ;)
>>
>>59130845
The bug in rust is false. Read about it instead of shilling it.
I don't know about the bug in go and I know go's standard library is even less safe than C's so I won't decide it's fake off-hand, but I would still believe it's mostly fake.
>>
>>59130855
Only if there are enough tests to find all such instances and only if the write isn't too far ahead.
>>
>>59130845
>[CITATION NEEDED]
google.com
Or, if you prefer, github.com
Thread posts: 324
Thread images: 26


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.