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

推荐订阅源

S
Schneier on Security
博客园_首页
量子位
博客园 - 司徒正美
S
SegmentFault 最新的问题
J
Java Code Geeks
小众软件
小众软件
博客园 - 【当耐特】
The Register - Security
The Register - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
博客园 - Franky
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
Cyberwarzone
Cyberwarzone
腾讯CDC
Apple Machine Learning Research
Apple Machine Learning Research
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Hacker News
The Hacker News
aimingoo的专栏
aimingoo的专栏
V
Vulnerabilities – Threatpost
P
Palo Alto Networks Blog
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
F
Full Disclosure
D
DataBreaches.Net
Martin Fowler
Martin Fowler
Cisco Talos Blog
Cisco Talos Blog
L
LINUX DO - 最新话题
云风的 BLOG
云风的 BLOG
C
Check Point Blog
T
Threatpost
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
W
WeLiveSecurity
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
Lohrmann on Cybersecurity
Last Week in AI
Last Week in AI
T
Tor Project blog
T
Troy Hunt's Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Security Affairs
SecWiki News
SecWiki News

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).