Some simple problems solved in C3

Поделиться
HTML-код
  • Опубликовано: 10 янв 2025
  • НаукаНаука

Комментарии • 28

  • @douglasdacosta853
    @douglasdacosta853 5 месяцев назад +3

    This really looks like a next gen of C. Nice job! Hope you're still working on it.

  • @rednibcoding3412
    @rednibcoding3412 Год назад +3

    Thank you for the insight.
    C3 looks promising, please keep working on it. I really don't like how new programming languages are developing. They are just packed with unnecessary features to cover every little edge case the user could run into, so the language ends up beeing cluttered, bloated, hard to grasp and to maintain.
    What I wish for, is a very C-like programming language that only has improvements where it _really_ needs them.
    The optimal programming language (at least for me) would be:
    - very C-like
    - no header files
    - build in string data type (and bool)
    - slices (growable/shrinkable arrays )
    - hash maps
    - tagged unions
    - safety features such as runtime array bounds checking and thread safety, etc.
    - defer (free, close file, etc.)
    i don't even need the macro stuff...
    And that's all.
    I find the programming language "Jai" also has a good approach, but it also seems to bring a lot of new stuff (some of it looks good though, but have the fear it gets too bloated/compicated and too much targeted towards game programming). The weird way of mimicking oop like behavior where you have "# as using" just to reference a struct member's fields when the member is also a struct type. Also the whole compile time execution stuff, man don't waste time on that and keep on developing the compiler core. And the release date is also up in the air
    You have mentioned Bitwise in another video, i followed the Bitwise streams back then and he had the most promising programming language idea ive came across since a long time (a c with some caveats (the ones i listed above (he didn't have strings though)) And the syntax was also really nice!. He excactly reflected what i wanted from an "upgraded c" with his programming language "ion". I wasn't really interesred in the rest of his stuff, only the language. Really too sad he stopped working on it.
    The Hare programming language was really promising too, the feature set is pretty minimalist yet powerfull and really enough for 95% of the use cases and their compiler is just around 17 kloc as of now.
    I like their design philosophy: "A Hare compiler, after release of v1.0, will compile Hare code written 50 years from now". So not only are they providing backwards compatibility, but somewhat of a forward compatibility. So this is pretty much the guarantee, that they won't "feature-kill" the Hare language over time! They said, that they will "freeze" the language and it's specifcations after the release of 1.0. And that is what no other new language out there does.
    But unfortunately they will never officially support the windows (and Mac os) (they will only support free os'es )-> so Hare is pretty much out for me because i mainly use windows. But Hare is open source, so maybe contributers will take the work and write support for windows.
    Hare would have been my fist choice because of the minimalism etc, but yeah, we'll see.
    I wish you good luck and enough motivation to keep working on the language, and please do not fall into the same pit like all the others, so instead of cluttering up the programming language with edge case features, just because the community is crying for it, instead please focus your valuable time and resources on optimizing the compiler, expanding the standard library, or porting the compiler to new architectures, implementing cross-compilation, a package manager, really good error reporting (like rust) etc., a lot to do! That's where your time and effort would be much better spent, and C3 won't end up like many other languages: bloated and hard to maintain language with xy features because they could be somewhat handy in some circumstances and just for the sake of having the language updated because its fun to work on it.
    Sometimes i get that feeling that language developers want to keep adding features just because it's fun to add new features. And they end up like all the others... destroying the language, slowly but surerly.
    I am a software engineer for over 2 decades now, and i know it's more fun to add new features instead of fixing bugs or optimizing existing code, but don't destroy a language because of it.
    Because i have that feeling the same will happen to c3 regarding the "ideas" section of the documentation and some of the already implemented features.
    And maybe think of a new name for the language. It sounds like an arbitrary and not really appealing name that would attract somebody's attention. I know it's the successor of c2, hence the name, but c2 is also not a good name, and not a lot of people know c2, so the name c3 doesn't make sense to the majority of people. The name c comes from c's predecessor b, and back then, the selection of programming languages was very sparse, so the name didn't really matter because it was a huge deal back then that their was a new language comming out. But now, you have to stand out, there are so many languages out there.
    I read people mentioning c3 few times, but wasn't motivated nor interested to look into it because c3 didn't sound appealing. I thought "just another language", because the name doesn't have character. Go has it's Gophers, Rust its Rusticans and so on, the community identify with it through the name. Same applies to the icon, you can identify the icons of facebook, twitter, twitch and so on even if it is black and white. Thats the reason why Google haven't decided yet how the mascot or icon should look like for their new Carbon language. They even stated that somewhere in the repo. It's a pretty big decision, if it doesn't appeal to people, it can have a big impact on the language. And google knows how marketing works, right? :)
    Anyway, now that i looked into c3, i found out it is actually an interessting project. But you have to get people beeing interested so they go further and look into it.
    Maybe choose a name that reflects the "minimalism" and "close to the metal" paradigm, maybe "Atom" or something like that.
    Anyway, thank you for your effort! :)

    • @c3lang995
      @c3lang995  Год назад +2

      Names are hard things and they affect a lot about how people think of the language. There are always lots of trade offs (Is it already used? Will it give the right associations? Is it too long? etc). The current icon and name is as neutral as I could.
      Feature creep is indeed a problem and easy to succumb to. It's easier to add features than remove them. One of the guiding principles for me has been that the compiler should be easy to reimplement, this is what I like about Hare: it has the same idea of having a concrete specification that should be possible to easily reimplement. I am still able to let the design go through phases of expansion and contraction (adding - removing features).
      If you want to help with the evolution of the language, feel free to join the discord: discord.gg/qN76R87

    • @_slier
      @_slier Год назад +1

      agreed.. they only thing i dont like about this language is its name.. gah..

    • @heavymetalmixer91
      @heavymetalmixer91 Месяц назад

      @@_slier Tbh at first I thought the name came from thinking of C++ as a second C, so this new language should be C3 (no, C# doesn't count LOL).

  • @0x370c2de
    @0x370c2de 5 месяцев назад +1

    This is the best "C-killer" programming language I've seen! It's cleaner, easier to read, and more important: NOT bloated
    Keep it up! It's better than Rust or Zig

  • @fallow64
    @fallow64 6 дней назад

    Great video! Out of curiosity, why is allowing `int pos, neg;` ambiguous?

  • @GaryChike
    @GaryChike 8 месяцев назад

    It would be cool to show a very simple IO console application in C3

  • @eduardabramovich1216
    @eduardabramovich1216 2 месяца назад

    please create more tutorials using c3, something like c by example would be great!

  • @_slier
    @_slier Год назад +6

    ur language is what expect from what improved c should look like.. unlike zig or rust.. they are bloated at best.. zig and rust are too verbose to my liking. i hope you keep continue on this project...and please do more this kind of video as an exposure to other people of what c3 can do .hope your language get more exposure

  • @HairyPixels
    @HairyPixels Год назад

    Why is the compiling taking so long? It's 20 lines it should be basically instant right?

    • @christofferlerno2633
      @christofferlerno2633 Год назад +2

      It was running the debug version of LLVM :D (AND it always recompiles the entire standard library)

    • @HairyPixels
      @HairyPixels Год назад

      @@christofferlerno2633 Oh the library must be to blame. I don't know about LLVM debug compile times but for 20s lines it should be nothing on any modern computer.

    • @christofferlerno2633
      @christofferlerno2633 Год назад +2

      @@HairyPixels 1. It compiles the standard library every time, so that is 15000 lines, not 20 lines
      2. The codegen is usually about 99% of the compilation time even without full LLVM debug information.
      3. LLVM with full debug information is about 10 times slower than in release mode.
      So of the time you see, around 0.1% is spent in the c3 compiler proper. 99.9% is spent *by LLVM doing codegen for the entire standard library in debug mode.*
      So to turn it around, what you're seeing is something like it would take to compile about 150.000 loc.

    • @HairyPixels
      @HairyPixels Год назад

      @@christofferlerno2633 ok that's not bad at all then. Why doesn't the standard library get linked in instead of being recompiled each time?

    • @christofferlerno2633
      @christofferlerno2633 Год назад +2

      @@HairyPixels A compiler maturity issue: packaging libraries separating interface files and implementation files is a manual process still. And the standard library is still in development. Later when generating C3 libraries the interface files will be automatically generated, at which point the standard library will be easy to package. So once both stdlib and compiler is 1.0 it will happen. While it's possible to cache object files, this is not something I want to have later, so that's why I am reluctant to add it.
      Ummm.. was that clear enough an answer?

  • @dejanlekic5513
    @dejanlekic5513 5 месяцев назад

    I have all this (and much more) in D for over 2 decades...

    • @christofferlerno2633
      @christofferlerno2633 5 месяцев назад

      Yes, D has everything and more. Sometimes that is what you want.