i am engaged to Rust

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024
  • Why would I use Rust? Why would I choose Rust despite the problems with the Rust foundation and all the other baggage with the language? It's because I think Rust has potential that not a lot of people can see. Rust is the future, lets talk about why.
    🏫 COURSES 🏫 Learn to code in C at lowlevel.academy
    📰 NEWSLETTER 📰 Sign up for our newsletter at mailchi.mp/low...
    🙌 SUPPORT THE CHANNEL 🙌 Become a Low Level Associate and support the channel at / lowlevellearning
    🛒 GREAT BOOKS FOR THE LOWEST LEVEL🛒
    C Programming Language, 2nd Edition: amzn.to/3OKh3q2
    C++ Crash Course: A Fast-Paced Introduction: amzn.to/3qdZILK
    The Rust Programming Language, 2nd Edition: amzn.to/3MHaS36
    🔥🔥🔥 SOCIALS 🔥🔥🔥
    Low Level Merch!: www.linktr.ee/...
    Follow me on Twitter: / lowleveltweets
    Follow me on Twitch: / lowlevellearning
    Join me on Discord!: / discord

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

  • @sahilyadav3782
    @sahilyadav3782 ปีที่แล้ว +374

    Rusty Relationship

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

      UNDERRATED

  • @jongeduard
    @jongeduard ปีที่แล้ว +272

    - This wedding is NOT endorsed by the Rust Foundation. - 🤵🧡🦀

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

      Ha. Rust trademark😂

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

      still can't believe their so flagrantly violating the dreamberd trademark like that.

  • @elkhayder
    @elkhayder ปีที่แล้ว +174

    The Rust logo seems more orange than usual, you will hear from their lawyers

  • @chris.dillon
    @chris.dillon ปีที่แล้ว +405

    Please keep the security researchers employed by writing C.
    I left my wedding present on the table of wedding presents.

    • @phoenix-tt
      @phoenix-tt ปีที่แล้ว +68

      Sorry, on which table? I accidentally dereferenced your bank account

  • @andreasproteus1465
    @andreasproteus1465 ปีที่แล้ว +342

    Languages come and go but C is always there.

    • @tirushone6446
      @tirushone6446 ปีที่แล้ว +34

      it may take some time but I think rust and c will grow old together

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

      C will never die

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

      That's because one needs a macro-assembler that's barely a programmer language from time to time to do shit with microprocessors.

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

      @@maxscott3349 It will, after the Von Newman architecture of stored program.

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

      I use c and Linux, that's just best. 😌

  • @riko.4174
    @riko.4174 ปีที่แล้ว +166

    "I like to look at this as 100% of all malicious vulnerabilities are caused by bad coders"
    - C dev

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

      and 100% of all programmers become bad coders at some point during certain nights working on important code

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

      You are a good programmer today, bad programmer tomorrow.

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

      @@puffin_000 I thought you became a bad programmer the moment you used C to begin with.

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

      @@monad_tcp actually 🤓 if you can code safely on C, you're a really good coder. Imagine no checks, no guards , nothing. Pure memory access and you can handle it. What a chad

  • @HardcoreSalmon
    @HardcoreSalmon 10 หลายเดือนก่อน +9

    What about zig? It's basically improved c.
    - easier to learn than Rust
    - has inbuilt bounds checking
    - has inbuilt integer overflow checking
    - has a defer command that frees memory automatically when out of scope
    - no need for header files, you just "include" the other files you want and no need for the "extern" keyword
    - no need to learn cmake and it runs in one command
    - It can compile c and c++ programs and even include c code in zig projects.
    I personally found zig 10x easier to learn than rust

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

      ​@@RustIsWinningWhat a f***ing zigger right?

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

    If the saying that “A language that doesn't affect the way you think about programming is not worth knowing.” then Rust is TOTALLY worth it, besides it is used or not.
    I would love to hear your opinions about new languages/projects comparing it to Rust specifically: what do you think about Zig, Carbon, Project Verona and, specially, Vale Language by Evan Ovadia?

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

      I don't think we can count on Project Verona yet, it's still in research stage.
      Same with Carbon, it is still in experimental stage.
      Zig is interesting though, D lang aswell!

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

      And even if Rust itself doesn't "catch on", its concepts definitely will

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

    Quick question for those really knowlegeable about Rust safety features. We can 'see' in 'theory' that Rust is safer. But what about in practice? Does the average Rust program end up being safer to attack and so on than an average C program? I'm asking this from an empirical point of view, do we have any proofs, studies, surveys, etc.?

    • @9SMTM6
      @9SMTM6 ปีที่แล้ว

      Proofs ain't empirical. They are inherently theoretical. You MAY proof something using statements obtained via empirics, but the proof itself is still theoretical, and it will state something with a propability in the end. It's not what you're asking for.
      Surveys? I mean, look at the market for a survey. Plenty of the large corporations have already or are in the process of adopting Rust to replace C(++) stacks, after initially dipping their toes with smaller projects. Also plenty of projects that need a secure base, such as cryptography libraries, have adopted Rust despite disadvantages (such as compatibility, C code is usable in more devices).
      Also, why are you asking this question at these "knowledgeable about Rust safety features"? That implies knowledge about the theory, not empirical knowledge.
      As someone familiar with the theory. There sure are gotchas. There always are. Such as using C libraries. Contrary to what some people may state, noone wants to rewrite everything in Rust, at least not in the foreseeable future. So you will end up using C libraries / parts in most Rust projects (I mean POSIX is a bunch of C APIs). And if that library has a memory error, or isn't documented correctly, or if you did not read it's documentation properly, then you can easily have safety issues. Or of course, sometimes it's unavoidable (e.g. to hit performance targets) to use 'unsafe' code, which is actually slightly less safe than writing C code. But usually you localize that in a few spots.

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

      Check out an article from Google titled "Memory Safe Languages in Android 13 ". Excerpts "While correlation doesn’t necessarily mean causation, it’s interesting to note that the percent of vulnerabilities caused by memory safety issues seems to correlate rather closely with the development language that’s used for new code." and "To date, there have been zero memory safety vulnerabilities discovered in Android’s Rust code."

    • @BlueSheep3
      @BlueSheep3 ปีที่แล้ว +70

      In 2022 Google released a blog about the safety of using Rust for low level code in Android called "Memory Safe Languages in Android 13"
      At the time, there were about 1.5 million lines (not sure if this is in the entire low level code base) of Rust code, which is about 21% of the native code.
      In all of that, a total of zero memory safety vulnerabilities were found, while in C or C++ code more than 1 vulnerability gets found per 1000 lines of code, meaning the Rust code would be expected to have 1500 bugs.
      Also, the total amount of vulnerabilities caused by memory safety went from 76% to 35%, but it goes down every year so that doesn't mean that much (but it went down significantly more than last year).
      I think this shows pretty clearly how effective Rust is, and you can read the blog yourself if you want more detail.

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

      Not 100% numerical but were seing a thrend of attackers using rust to write their malware since A) its harder to reverse engr since Rust is less well known B) its safety features have meant overall more relable malware
      So theres like a real world applied example , it doesn't answer "how much" but i think we can say that it's resonable to assume that it has value in practice

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

      I think you can't write the traditional exploitable buffer overflow weak spots in Rust unless you explicitly use unsafe, which is rarely used, if at all ever. I have never used unsafe except when external library wants me to call unsafe functions. The important safety feature for me is being safe from crashes caused by idiotic memory bugs during runtime. Going from C to Rust is comparable experience to going from typeless language to typed language, you'll save time by catching more errors during compilation phase.

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

    Rust is only 17 years old

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

    I'ma possibly just go ahead and marry zig.

  • @viktornikolov1570
    @viktornikolov1570 ปีที่แล้ว +167

    It would be nice if Rust truly becomes a widely used language. I would love to use it in my daily job someday.

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

      "It would be nice if Rust truly becomes a widely used language"
      I thought it already did. Maybe because rustaceans make believe it.

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

      @@IBelieveInCode me tooo
      i blaim the primeagin and all new OSS projects...

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

      Search for the right job. I am developing in Rust as my daily job :)

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

      @@IBelieveInCode It aint going anywhere naming yourself as a "rustacean"

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

      @@eckelfresh 🥲 where are you working and how can i apply?

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

    As my professor said one day: "You will die but C will live"

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

    I have started my low level journey with C since I want to do embedded and basically the entire embedded scene is in C. Once I feel comfortable I’ll have a look at Rust and will probably use that too.

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

      Check out zig for embedded!

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

      That’s a good way and I think it’s better than learning rust from the start. I think you have to fall on your nose with C a few time to actually learn what rust really is about. Otherwise you just wonder why they put so many obstacles on the way

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

      I kinda agree with this take, but don’t artificially lock yourself in. Do some Rust if you’re curious. You can always come back to things later. There’s no need to exclusively master something before allowing yourself to explore what else is out there.

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

      Makes you a better C programmer too.

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

      That's 100% true. I've only dabbled in Rust but there has been a noticeable shift in the quality of my C code compared to before I checked Rust out.
      I'm a bit sceptical about Rust actually replacing C. I believe a memory safe, but simpler, language is going to be needed for that (think Rust borrow semantics on a Go-like language). But as it stands, Rust definitely helps you be better at memory management even in other languages.

  • @elpatosilva
    @elpatosilva 9 หลายเดือนก่อน +6

    The thing is, all languages try to solve the security problems of C by simply not allowing you to do what you can do in C. That is why it is so difficult for someone get engaged to a new language that does not allow you to do things that your ex did allow you to do, if you know what I mean ¬¬

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

    indeed, rust is the greatest language for writing code. It's synthax makes you learn programming deeply. For example all asynchronous actions in any language is like a future trait, any risky action returns either ok or error result, which is exist in rust by result type, and if you want to make something optional, there is a type named option exist in rust. Making error handling mandatory even minimalistic way is also very good thing because if you make some mess you have to clear it and it's better if it's early.
    Writing rust is revolutionary thing relative to other languages that exist. Sometimes it can be rusty but, you cannot make rainbow without rain!

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

      Wow what a comment, and the bottom line really rocks

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

    You could also betray Rust with Zig.

  • @The-solo
    @The-solo หลายเดือนก่อน +2

    No C++ was harmed in this video.

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

    Honestly, I love Rust becase cargo. Python and C are a nightmare when you want to use libraries.

    • @Miles-co5xm
      @Miles-co5xm ปีที่แล้ว +2

      Pip?

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

      @@backendtower6580 yeah why make anything cool when you can spend months on your own library that will be used once

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

      ​@@backendtower6580or just use rust
      Write everything yourself is how you reintroduce heartbleed

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

      @@backendtower6580 omg you're a genius!!! why has anyone thought that???

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

      @@Miles-co5xm Venv is the bane of my existence. Especially after Ubuntu 23.

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

    Good message at the end, i was looking for tdoa code for my project and when i found it, it was wrote on rust. It was very difficult to make sense of it, I think its time to learn rust.

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

    Just discovered your channel, and it's fun to watch 😆, subbed! I come from a c++/c background, and I just started learning rust and it's been fun so far!

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

    Really like your last few videos, good job 👏

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

    Then if we write everything in rust, every malicious vulnerability will be because of logic bugs, authentication errors, crypto errors, SQL injections, CMD injections... right?

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

      Yes, nearly. And we will have successfully reduced the number of vulnerabilities by 70%, or in other words, over 3 times.

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

      @@hottoniapalustris1541 That's complete bovine excrement and if you were wiser you'd know it.

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

      Actually using rust there are some amazing SQL libraries that also completely destroy any possibility of injection as well, like with many other languages tbh. So cross those off too
      And thanks to enums (which you should be using instead of piles of bools) logic errors are (almost) impossible as well

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

      @@DissyFanart That's just propaganda. Stop it.

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

      Yes, and we also lose access to the thousands upon thousands of custom written libraries that only work on other languages. Have fun reimplementing LibTorch in Rust since it’s only in C++

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

    i think, the problem with C is that there is no way to protect memory or a standard way to make arrays, if C has standard way to make true arrays, memory protection checks and closures, it would be the best programming language

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

      What do you mean true arrays? What consists of a true array? Since my time using C89 I always thought the [] standard was a true array?

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

      @@zeektm1762probably dynamic, like std vector? you can create your own with malloc but there's no like a standard way

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

    The shirt he's wearing says "Expert" programmer in a certain way, not really expert, but still expert.

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

    I know it's a joke and I hope everyone takes it the same way, and this probably goes without saying, but still, don't marry someone for their "potential", marry them for who they are, as they are. If you go into something like marriage with your attachment or love being conditional on them becoming this certain version of themselves that YOU have in ur mind, u're just setting yourself up for disappointment and don't have anyone else to blame really. Plus u're being a major jerk to the other person:)

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

      Good luck with Python then

  • @ChelovegII
    @ChelovegII 6 หลายเดือนก่อน +2

    it took me an hour to init an array with bigints, top tier language right there!

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

    Well I think that Rust is like the new Pascal, where C is Fortran, Zig C#, Java VB and VBA just TypeScript. So, it'll be used unless memory is not abstract.

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

    I saw the C++ diss coming a mile away and it still was glorious.

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

    This man singlehandedly reignited my interest in low level programming

  • @Christian-of1tz
    @Christian-of1tz 6 หลายเดือนก่อน

    Interesting take. What about older programs that are running fine for decades using C (not C++) and when there is no one around that has Rust knowledge? And what about alternatives like Zig or Odin which seem to have an easier learning curve?

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

    I personally use and love Jai (Jonathan Blow's programming language)
    and hope that when it eventually goes out of private beta a lot of people will be using it and loving it.
    If not, I'll just still use it because I love it

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

      Have you also used Zig? both seem to be trying the same thing, but I wonder what one does better/worse than the other.

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

      If we're bringing our own favourite languages now, here are two more:
      Roc - high-performance purely functional systems language
      Austral - Rust, but dead simple and minimalistic

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

      Jai is more intended for games development, no?

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

      @@v01d_r34l1ty
      yeah.
      It has a lot of stuff that makes game development easier, but it also has other stuff too, and a lot of stuff that is useful for game development is useful for other things too.

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

      @@mskiptr
      Can't wait for Roc to become usable, though that's probably still a few years out.
      I absolutely love Richard Feldman vision for the language, especially the whole idea around platforms and embeddability.

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

    In Rust we trust!

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

    Excellent video! This is how I feel about Rust right now. Zig has some excellent compile-time options Rust doesn't (at least not yet), and C++ has more flexibility, but Rust is just safe. Zig and C++ aren't going to be fixed, they just can't be. Whereas Rust is starting off correct. The extra QoL features to make writing Rust nicer are substantially easier to patch into the language than "oh dont do this with pointers pls"

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

    Well, from my naive perspective anyway, we already seem to be past the point where most systems are so secure its easier to go after the people (social engineering), but, rust does probably streamline the generation of secure code. Funnily enough, I like it for the syntax and no oop, but safety is good too.

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

      Beyond that, having memory-safe code prevents bugs with memory which is a massive massive massive plus

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

      @@cycliii What I mean is you could check your own borrowing in something like c, rust just automates this process (which is good of course... less human error) and that pros are probably already following safety promoting principles (though again, not error free). Probably more of a (drastic) reduction (rather than an absolute stop), since you're still free to make memory errors at the very least in unsafe...

  • @shimadabr
    @shimadabr ปีที่แล้ว +14

    The biggest problem in Rust for (CS) students to me is that it's awful to study data Structures and Algorithms with it.

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

      Yeah Rust is a terrible language for toy programs, because it demands so much perfection.

    • @alang.2054
      @alang.2054 ปีที่แล้ว +1

      Oh yeah, few weeks ago I tried to implement b+ tree in Rust, fought the borrow checker instead. And just wrote it in c++ using raw pointers. Sometimes it feels like smart pointers can't always work flawlessly with complex ownership models

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

      Yeah, if you're learning data structures then it is definitely easier to use a literal language like C or C++. Even Python would be a better choice and Python sucks.

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

      Which is kinda funny because everything it forces you to do and think about, you should be doing and thinking about in any other language anyways. You just don't need to memorize it lul

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

      You'll have to put all of your data in flat arrays and perform the algorithms using primitive number values that point to the data array. Combine that with enums for representing states of a tree for example and you'll get a nice, clean and fast program. This way you can write every algorithm. Perhaps not the best idea to start learning the basics compared to something like C# or Kotlin where you can twist references how ever you like to help you model and understand the algorthms more directly without any additional cognitive overhead from the language.

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

    Im not to big of a fan of using Rust as I think it is cumbersome to use(I prefer C++) and ugly to look at. However from an objective point of view Rust is far superior to both C++ and C. It has an Ocaml style module system, sum types, pattern matching, traits(similar to Haskell typeclasses), memory safety, great support for functional programming and a very powerful macros system that beats both C++ template system and C macros. An interesting thing about Rust is that it seems that it attracts a totally different type of programmer than C and C++. C seems to be for Unix guys, C++ for game developers, but Rust seems to be attracting people from the dynamic programming languages like python and javascript.

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

      On the contrary, I think C++ is cumbersome to use and ugly to look at, especially modern C++. Rust's syntax and idiosyncrasies can get a while to get used to, but once you do everything makes a lot of sense, and going back to C or C++ feels like shooting yourself in the foot.

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

    Isnt rust a c++ replacement and zig a c replacement?

    • @zaks7
      @zaks7 7 หลายเดือนก่อน +1

      GO > C++, Zig > C, Rust cant be compared

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

    From your perspective, it make sense
    From software engineer perspective that is rushed by military or corporates, Zig make more sense
    ¯\_(ツ)_/¯

    • @gigachad8810
      @gigachad8810 9 หลายเดือนก่อน +2

      zig is not even stable. i dont see ho it makes more sense from any perspective

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

    tcc -b tells you when memory corruption happens before it causes problems.

  • @nickeldan
    @nickeldan 7 หลายเดือนก่อน +1

    The thing I can't get over is the runtime bloat.

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

      What I mean is, isn't there a "standard library" that is statically compiled into each binary?

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

    maybe saying that googles estimate of 70% applies to all code in the entire world is a little misleading? its just one example

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

      I don't think it's valid to call a statistic, even if it's been reduced to a single number, which was calculated based on data from thousands of projects, "just one example".

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

      @@peter9477 still one source that comes from one company's code (which is largely proprietary)

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

    Can you please give us your thoughts on what will be the future of zig, in a Rust world

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

    I'm gonna keep it platonic with Rust, C's been there for me.

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

    Damn she is beautiful ❤

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

    I *love* C.
    In the list of languages that I love, only Python comes a close second to C and the others are waaaay far behind. C++ is not even in the list.
    But I have no production level C code and am not aware of the many ways a C program can be memory un-safe.
    Will it be impossible for me to realize the ways that Rust is safeguarding agains that? Will I be able to appreciate a Rust quirk that's because it's forcing me to write safer code?

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

    C is portable Assembly, it makes no sense to fix C, as it lets you do everything you need to bring up your computer to a usable state.

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

    It's weird to compare Rust and C. Rust is much closer to C++ in terms of features. Plus you did not mention static and dynamic analysis tools around the C language, that makes it safer to use. The strong point of Rust is that it has those embedded directly in the langage and that they are harder to bypass, but not impossible for an incompetent coworker. Even with Rust, bad dev teams will produce poor code anyway. But I agree it does make the job simpler for a well organized team.

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

      At least yo would almost immediately know where this bad code is - unsafe blocks

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

      I'm curious, what type of things do you think represent poorly-written code in Rust? (For example, if it's a bunch of calls to ".unwrap()" to ignore the errors on the Result type, someone could always do a code search and refactor those to have proper control flow.)

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

      Very true, and that's why I think it makes the job easier for teams with a good development process. But it's easy for someone who does not care about safety to pull an unsafe block. I would even expect some team to ditch Rust just because it's "harder" than C++ because it prevents them to write garbage code (some people really think that).
      On the other hand, good dev teams have already set up linters, proper CI, do proper code reviewing and are aware of code smells (seriously, it is not that hard to enforce memory safety in Modern C++ with all that and some wit). Rust makes it easier for them, but I don't think it really improve safety for them. It probably reduce development time though.

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

      IMO, it would be someone using an unsafe block to bypass protections they find annoying and write code as though they were coding in bad C++ because they don't know any better. I see too many people thinking C++ is easier than Rust because of that and I'm pretty sure thay they are the reasons for so many memory faults in application. With proper tooling and dedication, it is not that hard to achieve good memory safety in C++ (and I suspect it's also feasible in C as well) as long as you know that memory safety is crucial.

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

      @@jonhdoe4119 I started using C++ before using Rust and I find Rust much easier to use than C++, the tooling around it is just better and while there are a few language features that I miss from C++ and a few annoyances with warnings for code style and such, I think Rust is just better in many areas than C++. I did used to have more gripes with the let syntax but I think overall that is just minimal compared to the advantages you get.

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

    Less and less programs are written in C and C++ and the problem is still memmory corruption because of C and C++?
    No problems in java, javascript, C# or any other fancy language?

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

      dude java is anything but fancy. Besides C and C++ are still widely used, specially on performance critical, big projects and low level stuff. Just cause it was created a relatively long time ago doesn't mean its outdates or obsolete, something a lot of people just don't get. The only problem with C and C++ is that they're very powerful, and with great power comes great responsibility. The only limit here is your skills

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

      The majority of those older applications that were written in either C or C++ have been debugged to hell and back again. They work better than newer applications and have more features. So yeah, if memory corruption is discovered, it's usually in newer code, which can be written in any language, and is often the result of not understanding what you're doing with a given language or using an interface incorrectly. In other words, bad programmers write bad code in any language.

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

      @@anon_y_mousse I totally agree with you

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

      Javs problem is its java

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

    Cool video! I do like it overall - the whole sizing them up as commodities analogy is fine until it gets to being like "y'know, the way we size women up as commodities, right boys?" Like that's kinda understood as normal and okay in some circles but fwiw as a woman engineer it gave me the ick. Maybe it's in character and I missed something. 🤷‍♀️ But it does seem to have resonated with some of the audience 😬 lol

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

    What about zig?

    • @LowLevel-TV
      @LowLevel-TV  ปีที่แล้ว +2

      zig gud

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

      Doesn't solve the problems Rust solves, and it isn't trying too. I see zig trying to be 1 to 1 replacement for C, while Rust is trying to be something different.

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

      👀

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

      ​​@@jonnyso1How is it just replacement for c?
      I has a whole toolchain and standard library for Zig. And just bcoz it has compiler to c and c++ doesn't mean it is just replacement for C.
      Just bcoz Rust has memory safety doesn't mean Zig doesn't solve it, it solves it by memory code not being complicated during implementation and being simple.

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

      ​@@LowLevel-TVthanks for the automatic translation google

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

    how about a video explaining the pitfalls of C and how rust overcomes it?

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

    Haskell gives you memory safety and a decent amount of logic safety...
    Of course, maybe not quite the best pick for bare metal! (Though you technically could code an operating system in haskell if you really wanted)

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

      the lovely thing about rust is that it has taken many of the best parts of haskell's type system, so you can use a lot of the same techniques to get logic safety in rust as well

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

    How do you see zig doing in this space? Does it give you the freedom of C with better safety? Would that make it more approachable than rust?

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

      yeah Zig is basically C but safer, easier to write and with more modern features. Like zig does bounds checking, makes overflow and underflow explicit, memory allocations are explicit, pointers cannot be null, so you have to use optionals, you have language support for tagged unions (aka sum types), everything is an expression (like in rust), etc.
      It's easier to learn than rust for sure, as it's not as different as rust, but rn there aren't as many resources for it and it's still a WIP language, so I wouldn't recommended to people that aren't willing to put up with the rough edges and the lack of documentation.

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

      I think zig is better in this space since "unsafe" zig is safer than _unsafe_ rust. For low level programming in rust you need to use _unsafe_ a lot. Also you likely need to use C libraries and zig is far better at doing that than rust.

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

      ​@@notuxnobux
      Rust unsafe is directly the freedom of C to do whatever you want, but if you're 99% of programmers, you aren't ever going to have to touch it, so it's fine being that way. The only people who are using it are, like you said, the super low level library devs, which are on average more knowledgeable than the rest on that specific area of programming, at least I'd hope.
      I think rusts unsafe being... unsafe. Is good, people should be testy around it when they're using it, because you removed the guardrails. If they tried to make unsafe safer it would undermine the point and imply more people should be (or need to be) using it tbh

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

      ​@@notuxnobuxIt really depends. You're generalizing but I'm not sure it's a good generalization. I've been working on a significant embedded Rust project and my own use of unsafe amounts to about 3 lines of code, all trivial, and the only C library in sight is a proprietary heart rate algorithm in a static .a file.

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

    I dont use Rust because for most of my projects are not security sensitive, I prefer something more manageable like C# or Python (and yes, on rare occasions, even C++ will do the trick). As a hobbyist programmer, the tradeoff between the restrictions and clunky syntax that Rust imposes and the benefits it offers are not enough for me.

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

      I think you would like to explore some of the funcionnalities of Rust that make it incredible. If you try the rust way, you will become also better in other languages. All the best for your projects

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

      i think you need to expand your defention of security sensitive since if you ever want to write anything thats going to be portforwarded you should probably think about it

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

      one of the most interesting things about Rust is how you model data, using _sum types/algebraic data types/tagged unions/enums with extra data_ or whatever you want to call them. this can transform the way you think about programming and is especially well suited for the principle of "make invalid state unrepresentable", which means that you construct your data types such that it is impossible for them to get into a broken state and that that is guaranteed by the typechecker, instead of having a bunch of invariants that are assumed throughout the code but never actually checked or are at the best only checked using asserts.
      The simplest example of this is using the Result or Option type instead of returning an error code and hoping that the user checks it before using the data. this means that you can never get a null pointer exception in Rust or silently carry broken data because you forgot to check a status flag. You will always know if an operation can fail and how they can fail, so you can handle it properly.
      another language that has a similar type system and makes you rethink programming is Haskell
      another really nice related feature is pattern matching, which makes it so much easier to check for various cases and to extract the relevant data from them

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

    why does it feel like i'm starting to understand this?

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

    I also have a crush on Rust’s Option 😘 can’t wait to unwrap my boxes

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

      You don't monad do you ? X) Perhaps you should take a look about category theory, monad and railway oriented programming. It will make your code elegant and easy to understand

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

      @@fabricehategekimana5350 thanks! Will definitely check it out!

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

    As much as I like rust part of me feels like in 10 years people are going to be like "oh god it's written in rust" like you do with java these days.

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

    "If you write unsafe rust, rust is going to be unsafe"
    But I'm a C programmer. The only way I know to write code is unsafe.

  • @bkbroiler1697
    @bkbroiler1697 28 วันที่ผ่านมา

    "good 'lifetime' partner"
    I see what you did there :)

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

    any language that will kill you for writing a linked list is a little scary

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

    Pure love ❤ can I borrow it? 😉

    • @LowLevel-TV
      @LowLevel-TV  ปีที่แล้ว +4

      no

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

      @@khanra17 Just clone her XD

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

      Just type "sudo pacman -S rustup", but sshhh, dont tell him

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

    I don't really think these languages are taken seriously and that's probably why people developing firmware aren't using it, I'm a firmware developer and we mostly use languages recommended by the company making the chips, like ST or Microchip in their respective IDE don't even propose Rust, so it's maybe great but much time do you think It'll take a C/C++ programmer to start coding good Rust

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

    My main problem with Rust is that ownership semantics assume that all problems can be modeled using "safe" data structures. This is just not true, and we can see this with people using array indices to try to bypass the borrow checker, or less discretely with Cel, RefCell, Ref, Rc, etc. Ownership semantics is good for some problems, and is pretty safe when used correctly, but for most problems, I don't see why you would need anything more than simple array bounds checking and memory structures like arenas.

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

      That's what I like about Rust. It define an implicit "good practice" default and you can change this behavior by declaring it explicitely (like mutability, lifetime, etc.)

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

    I'm with you! Good video!

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

    We don't C eye to eye on this one

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

    you can't have authentication errors if you don't have authentication

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

    There are only two kinds of languages: the ones people complain about and the ones nobody uses. - Bjarne Stroustrup

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

    maybe a dumb question but.. if you write a sublime piece of software and its running safely on a system somewhere, allong side a crappy piece of C i threw together years ago, that needs admin rights or root permissions to work properly and is thus ran as such ... (and yes not by me perse but currently the world is filled with these pieces of code , i prolly dont have to mention that half the bussiness world still runs on cobol and they cant find programmers that can convert it anymore) so as long as they do exist and are used , and they will for a long time , is the extra effort in writig rust and safe code not futile , my dumb tool might just be there to something stupid but if i can get it to change the memory of your program , the cpu is not going to stop it so ...

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

    I'm so happy for your decision

  • @isaialcantara
    @isaialcantara 4 หลายเดือนก่อน +3

    The guy is already cheating Rust with Zig

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

    from my experience, most programmers don't know C++ programming, including C++ programmers. Meaning programmers don't understand the C++ philosophy, paradigm. They know syntax and think that's it. programming is not for everyone.

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

    Curious what your opinion is on Mojo. (Maybe a video ?) I understand it implemented its own borrow checking and similar memory safety concepts into its design?

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

      Reading their site it screams "give us investor money plsss" The whole thing is basically conjecture, jargon, and fluff with no material on what it actually does, how it improves anything, and legitimate benchmarks. They are also closed source which is extremely big red flag with only a "trust me bro" on when they'll give source.
      I wouldn't touch the language with a 50 foot pole.

  • @j.r.r.tolkien8724
    @j.r.r.tolkien8724 10 หลายเดือนก่อน

    What do you think of Zig? Couldn't the same be said about it.

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

    3:28 Can I not say the same about C? Is it because unsafe rust is safer than unsafe C?

    • @abdulrahman-uc8ll
      @abdulrahman-uc8ll 4 หลายเดือนก่อน

      i wouldn’t say its safer because both offer low level memory manipulation. the difference is in rust you can mark unsafe code as unsafe (assuming you know what youre doing), while in C, all code is generally considered unsafe due to the points mentioned in the video. safe rust avoids many problems present in C.

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

    Zig: Consider getting a prenup.

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

      waiting for zig to finally be >18

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

    "C lets you do whatever you want", well i think that's the reason I'm still married to C.. 😅😅

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

    Question: What's a good project to experiment with and learn some low-level programming? I'm hoping to repeat the same project with C, C++, Rust, and Zig to see how I like each of them, explore their strengths and weaknesses, and then choose 2 (probably one old and one new) to keep learning with.
    Any thoughts on a good option? Thanks.

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

      Write a compiler/interpreter

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

      I've been doing C and Assembly and trying to automate real world math that I have to do a lot of. It's a lot more "fun" trying to reinvent optimized solutions for things like parsing strings. I've been fighting with inputting and outputting mixed fractions for quite a while now

    • @asdfghyter
      @asdfghyter 10 หลายเดือนก่อน +3

      you can rewrite some basic command line utility in all of your languages of choice

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

      another great project for any language is advent of code. you won't interact as much specifically with the low-level stuff there, but there are a nice variety of tasks

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

      @@asdfghyter Yeah, I was thinking of practicing Zig and C# with that, but I could just do all 4 languages I mentioned. That might be good for feeling them out in a variety of use cases, because they're probably more/less suitable to different tasks and contexts.

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

    from the thumbnail on my phone, that chain looked like a stream.

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

    "I hate rust but I don't why".

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

    ASAN may "fix" some problems with memory, doesn't it?
    no at all but many of them.

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

    Two points that need seperate vidoes: Rust has many problems and It is going to take over in the future.

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

    I am learning c pp . should i check rust ?

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

    Your views on GO programming language..
    If possible need a separate video.

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

    C was there when nobody else was

  • @MM-24
    @MM-24 10 หลายเดือนก่อน

    What about your opinions on Odin and Zim?

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

    Why not Zig?

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

    rust is nice, but c3 is interesting to me. once i finish writing my pong clone in assembly language (it's a dare), i'm gonna do something with it.

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

    Singing "Ooo I need a dirty woman. Ooo I need a dirty girl. " 😅

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

      "I am just a new boy, Stranger in this town..."

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

    If i was able i would learn machine code itself, faster and more accurate i belive، already encrypted because so many people dont know machine code atleast semi-encrypted programmers would decrypt...

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

    but what about zig and jai

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

    I don't like rust because like c++, the syntax is atrocious

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

    i couldn't implement a double linked list in rust 😢

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

    I may be hard to get it. But from what I understand is that rust bring safety to the code, by "understanding" and checking your code at COMPILE time. I need to stress at COMPILE time, right? Dose it bring and "checks" during run time? I am a Low Level Programmer, creating code mostly only for bare metal, things. What benefits will RUST bring me, except from checking my code that I did not screwed some pointers and things like that, during COMPILE time?
    To be honest I am open to learning it, but if it just checks for errors I have done during my programming and checking my memory "ownership" and doing this just at COMPILE TIME no thank you. At the moment I feel like it just forces me to use some rules just so that it can guarantee that I will not get memory corruption, thing I can do just whit a very careful code development. Hey but I might be wrong, and that can be cause I do not understand all of this better from a machine point of view.
    I program using ASM and C on ARM cores, so to be honest I do not get the safety point of view of this language when you can be as safe by being careful when you code, doing a good memory map and checking your code. This is my point of view. I do not see the RUST language bringing something in the machine code to check for memory corruption cases, or hack attacks. I might be wrong tho and still need to read, maybe someone can clarify that to me?

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

    I laugh so much when he described C lang :D

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

    If I marry Rust I expect the trombone. 😏

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

    I can C the light. 😉

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

    Excellent, give use some more wonderful Rust content :D

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

    hackers will never go away, especially if there's soft gooey humans in the loop

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

    @Low Level Learning Check RTIC - Real-Time Interrupt-driven Concurrency.