[TUHS] Why Pascal is Not My Favorite Programming Language - Unearthed!
toby at telegraphics.com.au
Sat Sep 2 05:07:54 AEST 2017
On 2017-09-01 12:22 PM, Dan Cross wrote:
> On Fri, Sep 1, 2017 at 10:43 AM, Toby Thain <toby at telegraphics.com.au
> <mailto:toby at telegraphics.com.au>> wrote:
> On 2017-08-31 10:38 PM, Dan Cross wrote:
> > While most of the
> > languages we use are Turing complete (I suppose that in the limit one
> > can write a Common Lisp implementation in C, for example), it is
> > unarguable that some languages make it *easier* to express some things
> > than other languages. In some cases this is deliberate: consider
> > languages with strong, static type systems versus dynamic but strongly
> > typed languages (or statically but weakly typed). Here the language
> > designers have intentionally made it hard to escape the tyranny of the
> > type system in order to prevent bugs.
> (Tyranny is not the word I would use. A more modern viewpoint would
> include topics like parametric polymorphism, typeclasses and so on.)
> The specific use of the word "tyranny" was meant to be tongue-in-cheek.
> Apologies if it did not come across.
> > Anyway, I wonder if Knuth would have produced the same TeX and METAFONT
> > had he started in Pascal; perhaps he would have, but maybe he would have
> > given up on some of the more ambitious parts of both because the
> > language made it much less convenient (not knowing SAIL, I'm
> It seems inconceivable to me that there are "ambitious parts" of TeX and
> METAFONT that Professor Knuth had to omit because he was using Pascal.
> But he wasn't using Pascal. The point was to wonder whether TeX and
I mean in the mid-80s rewrite, of course.
> METAFONT would be different programs if he were. Clem seemed to imply
> that he thought that was unlikely, based on his previous use of SAIL.
> I have not compared the codebases but wouldn't one expect that the final
> production TeX rewrite is *more* ambitious than the early SAIL version?
> (By the time I began using/porting TeX in the 1980s, the older version
> was completely obsolete.)
> I don't know, but that's besides the point: the question was more about
> how the initial programming language shaped the design of the program.
> Specifically, had Knuth *started* in Pascal instead of SAIL, would TeX
> have been different? To put it another way, to what extent was he
> constrained, freed, or otherwise influenced by his medium?
Maybe Professor Knuth himself has written about that, I'm not sure. A
great question for him, anyhow.
He's in an excellent position to contrast these 3 languages.
> > speculating). Perhaps having gone through the exercise of producing TeX
> > in SAIL gave him insight that inspired him to work around Pascal's
> > expressive limitations. Or perhaps the opposite is true.
> I honestly don't know what limitations you mean. If you mean "different
> style of expression," sure. (Maybe if SAIL had lexically scoped lambda
> closures, there'd be a difference worth talking about...)
> Formally speaking, Pascal is no more limited than any other
> Turing-complete language. But there's a difference between *formal*
> expressiveness and *informal* expressiveness. Some languages require
> proportionally more effort to produce the same program than others. I'm
> told that sed is Turing-complete; I'd sure hate to write TeX in it.
I'm well aware of that, which is why I specifically mentioned lexical
closures as (one of many) ideas with a powerful effect on expressiveness
More information about the TUHS