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

推荐订阅源

U
Unit 42
S
Securelist
小众软件
小众软件
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
O
OpenAI News
Cloudbric
Cloudbric
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
TaoSecurity Blog
TaoSecurity Blog
MongoDB | Blog
MongoDB | Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V
V2EX
PCI Perspectives
PCI Perspectives
T
Troy Hunt's Blog
Schneier on Security
Schneier on Security
P
Palo Alto Networks Blog
M
MIT News - Artificial intelligence
V2EX - 技术
V2EX - 技术
阮一峰的网络日志
阮一峰的网络日志
Hacker News - Newest:
Hacker News - Newest: "LLM"
G
Google Developers Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Last Watchdog
The Last Watchdog
The Register - Security
The Register - Security
腾讯CDC
N
News and Events Feed by Topic
C
Check Point Blog
爱范儿
爱范儿
T
Tailwind CSS Blog
Webroot Blog
Webroot Blog
P
Proofpoint News Feed
S
Schneier on Security
MyScale Blog
MyScale Blog
N
News | PayPal Newsroom
Recorded Future
Recorded Future
T
Tenable Blog
I
InfoQ
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Microsoft Security Blog
Microsoft Security Blog
Simon Willison's Weblog
Simon Willison's Weblog
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: Programming Philosophy and Language Design Insights
2020-08-14 · via Stonecharioteer on Tech

Today I discovered profound insights into programming philosophy and language design through classic talks and writings that have shaped how we think about programming languages and software development.

Alan Perlis: Epigrams in Programming

Epigrams in Programming by Alan Perlis contains timeless wisdom about programming and computer science. These concise observations reveal deep truths about our craft:

Selected Perlis Epigrams

  • “A language that doesn’t affect the way you think about programming is not worth knowing.”
  • “Simplicity does not precede complexity, but follows it.”
  • “It is easier to write an incorrect program than understand a correct one.”
  • “A programming language is low level when its programs require attention to the irrelevant.”
  • “When we understand the computer as a medium, we can design it accordingly.”

Programming Language Philosophy

The epigrams reveal fundamental principles about programming languages:

 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
47
48
# Illustration of Perlis's insights through code examples

# "A language that doesn't affect the way you think about programming..."
# Compare imperative vs functional approaches:

# Imperative thinking - focus on HOW
def sum_squares_imperative(numbers):
    total = 0
    for num in numbers:
        square = num * num
        total += square
    return total

# Functional thinking - focus on WHAT
def sum_squares_functional(numbers):
    return sum(num * num for num in numbers)

# The functional approach changes how we think about the problem
# - Composition over mutation
# - Expressions over statements
# - Transformation over iteration

# "Simplicity does not precede complexity, but follows it"
# This elegant recursive solution emerged after understanding complex iteration:
def fibonacci_simple(n, memo={}):
    if n in memo:
        return memo[n]
    if n <= 2:
        return 1
    memo[n] = fibonacci_simple(n-1, memo) + fibonacci_simple(n-2, memo)
    return memo[n]

# "It is easier to write an incorrect program than understand a correct one"
# This correct but subtle algorithm requires deep understanding:
def binary_search(arr, target):
    left, right = 0, len(arr) - 1

    while left <= right:  # Note: <= not <
        mid = left + (right - left) // 2  # Avoids overflow

        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            left = mid + 1
        else:
            right = mid - 1

    return -1

Perlis's Influence on Modern Programming

Alan Perlis was the first recipient of the Turing Award (1966) and his epigrams continue to influence programming language design and software engineering philosophy. His observations about abstraction, complexity, and language design remain relevant in modern programming contexts.

Guy Steele: Growing a Language

Growing a Language by Guy Steele presents a masterful talk on language design philosophy, delivered using only words that can be defined using previously introduced concepts.

Language Growth Principles

Steele’s key insights about programming language evolution:

Steele's Language Design Principles

Small Core + Extensibility:

  • Start with a minimal, well-designed core
  • Provide powerful mechanisms for extension
  • Let the community grow the language organically

Pattern Recognition:

  • Identify common patterns in user code
  • Elevate useful patterns to language constructs
  • Maintain backward compatibility during evolution

User-Driven Design:

  • Languages should grow from user needs, not designer preferences
  • Successful features emerge from actual usage patterns
  • Community feedback drives language evolution
 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
47
48
// Steele's philosophy illustrated through Java's evolution
// Java started small but grew through community needs

// Early Java (1.0) - basic object orientation
public class Stack {
    private Object[] elements;
    private int size = 0;

    public void push(Object e) {
        ensureCapacity();
        elements[size++] = e;
    }

    public Object pop() {
        if (size == 0) return null;
        return elements[--size];
    }
}

// Java 5 - Generics added based on user demand for type safety
public class Stack<E> {
    private E[] elements;
    private int size = 0;

    @SuppressWarnings("unchecked")
    public Stack() {
        elements = (E[]) new Object[10];
    }

    public void push(E e) {
        ensureCapacity();
        elements[size++] = e;
    }

    public E pop() {
        if (size == 0) return null;
        return elements[--size];
    }
}

// Modern Java - Var keyword, lambda expressions, streams
var numbers = List.of(1, 2, 3, 4, 5);
var evenSquares = numbers.stream()
    .filter(n -> n % 2 == 0)
    .map(n -> n * n)
    .collect(toList());

// Each addition addressed real user pain points while maintaining compatibility

The Constraint-Based Approach

Steele’s talk demonstrates constraint-based communication - expressing complex ideas using only simple, previously defined concepts:

 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
# Demonstration of growing complexity from simple components
# Like Steele's talk, we can build complex programs from simple parts

# Simple building blocks
def compose(f, g):
    """Combine two functions into one"""
    return lambda x: f(g(x))

def partial(func, *args):
    """Create new function with some arguments pre-filled"""
    return lambda *remaining: func(*args, *remaining)

def pipe(*functions):
    """Chain functions together"""
    from functools import reduce
    return reduce(compose, functions)

# Growing complexity through composition
add_one = lambda x: x + 1
multiply_by_two = lambda x: x * 2
square = lambda x: x * x

# Simple transformations
transform1 = compose(square, add_one)  # (x + 1)²

# More complex pipeline
complex_transform = pipe(
    add_one,
    multiply_by_two,
    square,
    partial(max, 10)  # Ensure minimum value of 10
)

# The power comes from combining simple, well-understood parts
data = [1, 2, 3, 4, 5]
result = [complex_transform(x) for x in data]
print(result)  # [16, 36, 100, 100, 121]

Clojure: Language Design in Practice

Every Clojure Talk Ever - Alex Engelberg and Derek Slager humorously but accurately captures common themes in Clojure presentations, highlighting the language’s design philosophy:

 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
;; Clojure embodies Steele's "growing a language" philosophy

;; Simple data structures as the foundation
(def user {:name "Alice" :age 30 :email "[email protected]"})

;; Functions that work on data
(defn adult? [person]
  (>= (:age person) 18))

(defn format-user [person]
  (str (:name person) " <" (:email person) ">"))

;; Composition and transformation
(->> users
     (filter adult?)
     (map format-user)
     (take 10)
     (into []))

;; The language grew organically:
;; - Core data structures (maps, vectors, sets)
;; - Sequence abstraction
;; - Transducers (added later based on usage patterns)
;; - Spec (validation and generative testing)
;; - Each addition addressed real community needs

Clojure Design Patterns

Common Clojure Patterns:

  • Data-first design - Prefer plain data structures over objects
  • Pure functions - Functions without side effects enable reasoning
  • Composition - Build complex behavior from simple functions
  • Immutability - Immutable data structures prevent many bugs
  • REPL-driven development - Interactive development cycle

Developer Growth and Roadmaps

Developer Roadmap provides structured learning paths for different technology domains:

Modern Development Learning Paths

The roadmaps emphasize growing complexity systematically:

Frontend Developer Progression

Foundation:

  • HTML/CSS fundamentals
  • JavaScript core concepts
  • Version control (Git)

Intermediate:

  • Modern JavaScript (ES6+)
  • CSS preprocessors and frameworks
  • Package managers and build tools

Advanced:

  • Frontend frameworks (React, Vue, Angular)
  • State management patterns
  • Performance optimization
  • Testing strategies

Expert:

  • Micro-frontends architecture
  • Server-side rendering
  • Progressive Web Apps
  • Accessibility and internationalization
 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
47
48
49
50
// Example of growing JavaScript complexity following roadmap progression

// 1. Foundation - Basic JavaScript
function calculateTotal(items) {
  let total = 0;
  for (let i = 0; i < items.length; i++) {
    total += items[i].price;
  }
  return total;
}

// 2. Intermediate - Modern JavaScript features
const calculateTotal = (items) =>
  items.reduce((total, item) => total + item.price, 0);

// 3. Advanced - Framework integration (React example)
import React, { useMemo } from "react";

const ShoppingCart = ({ items }) => {
  const total = useMemo(
    () => items.reduce((sum, item) => sum + item.price, 0),
    [items],
  );

  return (
    <div>
      <h2>Total: ${total.toFixed(2)}</h2>
      {items.map((item) => (
        <CartItem key={item.id} item={item} />
      ))}
    </div>
  );
};

// 4. Expert - Performance optimization with virtualization
import { FixedSizeList as List } from "react-window";

const VirtualizedCart = ({ items }) => {
  const Row = ({ index, style }) => (
    <div style={style}>
      <CartItem item={items[index]} />
    </div>
  );

  return (
    <List height={600} itemCount={items.length} itemSize={80}>
      {Row}
    </List>
  );
};

Language Design Principles

From these classic works, several key principles emerge:

Timeless Language Design Wisdom

  1. Start Simple: Begin with a minimal, well-understood core
  2. Enable Growth: Provide mechanisms for organic extension
  3. Listen to Users: Language evolution should be driven by real needs
  4. Maintain Consistency: New features should feel like natural extensions
  5. Embrace Constraints: Limitations can lead to more creative solutions
  6. Think Long-term: Consider how decisions will affect future growth

The Evolution Mindset

Both Perlis and Steele emphasize that programming languages and our understanding of programming itself are constantly evolving:

  • Languages shape thought - The tools we use influence how we approach problems
  • Simplicity is earned - True simplicity comes from understanding complexity
  • Growth requires planning - Successful languages are designed for extension
  • Community matters - Language evolution is a social process

Practical Applications

These philosophical insights have practical implications for everyday programming:

 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
# Apply language design principles to API design

# Bad API - doesn't grow well
class UserManager:
    def create_user_with_email(self, name, email):
        pass

    def create_user_with_phone(self, name, phone):
        pass

    def create_user_with_email_and_phone(self, name, email, phone):
        pass

# Good API - designed for growth
class User:
    def __init__(self, name, **contact_methods):
        self.name = name
        self.contacts = contact_methods

    def add_contact(self, method, value):
        self.contacts[method] = value

    def remove_contact(self, method):
        return self.contacts.pop(method, None)

# This approach follows Steele's principles:
# - Simple core (User with name)
# - Extensible mechanism (contact_methods dict)
# - Growth without breaking changes (new contact types)

This exploration of programming philosophy demonstrates that the fundamental questions about language design, complexity, and growth remain as relevant today as they were decades ago. The wisdom of Perlis and Steele continues to guide how we think about creating tools that enhance human thinking and problem-solving.


These insights from programming pioneers remind us that good software design is not just about solving immediate problems, but about creating systems that can grow and evolve with changing needs while maintaining their essential character and usability.