The C Programming Language is Over 50 Years Old, So Today I Learned Rust

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 มิ.ย. 2024
  • If you've ever programmed in C or C++, you know that its incredibly easy to make mistakes. These mistakes manifest in the form of bugs that can leave your code either broken or taken advantage of.
    In this video, we dive face fist into a new language: Rust. Rust was developed by Mozilla with an emphasis on performance and memory safety. This is the first video of many where we discuss Rust concepts and eventually program embedded platforms with Rust.
    🏫 COURSES 🏫
    lowlevel.academy
    🔥🔥🔥 SOCIALS 🔥🔥🔥
    Low Level Merch!: www.linktr.ee/lowlevellearning
    Follow me on Twitter: / lowlevellearni1
    Follow me on Twitch: / lowlevellearning
    Join me on Discord!: / discord
    0:00 Introduction
    1:48 Rust Hello World
    2:43 Rust Binaries
    3:32 Rust "Safety"
    5:20 Crashing Rust
    6:49 Embedded Rust
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 931

  • @timecubed
    @timecubed ปีที่แล้ว +632

    As all C programmers say, with great power comes great 'segmentation fault at line 115'

    • @heroes-of-balkan
      @heroes-of-balkan ปีที่แล้ว +36

      It gives line position where segfaults 🤯🤯

    • @timecubed
      @timecubed ปีที่แล้ว +18

      @@heroes-of-balkan it's worse when it doesn't. I've had segfaults but it gives me the line.

    • @heroes-of-balkan
      @heroes-of-balkan ปีที่แล้ว +6

      @@timecubed lucky you

    • @user-lg7td1he3s
      @user-lg7td1he3s ปีที่แล้ว +1

      hahaahah

    • @nogit387
      @nogit387 11 หลายเดือนก่อน +23

      As all JS developers say, with great power comes great '[object Object]'

  • @TrustifierTubes
    @TrustifierTubes 2 ปีที่แล้ว +1193

    Hi my friend, as a fellow C programmer, who switched to Rust a year ago after 30+ years of C. I would highly recommend dropping the OS packaged rust (i.e. using apt or rpm) and use rustup instead! The packaged versions tend to be several version behind, and Rust is hyper evolving right now (including the stable version. for example there is a major CVE that got addressed in 1.58.1 that plagues all previous versions). Also, with rustup you will get the latest and greatest version of rust-analyzer which in-turn makes integration with IDEs a lot cleaner.

    • @simonfarre4907
      @simonfarre4907 2 ปีที่แล้ว +10

      True. But even so, the OS packaged version is *so much more current* than a lot of other languages, and I think rustup is the reason for that.

    • @vlya1533
      @vlya1533 2 ปีที่แล้ว +15

      @@simonfarre4907 usually "current" is "unstable".
      So, you literally said "rust is _so much more unstable_ than a lot of others languages"

    • @louiscloete3307
      @louiscloete3307 2 ปีที่แล้ว +48

      @@vlya1533 No. Rust ships on the same schedule as Firefox. Every 6 weeks a new beta is branched off. If it survived 6 weeks of beta testing, it's pushed as the next stable release. Once it's been released as stable, it guarantees backwards compatibility. So any code which compiled with a previous stable compiler must still compile with the new compiler, and any code it can compile must compile with all new stable compilers further along. The amount of bugs on stable is almost nonexistent. I know of one serious bug in 2 years and about 10 bugs in total that was fixed with patch releases over that period. Just because it doesn't work as things had always worked doesn't mean it isn't as stable. The one doesn't necessarily imply the other. If you have empirical evidence of rustc's instability compared to MSVC, gcc and clang, that's another matter altogether.

    • @vlya1533
      @vlya1533 2 ปีที่แล้ว +1

      @@louiscloete3307 who are you arguing with? I've not commented or asked anything about rust beta release cycle :)

    • @louiscloete3307
      @louiscloete3307 2 ปีที่แล้ว +32

      @@vlya1533 > usually "current" is "unstable".
      So, you literally said "rust is so much more unstable than a lot of others languages"
      I wrote that to explain why "current" isn't necessarily "unstable".

  • @notshbn
    @notshbn 2 ปีที่แล้ว +493

    In rust you don’t necessarily need to provide the “return” or the semicolon on the last line as long as it’s what you intend to return from your function

    • @saadisave
      @saadisave 2 ปีที่แล้ว +57

      Using explicit return is actually against the official style. The return keyword is only used for early returns.

    • @fartzy
      @fartzy 2 ปีที่แล้ว +3

      @@saadisave this is the case for Scala as well

    • @rafagd
      @rafagd 2 ปีที่แล้ว

      Well, in this case you wouldn't need return even if you had to have returns, as it's a void function

    • @user-ik5pp4jn8d
      @user-ik5pp4jn8d 2 ปีที่แล้ว

      it’s like gcc statement expression

    • @plopph8811
      @plopph8811 4 หลายเดือนก่อน

      Allowing to be untidy is part of the root issues of modern programming. Idiots are getting les rigorous and that is a major problem

  • @nscarlos25
    @nscarlos25 2 ปีที่แล้ว +1152

    The binary is huge because this is an unoptimized version. You can get it way smaller if you compile it in release mode.
    There's no runtime in Rust. All the checks are made at compile time.

    • @Matt-mn4bw
      @Matt-mn4bw 2 ปีที่แล้ว +93

      Ye I was confused when he said this

    • @laravelisbullschitt3281
      @laravelisbullschitt3281 2 ปีที่แล้ว +41

      Ironic that everyone using rust is non binary!

    • @darkfire2703
      @darkfire2703 2 ปีที่แล้ว +134

      Building in release mode and stripping the binary results in a ~310Kb exectuable. This still includes parts of the rust standard library which is statically linked. When using no_std like you would in embedded, this size is again smaller by an order of magnitude.

    • @laurenpinschannels
      @laurenpinschannels 2 ปีที่แล้ว +5

      @@laravelisbullschitt3281 im continuous

    • @louiscloete3307
      @louiscloete3307 2 ปีที่แล้ว +79

      @@dansanger5340 But its runtime is similar in what it does and what it provides to the C runtime (and yes, C also has a runtime which sets up the stack and calls your main()).

  • @disgruntledtoons
    @disgruntledtoons ปีที่แล้ว +64

    C succeeded because it enabled engineers to get stuff done. Whether Rust overtakes C depends on whether Rust developers can get stuff done more quickly to the point that the advantages are clear. This means the learning curve must not be too steep, and there cannot be chronic situations where the developer has to learn something that won't be used for another sixth months.

    • @verified_tinker1818
      @verified_tinker1818 ปีที่แล้ว +9

      But C++ also has a steep learning curve, yet it's so popular, so that can't be all.

    • @kyledaniel1648
      @kyledaniel1648 ปีที่แล้ว +25

      @@verified_tinker1818 true, but, you can gradually adopt the more complex parts of c++ and basically just write c to begin with. Which makes it MUCH simpler/easier/quicker to get started with and become productive with than Rust

  • @nickscurvy8635
    @nickscurvy8635 2 ปีที่แล้ว +51

    What happens in unsafe stays in un-
    SEGMENTATION FAULT(core dumped)

    • @codigodesenior3995
      @codigodesenior3995 2 ปีที่แล้ว +1

      this is my nightmare

    • @blackcitadel37
      @blackcitadel37 2 ปีที่แล้ว

      C++ feels

    • @nickscurvy8635
      @nickscurvy8635 2 ปีที่แล้ว +3

      @@codigodesenior3995 sigsev is a blessing, not a curse. What would happen if the OS were not protecting that memory address would be potentially catastrophic, not just slightly frustrating.
      Imagine learning to program back in the day when you could accidentally brick your device while programming.

    • @codigodesenior3995
      @codigodesenior3995 2 ปีที่แล้ว

      @@nickscurvy8635 thx, i i didn't think about it...

  • @hugo4it
    @hugo4it 2 ปีที่แล้ว +58

    5:10 - Just want to add something here, you can *always* dereference a pointer safely, unsafe mode also allows dereferencing *raw* pointers.

    • @kangalio
      @kangalio 2 ปีที่แล้ว +15

      It's better to say reference instead of pointer though, or people will get confused and think you're talking about raw pointers

  • @KyrychenkoAnton
    @KyrychenkoAnton 2 ปีที่แล้ว +526

    What I'm not quite get is why its positioned as a replacement to C and not C++. Its much much more complicated than C with all impl/move/async/smart pointers/generics/lifetimes semantics, whereas C is basically an assembler macroses. So I think rust should in theory replace C++ then, but speaking of C++ - there's already 20'th redaction with move semantics/smart pointers/generics etc and lots of code analysis too. So idk, having nothing against Rust though, but this obsession on "replacing" C....

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว +102

      It's definitely a topic I'd like to learn more about. I don't see a world where Rust ever COMPLETELY replaces C, but I think there's room for replacement in small quantities.

    • @KyrychenkoAnton
      @KyrychenkoAnton 2 ปีที่แล้ว +26

      @@LowLevelLearning Sure, I actually love languages that have smth unique in this day of c-like llvm/jvm languages everywhere, rust definitely fun to write with its immutability by default and borrow-checker way of thinking, so kudos for it! xD

    • @CallousCoder
      @CallousCoder 2 ปีที่แล้ว +19

      I do agree! It’s such a whiny complaining compiler. If you are a C/C++ developer it feels like torture.

    • @SkyyySi
      @SkyyySi 2 ปีที่แล้ว +55

      Are you sure about that you're not just looking at this wrong? The question isn't whether Rust is more complex than C. The question is whether writing code that is memory safe with absolute certainty is more difficilt in Rust or C.

    • @CallousCoder
      @CallousCoder 2 ปีที่แล้ว +56

      @@SkyyySi it’s not really that difficult to write memory safe code, once you’ve learned it.
      And you have brilliant profilers that test this. And size of binaries does matter. Especially in the embedded world. So I don’t see Rust as a C/C++ killer. Just another language that complements the list of nice compiled languages.

  • @tompycz2225
    @tompycz2225 2 ปีที่แล้ว +115

    There are other languages as old as C, even older. But nobody ever hears about them anymore, because they weren't so good or didn't have such uses as to still hold up after so many years, as opposed to C (or are still used in niche cases, not popular ones). So "old" isn't really an argument. It's an excellent language in so many ways.

    • @Theineluctable_SOME_CANT
      @Theineluctable_SOME_CANT ปีที่แล้ว +2

      FORTRAN...

    • @tompycz2225
      @tompycz2225 ปีที่แล้ว +8

      @@Theineluctable_SOME_CANT my grandmother coded in that, I'm not even kidding

    • @tompycz2225
      @tompycz2225 ปีที่แล้ว

      @@ElSantoLuchador it's going to be interesting to watch whether there will be an uptick in the use of those older languages, as we approach the end of Moore and start going into more optimization.

    • @zackyezek3760
      @zackyezek3760 ปีที่แล้ว +15

      C is the Latin of computer languages. Still used directly by a powerful but obscurantist elite (for Latin the Catholic Church hierarchy, for C the kernel and assembly level developers), and a direct ancestor of the languages most of the planet now uses. FORTRAN is really the only other language that old that’s still in use.
      One of C’s often overlooked strengths is that it really IS a basically zero overhead, portable assembly with a good syntax. Yeah you don’t get all this invisible magic code and “safety”, but that’s because C was designed for writing the very bottom of the software stack, the foundations upon which things like that rest. One thing I really wish Rust hadn’t done was import some of Python’s bonehead syntax decisions. “Less ‘unnecessary’ punctuation” sounds nice until you realize that HUMAN languages moved in the exact OPPOSITE direction over the past ~250 years, for very good reasons like clarity and ease of reading.

    • @felixmoore6781
      @felixmoore6781 ปีที่แล้ว

      @@zackyezek3760 You're forgetting the largest part of this powerful elite (maybe on purpose-are you one of them?), embedded programmers. And they secretly control absolutely everything that has electronics in it, which today is everything- your car, assembly line robots, life support equipment in hospitals, traffic lights, smart toilets, phones and computers have chips in them that run their own code completely invisible to the OS, flight control systems, electrical grids, washing machines, etc., etc., even your espresso machine. Their power is immense. If we anger them and they decide to abuse it, then we're all doomed.

  • @kangalio
    @kangalio 2 ปีที่แล้ว +36

    5:38 noo, 12345 doesn't point to anything, it's just a number. The type of the **number** is usize! The usize definitely doesn't mean "undefined size", it means "unsigned pointer-sized integer" lol, like size_t in C

  • @ertugrulghazi334
    @ertugrulghazi334 2 ปีที่แล้ว +460

    C is 50 years old but still a top 3 language. It won't be going anywhere anytime soon.

    • @monsterhunter445
      @monsterhunter445 2 ปีที่แล้ว +56

      Maybe anytime soon could mean tommorow. Doesn't hurt to learn rust or an alternative. Don't be conservative with your tooling it's good to explore.

    • @jonathanmoore5619
      @jonathanmoore5619 2 ปีที่แล้ว +10

      Open your mind.

    • @ertugrulghazi334
      @ertugrulghazi334 2 ปีที่แล้ว +59

      @@jonathanmoore5619 Okay Morpheus.

    • @jonathanmoore5619
      @jonathanmoore5619 2 ปีที่แล้ว

      @@ertugrulghazi334 nonce

    • @ertugrulghazi334
      @ertugrulghazi334 2 ปีที่แล้ว +23

      @@jonathanmoore5619 come on, that was a good one.

  • @toddmartin7629
    @toddmartin7629 2 ปีที่แล้ว +80

    Rust's biggest draw back in embedded is the limitation of architectures it supports due to LLVM. Now this can change, but as of right now, if LLVM doesn't support a chip, neither does Rust. And LLVM is lacking in a few areas. Hope to see this improve though.

    • @cameroncarter3332
      @cameroncarter3332 2 ปีที่แล้ว +3

      Rust is the future of computer programming. Expect good things concerning Rust.

    • @dynfoxx
      @dynfoxx 2 ปีที่แล้ว +8

      Rust does have the WIP gccjit compiler and the GCC official implementation.
      Both will allow you to compile rust to anything gcc can.

    • @fumseck
      @fumseck 2 ปีที่แล้ว +3

      They are currently planning to remove LLVM from the toolchain

    • @Connie_cpu
      @Connie_cpu ปีที่แล้ว +1

      Xtensa is still the main backend I'm waiting on, but at the same time I'm seeing more microcontrollers move to RISC-V like Espressif's new ESP32-C3 and Rust works amazingly out of the box on that platform

  • @mikeywisniewski
    @mikeywisniewski 2 ปีที่แล้ว +79

    Seconded, would love to see Rust running with Raspberry Pico.

    • @peter9477
      @peter9477 2 ปีที่แล้ว +3

      I saw a video yesterday where it was...

    • @historichacker2013
      @historichacker2013 2 ปีที่แล้ว

      it aldready does

  • @vicshcher
    @vicshcher 2 ปีที่แล้ว +49

    You can actually enable dynamic linking instead of static to get lesser binaries, AFAIK

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว +8

      That's good to know. Like I said though, I like the fact that it wraps the run-time into the binary so it remains portable. I would hate for there to be some arbitrary external dependency.
      Thanks for watching!

    • @darkfire2703
      @darkfire2703 2 ปีที่แล้ว +22

      @@LowLevelLearning I sure you have read this somewhere else at this point, but static linking is not the problem causing the large executable size.
      Building in release mode and stripping the binary results in a ~310Kb exectuable. This still includes parts of the rust standard library which is statically linked. When using no_std like you would in embedded, this size is again smaller by an order of magnitude.

    • @Raleighthrbub123
      @Raleighthrbub123 2 ปีที่แล้ว +4

      @@LowLevelLearning I'm fairly certain there is no runtime ? But I do know you can designate targets when compiling with cargo with the --target flag. I do that all the time to compile from my x86 machine and get an ARM binary for my raspberry pi. You can knock the size way down with the --release flag too.

  • @PeterSramka
    @PeterSramka 2 ปีที่แล้ว +47

    It's great that you are excited about memory safety. You talked about it a lot in the video, but Java had memory safety back in 1995. That's 27 years ago! To me, one of the most interesting features of Rust is thread safety. This is the first time I ever heard of a language that guaranteed thread safety. IMHO, that's much more important (and more revolutionary) than memory safety.

    • @PeterSramka
      @PeterSramka ปีที่แล้ว +7

      @Igor Melo Both Java and Rust have a combination of compile-time and run-time memory safety. Nevertheless, some of the compile-time memory safety in Rust is very innovative.

    • @chadjones4255
      @chadjones4255 ปีที่แล้ว +2

      That's an interesting point.

    • @froge4300
      @froge4300 ปีที่แล้ว

      doesnt haskell have thread safety too

    • @huistelefoon5375
      @huistelefoon5375 หลายเดือนก่อน

      Lisp (65+ years old): Am I a joke to you?

  • @DaDa-gr7cy
    @DaDa-gr7cy 2 ปีที่แล้ว +1

    This is actually a very interesting series. Looking forward for the next episode. Keep it up!

  • @elertan
    @elertan 2 ปีที่แล้ว +165

    I like the way this video was presented, and welcome to the Rust community! The only thing I'd like to mention is that I've noticed some of the information/code you share is not (entirely) correct, and might cause confusion for others.
    - Rust does not require explicit return statements, the last expression will be the return value; unless you want to perform an early return.
    - I would recommend using Rustup to install the rust compiler and other very useful tools, such as cargo (the package manager used by rust), and generally includes a more recent version of the compiler as well.
    - The binary you compiled was not optimized, therefore it will also include debug symbols among other things which drastically increase the size.
    - usize does not stand for undefined size, it stands for unsigned size, which is the unsigned variant of size (signed is called isize) which is a pointer sized integer that varies in byte size depending on the target architecture you are building for; for example, on a 32 bit target, this is 4 bytes and on a 64 bit target, this is 8 bytes.
    Anyways, keep it up.

  • @saturdaysequalsyouth
    @saturdaysequalsyouth 2 ปีที่แล้ว +28

    It is easy to make mistakes in C but they're not impossible to avoid if you're aware of a few simple rules. Failing that, there are tools to help you like static analyzers. Adding optional extensions to the C language for safety and reliability would, in many cases, be a better approach than doing a complete rewrite in a different language.

    • @TCSyndicate
      @TCSyndicate 2 ปีที่แล้ว +11

      if it were as easy as u think, microsoft could clear 70% of their security errors with some simple tools and tricks.

    • @saturdaysequalsyouth
      @saturdaysequalsyouth 2 ปีที่แล้ว +6

      @@TCSyndicate It's not easy. But in many cases it is different than doing complete application rewrites, which would undoubtedly introduce new problems. My point is, if you're motivated to tackle this problem, you should be looking at it from different angles, not just jumping to an entirely new language straight away.

    • @TCSyndicate
      @TCSyndicate 2 ปีที่แล้ว +4

      @@saturdaysequalsyouth you've just got to be specific. Sure, rewriting a large application in a new language may introduce more problems than it solves, but "jumping to an entirely new language" may be fine for future applications. Restricting memory errors are definitely a vector that encourages the introduction ( and depending on the space, domination ) of new popular languages ( the most pop langs are gc'd ).

    • @saturdaysequalsyouth
      @saturdaysequalsyouth 2 ปีที่แล้ว +6

      @@TCSyndicate Yes, in the future there will be space for languages like Rust. For people who can't, or don't want to go that route, there are ways to reduce memory errors with exiting langauges like C. Static analysis, dynamic profilers, language extensions and hardware solutions like CHERI.

    • @TCSyndicate
      @TCSyndicate 2 ปีที่แล้ว +1

      @@saturdaysequalsyouth to be clear, the space already exists ( any app that wants speed & security guarantees ), the "future" part is continuing to make applications in that space.

  • @DavidRodriguez-df4gt
    @DavidRodriguez-df4gt 2 ปีที่แล้ว +4

    You keep saying that Rust is similar to Python but I just don't see it. At a glance it looks like C. Am I missing something?

  • @zxuiji
    @zxuiji 2 ปีที่แล้ว +17

    I still prefer C, much easier to tell it to do what I want, even if what I want brakes things

  • @vitorsantos6310
    @vitorsantos6310 2 ปีที่แล้ว +23

    The rust docs are pretty good. I have been passively reading them for about two weeks 🙂

  • @qm3ster
    @qm3ster 2 ปีที่แล้ว +13

    Is there a particular reason you chose to install rustc from the package manager and not rustup?
    Also please use the standard formatting as per rustfmt 🙏🏻

    • @azhagurajaallinall126
      @azhagurajaallinall126 2 ปีที่แล้ว

      Your last name spells like yahoo while you put google icon as dp,that's a good one bro 😅✌
      June 19 2022 4:11 pm ist

  • @msthalamus2172
    @msthalamus2172 11 หลายเดือนก่อน +1

    One of the best things about Rust is the information the compiler gives you when the build fails. I taught myself Rust mostly just from the suggestions it offered and the occasional web search. Its syntax is superficially like C and Python had a baby, sure, but only on a line-by-line level. That breaks down quickly when you get into macros though.

    • @bobfarker4001
      @bobfarker4001 10 หลายเดือนก่อน

      C# was the baby of visual basic and c++ but came out looking like Java.

  • @pjf7044
    @pjf7044 ปีที่แล้ว +2

    I was really intimidated by rust coming in. It was between rust and go for me. Not sure what it is but the rust syntax and logic just makes more sense to me and is closer to what I would come up with if I had to write my own language. Excited to learn more

  • @rodionsabbath9722
    @rodionsabbath9722 2 ปีที่แล้ว +4

    would love to see more of this

  • @C_J_365
    @C_J_365 2 ปีที่แล้ว +18

    I started learning Rust a little while ago and I love it so far. I'm looking forward to this series!

  • @MoeOuan666
    @MoeOuan666 2 ปีที่แล้ว +8

    I looked at it (from c, c++, python) from time to time, just grasping the concepts without doing more that 3-liner tests. I like it on some points (match, get rid of exceptions, interfaces/traits instead of inheritance, compiler messages, promise of zero cost resource safety) but the langage feels big, too big to get it whole in my head even as a core subset. I think it's because it's hard to have a small orthogonal subset of it where everything flow from core concept without more and more syntax details and add ons. Once you get pointers, C has this feeling, then act as core for C++. And python has it from the start, thesis to it's pseudo-code feeling (although a little bit less so since decorators). Maybe it's the lack of a real practical use, but Rust don't give me this nice compact orthogonal feeling...

    • @swapode
      @swapode 2 ปีที่แล้ว +2

      I completely get it. When I started with Rust it felt like this big thing with a lot of magic under the hood and a lot to learn.
      Now that I've used it for a while I think it's possibly the easiest language to really wrap your head around. While the learning curve is certainly steeper than other languages it's not anywhere near as long. There's actually no magic going on, just a very well thought out rule set that, once you got it, is rather simple.

    • @rtsa4633
      @rtsa4633 ปีที่แล้ว

      Honestly goes away one you get practical with it. Its like using pointers for the first time confuses a lot of people but it really isn't a complicated thing. Once you get past that curve, its way more fun.

  • @jordanlapointe4690
    @jordanlapointe4690 ปีที่แล้ว

    Really cool. Looking forward to more videos on this!

  • @danfg7215
    @danfg7215 2 ปีที่แล้ว +3

    Why learn Rust instead of C#? Sorry if dumb question.

  • @test40323
    @test40323 2 ปีที่แล้ว +20

    What about the speed? Most people use C on embedded devices instead of python for reason of speed and binary size.

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว +4

      I think there's a future where computer speed has outpaced the cost that a language like Rust incurs in overhead.

    • @test40323
      @test40323 2 ปีที่แล้ว +17

      @Bisweswar Bose , Amen to using C wrongly - I made every possible mistakes. But it is still my favourite language for its simplicity and elegance! Assembly can beat it but I haven't touched it since 32bit processors came out.

    • @samuelhammersberg5137
      @samuelhammersberg5137 2 ปีที่แล้ว +6

      The speed compared to C is pretty much the same in most cases afaik.

    • @samuelhammersberg5137
      @samuelhammersberg5137 2 ปีที่แล้ว +9

      @Bisweswar Bose While I can't deny the part about immaturity and the ecosystem not being as big as other languages, it is slowly becoming an industry staple, with a lot of major companies/groups investing in it as a C/C++ successor. Also calling an actually used language esoteric is flat out wrong.

    • @TCSyndicate
      @TCSyndicate 2 ปีที่แล้ว +12

      Rust has same speed as C. There's some binary size issues with default config that can be worked around for embedded.

  • @yewo.m
    @yewo.m 2 ปีที่แล้ว +1

    On top of using rustup, as many have mentioned, you could also use cargo instead of manually calling rustc and then running the program every time

  • @deadbugengineering3330
    @deadbugengineering3330 2 ปีที่แล้ว +1

    A tutorial about debugging stm32s with probe-rs instead of GDB would be sweet as I couldn't find a good learning resource for embedded-rust-newbs for this. Anyways, keep up the good work!

  • @EmbeddedSorcery
    @EmbeddedSorcery 2 ปีที่แล้ว +9

    I help maintain an embedded C++ kernel, and would love to eventually get to the point where I can rewrite it in rust (meaning similar design and api), so I look forward to seeing your "from scratch" videos. I've been digging into the Rust Embedonomicon, but definitely need some more experience with Rust first.

  • @ColinMill1
    @ColinMill1 11 หลายเดือนก่อน +9

    I started programming with City & Guilds mnemonic code (most won't even have heard about it I guess) so C is a fairly recent language as far as I'm concerned. I have seen so many "this will be the death of C" articles written about new languages I've lost count. My guess is that C will still be a major force, especially in the embedded world where it is still dominant, for a long time to come.

  • @torarinvik4920
    @torarinvik4920 10 หลายเดือนก่อน +1

    I love these humble "Im learning ..." videos. Just reminds us we are all students but never masters :) Openness is the key!

  • @AlessioSangalli
    @AlessioSangalli 2 ปีที่แล้ว +3

    Wow nice video. I put some time to learn Rust last summer but didn't love it. Recently a friend told me again about it and I promised I'd have a look at it again. Then your video pops up 🤣

    • @AlessioSangalli
      @AlessioSangalli 2 ปีที่แล้ว +1

      What I'm in a little disagreement is the "unfortunately" you used when saying modern OSes are written in C. Also, I believe we should mention Rust and C produce assembly that is very different and there is a tradeoff between safety and performance. 👍

  • @dyslexicsteak897
    @dyslexicsteak897 2 ปีที่แล้ว +6

    You're writing Rust like you're literally translating C, in Rust's style you're not meant to place your curly braces on newlines or add return, all functions will implicitly return () unless you specificy something else. You also mimic C in just installing the compiler, so you're missing the massive featureset of cargo and crates.io which makes managing dependencies ridiculously easy and allows much easier interfacing with the compiler.
    Side note, your binaries will be big because they get compiled in debug mode by default, the release mode is much more optimised in terms of space and speed.

  • @suhaskv
    @suhaskv 2 ปีที่แล้ว +13

    Feels good seeing you cover Rust! Looking forward to more Rust videos, good job!

  • @thedrunkmonkshow
    @thedrunkmonkshow 2 ปีที่แล้ว +1

    This whole time I had never even heard of Rust or knew that it existed although admittedly I'm behind on a lot of the newer languages as I haven't coded lately as much as I did when I was a teenager. Programming in C and C++ back in the 90's was a nightmare especially when it came to variables. Every time it came to working with strings, memory address and pointers I would panic and have to stop to pick up one of my C/C++ programming books and waste 30 minutes to an hour refreshing on how it all works to avoid crashing. The benefit of C aside from it being portable is that it's the closest thing to Assembly language and understanding Assembly language concepts help make C less painful. I haven't fully dived into C# but the little bit I've played with it looks like a fun higher level language kind of like Visual Basic which I love but it's limited only to Windows programs and there doesn't seem to have any low level capability. This Rust on the other hand appears to be high level and portable yet that option of being able to go unsafe {} to where you can get to the low level stuff is pretty remarkable and awesome. Glad I stumbled upon your video and thanks for sharing 😃

    • @thedrunkmonkshow
      @thedrunkmonkshow 2 ปีที่แล้ว

      @@vlc-cosplayer Oh cool I didn't know that .NET can run on other platforms. Good to know and thanks for the info 😀

  • @AJ-et3vf
    @AJ-et3vf ปีที่แล้ว

    great video! Thank you!

  • @DerSolinski
    @DerSolinski 2 ปีที่แล้ว +62

    I think you miss a huge point of Rust, its toolchain.
    You completely side track that by only installing the compiler, but I think that is one important aspect of it since it was directly developed side by side.
    Memory management is also something that needs to be addressed, also some minor misconceptions sneaked in there.
    Up to the point that I think you should do an update/correction video once you are more familiar with it. (Read the book it is good)

    • @tolkienfan1972
      @tolkienfan1972 2 ปีที่แล้ว +1

      You should list the misconceptions. It would be interesting to all of us with an interest in Rust

    • @DerSolinski
      @DerSolinski 2 ปีที่แล้ว

      @@tolkienfan1972 Na nit-picking and he corrected most of them in his later videos.
      (Also I would need to rewatch to do that, and I'm lazy 😉)
      Still if you are interested in Rust read the official rust book. (Its free and online)
      It is compared to other "official Programming Books" a really good read.
      Nothing for complete newbies but anybody who is a bit adapt with any kind of programming should manage just fine.

    • @baileyharrison1030
      @baileyharrison1030 2 ปีที่แล้ว

      Toolchains are not the same as a programming language. Just as a compiler isn’t the same as a programming language. I can use any rust compiler or build system that I want.

    • @DerSolinski
      @DerSolinski 2 ปีที่แล้ว

      @@baileyharrison1030 course you can, but then you are missing completely the point of rust being an ecosystem not just a language, much like your comment.

  •  2 ปีที่แล้ว +10

    The shortest tutorial in the world going from hello world to unsafe code, plus misnaming the concepts means it's a guaranteed misunderstanding for anyone who'd like a taste of rust.

  • @codigodesenior3995
    @codigodesenior3995 2 ปีที่แล้ว

    4:09 ... good this works it literally the best phrase you can hear when executing a code

  • @TekCroach
    @TekCroach 7 หลายเดือนก่อน +2

    C and C++ never die. The most powerful and the most versatile languages ever made. People just need different experiences and that’s why they are making alternatives.

  • @annguyenhoangphu451
    @annguyenhoangphu451 2 ปีที่แล้ว +6

    Thank you for your video. I'm learning Rust. Hope to see more video about Rust from you.

  • @TMS5100
    @TMS5100 2 ปีที่แล้ว +3

    Interesting to know that rust was bootstrapped using OCaml.

  • @rashidz97100
    @rashidz97100 2 ปีที่แล้ว +1

    Just the video I wanted to see today! 😊

  • @pup4301
    @pup4301 2 ปีที่แล้ว

    Crazy writing in rust right know. Can't wait!

  • @_lod
    @_lod 2 ปีที่แล้ว +3

    rust is great but it doesn't run on consoles easily yet (compiler is open source and console manufacturers don't wanna open source their code)

  • @taraskornuta
    @taraskornuta 2 ปีที่แล้ว +4

    Is it possible to mix C and Rust code?
    I'w notice that is uses libc...

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว +2

      Yup! You definitely can.

    • @Dygear
      @Dygear 2 ปีที่แล้ว +3

      It's very easy to call into C code, and it's very easy for C code to call into rust. That was actually a design constraint of rust, it has to be useable with C because Mozilla had a C code base that they didn't want the throw out while working on Rust.

  • @random6033
    @random6033 ปีที่แล้ว +1

    0:32 the most widely used operating system is ITRON

  • @Chalisque
    @Chalisque 2 ปีที่แล้ว

    I've only had a quick play with Rust, getting a simple implementation of sha256sum working. Pedantic, but nice once you get used to it. Though I had to do a bit more research on how to write code that actually compiles than with C or C++.

  • @freedom_aint_free
    @freedom_aint_free 2 ปีที่แล้ว +3

    The wheel is thousands of years old, so...

  • @YoelMonsalve
    @YoelMonsalve 2 ปีที่แล้ว +4

    My personal opinion, is that if you have not programmed in C, you aren't still really a professional. Once you learn C, you can switch, and easily understand, any other more "powerful" language.
    But learn C first, to know the depths of programming.

    • @nikolacekov9099
      @nikolacekov9099 2 ปีที่แล้ว

      Instead of learning C, could i learn C++ first to understand the depths of programming? Is C++ for a starter a bad choice?

    • @myxail0
      @myxail0 ปีที่แล้ว

      @@nikolacekov9099 yes its too complex. I'd start with C, then you can move on to C++

  • @zerocool3466
    @zerocool3466 ปีที่แล้ว

    Great video 🔥

  • @FahlmanCascade
    @FahlmanCascade ปีที่แล้ว

    Does Rust require a 10 MB runtime environment on every CPU? There is Rust code available for the Nordic nRF52, a truly small SoC which has just 1MB of flash and 256KB of RAM. If I want a C replacement (and I do), the executable files must be small.

  • @thatonesnowboarde
    @thatonesnowboarde ปีที่แล้ว +4

    Learning rust has been a side project, but golang has been my main focus lately due to the speed of development and less learning curve coming from other languages. I hope to see your channel include other languages such as Go...

  • @matthiasdebernardini3388
    @matthiasdebernardini3388 2 ปีที่แล้ว +8

    rust is amazing, so far only downside is limited packages (but that is changing) and that it doesn't run on exotic hardware (C always can, in fact if you can't get C to run on the device its considered non-functional)

  • @tabletopjam4894
    @tabletopjam4894 2 ปีที่แล้ว +1

    try rust on a microcontroller, because you *do* sometimes need to use some electronics with the code

  • @yash1152
    @yash1152 2 ปีที่แล้ว +1

    1:08 eventually take rust to Rpi pico
    7:42 running rust on baremetal arm
    hmm, those seem smth interesting :)

  • @glennmiller394
    @glennmiller394 2 ปีที่แล้ว +8

    I've spent the last month learning Rust. I've been programming C since 1987 and C++ since it first hit the scene. I find it to be delightful, controllable, and predictable. The learning curve isn't that steep coming from C/C++.

  • @Dygear
    @Dygear 2 ปีที่แล้ว +33

    I love that you're heading in the rust direction. Can't wait to learn along with you.

    • @fatfurry
      @fatfurry 2 ปีที่แล้ว

      among us

  • @Yupppi
    @Yupppi 8 หลายเดือนก่อน

    Would you learn Go as well and try to explain some key pointers how it differs from these common languages in good and bad? It seems to be used by quite a few companies. I remember Brian Kernighan talk about Go positively.

  • @rpxdytx
    @rpxdytx 2 ปีที่แล้ว +2

    2:15 The brace in a newline is kind of considered useless by the rustaceans, and since i am coding in rust for some time, i feel agony seeing the curly brace in a newline

    • @louiscloete3307
      @louiscloete3307 2 ปีที่แล้ว

      That's not the (very opinionated) default rustfmt style, so yes, I'd +1 you with this comment. Stick to the community's agreed-upon style and write your opening brace at the end of the control flow expression or function header.

    • @louiscloete3307
      @louiscloete3307 ปีที่แล้ว

      @@BobAg_ I find that I get up to speed with code quicker if all code in the language looks the same. If you're clever/whatever enough to not be bothered by that, good for you. It does help some people though, so I restrict myself to a specific style for the sake of those people (including myself) whenever there is a de facto standard.

  • @tuxidoyt
    @tuxidoyt 2 ปีที่แล้ว +3

    Would you like to Talk about D.
    I'm really interested in D

  • @kevinyonan9666
    @kevinyonan9666 2 ปีที่แล้ว +11

    GCC has a builtin static analyzer, in active development, for C. So why switch to Rust when I can continue using C with using analysis tools to have safe code?

    • @parallel4344
      @parallel4344 2 ปีที่แล้ว

      Metaprogramming alone should be a reason.

    • @kevinyonan9666
      @kevinyonan9666 2 ปีที่แล้ว

      @@parallel4344 if C gets type annotations, void pointers could work as good as templates

    • @kevinyonan9666
      @kevinyonan9666 2 ปีที่แล้ว +1

      @UCU3SuQ4YhUIdqg2CyTtcXQw ehhh don't get me wrong, they're convenient but they're also a crutch if you think about it. C++ also has metaprogramming but look at the insanity of its standard library because of it.
      Rust & C++ have to use metaprogramming because of their own constraints to achieve the same thing C can achieve in a "dangerous" way.
      Realistically, perhaps C will have a sane and more simplified way of doing metaprogramming in the future but gotta wait for a maintainable implementation. For the moment, metaprogramming in C and Golang is simply generating code to be compiled later on.

    • @parallel4344
      @parallel4344 2 ปีที่แล้ว +3

      @@kevinyonan9666 It's not about restraints, it's about doing work at compile time and in an abstracted way. Rust does it especially well, you can implement meta languages for compiler grammar rules as an example! It also has compiletime filesystem inclusion, etc. Trust me, I know how much of a mess the STL is - I myself am a Microsoft STL contributor, but Rust does it much better with a model which is older than C!

    • @kevinyonan9666
      @kevinyonan9666 2 ปีที่แล้ว +2

      @@parallel4344 Microsoft? That explains everything. Windows has the shittiest C support out of the major OSs.
      MSVC is still missing alot of C99 and C17 features. Yea GCC and Clang aren't 100% C99 compliant but they support alot more of it compared to MSVC.
      Ofc instead of finishing the job, Microsoft opts to yet again switch to another language with this time being Rust, because apparently the C++, C# hybridization didn't work out too well...
      Here's a good question, C also has the potential to have metaprogramming (outside the preprocessor) but the thing with C and what makes it special is that whenever you come across a problem, the solution is typically writing more C as opposed to "we need a new feature"
      I've been writing C for 7 years, so far all I'd like for C is the defer statement from Golang, function literals so that I don't need to always define a static function, and type annotation so that compilers can have the potential to optimize void pointers as good as type parameterized generics.

  • @samyvilar
    @samyvilar 2 ปีที่แล้ว

    Check out Asan (Address Sanitizer) Clang/GCC/Msvc all have supported it for several years now, it does have some overhead and limitations, but it’s still pretty useful for debugging, there also Memory Sanitizer; personally I use python if IO bound or C if cpu bound, or both through pythons ctypes package, should the need arise …

  • @alvarohigino
    @alvarohigino 2 ปีที่แล้ว +2

    So what? 50 yo and still rocks.

  • @adityaacharya1799
    @adityaacharya1799 2 ปีที่แล้ว +4

    Total respect and love for rust but C is amazing

    • @one_step_sideways
      @one_step_sideways 2 ปีที่แล้ว

      Rust is garbage and so are the people using it

  • @wertigon
    @wertigon ปีที่แล้ว +4

    While C is old, the memory model and simplicity of C makes it extremely powerful still. It's awesome that you can do things like allocate 8 bytes of memory as a string and then treat that string as a 64 bit integer for fast comparisons. Mindblowing stuff on how to speed up string comparisons, for instance. :)

  • @marcinziajkowski3870
    @marcinziajkowski3870 2 ปีที่แล้ว

    How often do we use "unsafe" statement in commercial code?

  • @Manny73211
    @Manny73211 2 ปีที่แล้ว +2

    in unsafe mode, can you divide by zero to crash the code?

    • @digama0
      @digama0 2 ปีที่แล้ว

      You can divide by zero in safe code. It will cause a panic (roughly similar to C++ exceptions except it is conventionally used for unrecoverable errors), which is classified as "safe" so the unsafe keyword is not needed. (Unsafe division by zero would be relying on the processor's behavior which would cause a SIGFPE or something.) Alternatively, you can use x.checked_div(y) and handle the error case yourself.

  • @0xABADCAFE
    @0xABADCAFE 2 ปีที่แล้ว +10

    Hasn't every language since C been the future already?

  • @danbuffington75
    @danbuffington75 2 ปีที่แล้ว +37

    C is 50 years old. But our numbering system is much older than that. Must mean we should invent a new way to count.

    • @louiscloete3307
      @louiscloete3307 2 ปีที่แล้ว +12

      Our numbering system doesn't make it easy to make counting mistakes though. This is a disingenuous statement, probably meaning something different than you intended. One liners are rarely good if they are on a controversial topic...

    • @OppaMack
      @OppaMack 2 ปีที่แล้ว +2

      Great point, they feel so special they want a EASY LANGUAGE BACAUSE I AM A BABYYYY

    • @louiscloete3307
      @louiscloete3307 2 ปีที่แล้ว +5

      @@OppaMack Not sure if you're saying Rust programmers are babies or C programmers are babies, but neither option is true. C is a great historical achievement, but I'd rather not have a situation where programmers have to be perfect to avoid serious security vulnerabilities. No human makes no mistake ever. We should look for tools and languages which are better taking our fallibility into account.

    • @OppaMack
      @OppaMack 2 ปีที่แล้ว +2

      @@louiscloete3307 Rust programmers are babies.

    • @louiscloete3307
      @louiscloete3307 2 ปีที่แล้ว +6

      @@OppaMack Ok so that's not true. You're obviously trolling or feel the need to prove your superiority somehow. Consider this the last time I'll respond. This can't be constructive. Enjoy C, but don't look down on other people with disdain based on a lack of knowledge as you're doing here.

  • @msthalamus2172
    @msthalamus2172 11 หลายเดือนก่อน

    I really like Rust. I could have done without its pedantry around naming conventions, but I learned to live with it. Its learning curve was admittedly steep, even with my level of experience, but then again I was deliberately trying to make it do something it wasn't designed to do at the same time I was learning the language from scratch. I'm the kind of dev who has to learn by doing. Following tutorials just puts me to sleep.

  • @rarebrockstark6219
    @rarebrockstark6219 ปีที่แล้ว +1

    Ya, im takeing C# (most likely) and HTML5 (only if another class is full) next year in high school

  • @snipzmattio5887
    @snipzmattio5887 2 ปีที่แล้ว +5

    C has its flaws but I still prefer it to rust

  • @mastershooter64
    @mastershooter64 2 ปีที่แล้ว +5

    virgins: rust OR c/c++
    chads: rust AND c/c++

  • @yac7571
    @yac7571 ปีที่แล้ว

    using unsafe safely. I'm intrigued

  • @HelicopterRidesForCommunists
    @HelicopterRidesForCommunists 2 ปีที่แล้ว

    Use that “unsafe safely”

  • @1290Zack
    @1290Zack 2 ปีที่แล้ว +7

    Why do you think it's unfortunate that C is still a major part of operating systems?

    • @Raleighthrbub123
      @Raleighthrbub123 2 ปีที่แล้ว +5

      According to microsoft, the memory unsafety of C is the result of at least 71% of security vulnerabilities. That's pretty unfortunate. If some of the best programmers in the world can't keep from making mistakes then no one can.

    • @lucass8119
      @lucass8119 2 ปีที่แล้ว +3

      @@Raleighthrbub123 This point is largely not applicable to operating systems programming. The Operating System MUST perform unsafe memory access, as it is the one who manages memory. It must literally implement its own malloc() to allocate memory, along with the paging system and virtual memory translation. In addition, it interfaces DIRECTLY with hardware, so it must perform unsafe memory accesses, often using constant shifts and addresses. Operating System programming would be unsafe even if done in Rust or C++, although you might get better markup (i.e. unsafe{}) in your code.

  • @rpxdytx
    @rpxdytx 2 ปีที่แล้ว +3

    1:30 isn't installing rustup better?

    • @Dygear
      @Dygear 2 ปีที่แล้ว +2

      Yes -- Ideally always install rustup so you get Cargo as well.

  • @wumwum42
    @wumwum42 2 ปีที่แล้ว +2

    You really shouldn't install rustc from the repos and compile it directly like its done with C.
    You should install rustup instead (From the repos if possible or website otherwise) and use cargo.
    Cargo manages projects, which allow you to easily add third party libraries (all of them open source) and lets you compile you package way easier.
    Important commands:
    cargo new NAME: create projekt
    cargo run : compile (Unoptimised) and run
    cargo build: compile (Unoptimised) file is in target/debug/NAME
    cargo build/run --release: Compile optimised (and run)

  • @robertmoore119
    @robertmoore119 2 ปีที่แล้ว +2

    I just saw some information somewhere about C/C++ being replaced by Rust.
    I am very new to programming, I have not mastered any language so far, but I have some understanding of basic high level languages.
    I may possibly learn C/C++ at some point, and the reason for my intrigue is the level of granularity. Which seems to be the main issue with the language.
    I can understand the benefit of Rust creating what appears to be rules that prevent memory issues.
    My critique of your explanation, C or C++ is probably tedious to write, and you mentioned most operating systems rely on C/C++ in one way or another. Linux being entirely written in C.
    You then opened the rust compiler using Linux. You then downloaded the Rust Runtime environment that is written in Linux.
    What appears to be evident to me, is that someone took the time to provide a safe method of memory allocation and control written in C.
    I'm not trying to start some kind of serious debate about the languages, and I'm sure rust is a decent language to write in, but I thought that was kind of funny.

    • @zactron1997
      @zactron1997 ปีที่แล้ว +1

      In C/++ you can basically write anything (they're both Turing complete after all). And yes, the Linux kernel running your Rust binary is written in C/++, so it's possible it has memory issues. The reason Rust can claim the safety badge where C/++ cannot is that the subset of memory operations allowed in Rust has been mathematically proven to be safe at a compiler level. In C/++, it's the developer's job to write that proof.
      The problem is that no normal developer ever will write that proof, so they rely on gut instinct, experience, and testing to determine what is/isn't safe. Rust let's a normal developer tap into the performance and safety of an experienced developer called "Mr Compiler"

  • @Supakills101
    @Supakills101 2 ปีที่แล้ว +10

    I'm very interested in the potential of Rust in game development, can't wait to dive in when I have some time.

    • @donythomas7
      @donythomas7 2 ปีที่แล้ว +2

      Check out bevy game engine written in Rust

    • @HonsHon
      @HonsHon 2 ปีที่แล้ว

      I think this would be a good language for that tbh, but I need to dive in.
      Now, in the embedded scene, Rust is completely not ready. Not saying it won't be ready in the future of course.

  • @matthewrease2376
    @matthewrease2376 2 ปีที่แล้ว +3

    Just learn assembly like a Chad.

  • @andrewbeef8758
    @andrewbeef8758 ปีที่แล้ว

    sir , i beg you to make a full series on RUST please

  • @iamworstgamer
    @iamworstgamer 8 หลายเดือนก่อน

    can you do a video and explain where to start with low level system programming, what are the core areas,

  • @vast634
    @vast634 2 ปีที่แล้ว +3

    Let X = 4 ... reminds me more of 80s BASIC programming...

  • @cryptobitez6090
    @cryptobitez6090 2 ปีที่แล้ว +4

    Alot of C people on the comments who don't want to learn something new lol.

    • @kyrylmelekhin2667
      @kyrylmelekhin2667 2 ปีที่แล้ว +2

      Because usually the new stuff is crap, or long forgotten old ideas taking a surface. Generally software gets worse with time, rust is only accelerating that trend. Well educated people know this, so they would not waste their time on yet another piece of crap.

  • @kyleeames8229
    @kyleeames8229 2 ปีที่แล้ว

    Ok, since we're talking about a programming language, it only makes sense that the candles on the birthday cake at 0:40 binary encode the age of C with lit candles representing 1.

  • @willsowerbutts
    @willsowerbutts 2 ปีที่แล้ว +1

    I'd like to see Rust on PDP-11 please.

  • @10gamer64
    @10gamer64 2 ปีที่แล้ว +13

    I doubt Rust would replace C anytime soon, just as COBOL or FORTRAN, there is simply too much to reprogram.

    • @42war_pig31
      @42war_pig31 ปีที่แล้ว +2

      True. But that doesn't mean that we can't write new programs in Rust which might otherwise would've been written in C++ or C. For example, Linux kernel, where C++ does not even exist, will have Rust as its second language.

  • @jakemandoshkin7065
    @jakemandoshkin7065 2 ปีที่แล้ว +3

    So, if my program is memory safe and low level efficient then I don't need Rust.

    • @louiscloete3307
      @louiscloete3307 2 ปีที่แล้ว +3

      If you can be sure you'll never make a mistake which introduces a memory bug in the future and leak all your users' data or clobber important sensor readings ever, yes. If no, Rust should be something you watch and consider for new projects at some stage.

    • @-..-_-..-
      @-..-_-..- 2 ปีที่แล้ว +1

      yes just stick with hello world and you'll be fine

  • @mehmetaltinsoy525
    @mehmetaltinsoy525 2 ปีที่แล้ว +1

    Thanks

  • @onichan6897
    @onichan6897 2 ปีที่แล้ว

    Same I'm current learning Rust.

  • @Saturate0806
    @Saturate0806 2 ปีที่แล้ว +5

    Would be amazing if you could cover multi threaded remote debugging on embedded devices

  • @victormikecharlie1596
    @victormikecharlie1596 2 ปีที่แล้ว +13

    I don't think so. C is right now the universal language for embedded systems because it's very simple, fast and it have a small footprint

    • @louiscloete3307
      @louiscloete3307 2 ปีที่แล้ว +3

      It's fast, but Rust can be as fast. Rust with #[no_std] (not linking standard library) is about as small too. C is faster and smaller only when there's not enough runtime checks to make the code actually robust IME.

    • @KookoCraft
      @KookoCraft 2 ปีที่แล้ว

      @@louiscloete3307 "just as good" complete bullshit. dont post stuff like this

    • @KookoCraft
      @KookoCraft 2 ปีที่แล้ว +7

      @Jamie Walkerdine entirely false! and spoken like a true windows user!

  • @sandeepvk
    @sandeepvk ปีที่แล้ว

    Zig is the new C. Zig is faster is compilation time than Rust and doesn't have as many high-level constructs as Rust. Plus doesn't have as strong safety guarantees

  • @alexandernyberg8668
    @alexandernyberg8668 2 ปีที่แล้ว +1

    4:24 "... but in C, this is a syntax error because I'm indexing an int like a dummy"