Glenn Vanderburg - Cló: The Algorithms of TeX in Clojure

9K views · 11 years ago · talk · expert · evergreen

Glenn Vanderburg reimplements the algorithms of Donald Knuth's TeX in Clojure and uses the exercise to look back on thirty years of programming. He compares the original code with a modern functional version and talks about what has and hasn't changed.

HN people recommend it for what it shows of the pains Knuth took in writing TeX and for its perspective on how far programming has come.

“you are shown the pains Don Knuth took to avoid subroutines calls”

4 comments from Hacker News

e
@escot2021 · in “Rewriting the Algorithms of TeX in Clojure (2015)”
Submitted the video to Hacker News.
RecommendsView on HN
t
@tosh2016 · in “The Algorithms of TeX in Clojure”
Submitted the video to Hacker News.
RecommendsView on HN
g
@gavinpc2014 · in “Ramda – A practical functional library for Javascript”
TL;DR, stack frame all the things. I'm joking (kind of), but I was reminded of this talk about implementing TeX in Clojure [0], in which you are shown the pains Don Knuth took to avoid subroutines calls, ostensibly for performance reasons—such heavy macro usage, for example, that the speaker calls the language a "dialect" of Pascal. Now we have the maxim about programmer cycles versus machine cycles, which is itself getting a little dated because of scale. Anyway, fun times to be in this field. You might also like the "It's 1982 and I can't believe we're still..." part of the talk, (a.k.a. "Everything's amazing and nobody's happy") for putting things into perspective. [0] ▶ this video EDIT Time is on their side though... with tail-call optimization coming to ES6 (just about the only "good part," according to Crockford).
RecommendsView on HN
d
@dj-wonk2015 · in “Reimplementing TeX's Algorithms: Looking Back at Thirty Years of Programming”
Perhaps Glenn has different goals than you might expect? The video goes into this better than the InfoQ article. In short, I think Glenn embraced the differences and challenges of adapting TeX in Clojure from an educational perspective. I don't think he intended to port it quickly or verbatim. Glenn wanted to head-to-head comparison to promote education. To explain, in Glenn's talk around 11:36 (▶ this video) he says: > While I'm glad that the source code of TeX is still available to study, I sure wouldn't point a new programmer toward it because we should not be doing programs today like we did then. > But what might be really valuable is to have a modern reimplementation written in a modern functional style to study alongside [the original TeX] to see how much has changed and to appreciate what he have and the value of improved tools and techniques and the tradeoffs that have been made. His slide on his educational goals can be seen at 12:06: > Illustrate what's changed > Demonstrate values of expressive code > Provide real examples of expressing procedural algorithms in functional style > Show how functional programs are easier to reason about > Show different styles of optimization
CitesView on HN