Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why I love Coding in C

Name: Anonymous 2019-12-26 19:45

For the first time in almost a year, I brushed up on my C fundamentals and built a few toy programs. As I played around with pointers and printed out a memory location, I experienced a literal chill down my spine. I had almost forgotten how marvelous programming in this language was.

The last time I had coded anything substantive in C was almost two years ago, when I had written a Web Server for Professor Jae’s (in)famous system programming class. As a callow junior, I was baptised into a highly partisan cult of C and Unix worship, and I loved every second of it. Well, any second that didn’t involve string manipulation.

In the years since, I coded less and less in C and more and more in languages like Javascript and Python. I had become estranged from low-level systems stuff. Returning to C reminded me why so many programmers love this language.

C is closest to the real

Computer Science traffics in abstractions. As a dicipline, many of its most import conceits were theorized and proven before the existence of physical computers. Modern CS and Software Engineering retains this theoretic and abstracted quality, especially as one employs higher level languages and technologies. Almost by necessity, most programmers have a superficial conception of the vast, layered ediface of systems that enable and support their work. There isn’t anything wrong with this; abstraction is pleasurable and useful in and of itself. But there is also a pleasure to be had in being close to the metal.

When I saw a memory address outputted to stdout, I felt that I was as close to the hardware that I could be without literally opening up my machine and stroking my ram modules like a crazy person. Now I did this in a Ubuntu WSL instance, so who knows what interfaces actually mediated my encounter with a memory address. The point is that aside from assembly, C gets as close as possible to the physical, tangible and real aspects of computing. There is something intoxicating in this proximity to physical components. Your virtual objects, of dubious ontology, suddenly seem as real as your motherboard.

I hope that it is clear that what I am describing is fundamentally a feeling, and is as such highly subjective and is also not morally superior to any other preference. There are a lot of holes in this notion of C being “close to reality.” But it feels that way, and in articulating this, I hope I am able to explain some of the psychological appeal of lower level programming in C.

C as the Ur-language

There is another thing I love about programming in C. Because C endows a programmer with a profound degree of control over memory, you know that it is a very good choice (from the perspective of performance) for building other elemental software. C is often the language of choice for OS, language and systems development. You know you could, at least in theory, write almost everything that could be written in C - from the kernel at the bottom of your OS to the graphics library at the top. There is an immense sense of possibility here. It doesn’t actually matter if you never write a kernel module or a compiler; just knowing you could is often enough to entice you into the cult of C.

Name: Anonymous 2019-12-26 19:47

Coding in C is like having your balls stomped: extremely painful for an average person, but loved as a fetish by a couple of degenerates.

Name: Anonymous 2019-12-26 21:30

LMAO!

C is not low level. Have you ever even read assembly, cretin? It's not even close. C models hardware as it was in 1969 (and barely at that). The only way to access hardware from C is through hacks (inline assembly, CUDA) which aren't even standard C.

Idiomatic K&R C is slow. An amateur Java program finishes faster, because the JVM actually uses the hardware better.

C is a DSL for UNIX, the world's worst operating system designed to be as insecure as possible. That's it. Just a piece of shit for homos who think everything is a file and fap to plain text.

No, it's not good for kernels It's not good for firmware. It's not for games. It just happened that the people who made those things were born in time to become one of these homos. Twenty yrs from now people will be praising JavaScript because X, Y, and Z famous programs were written in it, thinking they succeeded because of JavaShit not despite it.

Fucking C pleb nigger.

Name: Anonymous 2019-12-26 21:35

M-m-m-m-muh pointers tho!

Congratulations, you have access to a giant footgun as a fucking primitive. A footgun that cannot be optimized by smart compilers because it is so unpredictable. You can literally crash everything (talk about stop the world) in uncountably infinite ways, potentially at any line of code.

Good for you, you don't have GC. You won the retard olympics. Here's your helmet.

Name: Anonymous 2019-12-27 0:33

Does is have lambdas?

Name: Anonymous 2019-12-27 1:04

dicks out for Harambe

Name: Anonymous 2019-12-27 2:42

>>5
sure it does!
Clang blocks are lambdas:

#include <stdio.h>

int main()
{
void (^a)(void) = ^ void () { printf("test"); } ;
a();
}

Name: Anonymous 2019-12-27 2:50

c isn’t low level
it’s the closest to low level because it evolved with the hardware. every ee guy knows c and hardware is made faster so the software on it runs faster: most of this software happens to be in (obj)c(++).

c is slow
this is always unsourced. all credible benchmarks i found show c as number 1[1].

c is a unix dsl
kinda. that’s why there’s objc for mac and c++ for windows

unix is bad
it stood the test of time which can’ t be said about another os. as always you imply a better system, which you fail to source.

homosexuals attracted to files and plain text
they are gay but nobody except some teenagers from g take them seriously. they aren’t representatives.

bad for kernel firmware games
all leaders are in c. all documentation is for c. all debuggers and tooling is for c. unsafety is a first class concept.

pointers are scary
code monkeys are trained on gc languages which rightfully have success. the white man fires guns and writes c if he chooses to.

1 https://benchmarksgame-team.pages.debian.net/benchmarksgame/which-programs-are-fastest.html

Name: Anonymous 2019-12-27 2:57

x86 processors were actually designed for Pascal.

Name: Anonymous 2019-12-27 3:00

>>8
asm is faster

Name: Anonymous 2019-12-27 13:59

>> 9
they were mostly designed for assembly and were backwards compatible so customers didn’t have to upgrade. they had support for generic hlls specifically pascal and pl/m. these both aren’t relevant this millennium so all recent improvments and development are for c.

https://www.pcworld.com/article/146917/article.html
https://stevemorse.org/8086/index.html

>>10
yes, but that’s not a programming language anymore. processors get designed for hlls now.

Name: Anonymous 2019-12-27 21:59

fucking retards spending time and money on managing memory when it has been automated for decades already (GC)

Name: Anonymous 2019-12-27 23:35

>>12
use gc where determinism doesn’t matter -> code monkey shite, webapps
c -> fun stuff

Name: Anonymous 2019-12-28 0:15

dicks out for Harambe

Name: Anonymous 2019-12-28 3:44

>>13
nothing says determinism like random segfaults and buffer overflows

and btw Rust does your precious not-GC better

Name: Anonymous 2019-12-28 13:38

>>15
they’re not random but correlate 1:1 with programmer errors.

rust isn’t more deterministic as its (only!) compiler has over 5000 issues and rust has complex memory management and predominantly high level constructs.

c on the other hand sports many compilers, even a formally verified one (compcert) and has many tools to reach the highest level of determinism as required by important space missions. of course you can opt for a heavily optimizing compiler (gcc,clang,icc,msvc) or a quick compilation time(tcc,b) as 99.9...% determinism is enough for most applications and handling cosmic rays to get that 100% isn’t worth the effort for a video game.

Name: Anonymous 2019-12-28 13:56

Seg faults are hell to debug.

Name: Anonymous 2019-12-28 23:46

they’re not random but correlate 1:1 with programmer errors.
C has undefined behavior. The set of programs a C compiler can produce is larger than the set of valid programs. Same with sepples and other C-inspired trash.

Also, programmer errors aren't random? You choose to use something that can completely blow up if you aren't 100% careful to a superhuman degree. It's pure delusion. Do you think admitting to making mistakes makes you a brainlet pussy? This is useless nerd dick measurement that has nothing to do with building software.

It's okay to be white not a human formal verifier of imperative spaghetti code.

required by important space missions

And it shows.

A shortage of memory on board the Spirit Mars rover is what caused it to become unresponsive on the Martian surface on Jan. 22
"We just ran out of memory, ran out of RAM," Deliman said. "This is why we initially lost contact" with the rover. The six-wheeled vehicle runs hundreds of tasks simultaneously in normal operations, with each operation using its own chunk of RAM, he said.

Wow it's almost like there's a mature well-designed algorithm to automate freeing unused memory before OOM panics.


It's wasn't designed to be fast or close to hardware either. If C were designed for performance, it would have (as a portable standard):

- statements to ensure memory goes into L1, L2, L3 cache (apparently the biggest thing for performance nowadays)
- alignment specifiers
- SSE
- explicit vectorization (OpenMP)
- GPU-specific statements and primitives (OpenCL, CUDA)

But it doesn't have any of this, because it was only designed to be a DSL for a terrible family of operating systems from 40 years ago. Compiler vendors just made it fast because absolutely everyone was using it. (They still never made it as fast as FORTRAN because C is so bad.) Today JavaScript on V8 is almost as fast as C for the same reason. Your counterpart 20 yrs from now will be arguing that JavaScript is the best bare metal language just because there exists a compiler that makes it so through esoteric optimizations.

C is fucking AIDS from the same Intel school of thought that performance is all that matters. Fuck security, fuck resource isolation, fuck input validation, fuck race conditions, fuck side channels, I just want my gay casual game to load slightly faster. AIDS.

Name: Cudder !cXCudderUE 2019-12-29 1:47

>>18
Get off your fucking high-horse, deluded academic wanker.

Name: Anonymous 2019-12-29 3:37

>>19
Cudder can never recover from >>18

Name: Anonymous 2019-12-29 8:03

Cudder destroyed.

Name: Anonymous 2019-12-29 9:13

Learn Computer Science from the bottom up (Trigger Warning:C & Unix)
https://www.bottomupcs.com/intro.xhtml

Name: Anonymous 2019-12-29 14:58

>>18
compiler can produce incorrect code
every compiler can. we have no agi to understand semantics.

programming errors are random
what i was going for is that errors follow programmer error and if you did everything right they wouldn’t be. nobody makes no errors but it’s a good feeling to know that the error is yours and (very likely) not the compiler.

gc saves space mission
out of my expertise but i’ll wager determinism is the reason people on critical systems don’t use gcd languages. the french aerospace works closely with french academia which is the birthplace of correctness obsession. even they don’t use a gcd lang but use c written in their ‘’safe” language.

c standard is without perf stuff
c features all this. in a very unwieldy, bad manner. it’s not in the standard but who cares? do you ask your mom if you’re allowed to shit?

js will be c
not really. js will be java.

perfomance is the not the only thing that matters
yes, but it’s the most important. if your game has deterministic multiplayer, never crashes and is unhackable that’s cool but if it doesn’t run smooth nobody will play it. and it better look good and be in 4k and not stutter or the vr people will get sick.

i do c for fun. if you can recommend a better alternative i’ll change. everything just boils down to c or llvm ir anyways so why even bother.

Name: Anonymous 2019-12-29 17:32

>>23
compiler can produce incorrect code
every compiler can. we have no agi to understand semantics.

That isn't what >>18 was saying though, is it? Every compiler can produce incorrect programs (whose behavior isn't what the programmer intended). The difference with C is that it's trivial to make the compiler produce invalid or unspecified programs: programs whose behavior cannot be reasoned about.

If you write a bad Java program, it might crash or do something you didn't want. But it behaves according to certain rules: if you execute bytecode X in the virtual machine, it does Y. Not so in C, which is full of trap doors that render the behaviour of your program unspecified.

Undefined behavior is a necessary evil in the real world. But the right way to handle it is to limit its usage. Maybe only the internals of your system or runtime need it, and not the parts that programmers normally interact with.

Due to design choices made in C, undefined behavior lurks behind all kinds of normal and innocent-looking idioms. That was fine in the 1970s. But today, with most systems connected to the Internet, any invocation of UB in programs is a potential exploit.

Name: Anonymous 2019-12-29 21:48

The first repository I had to manage at my job was this shitty C enterprise dinosaur and it was such a pain in the ass I ended up quitting to work in the merchant marine for the better part of a decade.

Name: Anonymous 2019-12-30 13:15

I'm still waiting for a libre source CISC I can print out of homemade fab using a magnifying glass and a 3D additive manufacturer.

Until then, no language is complete, because no compiler is complete.

Name: Anonymous 2019-12-30 20:24

>>22
I read that whole thing and I didn't learn any computer science, nor did I learn anything about how computers work from the bottom up. It reads more like a tutorial for a specific operating system. Did the author title it wrong?

Name: Cudder !cXCudderUE 2019-12-30 23:11

potential exploit

s/exploit/freedom/

Any "vulnerability" in a locked-down walled garden is chance to give well-deserved fuckings to those corporate authoritarian pigs.

"Those who give up freedom for security deserve neither."

Name: Anonymous 2019-12-31 0:13

>>28
Okay, what about an exploit in an open sores libre software?

How do you like your microphone driver to phone home to the NSA because someone didn't bounds check some ``clever'' pointer arithmetic?

Name: Anonymous 2019-12-31 1:05

For a minute, I was worried that Cudder might not post something truly retarded in this thread. Fortunately my fears were unfounded.

Name: Anonymous 2019-12-31 9:25

>>30
Cudder hasn't posting here in years, it's someone pretend to be him with some shit DES tripcode.
However >>28 is correct in a regard:
Richard Stallman's philosophical freedoms in software 0 state that you should be free to run the program as you wish, for any purpose.
One of those freedoms is to work on the zero day market and compromise governments, corporations, even nations if you much wish.

Exploits are the law of nature, everything exists to be exploited, including vulnerabilities in systems.

I'm not sure what was intended in the artistic choice to quote a Free Mason Knight named Benjamin Franklin, but the reality is: if you're not homebrewing your own computer and locking it down in our post quantum computer era, might as well wave a white flag.

Also, who cares about x86, Harvard architecture is still wrong.

Name: Anonymous 2019-12-31 22:41

Name: Anonymous 2020-01-01 6:12

Name: Anonymous 2020-01-01 9:26

>>33
https://www.freeswan.org/freeswan_trees/freeswan-1.5/doc/DES.html
https://en.wikipedia.org/wiki/Data_Encryption_Standard#Attacks_faster_than_brute_force
Also, you forgot to 1) sign that file 2) sign and encrypt your domain to the httpd.
Anyone in the planet can man in the [side, middle, and transit] that output you could have dual sided proved here textually, if that httpd hasn't been compromised.

You could for fun say:
1577389535/31- is right, my Husband has been restraining me for the past years and sold my identity to a Nigerian spammer, it's all true
Also, I am free to exploit vulnerabilities as anyone can and should. Jwz is still correct, illusions are worst than no security at all.

Name: Anonymous 2020-01-02 3:52

Name: Anonymous 2020-01-02 4:42

G

Name: Anonymous 2020-01-03 9:52

Cudder exercised her G*d-given FREEDOM to cut off her dick.

Bless our troops.

Name: Anonymous 2020-01-03 16:42

>>37
Cudder do not blemish. I fuck your horse.

Name: Anonymous 2020-01-05 7:41

>>32
https://lord-left.github.io/aboutme.html
How did I know that was written by a shitskin? What race is this guy anyway? Some kind of spearchucker-streetshitter hybrid?

Name: Anonymous 2020-01-05 10:27

India is a superpower nation, bigot.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List