Unable to load image

C is getting butt-r*ped by :!marseytrain:s and there is nothing you can do to stop it.

https://11080372623597421729.googlegroups.com/attach/cb81ee09b37fd/D1095-Nxxxx_Zero_overhead_deterministic_failure_draft4.pdf?part=0.1&view=1&vt=ANaJVrEsPYaBTPqZFkBcjxbVf7Nb02D5sOHeFFpME6h72DuQuB9_kPNsTXYSKv_Y6GFvtPFYJHryF-10JUZX8gWa5DBUy0M76uTCYs6BUh9qmW-dXkdvEf4

See the attached proposal for rust style error handling types. In the email thread, a guy said the working group members are "very interested". I also saw a furry on twitter advocating for slices as a primitive in C. My prediction is that all of these :!marseytrain:s adding r-slurred features will succeed (see C23's nullptr, _Generic) since there are no non-autists in these groups.

!codecels discuss

77
Jump in the discussion.

No email address required.

In literally every programming language that isn't rust, evangelist of the church of ferroxide spread their belief and try to convert nonbelievers by trying to introduce rust like feautures, they truly are annoying and cancerous :marseyrave:

Jump in the discussion.

No email address required.

First thing I wanted to do when I came back to Java after some months playing with rust was the result object...

Jump in the discussion.

No email address required.

>not using c# or kotlin

:marseydownvotemad:

Jump in the discussion.

No email address required.

Who cares about C if you're not working on an embedded system or an OS

:marseyrave::marseyravegigaspeed::marseyravesuperspeed:

For everything else RUST is the future, just look how much drama they produce

Jump in the discussion.

No email address required.

the rust :!marseytrain:s shall inherit the earth

Jump in the discussion.

No email address required.

I am currently trying to learn C so that I can have an easier time reading the dinosaur book. How will this affect me?

:mar#seyhacker2:


:#marseydisintegrate: :!#marseyflamewar::space::!marseyagree:

Jump in the discussion.

No email address required.

Not at all. These changes will arrive in 5 years, and fully implemented in compilers in 10. You'll just have to deal with marginally more shittines & complexity in the future.

Learning C

It never even began for you. Every book I have seen (yes, including the og k&r C book) teaches you nonsense.

Jump in the discussion.

No email address required.

And will arrive in production code another 20 years down the road, if ever.

Jump in the discussion.

No email address required.

embeddedchads still write c89

Jump in the discussion.

No email address required.

I learn by googling how to do syntax and every time I reach a point on my coding where I wonder how to do something I google how to do it.

Jump in the discussion.

No email address required.

Every book I have seen (yes, including the og k&r C book) teaches you nonsense.

huh?

Jump in the discussion.

No email address required.

Most books teach you some very basic syntax & semantics as well as the standard library, which is completely r-slurred to the point of being unusable for serious work. They typically teach a certain style of programming reminiscent of a desugared C++ or rust, which is worse than just using a vanilla programming language.

Jump in the discussion.

No email address required.

learn D

Jump in the discussion.

No email address required.

Lol who cares

Imagine using C when Rust exists

Jump in the discussion.

No email address required.

Don’t most c code bases just use c98 or w/e?

I thought a benefit was it was a known quantity and didn’t change. I mean - there are new versions but people explicitly avoid them for “portability” (never know when you’ll need to compile on Solaris).


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

Linux moved to C11 a while back. The world won't be on C99 (realistically, gnu99/gnu89) forever.

Jump in the discussion.

No email address required.

Are you sure though? People seem convinced that targeting Solaris and AIX is a real thing that happens in 2023.


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

i think its a larp. I've never actually seen it happen, linux rules the world except on a few embedded things. And even if it were true, solaris 11.4 from 2018 added C11 support according to google search.

Jump in the discussion.

No email address required.

I was "trolling" but I have totally run into people who feel that targeting c99 because there might be Solaris systems from '01 is a valid consideration


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

Errno was an understandable mistake, but C already has a great way of error handling: any function that can possibly error out returns an int zero for success, non-zero for error.

It looks like they are repeating the mistake of C++ exceptions of letting you throw / error-return any type. One guy I used to work with liked to throw 1 and shit like that all the time. His code got the catch (...) {} to at least log that it had thrown something unrecognizable and die. Then another guy liked to used pthread_cancel() for some reason. Turned out the cancel implementation used the same exception stuff underlying the C++ exceptions implementation, so the ... caught on the thread cancellation and broke everything.

Jump in the discussion.

No email address required.

There are people who use anything but c99?

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

nullptr is a legitimately good change. _Generic is just ersatz function overloading, which is sometimes useful and has been in C in the form of type-generic math since C99.

Jump in the discussion.

No email address required.

Just use c99 forever

Jump in the discussion.

No email address required.

Chris Chan?

Jump in the discussion.

No email address required.

This is from 2018 and it depends on herbceptions so it cannot go through unless that does. I find it highly unlikely this feature will make it, even though I actually think it looks pretty reasonable.

see C23's nullptr, _Generic

Those are good things.

Jump in the discussion.

No email address required.

can someone summarize what this is doing. I have a basic understanding of programming languages

Jump in the discussion.

No email address required.

In C your function returns a value of the declared type using the return statement.

int divideAMillionBy(int x)
{
   return 1000000 / x;
}

This is declared to return int with the result. If you give it 0, it will crash.

In this new thing, there is an additional type declaration for an error return channel.

int divideAMillionBy(int x) _Fails(char)
{
   if (x == 0) { return _Failure('F'); }
   return 1000000 / x;
}

Then when you use this you have to do something like _Either(int, char) result = _Catch(divideAMillionBy(5)), check if result came through a normal return or through a return _Failure(), and appropriately access the int or char contained in result. (They seem to be changing around the names for using _Either so I left them out here.)

There's not much value to having the 'F' returned here, but from a quick skim I didn't see whether or not _Fails(void) would work.

For a C specific note, if you ever end up actually using this you probably won't see much _Failure or _Either - C has a pattern of adding new things to the underscore-prefixed namespace that is reserved for the standard and then providing a header file that aliases them with more convenient names. This is to make it easier on an existing codebase that already uses the name Failure or Either

Jump in the discussion.

No email address required.

You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.

Jump in the discussion.

No email address required.

Read "1. Introduction" of the pdf.

Most important: "C code would directly understand that a C++ function it called had failed ? moreover, C code would be able to return exception throws to C++ code."

Basically C and C++ can communicate more with each other.

Jump in the discussion.

No email address required.

I don't get it I thought that was a good thing

Jump in the discussion.

No email address required.

people complain for no reason whenever anything is added to C because it punctures their delusion of writing "portable assembly" like a leet low-level programmer

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.