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

推荐订阅源

J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
Martin Fowler
Martin Fowler
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
Engineering at Meta
Engineering at Meta
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
罗磊的独立博客
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
D
Docker
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX

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.