News for hackers. Stuff that matters.
Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by acqq on Monday January 12, 2015 @03:06PM (#8876098)
"Clojure implementation was of course far slower than TeX."

I think that sentence is the most important one in the article. I'd like to know how much, "far slower" sounds like some order of magnitude.

Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by dj-wonk on Monday January 12, 2015 @06:54PM (#8877276)
Many of us, sometimes for good reasons, have a habit of thinking performance is the most important thing. However, in this case, focusing on that one sentence overlooks the spirit in which the talk was given: to educate.

There is some key context that you might not get from the InfoQ article. Glenn's talk, as presented at ClojureConj, emphasized the educational benefits of comparing the original procedural style with an adapted functional style.

Another message that came across is that we've lost a historical appreciation of our tools. It is very easy to frown upon the techniques that TeX used. In context, many of them were reasonable (if not state-of-the-art) given the constraints of the time.

It seems to me that it would be quite challenging to dig in and unpack the original intention of TeX and translate it to a modern functional language. I tend to believe that a Clojure version could be made almost as fast, if not faster, given more effort, without destroying understandability.

Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by zokier on Monday January 12, 2015 @03:47PM (#8876316)
I found that bit slightly disappointing, and almost dismissive against the PL/compiler/optimization research done in the past 30 years or so. I don't believe that a modern clean rewrite would inherently need to be "far slower" than the original.
Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by acqq on Monday January 12, 2015 @03:59PM (#8876382)
It seems though that nobody improved the results of even short programs presented here:

http://benchmarksgame.alioth.debian.org/u32/compare.php?lang...

The slowdown of most of these is 2 to 9 times, only one is comparable to C.

And I can imagine the difference when reimplementing the Knuth's code to be even bigger. For what Knuth did as early as in 1960 see here:

http://ed-thelen.org/comp-hist/B5000-AlgolRWaychoff.html#7

He wrote the whole ALGOL compiler in 1960 alone. During the first week (!) he first wrote the assembler. As written by one of the guys who developed another compiler, the Fortran one:

"Our compilers were both punched or cards and were the same size. We had written ours in STAR 0, the only assembler that Burroughs supported on the 205. It had been Dick Berman's first programming project. Our compiler took one hour and 45 minutes to assemble. The first week of don's project he spent in writing his own assembler. He could assemble his compiler in 45 minutes. We were green with envy. I am sure that don used only half the computer time that Lloyd and I used."

Btw they had no terminals there then, and all shared one computer:

"Our compilers were both punched on cards"

"There was only one 205 at the Pasadena Plant. It was primarily used to run the payroll. Lloyd and I were given top priority on the machine since real money was going to be given to Burroughs as soon as we successfully finished our compiler. Payroll had second priority and don was third."

TeX was written by Knuth between 1978 and 1989, working on it for ten years and starting almost twenty years after his 1960 feat.

Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by DennisP on Monday January 12, 2015 @04:07PM (#8876414)
Compared to something extensively hand-optimized by Donald Knuth, it doesn't seem that surprising, especially considering Vanderburg went with better abstractions in preference to optimization.
Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by taeric on Monday January 12, 2015 @04:38PM (#8876578)
I find it hard to consider the abstractions "better" when they are so far behind the performance of the ones that were used. Higher level? Certainly. Better?
Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by dj-wonk on Monday January 12, 2015 @06:56PM (#8877281)
Glenn's goals are clearly tilted towards education and intelligibility. So yes, the abstractions are better by his definition.
Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by taeric on Monday January 12, 2015 @07:07PM (#8877325)
I still reject that they are better, and more that education should strive for better results. That is, if you define them as better with no argument allowed, then they are of course better. However, if you were to objectively compare them... I am unsure why they would be awarded the success. Again, higher level and/or easier to understand? Sure. Better?? By what metric?

This would be akin to declaiming that Newtonian physics is "better" than quantam, because it is easier to understand.

Also consider that TeX is still one of the more widely read source programs in existance. And there have been frighteningly few bugs. There are undoubtedly more bugs in this rewrite with "better" abstractions than there are in what is being rewritten. So it loses stability. It is slower. So it loses speed.

What, exactly, is it truly better at?

As indicated in another post, I am unsure that this really succeeded at the pedagogical goals that were intended. If anything, it almost shines as an example of how we have gone awry in teaching developers.

Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by dj-wonk on Monday January 12, 2015 @08:56PM (#8877688)
I found his emphasis on history to be unusual and refreshing, but we don't certainly don't need to agree on someone else's goals for their project.

That said, I personally don't see a lot of value in being too critical of projects with different goals. (That feels a little bit like back-seat driving where you have a different destination in mind than the person behind the wheel.) If someone has the motivation and creativity to embark on a project, good for them.

If you or someone else wants to port TeX with different goals, that's also fine.

In any case, until Glenn's source code is available, neither one of us can say very much about the code he has written.

Re:Reimplementing TeX's Algorithms: Looking Back at Thirty Y... by taeric on Tuesday January 13, 2015 @10:55AM (#8880574)
Oh, I am not against the excercise. I would even go so far as to applaud the work. What I do not care for, is essentially sloppy science in how we declare successes.

I mean, this is essentially back-seat driving Knuth, of all people.

And... TeX has been widely ported as is. I am in the crowd that is somewhat unconvinced it needs a rewrite.