惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
博客园 - 【当耐特】
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
美团技术团队
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
IT之家
IT之家
T
Tailwind CSS Blog
月光博客
月光博客
Vercel News
Vercel News
V
V2EX
Engineering at Meta
Engineering at Meta
B
Blog
Stack Overflow Blog
Stack Overflow Blog
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
腾讯CDC
I
InfoQ

Stonecharioteer on Tech

I Traced My Traffic Through a Home Tailscale Exit Node What Was I Reading Last? In Three Not-So-Easy Pieces Dogfooding Is Hard Code blocks in your books, finally GoForGo v0.9.0 Merrilin - We built an app to read books I use a Macbook now Data Structures & Algorithms - Preparing for Interviews Using a local DNS namespace for local service discovery Direction KOllector - Publishing KOReader Highlights gbt: branches touched in the last 24 hours A Soiree into Symbols in Ruby Some Smalltalk about Ruby Loops Ruby Blocks Returning from Ruby Blocks, Procs and Lambdas My Linux Laptop Finally Works: How Claude Helped Me Fix Years of Annoyances TIL: Watchexec - Modern File Watching for Development Workflows A Less Busy Mind GoForGo - Learn Go through live examples Migrating My Old Blog to Hugo with Claude The Qtile Window Manager: A Python-Powered Tiling Experience Read the RFCs that Built the Internet Py-x-Protobuf - Or How I Learned to Stop Worrying and Love Protocol Buffers Python Reverse a List New Beginnings Leaving ChainSafe Systems Screen Lock for Cinnamon Desktop using Zenity and Terminal Commands Crews Not Teams A System for Getting Better at LeetCode
TIL: The Little Book of Rust Macros and Rust Performance ...
2021-04-25 · via Stonecharioteer on Tech

Introduction - The Little Book of Rust Macros

Comprehensive guide to understanding and writing Rust macros:

What It Covers:

  • Macro Fundamentals: How macros work in Rust’s compilation process
  • Declarative Macros: macro_rules! patterns and syntax
  • Procedural Macros: Custom derive, attribute, and function-like macros
  • Advanced Patterns: Complex macro techniques and best practices
  • Debugging: Tools and techniques for debugging macro code

Why Macros Matter in Rust:

  • Code Generation: Eliminate boilerplate and repetitive code
  • Domain-Specific Languages: Create custom syntax for specific use cases
  • Compile-Time Logic: Perform complex operations at compile time
  • Zero-Cost Abstractions: Generate efficient code without runtime overhead

Learning Path:

  1. Start with simple macro_rules! examples
  2. Understand pattern matching in macros
  3. Progress to procedural macros
  4. Learn debugging and testing techniques

The Rust Performance Book

Title Page - The Rust Performance Book

Authoritative guide to optimizing Rust code performance by Nicholas Nethercote:

Key Topics:

  • Profiling: Tools and techniques for measuring performance
  • Memory Management: Optimizing allocations and memory usage
  • CPU Optimization: Instruction-level optimizations
  • Compilation: Compiler flags and optimization settings
  • Benchmarking: Proper performance measurement techniques

Performance Areas:

  • Hot Path Optimization: Focus optimization efforts effectively
  • Data Structure Choice: Selecting optimal data structures
  • Algorithm Efficiency: Complexity analysis and optimization
  • System-Level Concerns: Cache efficiency, branch prediction

Why This Book Is Valuable:

  • Written by a Mozilla performance engineer
  • Real-world examples and case studies
  • Rust-specific optimization techniques
  • Practical, actionable advice

Both resources are essential for Rust developers looking to write more sophisticated and efficient code.