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

推荐订阅源

Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Security Latest
Security Latest
P
Palo Alto Networks Blog
AWS News Blog
AWS News Blog
NISL@THU
NISL@THU
T
Threatpost
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
J
Java Code Geeks
P
Privacy International News Feed
阮一峰的网络日志
阮一峰的网络日志
S
Schneier on Security
博客园 - 聂微东
Project Zero
Project Zero
美团技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Scott Helme
Scott Helme
I
Intezer
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 司徒正美
O
OpenAI News
Last Week in AI
Last Week in AI
L
LINUX DO - 热门话题
酷 壳 – CoolShell
酷 壳 – CoolShell
SecWiki News
SecWiki News
月光博客
月光博客
S
Security Affairs
The GitHub Blog
The GitHub Blog
P
Privacy & Cybersecurity Law Blog
S
Secure Thoughts
V
V2EX
S
Securelist
F
Fortinet All Blogs
W
WeLiveSecurity
D
Docker
博客园 - 三生石上(FineUI控件)
Simon Willison's Weblog
Simon Willison's Weblog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
V
Visual Studio Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Engineering at Meta
Engineering at Meta

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 So Far So Rust Retrying HTTP Requests with Rust A Primer on Control Charts Learning Rust Explicit is Better than Implicit: Rust for Pythonistas Using Custom Delimiters in Jinja Templates TIL: Creating Fixed Length Iterables in Python Documentation Without Assumption Vagrant Python - A Reflection in 2022 Learning Golang No, A Virtual Machine Is Not Enough: Why Developers Need Native Linux Empathy in Tech For Those Who Came in Late A Weekend With PostgreSQL TIL: Gooey and Python Fire for Quick GUIs and CLIs TIL: 2ality - Dr. Axel Rauschmayer's JavaScript Blog TIL: MassDNS - High-Performance Bulk DNS Lookups TIL: Matomo Analytics, Google Tech Writing, Memory Programming, and NES TV Signals TIL: MontyDB - MongoDB Implemented in Python Returning to the Craft of Programming TIL: CPUFetch, OneFetch, and Learn CSS TIL: DNS Performance Testing and Pi-hole with Unbound TIL: Eli Bendersky's Blog, Awesome By Example, NoCoDB, and Martin Kleppmann TIL: CRDTs, Extreme HTTP Performance, and BYTEPATH Game TIL: AutoInvent, ASGI, Python Packaging, RAPIDS GPU Computing, and FlaskCon TIL: MangaDesk - Terminal Client for MangaDex TIL: McFly - Smart Shell History Search TIL: Siege Load Testing and Awesome FastAPI Resources TIL: Ventoy Bootable USB and Justniffer Network Analysis TIL: CLI Code Review, Git Split Diffs, and Internal Combustion Engine TIL: Benford's Law, Web Security Headers, Event Sourcing, and Mozilla Security Guidelines How to Write Documentation - The README.md File The Importance of Documentation TIL: NNgroup UX Research, SponsorBlock, and Labella Python Library TIL: The Little Book of Rust Macros and Rust Performance Book TIL: Git-Bug Distributed Issue Tracker and Omni Kubernetes Monitoring TIL: Zellij - Modern Terminal Multiplexer TIL: How Discord Handles 2.5 Million Concurrent Voice Users TIL: Volumio - The Audiophile Music Player TIL: Areopagitica - Milton's Defense of Free Speech TIL: Fast Node Manager, Zoxide Smart CD, Technical Writing, PyO3, and Qubes OS TIL: Slurm Workload Manager for HPC Clusters TIL: Data Visualization Guide and Oso Authorization Academy TIL: CORS Deep Dive, Piku Tiny PaaS, Rust Strings, and Deno Standard Library TIL: Raspberry Pi OS Development, Vim Beginner Guide, Password Management, and QueryBook TIL: uBlock Origin Performance Optimization on Firefox TIL: Breaking PostgreSQL at Scale and LeetCode Problem Patterns TIL: Awesome Tmux Resources for Terminal Multiplexing TIL: Grit - A Multitree-Based Personal Task Manager TIL: Lens 4.2 Kubernetes IDE, Shell Scripting Guide, and Dark HTTP Server Do The Job You Hate So You Won't Hate The Job You Love TIL: Innernet VPN Solution and NoteCalc Calculator App TIL: Argo CD for GitOps and Lens Kubernetes IDE TIL: Modern Rust CLI Tools - System Monitoring, HTTP Requests, and DNS TIL: tz - A Time Zone Helper Tool TIL: Distributed Systems Education, Fallacies, and Self-Hosted Internet Archiving TIL: Real-Time Voice Cloning Technology TIL: ChartMuseum for Helm, AMD's Corporate Journey, and Kubernetes Pod Scaling TIL: Docker and Kubernetes Tools - Whaler, Descheduler, and Dive TIL: Post-Mortem Collection, Terminal Plotting, and Technical Twitter TIL: Dark Mode Toggle Web Component by Google Chrome Labs TIL: Python eval(), exec(), and compile() Functions TIL: Camelot PDF Tables, PostgreSQL Row Level Security, Zerodha Varsity, and Write Yourself a Git TIL: fuser Command for Process and File Investigation TIL: i Hate Regex - The Ultimate Regex Cheat Sheet TIL: Dolt - Git for Data and Database Version Control TIL: x86 Assembly Programming and SafeEyes Break Reminder TIL: Comprehensive Distributed Systems Reading List TIL: Cosmopolitan C Library, Distributed Systems Book, High Performance Browser Networking, and Rust Roguelike Tutorial
TIL: Architecture of Open Source Applications, Compiler Development Resources, and Oil Shell
2020-09-16 · via Stonecharioteer on Tech

Today’s learning focused on understanding complex software architectures and language implementation techniques.

The Architecture of Open Source Applications provides detailed architectural analysis of major open source projects:

Volume Coverage:

Infrastructure Projects:

  • Apache web server: Multi-process architecture and module system
  • PostgreSQL: Query planning, storage engine, and ACID compliance
  • MySQL: Storage engines, replication, and performance optimization
  • Redis: In-memory data structures and persistence strategies

Development Tools:

  • Git: Distributed version control architecture
  • Mercurial: Alternative DVCS design decisions
  • Eclipse: Plugin architecture and IDE extensibility
  • LLVM: Compiler infrastructure and optimization passes

Application Frameworks:

  • Django: Web framework architecture and ORM design
  • Rails: Convention over configuration philosophy
  • jQuery: JavaScript library design patterns
  • Node.js: Event-driven architecture and non-blocking I/O

Architectural Insights:

Common Patterns:

Plugin Architecture:
- Core system provides stable API
- Extensions add functionality without core changes
- Examples: Eclipse, Apache modules, browser extensions

Layered Architecture:
- Clear separation of concerns
- Each layer depends only on lower layers
- Examples: Network stacks, operating systems

Event-Driven Architecture:
- Components communicate via events
- Loose coupling and high scalability
- Examples: Node.js, GUI frameworks

Performance Considerations:

  • Caching strategies: Redis, web servers, databases
  • Memory management: Garbage collection vs manual allocation
  • Concurrency models: Threading, async/await, actor systems
  • Data structure choices: Hash tables, B-trees, bloom filters

Compiler Development Resources

Comprehensive Compiler Articles

Phil Eaton’s Compiler Articles provide practical, hands-on compiler development guidance:

Language Implementation Steps:

  1. Lexical Analysis: Tokenizing source code
  2. Parsing: Building abstract syntax trees
  3. Semantic Analysis: Type checking and symbol resolution
  4. Code Generation: Producing target code
  5. Optimization: Improving performance and size

Practical Implementation:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Simplified tokenizer example
#[derive(Debug, PartialEq)]
enum Token {
    Number(i64),
    Identifier(String),
    Plus,
    Minus,
    LeftParen,
    RightParen,
    EOF,
}

struct Lexer {
    input: Vec<char>,
    position: usize,
}

impl Lexer {
    fn next_token(&mut self) -> Token {
        self.skip_whitespace();

        match self.current_char() {
            Some('+') => { self.advance(); Token::Plus }
            Some('-') => { self.advance(); Token::Minus }
            Some('(') => { self.advance(); Token::LeftParen }
            Some(')') => { self.advance(); Token::RightParen }
            Some(c) if c.is_ascii_digit() => self.read_number(),
            Some(c) if c.is_ascii_alphabetic() => self.read_identifier(),
            None => Token::EOF,
            _ => panic!("Unexpected character: {:?}", self.current_char()),
        }
    }

    fn read_number(&mut self) -> Token {
        let mut number = String::new();
        while let Some(c) = self.current_char() {
            if c.is_ascii_digit() {
                number.push(c);
                self.advance();
            } else {
                break;
            }
        }
        Token::Number(number.parse().unwrap())
    }
}

Cannoli - Python Compiler in Rust

Cannoli demonstrates implementing a Python subset compiler in Rust:

Architecture Overview:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// AST representation
#[derive(Debug, Clone)]
pub enum Expr {
    Number(i64),
    String(String),
    Identifier(String),
    BinaryOp {
        left: Box<Expr>,
        op: BinaryOperator,
        right: Box<Expr>,
    },
    Call {
        func: Box<Expr>,
        args: Vec<Expr>,
    },
}

#[derive(Debug, Clone)]
pub enum Stmt {
    Expression(Expr),
    Assignment {
        target: String,
        value: Expr,
    },
    If {
        condition: Expr,
        then_body: Vec<Stmt>,
        else_body: Option<Vec<Stmt>>,
    },
    While {
        condition: Expr,
        body: Vec<Stmt>,
    },
}

Code Generation Strategy:

  • Target LLVM IR for optimization and portability
  • Implement Python semantics (dynamic typing, reference counting)
  • Handle Python-specific features (list comprehensions, generators)
  • Provide runtime support for built-in functions

Oil Shell - Unix Shell in Python Subset

Oil Shell represents a modern approach to Unix shell design:

Design Goals:

Compatibility and Innovation:

  • Bash compatibility: Run existing shell scripts
  • Oil language: New shell language with better syntax
  • Type safety: Optional typing for shell variables
  • Error handling: Better error reporting and debugging

Architecture Improvements:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Traditional bash
if [ -f "$file" ]; then
    lines=$(wc -l < "$file")
    if [ "$lines" -gt 100 ]; then
        echo "Large file: $lines lines"
    fi
fi

# Oil shell equivalent
if test -f $file {
    var lines = $(wc -l < $file)
    if (lines > 100) {
        echo "Large file: $lines lines"
    }
}

Implementation Strategy:

Python-Based Implementation:

  • Written in OPy (Oil Python) - a subset of Python
  • Transpiles to Python for execution
  • Uses Python’s parsing and AST capabilities
  • Leverages Python’s standard library

Language Features:

# Variables with types
var name: Str = "example"
var count: Int = 42
var files: List[Str] = glob("*.txt")

# Better string handling
var msg = "Hello $name, you have $count files"

# Structured data
var config = {
    host: "localhost",
    port: 8080,
    debug: true
}

# Error handling
try {
    var result = $(command_that_might_fail)
} catch {
    echo "Command failed"
    exit 1
}

Supporting Resources

LaTeX Learning

Understanding LaTeX syntax and best practices, particularly for technical documentation and mathematical notation in compiler documentation.

Educational Compiler Projects:

  • Small-C: Historical compiler for C subset
  • LLVM tutorials: Official documentation for compiler backend
  • “So You Want to Be a Compiler Wizard”: Career guidance for compiler developers

Advanced Topics:

  • JIT compilation: Runtime code generation techniques
  • Functional programming: Implementing languages with first-class functions
  • Python singledispatch: Method overloading for interpreter implementation

These resources provide comprehensive coverage of both the theoretical foundations and practical implementation techniques needed for understanding and building complex software systems, from compilers to shells to large-scale applications.