C++/Rust Interop: Using Bridges in Practice
1 - New Rust Extends a C++ Project 5Large existing C++ Library New Plugin Existing Plugins 6C++ Header Class with Methods C++ Source Uses extern “C” from Rust Unsafe Rust C ABI Safe Rust hpp cpp std::unique_ptr<rust::Joint, deleter_from_fn> robot_joint_; }; } // namespace robot_joint hpp 10namespace robot_joint::rust { struct Joint; } // namespace robot_joint::rust extern "C" "C" { extern void robot_joint_free(robot_joint::rust::Joint*); } template struct deleter_from_fn { template constexpr void operator()(T* arg) const { fn(arg); } }; hpp 0 码力 | 45 页 | 724.12 KB | 5 月前3Rust 程序设计语言 简体中文版 1.85.0
Rust 程序设计语言 简体中文版Rust 程序设计语言 简体中文版 目录 Rust 程序设计语言 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 2/562Rust 程序设计语言 简体中文版 11. 编写自动化测试 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445 3/562Rust 程序设计语言 简体中文版 19.1. 所有可能会用到模式的位置 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .0 码力 | 562 页 | 3.23 MB | 9 天前3Shared Libraries
auto* pf = &f; lib1 .dynsym f: .plt_exe+8C++ Implication #4: Comparing Func Ptrs • Not comprehensive: • Different for –fpie • Different for comparison between pointers both taken at shared libs Fedore) configure compilers to build with –z relro : “relocate+read only” • Other languages (zig, rust) do too. • Could consider –no-plt too • Not always possible: https://gcc.gnu.org/bugzilla/show_bug0 码力 | 69 页 | 1.40 MB | 5 月前3So You Think You Can Hash
@ciura_victor Victor Ciura Principal Engineer Rust Tooling @ Microsoft 🐘 @ciura_victor@hachyderm.io 🦋 @ciuravictor.bsky.social 🦀 So You Think You Can Hash CppCon September 20242024 Victor Visual C++ @ciura_victor 🐘 @ciura_victor@hachyderm.io 🦋 @ciuravictor.bsky.social Oxidizer SDK 🦀 Rust Tooling 🦀2024 Victor Ciura | @ciura_victor - Unleashing 🦀 The Ferris Within 4 Motivation Title I'm not here to: convert anyone to 🦀 Rust start any language wars "sell the Rust snake oil" tell you to RiiR So, don't throw 🍅 Rust ❤ C++2024 Victor Ciura | @ciura_victor - Unleashing0 码力 | 119 页 | 6.54 MB | 5 月前3C++ Exceptions for Smaller Firmware
func3() -> Result{ return Ok(13); } Using Rust rustc --target thumbv7em-none-eabi -C opt-level="s" --emit=obj rust.rs 18400000000 <rust::combined::h7a7b0cc556a62e18>: 0: b5f0 push 2c: e00b b 0x46 2e: 4668 mov r0, sp Return Rust: Disassembled! objdump --disassemble --demangle rust.o > rust.S 30: f7ff fffe bl 0x30 34: e9dd 0100 ldrd r0, r1, [sp] fn func3() -> Result { Ok(13) } Using Rust (u64) rustc --target thumbv7em-none-eabi -C opt-level="s" --emit=obj rust.rs 18600000000 <rust::combined::hece36e1d2889c9fd>: 0: b5f0 0 码力 | 237 页 | 6.74 MB | 5 月前3julia 1.13.0 DEV
a bit, you might want to peek ahead at Performance Tips and Workflow Tips, or check out the comprehensive ModernJuliaWorkflows blog.Chapter 3 Installation There are many ways to install Julia. The following install juliaup in a shell with root privileges. cargo (Windows, Mac and Linux) To install Julia via Rust's cargo, run: cargo install juliaupChapter 4 Variables A variable, in Julia, is a name associated of its numeric primitive types, as well as providing portable, efficient implementations of a comprehensive collection of standard mathematical functions. 6.1 Arithmetic Operators The following arithmetic0 码力 | 2058 页 | 7.45 MB | 3 月前3Lifetime Safety in C++: Past, Present and Future
issues | ZDNET • Memory safety (chromium.org) • Implications of Rewriting a Browser Component in Rust - Mozilla Hacks - the Web developer blog • Google Online Security Blog: Memory Safe Languages in Profile Crubit: Adopting Rust’s Type System P2771: Thomas Neumann’s Dependency AnnotationsFuture of C++? C++ Core Guidelines’ Lifetime Safety Profile Crubit: Adopting Rust’s Type System P2771: Value SemanticsFuture of C++? C++ Core Guidelines’ Lifetime Safety Profile Crubit: Adopting Rust’s Type System P2771: Thomas Neumann’s Dependency Annotations Vale: Generational References +0 码力 | 124 页 | 2.03 MB | 5 月前3Cooperative C++ Evolution
JavaScript, C++, Objective-C) C++ examples CCured*, CFlat*, CNatural**, Cyclone**, D*, .NET*, Rust*… — C++11/14/17/20/23 Dart* ES 4, Python 3 TypeScript Swift ES 2-10 (except 4) C99/11/17, Python JavaScript, C++, Objective-C) C++ examples CCured*, CFlat*, CNatural**, Cyclone**, D*, VB.NET*, Rust*… — C++11/14/17/20/23 Dart* ES 4, Python 3 TypeScript Swift ES 2-10 (except 4) C99/11/17, Python JavaScript, C++, Objective-C) C++ examples CCured*, CFlat*, CNatural**, Cyclone**, D*, VB.NET*, Rust*… — C++11/14/17/20/23 Dart* ES 4, Python 3 TypeScript Swift ES 2-10 (except 4) C99/11/17, Python0 码力 | 85 页 | 5.73 MB | 5 月前3Coroutines and Structured Concurrency in Practice
of structured concurrency • nursery in Python trio • task group in Python asyncio • task scope in Rust • coroutine scope in Kotlin • async_scope in nvidia/stdexec We also call it a nursery (mnemonics: are opting out from ever supporting any of these Rust developers learned that the hard way https://carllerche.com/2021/06/17/six-ways-to-make-async-rust-easier/Sketching cancellation procedure • Forward0 码力 | 103 页 | 1.98 MB | 5 月前3A Long Journey of Changing std::sort Implementation at Scale
Default for standard sorting is unstable Python, Rust, Java have stable default sorts 73.2SOME THOUGHTS Default for standard sorting is unstable Python, Rust, Java have stable default sorts Why do we have even if comparator is broken? 73.3SOME THOUGHTS Default for standard sorting is unstable Python, Rust, Java have stable default sorts Why do we have std::sort that can read OOB even if comparator is broken0 码力 | 182 页 | 7.65 MB | 5 月前3
共 77 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8