A Practical Introduction to Derive Macros in Rust

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

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

  • @shimonpertz
    @shimonpertz 9 หลายเดือนก่อน +5

    Clear language, high level of explaining and simple to understand, neat slides. Liked and Subscribed.
    Keep up the good work mate!

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

    Really good video - with syn and quote, writing powerful macros is more effortless.

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

    I happened to chance upon your videos on reddit.
    i had a hard time learning about macros from the book, and the clarity of your explanations is simply amazing.
    thanks for all the tutorial videos!
    they are of tremendous help!
    I can't wait for your subsequent videos.

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

      Thank you so much. 😊

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

    proud of finding this very good quality channel this early

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

      Thank you. 😊

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

      @@_schwm cant wait for tutorials about basic and advanced use of traits (blanket implementaitons, trait objects etc) and generics. Your examples and way to explain things are very very catchy.

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

      same here. Rust... so much to learn, so interesting.

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

    Short and easy to understand! Thank you very much!

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

    Thank you SOOOO MUCH for making this!
    The topic of proc-macros was intimidating for me to even approach because of my perceived difficulty and complexity of them.
    With how concise and clear this is written and done, and even explaining all the nuisances, and the reasoning for each part, it really makes proc-macros way more approachable!
    Huge thanks for taking the time to write and record this, its a HUGE help to get a understanding of what they really are, and how to start writing them~

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

      You're so welcome! 😊

  • @TON-vz3pe
    @TON-vz3pe 10 หลายเดือนก่อน

    This is quality content. You explained the things which I considered complex with a simple example and easy words.

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

    Nice video, waiting for more on attribute and function macros

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

      Will be there in next 5 weeks I believe. Thank you. 🩶

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

      Forgot to inform, it's been out.

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

    Hello folks. Now we have a Discord server as well: discord.gg/uu8a5GjMg4 🙃

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

    @0:20 Function-like macros can also be procedural, though all declarative macros are function-like. Declarative macros are macros defined via macro_rules! and procedural macros are defined via proc_macro and run arbitrary Rust.

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

    These are awesome.

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

    This is really amazing tutorial! I also stumbled upon it in reddit. Great job! thank yo uso much!

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

      Thanks for watching. ☺️

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

    Awesome video!

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

    thanks! you deliver a very clear explanation.

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

    awesomeeee 👏👏👏👏👏👏👏👏👏👏👏

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

    you are awesome!

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

    Very good!!

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

      Thank you.

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

    Thanks for the vid! Can you tell me what color scheme you're using? It's very pleasing.

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

    Excellent explanation! Thank you. Just a bit too fast for me. Felt like some seconds in between the concepts where needed for thinking. Ofacause pause is an option.

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

    thank you 😊

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

      You're welcome 😊

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

    Seems like visual studio is fighting you: you constantly have to clear out where it’s trying to be helpful

  • @Robert-ht5kd
    @Robert-ht5kd ปีที่แล้ว +1

    3:03 What is that terminal?

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

      It's fish and tide. After you install fish, you can install fisher (fish package manager) and then tide here: github.com/jorgebucaran/awsm.fish

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

    What kind of sorcery is this!!??

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

      Unless you don't want to generate some code, writing macros is totally optional. So, a sorcery you can ignore indeed, my friend.

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

    love me pls😇

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

      Here I go. 😊

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

    I followed allong until the !vec[#(#field_idents),*] syntax, that made my brain unhappy

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

      let me explain it by oversimplifying.
      `#var_name` is a special syntax for `quote::quote!` to generate code with variables that come before it.
      if your variable outside `quote::quote!` is a very simple type like string or integer, then inside `quote::quote!`, you can simply use `#var_name`.
      but, if `#var_name` is an array or vector, you should use `#(#var_name),*`, and possibly wrap it inside a `vec![]`.
      the reason why you do this if `#var_name` is a vector or array is because, while you're generating code, you need to iterate over each element inside `var_name`. so you can say `#(),*` is like a for-each loop while generating code.

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

      @@_schwm sum it up is just way to make vec with field identifier strings in it. I just hate the syntax...

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

    Thank you 😊