Rust & Zig Combined • Richard Feldman • GOTO 2023

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 มิ.ย. 2024
  • This presentation was recorded at GOTO Copenhagen 2023. #GOTOcon #GOTOcph
    gotocph.com
    Richard Feldman - Functional Programming Language Expert & Author of “Elm in Action” ‪@rtfeldman‬
    RESOURCES
    / rtfeldman
    / rtfeldman
    github.com/rtfeldman
    Links
    www.rust-lang.org
    ziglang.org
    www.roc-lang.org
    ABSTRACT
    Why would someone use both Rust and Zig in the same project? Rust is complex and famous for its borrow checker's memory safety benefits, whereas Zig is famously simple and has no borrow checker. Wouldn't a project want one or the other, rather than both together?
    The compiler for the Roc programming language intentionally uses a combination of Rust and Zig. As it turns out, the circumstances that make this a good choice are not as rare as you might think, and the differences in memory safety between Rust and Zig are also not as big as you might think.
    Come learn about the surprising benefits of combining two languages as different as Rust and Zig! [...]
    TIMECODES
    00:00 Intro
    02:45 Outline
    03:02 Why did we mix Rust & Zig?
    17:40 Memory safety in practice
    39:28 Where to draw the line?
    45:15 Outro
    Download slides and read the full abstract here:
    gotocph.com/2023/sessions/2890
    RECOMMENDED BOOKS
    Richard Feldman • Elm in Action • amzn.to/387kujI
    Dean Bocker • Don't Panic! I'm A Professional Zig Programmer • amzn.to/3ljKT8d
    Tim McNamara • Rust in Action • amzn.to/3ux2R9u
    David Drysdal • Effective Rust • amzn.to/4dAjbdX
    / gotocon
    / goto-
    / goto_con
    / gotoconferences
    #Rustlang #Ziglang #Roclang #Rust #Zig #Roc #ProgrammingLanguages #Programming #FunctionalProgramming #BorrowChecker #MemorySafety #Haskell #Concurrency #RichardFeldman
    Looking for a unique learning experience?
    Attend the next GOTO conference near you! Get your ticket at gotopia.tech
    Sign up for updates and specials at gotopia.tech/newsletter
    SUBSCRIBE TO OUR CHANNEL - new videos posted almost daily.
    th-cam.com/users/GotoConf...
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @luizpbraga
    @luizpbraga 27 วันที่ผ่านมา +39

    love his "2x video speed" energy

  • @bjorn2625
    @bjorn2625 28 วันที่ผ่านมา +10

    Fantastic that you’ve put this online!!

  • @ZenonLite
    @ZenonLite 28 วันที่ผ่านมา +18

    Zig 🤝 Rust

  • @possumkeys
    @possumkeys 27 วันที่ผ่านมา +9

    😅 I like how this was NOT a talk about Roc lang. 😂

  • @ulrich-tonmoy
    @ulrich-tonmoy 26 วันที่ผ่านมา +6

    Rust and Zig might be the new C++ and C (rust is not to zig what c++ is to c) to continue their legacy to further

    • @user-zy4yh8iw1f
      @user-zy4yh8iw1f 23 วันที่ผ่านมา +2

      Do you mean rust and zig combined is the future?

    • @ulrich-tonmoy
      @ulrich-tonmoy 23 วันที่ผ่านมา +3

      @@user-zy4yh8iw1f yep zig gives you full control where as rust gives many feature and make you do things its way just kind of like c c++

    • @user-zy4yh8iw1f
      @user-zy4yh8iw1f 23 วันที่ผ่านมา +2

      @@ulrich-tonmoy nice take.

  • @TechTalksWeekly
    @TechTalksWeekly 22 วันที่ผ่านมา +1

    This talk has been featured in the last issue of Tech Talks Weekly newsletter 🎉 Congrats!

  • @timi_t_codes
    @timi_t_codes 28 วันที่ผ่านมา +1

    Looking forward to this talk 🔥

  • @yorailevi6747
    @yorailevi6747 26 วันที่ผ่านมา

    i just checked the repo for the roc compiler… Why is there a float implementation in zig? isn’t it supposed to be a hardware primitive?

    • @antonf.9278
      @antonf.9278 25 วันที่ผ่านมา

      How would you implement hardware primitives when targeting LLVM?
      You can either generate llvm bytecode directly or have an existing compiler do that for you.
      If it's something self-contained like floating point arithmetic and you want to do the same thing as zig, use zig.

    • @brendanhansknecht4650
      @brendanhansknecht4650 2 วันที่ผ่านมา

      We don't implement a float in zig. We do implement `Dec` in zig. That is a fixed point decimal type that is more useful for correctness of certain classes of code.

  • @chewbaccarampage
    @chewbaccarampage 25 วันที่ผ่านมา

    He probably needs to bootstrap the languag, but wants to avoid bugs in the bootstrapped compiler. It took a decade or so before Microsoft was able to build a .Net compiler in C#. I don't build compilers, but I suspect it's very common to cobble together a few tools to bootstrap a language until it's mature before rewriting the compiler in the language of choice. I did try Linux from Scratch once and it's pretty similar where you bootstrap the system with some janky tools before building the production Linux system.

    • @AGeekTragedy
      @AGeekTragedy 25 วันที่ผ่านมา +2

      I think* I've seen another video where Richard said that he didn't have any plans to have Roc be self-hosting. I think he has a particular set of domains in mind within which he is design Roc to be a natural choice compilers just isn't one of them.
      * It's possible I'm confusing him with the Elm guy. I think it applies to both.

    • @brendanhansknecht4650
      @brendanhansknecht4650 2 วันที่ผ่านมา +2

      Roc has no plans to self host. Rust is a correct language for the compiler. Zig would be another great choice. Roc isn't the right choice.

  • @MegaCashB
    @MegaCashB 26 วันที่ผ่านมา

    Is the video speeded up? lol

  • @abiiranathan
    @abiiranathan 25 วันที่ผ่านมา

    I've seen this video before. Why is it now 3 days ago??? Anz it's at 2x. Anyway nice talk

  • @steveoc64
    @steveoc64 28 วันที่ผ่านมา +1

    Heaven and Hell ;)

    • @RiwenX
      @RiwenX 28 วันที่ผ่านมา +3

      Which one is which?

    • @steveoc64
      @steveoc64 26 วันที่ผ่านมา +1

      @@RiwenX yeah, well if you need to ask….. then you are probably already neck deep in the rust koolaide, so no amount of logical discussion will bring any light to the question

    • @RiwenX
      @RiwenX 26 วันที่ผ่านมา

      @@steveoc64 In all fairness that's just projection. You sound like a cultist

    • @user-zy4yh8iw1f
      @user-zy4yh8iw1f 23 วันที่ผ่านมา

      ​@@steveoc64Hey, I just wanna know your opinion.

  • @musicalintuition
    @musicalintuition 24 วันที่ผ่านมา +1

    (slightly off topic) I don't know why everyone keeps saying Zig is simple. Over the years I've done a bit of x86 assembly, C, Java, JS, Haskell and Lisp, and yet, there's just something about Zig that keeps on biting me because it never works the way I expect.

    • @brendanhansknecht4650
      @brendanhansknecht4650 2 วันที่ผ่านมา +1

      I think it is a competitive statement
      . Simple compared to c++ and rust. That said, zig is still young and changing. Overall, it has a pretty simple to learn core with less sharp edges than C.

  • @NeatMemesDotCom
    @NeatMemesDotCom 27 วันที่ผ่านมา +11

    TLDR a dude tried to cut corners while building a new programming language and ended up having to use two new languages. Jesus...

    • @antonf.9278
      @antonf.9278 25 วันที่ผ่านมา +3

      A yes, rust, the language you use when you want to cut corners.

  • @zcizzorhandz5567
    @zcizzorhandz5567 19 วันที่ผ่านมา +2

    Why tf would anyone combine Rust and Zig. Are we that bored? *Are we trying to solve problems or sing Kumbaya?*

    • @maxmustermann5590
      @maxmustermann5590 11 วันที่ผ่านมา +2

      There's actually a nice talk about exactly that question. GoThere Composiums or something like that