Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Generating ergonomic C++ APIs using Rustdoc, procedural macros, and Serde - Björn Wieczoreck

Автор: RustLab Conference

Загружено: 2024-12-13

Просмотров: 158

Описание:

🔔 FOLLOW RUSTLAB CHANNEL 🔔

ABSTRACT:
How to integrate your new shiny Rust code into an existing codebase is a common problem. For this you might need to provide an API so that your Rust code can be accessed from the non-Rust side, for example from a C++ codebase. Rust only provides tools out of the box to define a low level C API, and even that can be troublesome. In this talk we want to demonstrate how you can use procedural macros, Rustdoc's unstable JSON format, and Serde to generate an idiomatic and ergonomic C++ API based on your existing Rust API.

DESCRIPTION:
This talk introduces a novel approach to generate C++ APIs from an existing Rust API by using procedural macros, Rustdoc, and Serde. Functions and impl blocks which should be exposed in the C++ API are annotated with a procedural macro attribute. This macro generates low level extern "C" functions for the corresponding function definitions. Arguments and return values of these functions are passed as byte buffers in this case. Ultimately, Rustdoc's unstable JSON format is used to generate a set of low level bindings for the generated extern "C" functions and, on top of that, a set of ergonomic high level C++ bindings. An intermediate layer handles all the required (de-)serializing of the argument/return type byte buffers to acquire the corresponding native representations.


ADDITIONAL NOTES:
This talk demonstrates how you can generate a "nice to work with" C++ API based on a given Rust API. The proposed workflow is based on procedural macros to generate extern "C" functions, Serde for converting data into the right representation on each side of the FFI interface, and the unstable Rustdoc JSON format to collect and generate the necessary headers for the C++ side. The talk is based on a framework we have developed internally and have been using in production for over a year now. It will start with showing how we handled FFI generation in the past before moving to our new framework. After that it will show in detail how the new framework works internally and which improvements it has over other solutions. Overall our new framework allows for more ergonomic API surfaces on both sides of the FFI interface at the cost of some performance overhead for serialization/deserialization.
There will also be a comparison with existing tools like cbindgen and cxx.

This channel is dedicated to the videos of the RustLab conference.
⚙️ Follow us on TWITTER:

/ rustlab_conf
⚙️ Follow us on FACEBOOK:

/ rustlabconference

RustLab is the first Italian international conference on the Rust programming language, organized by Develer.
Develer is not just an Italian company projecting and releasing hardware and software solutions for the industrial environment, but is also an ensemble of people sharing their great passion for new technologies and how they can be applied to your everyday life.

⚙️ Follow DEVELER on INSTAGRAM:

/ wearedeveler
⚙️ Follow DEVELER on FACEBOOK:

/ we.are.develer
⚙️ Follow DEVELER on TWITTER:

/ develer
⚙️ Follow DEVELER on LINKEDIN:

/ 114426
⚙️ Follow DEVELER on TELEGRAM: https://t.me/wearedeveler
⚙️ Follow DEVELER on TIK TOK:

/ wearedeveler

Generating ergonomic C++ APIs using Rustdoc, procedural macros, and Serde - Björn Wieczoreck

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Lightning Talks - 10/11/2024

Lightning Talks - 10/11/2024

Generating ergonomic C++ APIs using Rustdoc, procedural macros, and Serde - Björn Wieczoreck

Generating ergonomic C++ APIs using Rustdoc, procedural macros, and Serde - Björn Wieczoreck

SWC Lecture 2025 - Professor Stanislas Dehaene

SWC Lecture 2025 - Professor Stanislas Dehaene

Scaling out operational research with Rust - Massimiliano Mantione (Keynote)

Scaling out operational research with Rust - Massimiliano Mantione (Keynote)

Don't panic! - Our journey to error handling in Rust - Tomer Cohen

Don't panic! - Our journey to error handling in Rust - Tomer Cohen

Как устроена компьютерная графика? OpenGL / C++

Как устроена компьютерная графика? OpenGL / C++

Война завершается / НАТО вступает в бой / Атака на остров

Война завершается / НАТО вступает в бой / Атака на остров

Kubernetes — Простым Языком на Понятном Примере

Kubernetes — Простым Языком на Понятном Примере

Боитесь программировать? Бойтесь. Но программируйте. Показываю, где и что • Offtopic • Live Stream

Боитесь программировать? Бойтесь. Но программируйте. Показываю, где и что • Offtopic • Live Stream

Low Latency Rust - Gabriel Dalboozi

Low Latency Rust - Gabriel Dalboozi

Profile-Guided Optimization (PGO) for Rust applications: Practical Guide -  Aliaksandr Zaitsau

Profile-Guided Optimization (PGO) for Rust applications: Practical Guide - Aliaksandr Zaitsau

Вся IT-база в ОДНОМ видео: Память, Процессор, Код

Вся IT-база в ОДНОМ видео: Память, Процессор, Код

Принц Персии: разбираем код гениальной игры, вытирая слезы счастья

Принц Персии: разбираем код гениальной игры, вытирая слезы счастья

Procedural Macros in Rust

Procedural Macros in Rust

КАК УСТРОЕН TCP/IP?

КАК УСТРОЕН TCP/IP?

From 0 to UI using Slint - Tobias Hunger

From 0 to UI using Slint - Tobias Hunger

Цепи Маркова — математика предсказаний [Veritasium]

Цепи Маркова — математика предсказаний [Veritasium]

Flutter в 2025: возможности, ограничения и реальный опыт / ЧТУК

Flutter в 2025: возможности, ограничения и реальный опыт / ЧТУК

DTrace for Rust... and everything else too! - Adam Leventhal

DTrace for Rust... and everything else too! - Adam Leventhal

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]