Video wird geladen...
Video konnte nicht geladen werden
I removed ';' from C
85,672 Aufrufe • vor 1 Jahr •via X (Twitter)
36 Kommentare

- Tiny C Compiler: - B reference: - The Patch:

Bro is trying to turn C to JavaScript

This heresy against Holy C has been noted. May The Emperor’s mercy find you quickly.

Okay now remove { } and boom it's Python

My hot take that the last statement in a block shouldn't have a semicolon, but that curly braces should be mandatory even if there's only one statement within.

Pascal my beloved

I'll use ; more in python.

in js the annoying thing about asi is, it turns return 42 into return; 42; which then returns undefined instead of 42

You messed with the primal forces of nature, Mr. @tsoding!

“Let’s recompile the compiler”

I think the case for semicolons in C is that it's such an old language that, at the time, there probably wasn't any certainty that every OS would use LF or CR (or both) as an EOL marker; so by requiring a programmer to use a semicolon, there was always an EOL marker.

“I removed the safety goggles and respirator. Most of the time things are just fine” Semicolon is there for a very specific reason. It breaks ambiguity (And frankly we needed some more checks)

C-emi colon

I was disabling semicolons for years, until I found one very specific case when I needed semicolons. The case was global search with regular expression across whole codebase with replacement, for the part of string which was at the end of the line, but also the string was used in different places, and should be replaced only at the end of the line. Enabling semicolons solved this issue, but made a mess with git repository. Since then I just keep semicolons enabled in all of my projects.

Code is meant to be read by humans too, unlike binary files. So I prefer the C semicolon.

I'd rather add it to python, along with the curly braces instead of indentations.

Humans mostly look at the indentation. So the computer should do the same. Otherwise it is easy to write something that doesn't behave the way a human would assume. Every bug and exploit due to C syntax is caused by misleading indentation but devs still say it shouldn't matter...

Most programming languages are too verbose, they should take inspiration from rust:

@theshashwat20 i am boutta write c like i write javascript and you will witness all of it live

now make a python compiler that expects semicolons

I like semicolons for clarity. I agree it's mostly for humans, but it really helps with getting rid of misunderstandings.

why?

why not?

I've never seen such bullshit in my life before No, the compiler can't know where you need a semicolon. Forcing the compiler to do so, only creates ambiguities Stop spreading misinformation especially when you have such a large follower base void a(){} void b() { return a(); }

1. It's ironic that my change literally doesn't break your example. It's specifically for statements that are `<rvalue><;>`, not `return <rvalue><;>` 2. You are the one spreading misinformation by calling educational material that is designed to provide food for thought and spark constructive discussion "misinformation". 3. By bringing the "follower base" you are revealing that you are simply jealous and cannot be take seriously. :)

Without semicolons, it's easier to make mistakes that compile without errors, which create harder bugs to debug, or even notice.

Wow! Thank you for this.🙏 Yes, semicolons between expressions needed/preferred.

Removing the semi-colon introduces ambiguities. This kind of ambiguities (what should "run" first) might be useful for performance, but I'd rather have a proper language for that.

😨😨

Could've stopped at "greatest semicolon conspiracy ever" - Pft, silly hoomans, you've been duped! 🤓 All "proper syntax" chatter aside, this is a great demo on benefits of understanding compilers. Some of us went a long time taking compilers for granted before we learned.

@GODPIXELthereal

YOU MONSTER...

I think you trade the missing semicolon errors for missing brace ones in that case.

As someone that spent on previous projects 85% of work time fixing people's made bugs, I feel like this would triple the bugs easily

REMOVE THE NEW LINE CHARACTER FROM C, IT IS TIME!

Use a linter?
