[HN Gopher] tex.web - Version 3.141592653
___________________________________________________________________
tex.web - Version 3.141592653
Author : susam
Score : 46 points
Date : 2021-11-12 17:57 UTC (5 hours ago)
(HTM) web link (ctan.math.utah.edu)
(TXT) w3m dump (ctan.math.utah.edu)
| jpfr wrote:
| Notice that the TeX you have installed locally is many conversion
| steps removed from the WEB source.
|
| Pascal code is extracted from the WEB. Then the Pascal is
| translated into C. Afterwards, years of development have
| accumulated on that C source to handle utf-8, modern fonts, PDF
| output, etc.
|
| Most work nowadays happens on top of LuaTeX that replaces and
| extends pdfTeX.
|
| There are shockingly few people maintaining that core of the TeX
| environment.
|
| The source control is mirrored here: https://github.com/TeX-
| Live/luatex/tree/experimental
| smnrchrds wrote:
| Are LuaTeX and pdfTeX forks? Or are they programs built on top
| of TeX itself? Will the changes in this new version make their
| way to the engines we use?
| jfk13 wrote:
| pdfTeX was an extension to TeX (as was XeTeX), for a long
| time maintained as a collection of change-files applied to
| the canonical TeX source, although nowadays they're managed
| as separate WEB files.
|
| LuaTeX was in turn an extension of pdfTeX, but I think at
| this point it would be better described as a fork rather than
| an extension. (Though it's not clear to me exactly how to
| distinguish these concepts.)
|
| Anyhow, I believe the 3.141592653 updates have already been
| ported to all these engines.
| svat wrote:
| Minor correction: C code is extracted directly from the WEB.
| (web2c doesn't use `tangle`, the program that converts WEB to
| Pascal.) (Unless there's something I've missed...)
| jfk13 wrote:
| Actually, the Web2C build process normally used these days
| (e.g. in TeX Live) does first run tangle, to convert the WEB
| source to Pascal. Then the web2c tool (along with a few
| helpers) translates that Pascal to C.
| hardwaregeek wrote:
| It's wild to me that we're still using a program written in a
| custom programming language that is in turn implemented in
| Pascal. It does speak to Knuth's programming ability that tex has
| lasted so long with so few bugs. That said, I would love to have
| a successor at some point with a little more usability and a
| little better interoperability.
| NelsonMinar wrote:
| The responses here think you are talking about the TeX
| programming language. But you're talking about Web, which
| dating to 1987 long predates the WWW. The key feature of it is
| "literate programming", the idea that you'd write an essay
| interspersed with the working code. It's not an idea that
| caught on.
|
| https://en.wikipedia.org/wiki/Web_(programming_system)
| todd8 wrote:
| In the 80's I was intrigued by literate programming. I
| studied Knuth's literate source code for TeX carefully.
|
| You're right, it never caught on, but a few years ago I read
| a statement by Knuth that said he still writes code that way.
| Today, about half of the time my Emacs configuration is
| written in org-mode babel[1] which supports literate
| programming. In fact, this a common example of literate
| programming that I see on the internet along with Jupyter
| Python[2] notebooks widely used by scientists.
|
| Although literate programming seems to work okay for Emacs
| configurations (often reaching over a thousand lines of
| code), I've never felt like the approach helped me enough to
| employ in other programs.
|
| [1] https://orgmode.org/worg/org-contrib/babel/intro.html
|
| [2] https://jupyter.org
| plafl wrote:
| It requires a lot of skill to write TeX, but the key is
| declaring it feature frozen for almost 40 years. I like Knuth's
| approach to open source: "Here is the code, I wrote it because
| I needed it, I hope you find it useful. Now, if you don't mind
| I have things to do. I no longer use email but I read snail
| mail every six months"
| jhoechtl wrote:
| The successor is there: Sile
|
| https://sile-typesetter.org
| jfk13 wrote:
| While SILE is an interesting project, it's some way from
| being ready to be "the successor to TeX".
| smitty1e wrote:
| TeX is like the Latin language. Its esoteric nature keeps out
| the riff-raff.
| hoten wrote:
| Copying the introduction text:
|
| @* \\[1] Introduction. This is \TeX, a document compiler intended
| to produce typesetting of high quality. The \PASCAL\ program that
| follows is the definition of \TeX82, a standard
| @:PASCAL}{\PASCAL@> @!@:TeX82}{\TeX82@> version of \TeX\ that is
| designed to be highly portable so that identical output will be
| obtainable on a great variety of computers.
|
| The main purpose of the following program is to explain the
| algorithms of \TeX\ as clearly as possible. As a result, the
| program will not necessarily be very efficient when a particular
| \PASCAL\ compiler has translated it into a particular machine
| language. However, the program has been written so that it can be
| tuned to run efficiently in a wide variety of operating
| environments by making comparatively few changes. Such
| flexibility is possible because the documentation that follows is
| written in the \\.{WEB} language, which is at a higher level than
| \PASCAL; the preprocessing step that converts \\.{WEB} to
| \PASCAL\ is able to introduce most of the necessary refinements.
| Semi-automatic translation to other languages is also feasible,
| because the program below does not make extensive use of features
| that are peculiar to \PASCAL.
| [deleted]
| cxr wrote:
| I've been thinking a lot about literate programming, and I'm
| positive that Knuth-style LP's worst enemy is TeX. Realistically,
| an LP system is going to need to prioritize the reading
| experience of the input format itself, not just the output format
| after running it through a typesetting system (no matter how
| powerful the typesetting system might be). Consider Gruber on
| Markdown, and this 2014 blog post about (what became) CommonMark:
|
| > A Markdown-formatted document should be publishable as-is, as
| plain text, without looking like it's been marked up with tags or
| formatting instructions (Gruber)[...] forks of Markdown, such as
| GitHub Flavored Markdown and MultiMarkdown extend standard
| Markdown in various ways, and are targeted for their particular
| use cases. GitHub's implementation for code blocks, for example,
| looks like something a group of programmers would want to have;
| it looks more like code than text
| <http://shindoisshin.net/blog/2014/9/6/standard-markdown-cont...>
|
| Consider this file. Those who are expected to interact with it in
| this form includes Knuth and his collaborators--the few who have
| sent in corrections--and nobody else. You aren't expected to read
| a literate program like this. In an ideal world, where we had
| computing better figured out, Knuth wouldn't interact with it
| like this, either.
|
| The second thing to address would be the use of "static" target
| languages like C and Pascal. A literate programming work should
| aim to be more like the experience of programming by configuring
| program entities (I hesitate to say "objects")--like Self, except
| powered by the written word. Among the negative ways to react to
| the last remark would be to say, "'Self, except powered by the
| written word'? So pretty much the opposite of Self, then.
| Basically, what we already have." But this is too superficial.
| Consider Jef Raskin on "the woes of IDEs":
| <https://queue.acm.org/detail.cfm?id=864034>
| svat wrote:
| I actually agree with your main point -- in fact I would go
| further and say that in an ideal LP system, the (or at least
| _a_ ) source format would just simply be valid files in the
| target language, with any LP-related markup or whatever in the
| comments. The reason is so that LP programs can get
| contributions from "mainstream" programmers. (It's ok if the LP
| users have an alternative format they can write in, as long as
| edits to the source file can be incorporated back.)
|
| So the following correction is not intended as disagreement but
| simply to share some history / facts:
|
| > _Consider this file. Those who are expected to interact with
| it in this form [...] You aren 't expected to read a literate
| program like this. In an ideal world, where we had computing
| better figured out, Knuth wouldn't interact with it like this,
| either._
|
| Actually, even in the world we live in, _no one_ is expected to
| read a literate program like this (Knuth has comments to that
| effect somewhere), and everyone is "supposed" to read the
| typeset program (today that would be tex.pdf or whatever).
| Knuth reads it off the printed book. He navigates the program
| using the indexes in the book, and as recently as this year he
| raved about how good his system was
| (https://tug.org/TUGboat/tb42-1/tb130knuth-tuneup21.pdf):
|
| > _While I was preparing this round of updates, I was overjoyed
| to see how well the philosophy of literate programming has
| facilitated everything. This multifaceted program was written
| 40 years ago, yet I could still get back into TeX's darkest
| corners without trouble, just by rereading [B] and using its
| index and mini-indexes! I can't help but ascribe most of TeX's
| success to the fact that it has enabled literate programming._
|
| This works for him, because he started programming in the days
| when program "listings"--printouts of source code--were the
| most common way to read programs, and it's also how he wrote
| TeX (https://news.ycombinator.com/item?id=10172924: _"Knuth
| wrote the entirety of the first version of TeX on yellow legal
| note pads, and then typed it all in, and then started
| debugging"_ -- he worked full-time on the program, writing it
| with pencil on paper, over several _months_ , before typing a
| single word of it into a computer). And of course, he's a
| professional book-reader and book-writer (and book-tweaker, as
| his books keep getting newer editions and updates), so it comes
| naturally to him.
| JasonFruit wrote:
| I'm with you up to that last paragraph, and wonder if I would
| agree with you more there if you explained what you mean by
| "powered by the written word."
| plafl wrote:
| I think the main problem with LP is philosophical: it is used
| so you can deeply understand the whole program but most people
| want to understand a part and ignore the rest. So for example
| extracting how Tex renders math equations is almost impossible
| without understanding the whole (some people kindly did this
| and published a paper using SML). This actually is related to
| your comment because it's impossible to "navigate" or to
| "debug" the code, or at least I'm unaware of how could it be
| done in a simple way (that is, with existing tooling) and so if
| you want to learn how Tex is written you must proceed page by
| page of "TeX: The Program" instead of randomly jumping through
| code, hacking here and there. It's like learning mathematics
| axiom by axiom. I personally find it unproductive as learning
| for me is highly non sequential. If knowledge is a graph of
| concepts I want to explore as I wish, not following another's
| predefined serialization.
| JasonFruit wrote:
| I've found literate programming helps in one main situation:
| where I am writing and want to force myself to very
| thoroughly think through a difficult and self-contained
| section of code that has to be understood as a whole. In that
| case, the narrative format makes me much less likely to
| overlook edge cases, and I find it easier to go back in and
| make changes later on. I wouldn't ever write a larger system
| in that way, but on that scale it's like working with a
| metronome in music: it's a form of discipline that produces
| almost magical results.
| e12e wrote:
| I think one "unfortunate" side effect of literate programming
| with a "stupid" procedual language like C, Pascal or even Java
| - is that your lp system tends toward becoming your macro
| system.
|
| It does allow straightforward, short procedual/structured
| programs to become very readable and easily understandable -
| but for bigger "piles of code" - it's probably not that good a
| fit in practice.
|
| I guess https://github.com/daly/axiom is both an argument for
| this being true (I seem to recall there was an effort to get
| away from lp) - and against (proof of existence: it's a big
| system, it's old, it seems to not be dead).
|
| Then there's the other thing - I don't recall who's quote it is
| - but it is along the lines of: "There are few good
| programmers, there are few good writers of prose/technical
| documentation - therefore the subset of people that are both
| great programmers and great writers are tiny - and that is the
| subset for whom literate programming is a great fit".
|
| I do think there's a middle ground though, and "notebooks" for
| "executable, repeatable" research papers is one such middle
| ground (or: to write a great cs paper your team need to have
| both skills anyway).
|
| But there are certainly great programmers that can't write
| documentation on how to escape a wet paper bag.
| dunham wrote:
| I had this sitting in my dropbox a few years ago, and Dropbox
| decided (from the extension) that it was now a special file that
| I wasn't allowed to delete or move.
| owenmarshall wrote:
| % A reward of $327.68 will be paid to the first finder of any
| remaining bug.
|
| 2^15, for those playing along at home.
| asdjfhasdhf wrote:
| why pi version?
| owenmarshall wrote:
| One sad day in the future it will cease to merely approach pi
| and instead become pi.
| grzm wrote:
| > Since version 3, TeX has used an idiosyncratic version
| numbering system, where updates have been indicated by adding
| an extra digit at the end of the decimal, so that the version
| number asymptotically approaches p. This is a reflection of the
| fact that TeX is now very stable, and only minor updates are
| anticipated.
|
| https://en.wikipedia.org/wiki/TeX#TeX82
| ilaksh wrote:
| If anyone is like me and doesn't use these programs and couldn't
| figure out what to do with it on Ubuntu:
|
| https://www.docdroid.net/9OBjfK8/tex-pdf sudo
| apt install texlive # maybe download other files from
| that dir weave tex.web dvipdfm tex.dvi
| # output is tex.pdf
| dhosek wrote:
| In September 1990 when tex.web 3.1 and mf.web 2.7 were released
| there was great confusion in the TeX world. Had DEK made a typo
| when he updated the version numbers of the files? It was sometime
| between that release and the next in March 1991 when he revealed
| the plan for the version numbers to converge to p and _e_.
|
| The bugs that have been found in the past couple decades have
| been rather esoteric. The one that was most likely to actually
| occur in real use was raised if someone responded e (edit the
| source at the error location) when no file had occurred (I think
| it had to happen on the first line of input as well). Most
| related to extreme edge cases that would be difficult or
| impossible to raise in a production TeX system.
| svat wrote:
| I made some attempts a few years ago to read this program in its
| entirety. I managed only the faintest glimpse and had grand plans
| of making it easier. I wrote down some of it:
| https://shreevatsa.net/tex/program
|
| (Actually, a while after that I got more used to the style and I
| can now mostly read the program without the difficulties that
| used to bother me earlier, and I haven't gone back and updated
| the page. But I think chronicling my early difficulties arising
| was useful, as I suspect other new people may face them too: and
| I wouldn't be able to do it now: the "curse of knowledge".)
|
| More recently, I tried to connect some people who may be
| interested in making this program more readable, converting it
| into other languages/formats, etc:
| https://github.com/shreevatsa/webWEB -- please join if you're
| interested or can help or have already done something along these
| lines.
___________________________________________________________________
(page generated 2021-11-12 23:01 UTC)