<div dir="ltr"><div dir="ltr">On Tue, 16 Jul 2019 at 18:32, Thomas Schneider via texhax <<a href="mailto:texhax@tug.org">texhax@tug.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> <a href="https://github.com/TeX-Live/texlive-source/blob/trunk/texk/web2c/tex.web#L11308]https://github.com/TeX-Live/texlive-source" rel="noreferrer" target="_blank">https://github.com/TeX-Live/texlive-source/blob/trunk/texk/web2c/tex.web#L11308]https://github.com/TeX-Live/texlive-source</a><br>
<br>
So that's the source of TeX!  Cool.  But it is a Pascal program - a<br>
language I use a lot for understanding the underlying theory of<br>
biology.  I have always wondered where the Pascal compiler is for TeX<br>
and whether I could use it for my programs.  The current status of<br>
Pascal is miserable.  I use a translator called p2c - which works but<br>
which happily translates anything to C and allows compilation of bad<br>
code which is then really hard to debug.  The Free Pascal Compiler<br>
doesn't have the original Pascal features and so I can't use it (yet),<br>
but at least it detects bad code.  Finally, the Gnu Pascal compiler is<br>
no longer functional on macOS with little chance of being fixed. <br>
Apparently it works on Linux.<br>
<br>
So if there is a compiler I could use that is the basis of TeX, that<br>
could be a more stable platform.<br>
<br>
Where is the TeX Pascal complier?  Is it being robustly maintained?<br></blockquote><div><br></div><div>There is no such thing as "the TeX Pascal compiler". When originally written, TeX was designed to work with a variety of Pascal compilers on a variety of systems, by making small "system-dependent" changes in "change files" and keeping the original tex.web unmodified. (Though of course it was written on a particular system with a particular Pascal compiler; what Knuth calls "Pascal-H" in a few places in the TeX program.)</div><div><br></div><div>Since then, most of the world compiles TeX via conversion to C with web2c. If you really want to compile with a somewhat recent Pascal compiler, you have a few options:</div><div><br></div><div>-  Wolf­gang Hel­big made a set of changes to allow it to be compiled with GNU Pascal; you can see it on CTAN as the package TeX-GPC: <a href="https://ctan.org/pkg/tex-gpc">https://ctan.org/pkg/tex-gpc</a></div><div><br></div><div>-  With GNU Pascal itself becoming somewhat hard to install; he again made a set of changes to allow it to be compiled with Free Pascal; you can see it on CTAN as the package TeX-FPC: <a href="https://ctan.org/pkg/tex-fpc">https://ctan.org/pkg/tex-fpc</a></div><div><br></div><div>- Another very recent option is Jim Fowler's Pascal-to-WebAssembly compiler, about which he wrote an article in the most recent TUGboat issue. It allows TeX to run in the browser (locally, i.e. without relying on a cloud service); you can find the source code at <a href="https://github.com/kisonecat/web2js">https://github.com/kisonecat/web2js</a> and you can find a demo at <a href="https://people.math.osu.edu/fowler.291/latex/">https://people.math.osu.edu/fowler.291/latex/</a> or <a href="http://tikzjax.com/">http://tikzjax.com/</a><br></div><div><br></div><div>Obviously none of these would have been well-tested as the binaries in major distributions like TeX Live or MikTeX, but I've tested basic functionality on a small test file with TeX-FPC and web2js and both seem to work.</div><div><br></div><div>Hope this helps,</div><div><br></div></div></div>