[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: file.png (940 KB, 980x606)
940 KB PNG
the cost of making a programming mistake in this language is getting your computer hacked with 0 clicks. it's too high to be worth the performance benefits today.

what was dennis ritchie and ken thompson's justification for making this abomination when we had safer and higher level programming languages for decades before C?
was it extreme shortsightedness? stupidity (doubt)? or were they just fucking around with people and it was all a meme that people unironically fell for and they went with it for the lulz?

i guess ken washed away his sins by making Go. can't say the same for dennis.
>>
>>108700519
Wtf is a click?
>>
>>108700519
literally a skill issue
>>
>>108700519
>by making Go

One may place hand‑crafted assembly in a separate file bearing the .s extension. Written in Go’s Plan9‑style assembler, such a file is processed by the Go toolchain, which then makes the resulting symbols available to ordinary Go code. This avenue is often chosen for heavyweight tasks—cryptographic primitives, low‑level kernel interactions, or system‑call wrappers—where the performance gains justify the extra effort.

A subtler doorway opens through the //go:linkname comment directive. By positioning this comment immediately before a Go declaration, a developer can bind the Go name to an external assembly symbol, even when the Go name is unexported. This permits the exposure of hidden runtime functions without polluting the public API.

Since Go1.20, a single line of assembly may be embedded directly within a Go function body using the //go:asmstmt pseudo‑directive. The comment takes the form //go:asmstmt <assembly>, and the compiler emits that solitary instruction. This is suited for tiny, precise optimisations where a full separate file would seem excessive.

When deeper integration with existing C code is required, cgo offers a bridge. Through cgo, a Go program can call C functions that themselves contain inline assembly or link to compiled assembly objects, thereby reusing established libraries or tapping platform‑specific instructions beyond Go’s native assembler.

--
no runtime astronaut can survive at his high altitudes without the oxygen (low-level base)
>>
good morning saar remember to do the needful today!
>>
>>108700617
yeah sure. eventually the high level abstractions needs to stand on low level code. no one is denying that.

but most programming solves problems at a higher level that doesn't require interacting with the low level code directly.
lower level code for performance should be opt-in. which is the case in most programming languages.

there is no reason to use assembly for parsing an http request/response.

this way the potentially unsafe lower level code is isolated and maintained in one place, and is easier to vet and test. rather than scattered all over your code.
>>
>>108700537
>>108700624

nice hello_world.c anon

the creators of C wrote software full of buffer overflows and vulnerabilities. and there isn't a single C large project that didn't have a massive CVE throughout its history.
we are yet to find a single person that possess the skill needed to code in C safely.
>>
>>108700519
because it's fast and makes shit like mmio a breeze
you're free to fork oberon and to write a working userland for it by the way but you won't, you'll just bitch about C and unix again in a week
>>
>>108700700
>fast
this is a boomer meme
we have had languages that are as fast as C or faster for decades.
>>
>>108700715
ya sure
then write a good general purpose OS in any of them
why do you think i mentioned oberon? put your money where your mouth is
>>
>>108700658
Boomers and Zoomers just live in a Morlocks and Eloi type reality...
Late Xers and early Millennial rise up.
>>
>>108700715
>faster
No
>>
>>108700536
typedef struct {
int x;
int y;
MouseButton button;
long long timestamp;
ClickPattern pattern;
} Click


I'd guess that most exploits don't define this type or one similar to it. To answer your question, in this context it's an object representing a mouse input event.
>>
I hate the fucking zoomer retards that talk about c being a "dead language" and can't run ls /usr/include, literally 95% of your software uses c, and not just libc unless it's written from the ground up. This is what happens when you run operating systems built for cattle.
Windows doesn't come with a compiler, but it was used in every computer class from elementary onward. People just played pinball.
>>
>>108701377
>can't run ls /usr/include, literally 95% of your software uses c
yeah and that's the most unfortunate thing in the history of computing. we could have been living in a utopia right now if someone shot Dennis and Ken a bit earlier. but now we have to live with the consequences
>>
>>108700519
>what was dennis ritchie and ken thompson's justification for making this abomination when we had safer and higher level programming languages for decades before C?
same reason people constantly reinvent the wheel everywhere else?
they wanted a language tailored to the things they had and worked on.
>>
>>108701332
I don't think structs are objects
>>
>>108700727
there are a ton of them though. many technically better, but lack basic drivers because that's the lock-in.
Fuchsia is probably the only real alternative OS currently and it's basically C++ and Rust.
>>
im a no coder, ive read they are selling rust as that safe and fast language of the future? is that really the case for now?
>>
>>108701452
>Rust
it's good. chuds hate it for non technical reasons like "MUH TRANNIES" or something.
>>
>>108701377
>literally 95% of your software uses c,
it's also why literally 95% of being an IT wage cattle is constantly OOOPDOOTING to stay ahead of the next CVE.
>>
>>108701452
yes. it's probably the best programming language you can use now. it has real world usage, real world users and has most of the features you'd want and expect in a langauge designed post 1995.
>>
>>108701446
and you're using them to post shit on 4chan i presume
>>
>>108701504
You're such a fucking insufferable, goal-post, moving faggot. kys.
>>
>>108701452
Modern C++ is underrated. C++20 feels like the language of the future. Most vulnerabilities in C++ projects actually come from parts of the codebase written in C.
>>
File: (You) celebration.png (568 KB, 938x854)
568 KB PNG
>>108701473
>Cargo (BAD)
>"Everybody uses this crate" v0.1.0 (BAD)
>Centralized repo for crates (BAD)
>"Oh you don't need that" download the entire repo to your personal computer just so you don't get MitMed by Rust losers (BAD)
>More time spent developing cargo-mommy than on making the rest of the ecosystem v1.0 (BAD)
>microdependency hell means bringing in one crate actually imports 1000 (BAD)
>"we want a svelte standard library" all FFI tools are now crates (BAD)
>"you don't have to use cargo if you're autistic enough" all FFI tools being crates mean you either manually translate header files or use crates (BAD)
>Postfix notation making me write more to get the same effect (BAD)
>Half the important language features are hidden behind ? and ! with no clear intent unless you've written Rust for over a year (BAD)
>macro_rules (BAD)
>Tied to the hip to LLVM (BAD)
>Every other llvmslop language is working on moving away from it but we get billions in donations from big tech so we won't! (BAD)
>By the way we're the resistance even though Microsoft and Google are our platinum donors (BAD)
>We're not Mozilla anymore but we'll sue you for using Rust(R)(tm) just the same (BAD)
>By the way everyone keeps donating their project to the same Rust(R)(tm) foundation that wants to sue its users to death (BAD)
AND THOSE ARE JUST THE NON-TECHNICAL REASONS (You) LINEBACKER IN A DRESS
>>
>>108701530
isn't this because more code is written in C and Java and Javascript than in C++?
also Javascript code tends to be network facing so it would be more vulnerable i guess.
>>
>>108701530
Modern C++ is footgun city too. It's better than C, but that isn't a hard barrier to overcome.
>>
>>108701537
Why are retards so violently upset by working package management? Are you all jobless or something? I can do in one command `cargo update`, what would take weeks to do in C land. I've actually worked with a in-house C toolchain and Linux distro and you're delusional if you think that experience is somehow more secure can even npm.
>>
>>108701596
I have working package management. It came with my Gentoo installation.
>I can do in one command `cargo update`, what would take weeks to do in C land.
lmfao
>>
>>108701623
>Gentoo
Jobless neet confirmed or I wish you were jobless.
>>
>>108701623
No you don't. What ends up happening is your incompetent ass shits out a ELF that depends on glibc 2.50+ and then deliver it to a customer running EL8 and get yelled at because you fucked up like the incompetent shitter you are. No one cares about your tranny distro in the real world and you've never had to deal with production software for equipment or servers for Linux and I can tell. In Rust, rustup and cargo do 99% of the maintenance and security I care about. The rest is C garbage noise I can mostly punt to cross-rs or zigbuild. Immensely better experience than dealing with 3 to 4 different flavors of gcc because gcc is still a trash toolchain that can't cross build or target different glibc's in 2026.
>>
>>108701514
man shut the fuck up. you don't even know what goalpost moving is. my point from the get-go was that there is no general purpose system made on any language that isn't C (or based on C) that you can use daily. there isn't any I can load on my box right now and have it do basic shit i'm used to doing. and i really don't give a shit if any of these C-free OSes you gush over are "general purpose" on the strictly academic definition because that amounts to absolutely nothing, you don't use your computer solely for writing and running numeric programs or operating a server. nobody cares if your OS is sooo safe but has no userland and runs nowhere. seL4 has been verified to be correct and it's written on C but nobody uses that because guess what you can't shitpost or play vydia or watch movies in it. then you go on and gush about all the amazing software written in languages superior to C and then you dont even use it. i doubt you even develop for it. maybe if you spent more time writing code instead of your gay posts you'd have something to show for but no, you can't even do that. all you can do is bitch
>>
>>108701679
Ok and? That doesn't mean C is good or fast. Your whole premise is flawed and you're retarded.
>>
>>108701702
i'll concede C is slow and shit and gay when you have any C-free operating system with actual features outperforming Linux or BSD or whatever
>>
>>108701721
I already told you Fuchsia exists, tranny.
>>
>>108701473
>>108701480
>>108701530
that's great to know! i was reading about it and it seems quite fast and works very well with c. i became interested in it after reading about the new xfce compositor, which is being written in rust.
https://gitlab.xfce.org/kelnos/xfwl4
they are really aiming for backwards compatibility, its kinda exciting if they can pull that off.
ive read mozilla's .jxl implementation is also rust, so its great if all works out.
>>
>>108701742
yeah sure fuschia exists and it has feature parity with my linux box or windows box right?
you're using it at this exact moment to post on 4chan right?
god how can you fail to get the point to this degree
i don't care how performant you think your little code is when it does nothing really fast



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.