Glenn Vanderburg - Cló: The Algorithms of TeX in Clojure
Why Hacker News recommends it
HN recommends it for its insight into Knuth's TeX algorithms and what changes when they are rewritten functionally.
What it is
Glenn Vanderburg presents Cló, a Clojure library that reimplements TeX's core typesetting algorithms as composable functions. He shows what translating procedural, literate-programming code into functional form teaches.
Recommended by 1 HN commenters across 1 different months, 2014 to 2017.
What Hacker News said
Recommends gavinpc · 2014-11 · on “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 i
Cites dj-wonk · 2015-01 · on “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 f
Cites rhythmvs · 2017-02 · on “SILE Typesetting System”
SILE indeed looks great, promising to come on par with the typesetting quality we have come to expect since TeX: Knuth-Plass line breaking, Unicode and OpenType font features support, complete with contextual shaping, Cassowary constraint solver, parallel text, multiple apparati, foot and marginal notes, vertical typesetting… This is a typographer’s dream! But, like TeX and friends (LaTeX, ConTeXt, etc.), creating stylesheets and document templates still looks like a pain with SILE and alike. At least from the perspective of designers who have come to expect a strict separation of concerns between document structure/semantics and its styling, and who are used to work with a declarative style