They Made a Sequel to C
HTML-код
- Опубликовано: 7 сен 2024
- Streamed Live on Twitch: / tsoding
Enable Subtitles for Twitch Chat
More Episodes: • C3 Programming Language
References:
- c3-lang.org/
- github.com/c3l...
- github.com/c3l...
- Code: github.com/tso...
Support:
- BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9
- Pay for my VPS: zap-hosting.co...
Everyone talking about C killers, meanwhile I'm looking for the C healer
Everyone ask what is C nobody ever ask how is C :L
HolyC
@TempCrap-nn4cm tell me about it!
I am starting to learn how to use clang tooling and I have some ideas about extending the C language. In particular I want comp time functions
@@gwentarinokripperinolkjdsf683 Do you want compile time functions like in zig? If yes then zig is your answer!) You can also perfome computations using good'ol macro-magick(though heavy use is ill-advised), also most of the simple computations that can be done in compile time are already done in compile time by using optimisations of modern compilers(though yes, this behaviour is NOT a guarantee). If you are talking about meta-programming then *light* macros are all you need. Anything more than that - you might as well use just c++ at this point(you can treat c++ as a feature dump of c extensions), since it has compile-time functions and a metric ton of other features like that.
"This is what happens when C programmers start making websites" 😂
Man I laughed so loud🤣🤣🤣
Pokémon evolution!!
@@saeedhaidar1375I have got literally kicked out of a team call for laughing my soul out for this 😂
reading this comment at the same time tsoding says it hits different
The FAQ now has a "How do I use WASM?" section now.
14:11 face asking : " do i developed it in my dreams or something?"
the "unecessary" fn keyword actually allows to disambiguate a bunch of problems that the C declaration syntax suffers from, especially when declaring function pointers
Helps make the code greppable too
@@iverbrnstad791 Yeah, that was the big pet peeve and we haven't started the video!
I feel like zozin has forgotten what it is like writing idiomatic C. It is not like your higher level languages where you just get a 'print'. Like java (shots fired), you do this 'void main' bullshit. Like, what does 'VOID' mean? (I know what it means now dont correct me below), what does MAIN mean (oh we need a main function, I dont know why but whatever.)
I prefer an explicit function keyword. That is C/C++ problem. I hate it has no function, fn, fun or func keyword.
Also, i am optimistic about C3. I think it is a less feature promisey V, but I look forward to seeing both develop as a 'just a thin layer' above C.
@@iverbrnstad791 So do comments, no? /* fn */
@@artemiasalina1860 no
C3 looks a bit like zig, just with less features.
14:07 that slow look at the camera is hilarious LOL
I actually talked with the creator of C3 a little some time back. It was throughly a good experience both from a programming language and a personal standpoint.
One day, I'll be able to fully comprehend the things you say
This is how charming he is.
My brain is too soyed to understand after previous web development streams
I feel like the subtitles are not doing their job here... They're nice, if not for the fact that now I don't get the *real* subtitles
You can still enable the auto-generated subtitles
Why are you still using C3 ?
C23 is already out smh
Who cares about C23? We already have C99
@@solidnywonsz i saw someone say that on the C3 video after this one and i realized i could have made the joke way funnier
44:10 I think it's actually a good idea, cuz defer also accounts for breaks/continues in the while loop, in case you want to use them
Making the comments into RUclips subtitles is interesting. Never thought about that option
Why didnt they name it C+++
Why not C^2
too close to C# (C++++)
because it would cause segfaults
++c
they are not intel
a.f(b) is different from f(a, b) in which namespace f is a member of. I don't care much for method chaining, but it is useful to have built-in syntax that groups all methods for a type into their own namespace.
They are actually the same thing, in my own POV sha
You can do f_a(a, b) if you insist. Manual namespacing. But the fact that a function takes a is sufficient to classify and search for such functions.
We already have c with four +
It names C#
C sharp sucks
C hashtag is awful
@@hpntic c# is c++ flavored java, but with pointers and near-c speed, it's good for rapid iteration where you don't wanna care about lifetimes nor memory size and just want to do something, but p5.js and python are too slow.
currently I mostly do tool dev, so c# is my go-to
Press 6 for beatbox mantra
We got a sequel to C before GTA 6
People like methods mostly because it makes the code read almost like english. " a = b.copy(c)" is in the same order as subject, verb, object. It also keeps the current translation unit's namespace a bit cleaner I guess.
raw c is more like English. a = fsin(b). A is float sinus of b.
@@RukopisyNarnie consider a void function call to a function that modifies or requires self. It would read as "Operation(self, arg)", this could be "compare(a,b)", with a method it would be "a.compare(b)". Its really just to make it easier to read and parse, I argue that not having to explicitly pass self into the function makes it a worthwhile addition in its own right
@@TheAlexgoodlife It doesn't seem more readable to me. I guess it makes it easier to chain it for functions that return its "hosting type".
this is also kinda the same grammar convention in declarative functional programming right?
@@samuraijosh1595 I am not sure if I understand what you say
I swear I couldn't stop laughing throughout the entire video. Thank you, you made my year.
I checked C3s change logs and apparently "printn" was once "println" and they willingly changed it for some ungodly reason.
Revision 2023-03-18 apparently
it would be too good perhaps that's why. they had to get us
I guess they thought it was more C-ish to use n as in
than ln as in natural logarithm. You know, just like in puts. Wait...
I hated how long and garbled printfln looked, and then I learned a bit of F# (F# uses printfn) and `printfn` quickly grew on me. A huge advantage is that it's much easier to read (fln is not good for readability).
@@christofferlerno2633 But as discussed all over these comments, fn now stands for function, even if the subprograms aren't functions at all. To please the parser, apparently.
@@0LoneTech Here's the answer why: c3.handmade.network/blog/p/8886-why_does_c3_use_%2527fn%2527#30031
i didn't expect the emacs mode of this language to be inspired from tsoding's thing hahaha
The only language that is syntaticlly consise that I've every seen is the dead language OOC.
That was the most beautiful thing I've ever seen.
OOC. That brings back memories, last time I read about that one was ages ago.
There is actually a C4 PL, but that language is a little too explosive for my taste
There is actually a C16/17/18 PL, but that language is only for android
I have a C17 compliant compiler, but not on android.
Arab programmers: "I'm in love"
"What's the point of `fn` keyword?"
The fn keyword takes parsing a function definition from O(n^3) to O(n) (if i remember right) by making the grammar fully predictable
EDIT: I did not remember right, lmao, I remembered very, very wrong
What does n represent in a function declaration? I thought it's constant time.
@@mrglick5050The number of tokens in the function definition [`void`, `main`, `(`, `)`, `{`, `}`]
@@mrglick5050tokens?
It’s probably the length of the file in # of lines
@@mrglick5050 Number of tokens in a function definition; though, I'm probably wrong about that. It's only when you get to nesting functions in other functions that you'd have ambiguity with expression statements. \shrug
have you looked at Odin-lang? I've gotten really into it as of late, it has defer and builtin vector type arithmetic as well. I'd be curious to see what you would think of it.
He played with it on stream. You will probably find recording of that stream on chanel.
@@RukopisyNarnie I couldn't find it, do you know what it is called? or around when it was?
@@dragonkid5204 I have no idea, but I remeber him trying it.
@@dragonkid5204 Maybe I mixed it upnwith something. Sorry.
@@RukopisyNarnieis it possible that you were thinking about zig? There was indeed a zig stream but I don’t recall an Odin stream.
Can't wait for part 4. That one's gonna blow everyone's minds.
1:11:29 the language redeemed itself and he is expressing how much he loves it
I like that you wrote your own C3 mode before you knew C3 existed. 420 IQ move!
The nice thing about methods is that auto complete is much nicer with them compared to having the entire list of all functions.
Adding chat in CC is novel. Probably breaks RUclips's Machine Learning too. double awesome.
Man, I'm still waiting for the day they will add classes to C :D
First thing I will do is to alias c3c to "cccc", the way it should be.
This comment is underrated
I've wrote a todo app and I've called it c3 because of it expanding calcurses todos to have a tree-like structure.
I think I have to start a lawsuit against them.
14:41 broke me
Das crazy,can't wait for c4
I think zozin could love Odin language (and i'm not payed to say that). After years of C/C++, Rust and some other Scheisse, it is very refreshing to use it
[PARENTAL ADVISORY] 18++
The random beet boxing made this all the better.
for changing the color you could use the vector swizzling to move to 0xFF along the color! color = color.brga;
"What is this JAVA!?"...Yeah I totally agree 😂
800x600 is of the orthodox aspect ratio but the holiest resolution is 640x480.
Hot take: C will die when Intel comes up with a new instruction set architecture. But as long as they keep making them backwards compatible, we're stuck with C.
no? GCC/clang are made to have maximum compatibility, they'll just port to a new instruction set... that's one of the fundemental jobs of a compiler.
also, intel won't change to a new ISA, i'm not sure why you think that would even remotely be a good idea for them
@@ChristopherGray00 itanium lurking around in the corner like oscar the grouch.
@@satibel itanium? you mean that ISA in 2001 that immediately flopped when it came out and that intel had zero reason to proceed with?
yeah, no one is going to use a proprietary one-company ISA and move their entire infastructure over for it. companies will just move over to AMD for better top-level performance with no changes needed.
I loved this language, i bought me after the vector stuff
The language looks very promising.
looks like zig with less crappy syntax
I’m not sure if this version will take off, but when they fix all the problems and release it as C4, I’m sure it’ll blow up
14:40 the video is now turing complete
a """C replacement""" without sum types and some level of pattern matching on them in this day and age is just a meme
correlating those two concepts makes no sense
There is a plan to add "defer" to C, there are even actively discussed proposals on WG14. However, "defer" introduces quite many complication due to odd corner cases. Moreover, "defer" is virtually unusable without lambdas that have their own problems.
More like, whoever proposed a defer was the same person who proposed lambdas, and used the defer as a vehicle to push his lambda proposal. You don't need lambdas for defer to work, and edge cases are mostly related to go-to.
Auto exists in C, but you have to register a function for each type.
Look up the GLib macros for g_auto, g_autoptr etc etc.
It uses __attribute__((cleanup(...))) to do it.
@@GegoXaren This GCC extension, not a standard portable C. Btw. it is possible to use nested functions with statement expression to get a lambda-like function that can be used with `cleanup` attribute. Something like `({ void foo(void*){...} foo; })`
14:11 That is c-2-emacs-2-human recursion...
1) The ".o" files that were created with --target wasm32 are actually WebAssembly binaries, not ELF object files. So it seems that wasm "just works (tm)".
2) If you don't like prefixing everything with "raylib::", you can just have the main file and the raylib.c3 use the same module. You don't have to create a new module for each file. Although it is indeed a bit weird that there is no import blah::* or using blah or even import blah as foo.
I'm gonna wait for C4. It's gonna be explosive.
But wait... Sequel to C is actually D
but there's already a programming language called D. and it requires a runtime (including GC! 🤔), or you are limited to a subset of functionality (called BetterC).
the semantics look more like rust than C
crust
lol 😅
crust
@@bossgd100 okay no cap this is a good name for a language that melds the two
@@paulkanjaI NEED THAT
Okay, this language looks very cool. The only things that I don’t like are the contracts stuff and defer. I think the using keyword in C# is better approach than defer, you can really see the scope of the thing that you are “using”
No it’s not better, it introduces extra indentation and helps turn your code into The Tower of Doom
Or you could define using() declaration as open ended and it effectively has the same scope as the function. That being said, if you are using enough calls to make a tower of Doom of using statements, you're probably doing something wrong.@@egorsozonov7425
Regarding the $foreach: When it is executed at compile time the compiler loops and generates all the io::printfn() - lines.. and then there is no loop any more in the resulting code. In order to not confuse with scope, because it isn't, they did chosse the $endforeach, maybe. To annotate that you do not have a scope you could also used special curlys like ${ and $} to annotate that this are only lingual curlys but they will not exist anymore, when the compiler slided over it.
they should have called it c4, because then the slogan could be "this language is the bomb"
I want a prequel to C. something closer to ASM, but with more verbose operations.
Can't wait for C4 programming language that just explodes your computer at compilation
21:16 it's not "just a syntax" (well it is, but) it's actually important for organizing your code.
i think it's a huge problem to not let you namespace functions like this.
without it you just have a million global functions maybe namespaced with Foo_next() but Foo.next semantically lets you know the function is only relevant to the Foo struct/class
windows stuff might be there for cross-compilation.
14:00 that moment when you just want some pretty colors on your screen and you get doxxed by a random repo maintainer
26:50 If you want compiletime access of the complete language, rather use Lisp or Scopes.
Feeling when that guy Alexy gives you a github star 😻
the end for each may be because otherwise it could be confused with generate a block. needed because for loops accept statements, most commonly the block statement
This C3 thing looks a lot like hare (or hare looks like C3, idk which was there first). Still nice to have different alternatives :)
C3: 2019, Hare: 2021
I actually liked the syntax of c3. Linking native libraries is very easy. It has modules, generics, macros and what not. I think I like it more than zig already.
Now we know what language was C3PO programmed with
"not readable, only maintainable"
19:44 that got me lol
Read write read only space can you make
imo everything should be public unless there's a really good reason for it not to be.
Folders have to sorted by allocation sort folder
c3 before gta 6 is crazy
a keyword in general is a good idea... but it should be a keyword: it is in the name - a WORD, not 2 arbitrary letters. We are not in 1973 where storage is rare and typing is limited by the computer.
This is one of the worst atrocities that is still plaguing programming languages: They either use cryptic symbols, terrible abbreviations, or you are in library.section.namespace.class.subclass.function.variand-land . Just make it "function" or "func" or something readable.
And brightmode - it is superior in most aspects. Only for programming i tend to switch to DarkMode cause way too often the tools have TERRIBLE font-support and with bad styling and bad fonts dark-mode has better colour clarity. But bright is just better for readability and better for the eyes.
libc doesnt have a fraction type its just a struct containing quotient and remainder from an integral division
That prob should have starting point
"Javascript damaged my brain" I think he speaks for all of us
First you find code based from your old code then René shows up. You not only famous, you a legend. 🎓🎩 👑
I watched the entire video. Now I can say that I have 10 years experience in C3.
if you like the built in vectors and swizzling, you might also like odin. it doesn't have methods. heh.
Can't wait for C4, it will be the bomb
Why the need to add fn for a function tho...
Bro probably fixed three bugs in their code by the end of the video. 😅
1:07:55 real world example of an undefined behavior happening on an innocent C programmer
Read only is have to boble recursive sorted
34:17 Camera spazz
$300 for another Zig stream(?
We need a full version of Kawaii Frikkin Desu
Should have called the compiler binary ccc
Programming in C4 is like exploding a bomb
Have you tried the prologue? C--
You don't have to make things up. The real prologue is obviously B
@@MartinDerTolle You likely jest, but you are to some degree correct. C inherits from B, which in turn inherits from BCPL, spawning the vigorous argument about whether C would be succeeded by D or P. Meanwhile, C-- begat Cmm which is in active use inside the Glasgow Haskell Compiler.
However, none of these are prologues (that's more akin to Haskell's Prelude) or sequels (like the numbered generations of K).
We need more videos from you, that way we can get more depressed realizing we're not real programmers compared to you xD
С3 is nice enough, but C4 is gonna be the bomb!
We need more new frameworks and libraries to make existing languages useful. Not more languages
Have you reviewed Forth?
Do you think it can replace C?
The only high level language older is Fortran.
First language to use a database and 2D CAD.
It is low level, like C, though not as fast.
Incremental compilation.
Rapid development, 50x faster than C.
Extend and design the language as you need.
Is used in the real world, mostly microcontrollers.
Is used by NASA, by Riad Airport Saudi Arabia security management system, large construction management software.
Large active user community, FIG.
It looks like they did good work with this, but I don't really see why you'd use this over Zig, which has a faster developing ecosystem
Ok so this language looks pretty neat; nice features, good documentation, simple mission statement, seems good. My concern is I don't see any reason for this to get adopted by the masses. If you're a C die-hard, then you don't want a new language, you want C. If you're a corporation or government body, you don't want C, you want Java, or Python, or C#, or whatever other big-money language.
It's awesome people are experimenting with new languages, but what does C3 offer that actually makes it worth adopting? Rust has its safety claims, C++ has its massive ecosystem, C# has Microsoft and .NET, etc.
Not to sound rude, but it seems like Odin, Jai, C3, Zig, etc. all fall into this C fanclub of languages, too similar to C for people that hate it, and too different for those that love it.
Rust's strength seems to be a C-like syntax veneer on Haskell-like type classes. And then they try to scare people off with the borrow checker. Can't just write a function, you have to replace the move semantics or the call site has to counter it.
I agree that it is very unlikely that C developers will switch to a new language, but I disagree on the rest. I think there is plenty of people who want to get into system programming but C is too annoying. I am one of them, there are 5 things that I really dislike about C:
1. No module/namespacing
2. Not having a language supported way to release/close resources (something like using in C# or defer in Go)
3. The lack of a build system (I think Zig is making the best solution for this)
4. The preprocessor
5. Header files
we survived 30 mins without raylib
I actually talked with the creator of C3 a little some time back. It was not a good experience, both from a programming language and a personal standpoint.
Hey, man is the guy weird or something ie McAfee. If it’s not a bother for you, would be interesting to know brief details for all around since creating a language good or bad seems a remarkable feat (but not necessarily wise) so very unique all in all.
I am a member of his discord channel and it's been more than one year. In my experience, I felt he is such a nice guy.
@@JazzBrown-ym8ku It's nothing serious, he's just an asshole if you question his design.
@@JazzBrown-ym8ku No, he just has a large ego (apparently you can't say the a word).
@@gagagero Oh okay thanks for replying seems somewhat par the course for large tasks like this.