newrustacean.com

The official website for the New Rustacean podcast

OTHER License

Stars
180

Bot releases are visible (Hide)

newrustacean.com - News: Rust 1.35 Latest Release

Published by chriskrycho over 5 years ago

  • Date: May 23, 2019
  • Subject: WASI, Option::copied, and the future of async/await syntax!
  • download mp3
  • script

Show Notes

Sponsors

Thanks to Parity for sponsoring the show and hiring Rust developers!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - CYSK: bindgen and cbindgen

Published by chriskrycho over 5 years ago

  • Date: May 17, 2019
  • Subject: Automatic generation of FFI types between Rust and C APIs.
  • download mp3
  • script

Show Notes

Sponsors

Thanks to Parity for sponsoring the show and hiring Rust developers!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - e031: FFI Deep Dive

Published by chriskrycho over 5 years ago

  • Date: May 11, 2019
  • Subject: Exposing Rust types and functions to C API consumers.
  • download mp3
  • script

Show Notes

It's impossible to make the declarations below follow the order I talked through them on the recording without also making them horrible to read, so just use this outline instead:

  1. add_in_rust
  2. Strings
    1. concat_strings
    2. free_rust_string
  3. Point
    1. point_translate
  4. union
  5. OpaquePoint
    1. opaque_point_new
    2. opaque_point_translate
    3. opaque_point_free

Links

Sponsors

Thanks to Parity for sponsoring the show and hiring Rust developers!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - e030: Can You See Me Now?

Published by chriskrycho over 5 years ago

  • Date: April 29, 2019
  • Subject: Item visibility and pub(<restricted>) as API design tools.
  • download mp3
  • script

Show Notes

The easiest and most effective way to understand the example in this case
will simply be to look directly at the source code. You can read
the docs for each of the nested modules, but you'll be doing a lot of
navigating around for that.

Also, I am using Cargo’s --document-private-items flag, so that you can
see all the items in all the modules, even those which are not public,
but note that usually you would not see docs for those!

Links

Sponsors

Thanks to Manning for sponsoring the show and giving all of you a 40%-off
discount on their whole store (but especially their WebAssembly in
Action MEAP
) at deals.manning.com/new-rustacean!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - e029: I’m Out to C

Published by chriskrycho over 5 years ago

  • Date: April 3, 2019
  • Subject: Using Rust’s Foreign Function Interface (FFI) with C!
  • download mp3
  • script

Show Notes

The code samples here directly match the things I described in the show, so you will likely want to look at add and ffi::add, then Point, translate, and ffi::translate in that order.

Links

Other helpful Rust FFI discussions:

Sponsors

Thanks to Manning for sponsoring the show and giving all of you a 40%-off discount on their whole store (but especially Carol Nichols' and Jake Goulding's Rust in Motion video content and the Rust in Action MEAP!) at deals.manning.com/new-rustacean

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Bonus: How the Sausage Gets Made

Published by chriskrycho over 5 years ago

  • Date: March 23, 2019
  • Subject: How I make the show, and why you won’t find it on Google Play, Spotify, or Stitcher.
  • download mp3
  • script

Show Notes

Sponsors

Thanks to Parity for sponsoring the show and hiring Rust developers!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - News: Rust 1.33 and 1.34

Published by chriskrycho over 5 years ago

  • Date: April 19, 2019
  • Subject: Moar const fn, some Pin, and alternative Cargo registries!
  • download mp3
  • script

Show Notes

Sponsors

Thanks to Parity for sponsoring the show and hiring Rust developers!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Bonus 13: I Still Make Silly Mistakes

Published by chriskrycho over 5 years ago

  • Date: February 28, 2019
  • Subject: A story about parsing command-line arguments manually and some thoughts on “rookie mistakes.”
  • download mp3
  • script

Show Notes

Sponsors

Thanks to Parity for sponsoring the show and hiring Rust developers!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - e028: Meet My Associates

Published by chriskrycho over 5 years ago

  • Date: February 21, 2019
  • Subject: Associated items: functions and methods, constants, types, and (very briefly!) GATs.
  • download mp3
  • script

Show Notes

Sponsors

Thanks to Manning for sponsoring the show and giving all of you a 40%-off
discount on their whole store (but especially Carol Nichols' and Jake
Goulding's Rust in Motion video content and the Rust in Action MEAP!) at
deals.manning.com/new-rustacean

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - News: Rust 1.32

Published by chriskrycho over 5 years ago

  • Date: January 22, 2019
  • Subject: dbg!, unified paths, more places you can use Self, and a
    bunch of const fn stabilizations—plus some neat community highlights!
  • download mp3
  • script

Show Notes

Sponsors

Thanks to Parity for sponsoring the show again. Go check out their Rust
jobs
!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Rust 1.31 and the 2018 Edition, Part I

Published by chriskrycho almost 6 years ago

  • Date: January 7, 2019
  • Subject: An overview of the edition, and some of the improvements that
    are available in both the 2015 and 2018 editions: better lifetime elision,
    some Cargo features, and some library stabilizations.
  • download mp3
  • script

Show Notes

Sponsors

Thanks to Parity for sponsoring the show again. Go check out their Rust
jobs
!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Rust 1.31 and the 2018 Edition, Part II

Published by chriskrycho almost 6 years ago

  • Date: January 14, 2019
  • Subject: Stabilizing rustfmt, clippy, tool lints, and const fn (all
    in both editions!), and the 2018 Edition-specific features: syntax
    changes and non-lexical lifetimes!
  • download mp3
  • script

Show Notes

Sponsors

Thanks to Parity for sponsoring the show again. Go check out their Rust
jobs
!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Interview: Integer32 (Carol Nichols || Goulding and Jake Goulding)

Published by chriskrycho almost 6 years ago

  • Date: December 31, 2018
  • Subject: Talking with Carol and Jake about The Rust Programming Language, Rust in Motion, and Rust Belt Rust. With a bonus discussion about the value of focusing on our kids over just building big businesses.
  • download mp3

Show Notes

Things we mentioned on the show:

Sponsors

Thanks to Manning for sponsoring this episode; don’t forget to grab some of their content at 40% off using the code podnewrust18!

Thanks to Parity for sponsoring the show again. Go check out their Rust jobs!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Trust Me; I Promise!

Published by chriskrycho almost 6 years ago

  • Date: November 30, 2018
  • Subject: An intro to unsafe Rust and Rust's idea of safety.
  • download mp3
  • script

Show Notes

Errata

A quick correction: on the show I said that a trait needed to be unsafe when it had an unsafe fn method. This isn't correct: safe traits can have unsafe methods, and unsafe traits can exist without any methods at all (as implied by my reference to Send and Sync). You can see this in practice in the following example, which compiles just fine!

trait ASafeTrait {
    unsafe fn unsafe_method() {}
}

unsafe AnUnsafeTrait {}

The idea of an unsafe trait is that it has some conditions which you must uphold to safely implement it – again, just as with Send and Sync. In the case of most traits, this will be because some trait method has invariants it needs to hold else it would cause undefined behavior. For another example of this, see the (unstable as of the time of recording) trait std::iter::TrustedLen.

Thanks to Rust language team member @centril for noting this to me after listening when I was recording the show live!

Links

Examples

Borrow-checked code in unsafe

let mut f = String::from("foo");

unsafe {
    let borrowed = &mut f;

    // This would be unsafe and throw an error (before Rust 2018):
    // let borrow_again = &f;

    println!("{}", borrowed);

    // This would be unsafe and throw an error:
    // println!("{}", borrow_again);
}

(See it in a playground)

Safely mutating a raw pointer
let f = Box::new(12);
let mut g = Box::into_raw(f);
g = &mut (g + 10);

(See it in a playground)

Sponsors

Thanks to Parity for sponsoring the show again. Go check out their Rust
jobs
!

Patreon Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Bonus: Translating Between Languages

Published by chriskrycho almost 6 years ago

  • Date: October 23, 2018
  • Subject: Musings inspired by a project translating TypeScript to Rust
  • download mp3
  • script

Sponsors

Thanks to Manning for sponsoring the show and giving all of you a 40%-off discount on their whole store (but especially Carol Nichols' and Jake Goulding's Rust in Motion video content and the Rust in Action MEAP!) at deals.manning.com/new-rustacean

Patreon Sponsors

  • Aaron Turon
  • Adam Green
  • Aleksey Pirogov
  • Alexander Payne
  • Alexander Kryvomaz
  • Andrew Thompson
  • Anthony Deschamps
  • Anthony Scotti
  • Behnam Esfahbod
  • Benjamin Wasty
  • Brandon 'Spanky' Mills
  • Brian Casiello
  • Brian Manning
  • Bryan Stitt
  • Bryce Johnston
  • Caryn Finkelman
  • Cass Costello
  • Chap Lovejoy
  • Charlie Egan
  • Chip
  • Chris Palmer
  • Daniel
  • Dan Abrams
  • Daniel Bross
  • Daniel Collin
  • Daniel Mason
  • David Hewson
  • Derek Morr
  • Doug Reeves
  • Eugene Bulkin
  • Fábio Botelho
  • Gaveen Prabhasara
  • Graham Wihlidal
  • Henri Sivonen
  • Ian Jones
  • "Jake ""ferris"" Taylor"
  • James Cooper
  • James Hagans II
  • Jerome Froelich
  • [Joar Wandborg]
  • [John Rudnick]
  • Jon
  • [Jonathan Knapp]
  • Jonathan Turner
  • Joseph Hain
  • Joseph Marhee
  • Justin Ossevoort
  • Kai Yao
  • Keith Gray
  • Kilian Rault
  • Lee Jenkins
  • Luca Schmid
  • [Luiz Irber]
  • Lukas Eller
  • [Martin Heuschober]
  • Masashi Fujita
  • Matt Rudder
  • Matthew Brenner
  • Matthias Ruszala
  • [Max Jacobson]
  • Max R.R. Collada
  • [Messense Lv]
  • Micael Bergeron
  • [Michael Mc Donnell]
  • Michael Sanders
  • [Nathan Sculli]
  • [Nick Coish]
  • [Nick Stevens]
  • [Nicolas Pochet]
  • Olaf Leidinger
  • Oliver Uvman
  • [Oluseyi Sonaiya]
  • Ovidiu Curcan
  • [Pascal]
  • [Patrick O'Doherty]
  • Paul Naranja
  • Paul Osborne
  • Peter Tillemans
  • Ralph Giles
  • [Ramon Buckland]
  • Randy MacLeod
  • Raph Levien
  • Richard Dallaway
  • Rob Tsuk
  • Robert Chrzanowski
  • [Ryan Blecher]
  • [Ryan Osial]
  • Scott Moeller
  • [Sebastián Ramírez Magrí]
  • [Simon Dickson]
  • Simon G
  • Steve Jenson
  • Steven Knight
  • Steven Murawski
  • [Stuart Hinson]
  • Tim Brooks
  • Tim Süberkrüb
  • Tom Prince
  • Toolmaker's Guild
  • Ty Overby
  • Tyler Harper
  • Victor Kruger
  • Will Greenberg
  • [William Roe]
  • Zak van der Merwe
  • Zachary Snyder
  • Zaki

[Joar Wandborg]: Joar Wandborg
[Jonathan Knapp]: https://www.coffeeandcode.com/
[John Rudnick]: http://www.cindur.com/
[Luiz Irber]: http://luizirber.org/
[Martin Heuschober]: https://github.com/epsilonhalbe
[Max Jacobson]: https://twitter.com/maxjacobson
[Messense Lv]: https://github.com/messense
[Michael Mc Donnell]: https://www.linkedin.com/in/michaelmcdonnell/
[Nathan Sculli]: http://influential.co/
[Nick Coish]: http://github.com/ncoish
[Nick Stevens]: https://github.com/nastevens
[Nicolas Pochet]: https://github.com/n-pochet
[Oluseyi Sonaiya]: http://oluseyi.info/
[Pascal]: https://pascalhertleif.de/
[Patrick O'Doherty]: https://twitter.com/patrickod
[Philipp Keller]: https://twitter.com/hansapla
[Ramon Buckland]: http://www.inosion.com
[Ryan Blecher]: http://notryanb.github.io/
[Ryan Osial]: https://github.com/osialr
[Sebastián Ramírez Magrí]: https://www.twitter.com/sebasmagri
[Simon Dickson]: https://www.simonhdickson.com/
[Stuart Hinson]: http://stuarth.github.io/
[William Roe]: http://willroe.me

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - e025: Traits Deep Dive, Part III

Published by chriskrycho over 6 years ago

Traits Deep Dive, Part 3

  • Date: July 4, 2018
  • Subject: Closure traits, impl trait, dyn trait, and object safety!
  • Script
  • Audio:

Show Notes

Sponsored by Parity Technologies! Parity is hiring Rust developers so if you're interested, you should check out their job listings!

Links

Example

You can see all of the pieces of the final example described in the show here (and the module has the required definitions for Point).

let points = vec![
    Point { x: 1.0, y: 2.0 },
    Point { x: 12.0, y: 4.3 },
    Point { x: -5.4, y: 18.7 },
];

let origin = Point::default();

// This is the version we start with. It works fine, but it's not elegant.
let distances_inline: Vec<f32> = points
    .iter()
    .map(|point| {
        let change = point - &origin;
        (change.x.powi(2) + change.y.powi(2)).sqrt()
    })
    .collect();

// This version is *much* cleaner!
let distances_impl: Vec<f32> = points.iter().map(distance_from_impl(&origin)).collect();

Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Crates You Should Know: The wasm tools

Published by chriskrycho over 6 years ago

  • Date: March 31, 2018
  • Subject: wasm intro, wasm-bindgen, and wasm-pack
  • Audio:

Show Notes

Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - e023: Traits Deep Dive, Part 1

Published by chriskrycho over 6 years ago

  • Date: April 28, 2018
  • Subject: Defining and using your own traits, using other crates' traits, and the orphan rule.
  • Audio:

Show Notes

Traits—

Also of interest: specialization:

Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Rust 1.24

Published by chriskrycho over 6 years ago

Rust 1.24

  • Date: March 1, 2018
  • Subject: Performance wins, incremental compilation, and the Rust 2018 Roadmap and Epoch.
  • Audio:

Show Notes

Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact

newrustacean.com - Crates You Should Know: Serde

Published by chriskrycho over 6 years ago

  • Date: February 10, 2018
  • Subject: The library for serialization and deserialization in Rust.
  • Audio:

Show Notes

Sponsors

(Thanks to the couple people donating who opted out of the reward tier, as
well. You know who you are!)

Become a sponsor

Contact