Don Knuth @ JKU

At the University of Technology Vienna many people were there and asked questions. This is the result of a lot of promotion done by the university. However, the session was actually part of Knuth’s attendance of the First Symposium on Structure in Hard Combinatorial Problems. This week he is at JKU (Johannes-Kepler-University in Linz) and meets the team of Armin Biere, the expert on SAT and SMT-solving in Austria (please remember that TAOCP Volume 4B is about satisfiability). And because there was not soo much promotion (AFAIK the only references on the internet are DEK’s News page, the press department of the university published an article and DEK got a profile page at JKU) the lecture hall was only full and not over-crowded 😉

Donald Knuth giving an All questions answered Session at JKU Linz
Don Knuth at JKU Linz

My question got answered at minute 45 (or with the other webcam):

I’ve got a question regarding the MMIX computer. Are you actively developing it or is it in a final state?

—Question answered (21st of May 2013, real time ~10:15 UTC, local time ~12:15)

See also: “Experiences with SAT” Lecture by Don Knuth at JKU

Thanks to JKU and Don Knuth!

Tags: Donald Ervin Knuth, JKU Linz, All questions answered, MMIX computer, May 2013

Don Knuth @ JKU

Gödel Lecture Series: Donald Knuth

Information sign to lecture hall EI7
All questions answered session – information sign

“I figured the only reason there is so many people here is, because you want all your questions answered” (Donald E. Knuth at Vienna Gödel Lecture 1)

So I finally saw Donald Knuth in real life. As someone who made major contributions to digital typesetting and algorithm theory, his research objectives intersect with my field of interest in majority and he personifies a person who achieved one of my major goals: Providing tools for everyone to publish content/data/information. It’s kind of a big deal for me, because I state to be a “knuth fanboy” for about one to two years now (meaning I am explicitly studying/looking for content authored by DEK).

Myself (question): Thank you so much for being here. I enjoy your research so much. My question today is the one about programming language design. So you are the author of TeX and the WEB system. You have written many source codes in Algol, Pascal… you even published a source code in INTERCAL [tpk] and you also have been quoted to tell at the ACM Turing 100 Banquet that python is the only popular language which is not ugly [acm]. So my question here is today, uhm, what are your personal criteria for what makes a programming language beautiful?

Don Knuth (answer): Okay, so, criteria for a beautiful programming language… depends on the programmer and the application. So, one size does not fit all. To me the best programming language is the one that matches the intuition of the programmer. So that you can put your thoughts down without having to translate it to something that’s not actually important. But different programmers have quite different mentalities. I mean, some people love a functional style of programming language (for example) or more declarative. Others want to be imperative.

I never… I can use Haskell and LISP but I feel a little bit like a dog standing on high feet while I am doing that. When I use C it feels right. But that’s not like I can say other people are wrong. When I use C++, I can’t stand it. I mean it just… the way of thinking does not go into my head at all. If you say something is static, what is this… the less-than sign sometimes means a template, sometimes means less than… so it gets ambiguous. But I am sure that the people who designed these languages did it because it was really right for them. So there are different applications as well… of languages.

I was asked in the 60s to write a paper about the design of programming languages. And I started it and I decided that the best way to say what a good language is to have an example of a bad language. But I did not wanna hurt any feelings of my best friends. So I invented my own bad language: I called it BL\I (bad language 1). It was a… B L backslash 1. I defined it but of course also my definition was bad. And then I… this was a language for string manipulation. Another thing about a language—of course you have an application area of what you are trying to do—so I also defined another language that was supposed to be a good one called StrolsString Oriented Language. So I had that language and then I had Strols. And then I was going to write up other things about programming language design. But I never finished the paper in the 60s and I guess I was worried that somebody would implement this language [Editor’s note: pointing to BL\I on the board]. So about 2-3 years ago all my papers on programming languages were collected into a book and I decided “Okay, now it is time to get up my old notes”. So I don’t know… chapter 13. The book is called “Selected papers on computer languages” and chapter (something rather) is about design of language and includes BL\I; you can take a look.

That sort of summarizes my opinions about the idea of good language designers. But just the fact that it works for me though does not mean it is going to work for everybody.

Myself: Thank you.

—Question answered (16th of May 2013, real time ~16:20 UTC, local time ~18:20, livestream at 00:47:44)

The question really was meant to answer the question for criteria and I was not looking for the “best” programming language (which btw, was asked already some time ago). I am fond to the aesthetics of mathematical structures, data structures and language design and was looking for his opinion on a linguistic level. From a point of view I was looking for guidelines how to design a good (programming) language. I am kind of happy with his answer. The most important keyword for me is intuition. Intuition corresponds to the Principle of Least Astonishment (yes, I always have to link Armin’s article if I use this term) which is very important in UI design. To make computer science accessible to a wide range of programmers we have to find languages which fit to their intuition and don’t surprise them. That’s important in my opinion and DEK valued it with this answer.

And yes, I have to admit that I missed to check out this book and I am going to study it now 😉

“My idea is that P equals NP but we will never know why” (Donald E. Knuth during the Vienna Gödel Lectures)

“It has to may be that during the 1970s more computing time was spent simulating the Game of Life than anything else.” (Donald E. Knuth about the hype of Game of Life during the 70s)

Thanks, Don.

Don Knuth after entering the lecture room
Don Knuth before the beginning
Don #Knuth talking to @meisterluk
Don #Knuth talking to @meisterluk [twitter]
Book signing after the lecture
Book signing after the lecture
Signature by Donald Knuth
Signature by Donald Knuth in TAOCP
Karlsplatz in Vienna (TU Vienna)
Karlsplatz in front of University of Technology Vienna

Tags: Donald Ervin Knuth, Gödel Lecture Series, Vienna, All questions answered, Programming language design, May 2013

Gödel Lecture Series: Donald Knuth

Uncovered case

/*******************************************************************************
 calculates the accounts receivable using the formel from the book
 @param:  param1, param2, param3, param4
 @return: returns the value of the formula
*******************************************************************************/

function calculateForderung(param1, param2, param3, param4)
{
	//alert("calculateForderung: \n param1: "+param1+"\n param2: "+param2+"\n param3:"+param3+"\n param4:"+param4);
	// param1 -> F_L1
	// param2 -> F_F1
	// param3 -> F_F2
	// param4 -> F_F3
	var x = Math.round(param2/param1);
	var y = x * param3/100;
	var z = x - y;
	var q;
	if(z > param4)
	{
		q = z - param4;
		temp = 1;
	}else if(z < param4)
	{
		q = param4 - z;
		temp = 2;		
	}
	//temp = z;
	//alert("Result: \n55000 / "+param1+" = "+x+" \n"+x+" * "+(param3/100)+" = "+y+" \n"+x+" - "+y+" = "+z+" <- final result");
	return q;
}

The “Accounting & Balancing” guys at the institute of “Business Economics and Industrial Sociology” developed a small Javascript application where you can solve small accounting problems and get instant feedback whether or not you did all the booking correct. I am not aware of the formula behind (they are also talking about it in the comment) so I had to read the source code. However, I came across this classic “uncovered case” bug: what if “z == param4”? Yeah, undefined behavior because q is uninitialized. What a classic.

Uncovered case