Strings in Rust FINALLY EXPLAINED!

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

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

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

    📝 Get your *FREE Rust cheat sheet* : www.letsgetrusty.com/cheatsheet

  • @antonioquintero-felizzola5334
    @antonioquintero-felizzola5334 3 ปีที่แล้ว +58

    This has become my favorite RUST channel on TH-cam.

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

      Because this is the only rust channel on TH-cam

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

    Little note about function parameters:
    Taking &str instead of String is good, but only if you don't need an owned String. If you do need an owned String, make sure to take a String, so the caller can decide how the owned string is generated. (For example, the caller might already have a String. If you take a &str, you need an unnecessary clone)
    Now to contradict myself: If you do need an owned String, it might be best to use an impl Into instead. This way, the caller can pass in a &str as well. Improves ergonomics.
    In the same vein, taking impl AsRef instead of &str also allows your function to take an owned string. It is trivial to put an & in front, so it's not as important as Into, but it also slightly improves ergonomics.
    Depending on what you actually do with it, you might even want your string input to be IntoIterator or something. This does decrease ergonomics, since the caller now needs to call chars on the string, but it does mean your function will also work with, for example, Vec.
    If you sometimes return an owned string and sometimes a &str, you can use Cow. For example, if you sometimes return a string literal, Cow

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

    I think this is probably your best video yet. It's great that you've gone a little bit deeper. Programmers really need to know this stuff. Thanks for your effort.

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

    This might be the best string and UTF8 encoding video I’ve ever seen. So many experienced, professional programmers really do not understand how Strings actually work, even in their own language or choice. And it truly did demystify for me Rusts behavior around the different string types. Much appreciated.

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

    As a note on your comment at the end: The type that you said that Rust does not have would be represented by Vec in Rust applications. It is not equivalent to rune slices in Go ([]rune), but intended for the same usage.
    In general, go slices are similar to rust vectors. However, there is a difference between char and rune: In Go, rune is an alias for int32. In Rust, char is its own type. With Rust's emphasis on memory safety, safe Rust code cannot generate invalid chars. This means that it's behavior is different from u32, the type that it would otherwise be equivalent with. In Go, it is perfectly possible to create meaningless runes. The same is true for strings by the way, safe Rust code cannot generate invalid UTF-8 values, but no such limitation exists in Go.
    As I understand it, these are equivalent types between Go and Rust:
    - string -> &[u8]
    - rune -> i32
    - byte -> u8
    - []byte -> Vec
    - []rune -> Vec
    - [7]byte -> [u8; 7]
    - [7]rune -> [i32; 7]
    The other Rust types that we mentioned (char, &str, String, Vec, etc) have additional memory safety guarantees that Go does not provide.

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

    Def one of the best, light weight (and logic dense) videos I've seen regarding rust string types from a practical standpoint (concerning aspiring Rustaceans).
    Excellent vid.

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

    At 20:50 you talk about fixed-length encoding using four bytes. This is what UTF-32 does. AFAIK none of the major languages uses it, but Python has an interesting take on it: When a string is created, the interpreter chooses the “best fit“ between ASCII, UTF-16, and UTF-32, so that constant indexing is always possible but not too much memory is wasted. This of course only works because Python strings are immutable.

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

      Rust's char type actually is UTF-32, as far as I understand it. Which means you could get very similar functionality to a fixed character length encoding by simply using a Vec (or an &[char] to emulate a string slice), if you so wished. Granted, not all the operations that are possible for the normal string types are implemented for a Vec, but given the size of the Rust ecosystem, there's probably a library to make it possible.

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

      I'm like 90% sure that Java `String`s are UTF-32. From my recollection, the `char` type in Java is pretty explicitly an `int` under the hood as well.

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

      ​@Haniyasu char is UTF-16. But if i remember correctly, multibyte encoding does not work in Java. Could be changed now, haven't use Java since Java 8

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

    Keep it up!! As Rust grows, you will one day be remembered as one of the O.G. Rust youtubers!

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

    Probably the best explanation of string, utf-8, ascii types I’ve encountered in my 15 year career! Keep up the good work!

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

    This was driving me crazy last week.
    Really glad to see good, thorough showcase of this concept in Rust.
    Appreciate your content! Keep at it, this will be big when Rust blows up.

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

    Liked the little explanation of UTF-8 encoding. Thanks for making the videos. It helpful to refresh what I’ve read and get a few tips too

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

    This earns you the title of professor. Hardly seen anything better explained than this!

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

    learn more about utf, bytes and string on 20 min video than my 4 year of uni, thanks man ✌️

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

    Thanks a lot! I finally understand the difference between String and &str! And it wasn't complicated, I "made" it complicated in my head. :)

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

    awesome video, just a small thing. Newer programmers may be confused by the lookup vs search times for a character. For UTF-8 (or any variable length encoding) if you want to lookup the nth scalar or grapheme you need to do a linear walk through of the string to count off every time you get to the end of a sequence of bytes representing a scalar/grapheme but for a fixed length encoding (runes, UTF-32) you can rely on each unit (scalar/char/grapheme) being a fixed size and you can just skip (n - 1) * 4 bytes (UTF-32 uses 4 bytes per scalar) to land in the right place. Not sure if I just confused a bunch of people or added clarity for some.

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

      UTF-32 has fixed length code points/units, but not grapheme clusters

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

    Finally! A great explanation of what's going on between string slices and Strings -- thank you! I also appreciated your delving into unicode encoding -- I was worried you were going to rabbit hole on binary representations of a bit characters, but you did exactly the right thing in terms of explaining how unicode encoding works, how it solves the "where am I" when you have a pointer to an arbitrary byte in a unicode string (i.e. "am I at the start?" "where is the next char boundary?") -- I love that you explicitly mentioned that the first byte of a multicode byte string is differentiable based on the high order bits, and that it encodes the length of the multibyte sequence. You mentioned indexing into a Unicode string was a linear operation, which is true, but it's sub-linear in terms of number of bytes explicitly traversed -- if you have 4 4-byte unicode chars in a string, traversal takes only 4 operations, not 16, due to this clever encoding of the first byte.

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

    Wow, this is extremely useful! I come from the Java world and it was really confuse me when working with Rust string, especially when I need to deal with ideographic characters. Thank you!

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

    This is a great guide to a subject that has given me a ton of grief in Rust. Awesome job!

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

    Here a brief summary of UTF-8 encoding:
    - UTF-8 (Unicode Transformation Format, 8-bit) is an encoding scheme, just like ASCII, for representing Unicode characters.
    - In UTF-8, ASCII characters are represented using a single byte, which means that any valid ASCII text is also valid UTF-8 text.
    - Therefore, UTF8 is backward compatible with ASCII.
    - In UTF-8, characters that can be represented using a single byte (i.e., ASCII characters) are represented as themselves.
    - Characters that require more than one byte are encoded using a combination of multiple bytes.
    - A code point refers to a numerical value assigned to each character or symbol in the Unicode standard.
    - Code points are represented using hexadecimal notation and are typically prefixed with "U+" to distinguish them from other numerical values.
    - For example, character "é" (Latin Small Letter E with Acute) consists of two Unicode code points: the base character "e" (U+0065) and the combining acute accent (U+0301). When encoded in UTF-8, "é" is represented by the bytes 0xC3 0xA9.
    - A grapheme refers to a visual unit of a written language. It represents a single user-perceived character or a combination of characters that are displayed together.
    - len() function returns the number of bytes, not the number of characters in a Unicode-unaware string.
    - len() function returns the number of characters in case of a Unicode-aware string.

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

    The thing I like about Rust is you can take a buffer out of one type and transfer it to another. Like for instance you can convert between String, Vec and Box, while keeping the same underlying buffer without reallocation and copying. Hope C++ would have this. It had node transfer in limited form for lists and in newer standard for maps.

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

      Note that converting to a `Box` reallocates if the length is less than the capacity, but other than that, owned conversions just transfer ownership of the existing allocation.

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

      @@SolomonUcko oh, OK. Good to know. I'm still at the very beginning at learning Rust.

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

    I learned something new about how UTF-8 works! Thank you!

  • @ko-ko-ko-la
    @ko-ko-ko-la 5 หลายเดือนก่อน

    Не очікував тут побачити земляка, дякую за туторіал)

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

    Most people say strings in rust are complicated. For me, it makes a lot of sense how it's handled. I do quite a bit of C progamming on µCs, and there everything is char*

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

      Is rust bad for microcontrollers?

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

      @@sconosciutosconosciuto2196 Embedded Rust usually doesn't have the full standard library. It has parts of std called core and alloc.
      If your resources are limited, you can use a CString, which is null terminated and equivalent to char*.

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

    2:04 you could create an array of chars or Vec since chars are 4 bytes long.

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

    you are the best one to explain the difference between the two.

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

    Namaste brother. You’re videos are too good. Keep this format going, tackling each topic standalone or mixed if it’s contextually relevant.

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

    Thanks for this refresher, I was getting pretty rusty.

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

    Shit just got serious

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

    This is the first time I really understood UTF-8

  • @agailloty
    @agailloty 5 ชั่วโมงที่ผ่านมา

    I learn so much from your videos. Thanks

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

    The super in-depth content I crave! Great video

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

    I really like all of your videos they are one of the best out there. You mentioned that you came from a javascript background. How did you become a pro-rust-developer? did you learn the language privately and than you searched for a job or was it a fluent transition within the company you've worked in? I'm prof. C# /Typescript/Javascript developer and would like to jump on the rust-train :-)

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

    This was great. I wish I had this when I was first learning Rust.

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

    Your channel is so cool, thanks for putting the effort in making these tutorials.

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

    Amazing content for a beginner! Super helpful! Thank you very much! 🙌

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

    Привіт світ - was great!)

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

    I started with creating char arrays in C back in the day so this isn't too crazy compared to that.

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

    Thank you, you demystified Unicode for me, now I see how I would implement some of the UnicodeSegmentation crate myself :)

  • @partisan-bobryk
    @partisan-bobryk 3 ปีที่แล้ว +9

    🇺🇦 Thank you for the explanation and examples!

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

    As far as I understand in Go you take a string which is a slice of bytes and build another slice of int32, 1 per each unicode code points. So it's nothing special, or advantegious. You just paid for a a full string decoding once. This would be equivalent to chars().map(|c| c as u32).collect::() in Rust.
    But because in Rust iterators are lazy you don't pay for creation of a new vector each time unless you explicitly want to.

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

      shouldn't it be `.chars().map(|x| x as u32).collect::()`?

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

      @@proloycodes You're correct. Fixed.

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

    Nice and useful intro to Rust strings. Thanks :)

  • @theana5550
    @theana5550 3 ปีที่แล้ว

    Okay... it's been about a month, but you can just use a Vec for constant time lookups.

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

      A char does not equal a user perceived character. 1 user perceived character can be multiple chars.

    • @theana5550
      @theana5550 3 ปีที่แล้ว

      @@letsgetrusty yeah, true

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

    splendid and thoroughly explained. Bravo!

  • @carlesxaviermunyozbaldo4782
    @carlesxaviermunyozbaldo4782 3 ปีที่แล้ว

    Great explanation of this important topic in Rust. Thank you very much!

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

    String in Rust made my head spin. Coming from Ruby and Python string is very easy.

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

      I have been using Python since the Python 2 days and while it seemed simpler by trying to automatically convert between unicode and bytes, this was a source for really confusing errors. In fact, Python 3 became more strict in this area by introducing the same separation between bytes and (character) strings that Rust is essentially using - which saves programmers from a lot of hard to track errors. The difference is that in Python, indexing into a string now counts the characters, which has an unexpected complexity, while Rust counts the bytes and then checks that the result is valid.

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

    Very nice in depth video.

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

    interesting that you see ASCII as a map from integers to characters and not a map from characters to integers :)

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

    Great content! Can you do a video of chars in Rust and unicode scalar values? After hours of searching on the Internet, I am still confused.

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

    You have such great videos. Learning a lot.

  • @thesuperyou2829
    @thesuperyou2829 3 ปีที่แล้ว

    what an effort man.... hats off

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

    Let's get goddamn rusty!

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

    Fantastic explanation, thank you very much! 👍

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

    How does Rust handle interoperability between string implementations (OSString, CString, a hypothetical UTF-32 String etc.)? Is there enough compiler sugar to pass a reference to an alternate String type to &str, or is there an "IString" trait you can implement or is there a lot of myString.as_str() involved?

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

      it’s always manual conversions, though you have a lot of options depending on what you need - rust is super strict about not performing expensive conversions automatically (especially ones that can fail, like converting a byte string to a utf-8 string)

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

      usually you will see something like AsRef in th3 standard library

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

    Слава Україні! 🇺🇦🙏🏾 great seeing Ukrainian in this video

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

    Your tutorials are the best in Rust I've seen! Your English is also gorgeous. I didn't know you were Ukrainian before this video. Glory to Ukraine 🇺🇦 from Kazakhstan 🇰🇿

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

    18:03 Namaste!

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

    I know about the stack and the heap (and the register), but I've never heard of the "application's binary". What is it? Do you have another video where you explain it?
    Thanks!

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

      There are a few different ways a program can get read only or read write memory.
      Your executable normally contains a chunks or describes chunks or memory that it needs.
      The OS then copies or creates these chunks from your program and marks them as read only or read write.
      They are different sections of the program then heap and stack. That's the basics hope it makes sense.

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

      @@dynfoxx Definitely! Thank you!

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

    Really helpful, thanks !

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

    Very interesting video thanks!

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

    10:37 wow that's so cute, thank you))

  • @jhanink
    @jhanink 17 วันที่ผ่านมา

    very well done video.

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

    this channel is a blessing. best explanation out there. thank you

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

    Y U no have THANKS button? I would have bought you a pint! Thanks mate, fantastic explanation. Had some aha moments. Thanks again

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

    I'm a little late, but what is the binary? And how does it differ from the stack and heap?

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

    Awesome content, thanks for your work!

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

    The proliferation of code pages was an issue many years before the world wide web hit critical mass. Not everyone developed code to run in only one Country/Region.

  • @minecrafter8863
    @minecrafter8863 3 ปีที่แล้ว

    Hey bro, thanks for video. Do you use rust for blockchain development? The guys at Solana would love to have a series on that development on solana!

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

    Definitely learnt unicode.. thanks!!.. wondering how this complexity is being hidden in other languages 🤔..

    • @xrafter
      @xrafter 3 ปีที่แล้ว

      They usually hide this checking and validation away from you .
      in js for example the engine will do it .

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

      @@xrafter In JS they just let you make the mistakes. "🤔".length == 2, for example. And to split grapheme clusters, you will have to go find an external library, because it can't do that at all.
      The only thing other languages can do is streamline the usage of the complex stuff. In Elixir, for example, they hide the concept of string normalisation by making string equality work correctly out of the box. They still have an iterator over grapheme clusters but it's in the core library so you don't have to pull a separate dependency to get it.
      Older languages as a rule just get string handling wrong and push the complexity to the developer. It isn't so much hidden, as completely absent.

  • @jhanink
    @jhanink 17 วันที่ผ่านมา

    how do you get that type annotation automatically added - what extension is it?

  • @__abhish
    @__abhish 3 ปีที่แล้ว

    really nice content man. Keep it rusty xD

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

    Дякую за вашу працю.

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

    FINALLY, thanks bro

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

    Simply brilliant !!!

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

    Outstanding video.

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

    I am trying switch over as well from nodejs still struggling with rust..

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

    What intrigues me is that, according to that explanation, in UTF-8 we should have 2,164,864 possibilities and not 1,112,064. So lets see:
    - 1 byte characters (0xxxxxxx): 2^(7) possibilities = 128 possibilities
    - 2 bytes characters (110xxxxx 10xxxxxx): 2^(11) possibilities = 2,048 possibilities
    - 3 bytes characters (1110xxxx 10xxxxxx 10xxxxxx): 2^(16) possibilities = 65,536 possibilities
    - 4 bytes characters (11110xxx 10xxxxxx 10xxxxxx 10xxxxxx): 2^(21) possibilities = 2,097,152 possibilities
    Total possibilities of characters: 128 + 2,048 + 65,536 + 2,097,152 = 2,164,864
    So why 1,112,064?

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

      In 2003, the RFC 3629 standard for UTF-8 restricted the possible range of symbols by U+10FFFF and excluded U+D800..U+DFFF from the range, to make UTF-8 compatible with UTF-16.

    • @marcorodrigues1331
      @marcorodrigues1331 3 ปีที่แล้ว

      @@MalleusRegum thanks for the clarification!

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

    Great Video!!!!

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

    I think it's really the name that's confusing. It seems better to just think of &str as an immutable reference to a string - it can be viewed but not modified. If you want to modify, you need a String. The rest of the stuff about slicing and indexing isn't really confusing, people are probably already familiar with indexing into arrays. Finally, you just have to remember that you can only index in a &str, not a String. You can learn why if you want to, but it doesn't really matter much at the end of the day.
    &str: indexable, immutable
    String: non-indexable, mutable

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

    How do you get VSCode to show the type annotations for let bindings automatically?

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

    дяка за «Привіт Світ» 😁

  • @menardmaranan9356
    @menardmaranan9356 3 ปีที่แล้ว

    What's the extension you're using for type autocomplete?

  • @gamer-gw9iy
    @gamer-gw9iy 2 ปีที่แล้ว

    Let's get rusty!

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

    Excuse me! Can you tell me how your vscode can show type of rust variable on the left side? Thanks a lot

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

      @Let's Get Rusty I was wondering the exact same thing

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

      That's the rust language server.

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

      Or should I say, Rust Analyzer extension.

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

    I love the Namaste 🙏

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

    "Applications binary" - is is the a static memory?

  • @jimshtepa5423
    @jimshtepa5423 3 ปีที่แล้ว

    Богдан, спасибо! очень крутой материал

  • @idiot7leon
    @idiot7leon 3 ปีที่แล้ว

    Thanks!

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

    What is string slice?

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

    Good stuff! Just getting into Rust as a mainly JS-Dev and this is by far the best content out there! One question: What VS-Code extension are you using, that shows these greyed out type-annotations and function-parameters?

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

      It's built-in in vs code and it's generated by the Language Server and it's called inlay hints

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

    please teach me about integers? what are integers?

  • @driftwood-f4p
    @driftwood-f4p ปีที่แล้ว

    How do you enter emoji in your code?

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

    wow. I'm from JS too

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

    Дякую (:

  • @emvdl
    @emvdl 3 ปีที่แล้ว

    Thanks! 🤙

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

    You skipped straight past the original solution to the 127 character limit which was code pages and encoding. UTF-8 was the better solution that came out of this, but UTF-8 was not widely used. UTF-16 was, but the problem with it was that it doubled the amount of memory required to represent every character, even those that could be represented by ASCII. So it was not popular because computers back in the 90's had such limited memory. UTF-8 was popular in the early 2000's, but the problem was that it was not standardised on and everybody was still using character encodings. So there was this fun problem of writing data into databases in the wrong encoding and then decoding it in the wrong way too, leading to all sorts of fun jobs for me to fix peoples databases and nobody really understood how to fix. These days this problem is all fixed (I guess, right? right guys?). But yeah, just wanted to write about how UTF-8 was NOT the original solution to the ASCII problem.

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

    Hello, happy to subscribe to your channel. Would you please say few words why an absolute beginner would rather get more motivated to learn Rust rather than say Python (or any other language that is closer to the English language syntax, ie easier ). Thank you kindly

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

      If you don't need to do low level systems programming then learn Python instead. It's easier and will allow you to build things quickly.

  • @dibyojyotibhattacherjee4279
    @dibyojyotibhattacherjee4279 3 ปีที่แล้ว

    Hey do u get the warning that says something like could not access incremental compilation directory?.

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

      Nope

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

      looks like you are using termux cuz i also get that

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

    what is byte?

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

    Why is there both to_string() and to_owned()?