YoVDO

Mistakes to Avoid When Writing a Wrapper Around a C Library

Offered By: Rust via YouTube

Tags

RustFest Courses Rust Courses API Design Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Discover common pitfalls and best practices for creating Rust wrappers around C libraries in this 35-minute conference talk from RustFest Zürich 2017. Explore safety issues like leak safety, API design considerations, and implementation challenges. Learn how to avoid transmuting tuples, handle hidden global variables, and properly implement lock APIs. Gain insights on testing strategies, memory layout assumptions, and dealing with Rust panics. Benefit from Pierre Krieger's expertise in graphics programming and game development as he shares valuable lessons for creating robust and efficient Rust wrappers for C libraries.

Syllabus

Intro
What is a wrapper
Not catching rust panics
Not testing on a large scale
Assuming a certain layout
Transmute tuples
Highlevel abstraction
When to view
Lock API
How to fix this
Mistake 4 Hidden global variables
New text mutex
Why it doesnt work
Conclusion
Read primitives from memory
Mistake 2 assuming threat implementations are bugfree
The problem
Why would someone do this
How to solve this
Other examples
Mistake 1 API related
Mistake 2 API related
Conclusions
Question


Taught by

Rust

Related Courses

Rust for Programmers
Codecademy
Python and Rust with Linux Command Line Tools
Pragmatic AI Labs via edX
Rust Data Engineering
Pragmatic AI Labs via edX
Rust for DevOps
Pragmatic AI Labs via edX
Rust for Large Language Model Operations (LLMOps)
Pragmatic AI Labs via edX