Rust & Zig Combined • Richard Feldman • GOTO 2023
Vložit
- čas přidán 31. 05. 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.
czcams.com/users/GotoConf... - Věda a technologie
love his "2x video speed" energy
Fantastic that you’ve put this online!!
Zig 🤝 Rust
😅 I like how this was NOT a talk about Roc lang. 😂
This talk has been featured in the last issue of Tech Talks Weekly newsletter 🎉 Congrats!
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
Do you mean rust and zig combined is the future?
@@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++
@@ulrich-tonmoy nice take.
Looking forward to this talk 🔥
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.
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.
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?
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.
Is the video speeded up? lol
I've seen this video before. Why is it now 3 days ago??? Anz it's at 2x. Anyway nice talk
(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.
Heaven and Hell ;)
Which one is which?
@@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
@@steveoc64 In all fairness that's just projection. You sound like a cultist
@@steveoc64Hey, I just wanna know your opinion.
TLDR a dude tried to cut corners while building a new programming language and ended up having to use two new languages. Jesus...
A yes, rust, the language you use when you want to cut corners.
Why tf would anyone combine Rust and Zig. Are we that bored? *Are we trying to solve problems or sing Kumbaya?*