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

推荐订阅源

N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Threat Research - Cisco Blogs
Cloudbric
Cloudbric
Recent Commits to openclaw:main
Recent Commits to openclaw:main
I
Intezer
Attack and Defense Labs
Attack and Defense Labs
P
Privacy International News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
Lohrmann on Cybersecurity
C
Cybersecurity and Infrastructure Security Agency CISA
V2EX - 技术
V2EX - 技术
AWS News Blog
AWS News Blog
O
OpenAI News
L
LINUX DO - 最新话题
N
News | PayPal Newsroom
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
A
Arctic Wolf
Spread Privacy
Spread Privacy
G
GRAHAM CLULEY
T
Tor Project blog
博客园_首页
Know Your Adversary
Know Your Adversary
有赞技术团队
有赞技术团队
S
Secure Thoughts
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
T
Tailwind CSS Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
V
Visual Studio Blog
J
Java Code Geeks
Cisco Talos Blog
Cisco Talos Blog
Schneier on Security
Schneier on Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security Affairs
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
雷峰网
雷峰网
宝玉的分享
宝玉的分享
量子位
Last Week in AI
Last Week in AI
月光博客
月光博客
罗磊的独立博客
S
SegmentFault 最新的问题

Jonathan Fine

Towards 21st Century Digital Typography Lighter TeX Runs Faster Render Latex Multiple Ways A Blind Math User Story A Visually Impaired Coder's User Story Accessible and Tagged PDF User Stories and Accessibility New Online Tools for TeX Beginners Tex Hour Agenda Blind Math News Accessibility Evaluation: Open University and RNIB Accessibility Tools Latex math on social media Multi Author Docs Blind Math News New Year's and Christmas Fun Tex Office Hours Importance of Typography UK TeX users — from here to there Calling UK LaTeX editors etc LaTeX Tutor Sub and Sup A LaTeX Typing Tutor About the LaTeX Typing Tutor London Scholarly Tech Meetup UK TeX User Group survives Jonathan Fine's statement for Chair of UK TUG Some new 2019 Q3 ac.uk LaTeX pages UK TUG — more news soon Why 2358? Why did I choose Hugo? Linear homology in a nutshell: now on arxiv Contact
Happy Birthday Don Knuth
2021-01-10 · via Jonathan Fine

Happy Birthday

Don Knuth, author of The Art Of Computer Programming and creator of the TeX typesetting system is 83 today. Happy Birthday Don. Thank you for TeX and everything else.

You're warmly invited to join me online to celebrate Don's life and work. The virtual party is on Thursday 14 January, 6:30 to 7:30pm UK time. Here's the zoom details

TeX Office Hour

During the lockdown I'm holding a TeX Office Hour every Thursday evening, from 6:30 to 7:30pm UK time. All are welcome, particularly TeX beginners. Experts are also welcome. And for celebrating Don, any friend or fan of Don is welcome.

This celebration for Don Knuth is just one event in this series of TeX Office Hours. We all benefit when we share experience and understand each other better. Sometimes beginners ask the best questions, provide the best examples and problems.

The rest of this post celebrates a paper Don wrote in 1974. It's a bit technical. If you get to the end, I hope it's worth it for you.

Don Knuth and goto's

In 1974 Don wrote a major survey paper Structured Programming with goto statements. I'm going to share with you something from this paper. What I'm about to say might be unfamiliar, so bear with me while I make a gentle start.

Background

The goto is a powerful and easily abused program control flow statement. That said, there are cases where a goto statement can improve both performance and readability. (And by the way the switchcase statement in C is a sort of goto.)

I'll now pivot by suggesting that carefully chosen new program control flow statements can give the benefits of goto without the cost. For example, as in switch.

Merging binary trees

Don likes examples and problems. Here's one from his 1974 paper. Consider the problem of merging two sorted binary trees into one ordered sequence. Don wrote

A conceptually simple solution to this problem can be written with coroutines, or by forming an equivalent program that expresses the coroutine linkage in terms of goto statements.

He goes on to write:

It appears to be cumbersome (though not impossible) to do the job without using either feature [ie goto or coroutine].

By the way, Don gained this insight about coroutines as control structures from Christopher Strachey.

Async in Python

I've read Don's 1974 paper several times. I reread it again last year, because of a discussion about ifelse on Python ideas. And suddenly I saw something I hadn't noticed before.

Python 3.4 introduced a new keywords async and await, which enabled a module that provided asynchronous I/O. Because I saw these keywords in a module I wanted to use, and because I knew that async I/O is a good idea (for high performance web servers), I wanted to understand what was going on.

And Python core developer Brett Cannon wrote this blog post that told me that new ideas were needed.

What really surprised me was that the new idea that really helped me understand what async and await in Don's 1974 paper. You see, it's all about coroutines. I could read the definition of coroutine, but I did have good examples. I couldn't see how it was useful.

Conclusion

Don's 1974 paper told me, in so many ways, was the coroutines were a systematic way of solving certain problems that otherwise would benefit from the use of the goto statement. And it gave me an explicit example that I could actually understand, namely the merging of sorted binary trees.

Finally, a suggestion. If you don't understand something, try to find a simple example. And at the beginning, the simpler the better (as long as it shows something).