3 ms·
"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 slo
by acqq 12y ago
"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.
- zokier 12y agoI 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.
- acqq 12y agoIt seems though that nobody improved the results of even short programs presented here: http://benchmarksgame.alioth.debian.org/u32/compare.php?lang=clojure&lang2=gcc 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 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.
- DennisP 12y agoCompared 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.
- taeric 12y agoI 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?
- dj-wonk 12y agoGlenn's goals are clearly tilted towards education and intelligibility. So yes, the abstractions are better by his definition.
- taeric 12y agoI 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.
- dj-wonk 12y agoI 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.
- dj-wonk 12y agoMany 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.