Search Results: "jan"

23 November 2005

Antti-Juhani Kaijanaho: Remember to vote!

Remember to vote in the European Parliament elections!

Antti-Juhani Kaijanaho: A geekity test

19:30 @<mudyc> A one-question geek test. If you get the joke, you're a geek: 
19:30 @<mudyc> Seen on a California license plate on a VW Beetle:
19:31 @<mudyc> FEATURE

Antti-Juhani Kaijanaho: Diploma

QVOD DEVS OPTIME VERTAT
EX LEGIBVS VNIVERSITAS JYV SKYL ENSIS ATQVE EX DECRETO
AMPLISSIMAE INFORMATICARVM IN EA VNIVERSITATE FACVLTATIS
ABSOLVTO OMNI SPECIMINE LEGITIMO PHILOSOPHIAE MAGISTER CREATVR OMNIBVSQVE HVIVS DIGNITATIS IVRIBVS PRIVILEGIISQVE ORNATVR
IN VBRE JYV SKYL A. D.
XI KALENDAS IVNIAS ANNO MMIV
VIR PRAECLARISSIMVS ANTTI-JUHANI KAIJANAHO PHILOSOPHIAE CANDIDATVS
QVOD FACTVM
NOMINE MEO SVBSCRIPTO ET SIGILLO VNIVERSITATIS ADFIXO
EGO CONFIRMO
LEGITIME CONSTITVTVS PROMOTOR JAAKKO LEHTONEN
This is what I got today in mail. I had participated in absentia in the University's promotion, which happens every four or five years or so. The above is the text of my new diploma. I am now really philosophiae magister.

Antti-Juhani Kaijanaho: Yet another case of C++ unsafety

I was playing around with BNFC's C++ mode, and discovered that its authors have fallen prey to two of C++'s famous pitfalls: Were you aware of these issues? :) I fixed these problems in BNFC with this patch.

Antti-Juhani Kaijanaho: Nice soundbite from Tanenbaum

Patriot Act [...] requires John Ashcroft's written permission before you can open your mouth Source: Some Notes on the "Who wrote Linux" Kerfuffle, Release 1.1

Antti-Juhani Kaijanaho: Safety is the beginning of wisdom, not its end

I wrote a couple of days ago about safety in programming languages. A certain comment reminded me that people (even programmers) misinterpret technical terms from the area of programming languages. It reminds me of that old joke about the C programmer who is very hurt when somebody claims that C is not a functional programming language - of course it is functional, our hero says, as it functions perfectly. It also reminds me of a quote Christopher Strachey has been said to have written in the 1960's:
It has long been my personal view that the separation of practical and theoretical work is artificial and injurious. Much of the practical work done in computing, both in software and in hardware design, is unsound and clumsy because the people who do it have not any clear understanding of the fundamental design principles of their work. Most of the abstract mathematical and theoretical work is sterile because it has no point of contact with real computing.
In programming languages jargon, safety is the property of a language that all well-formed programs have a well-defined semantics. That is, in a safe language, programs that the compiler does not reject, do not go beserk (corrupt the stack or heap or otherwise invoke nasal demons). A well-defined semantics might be a forcible halt of the program, which is often not the ideal way of dealing with problems (sometimes it is even harmful), but it is beyond the scope of safety to specify a programmer-friendly semantics for such occurrences. Safety is the minimum requirement, not by any means sufficient for all contingencies. There is a related slogan attributed to Robin Milner:
Well-typed programs do not go wrong.
(Wrong, in this case, is an abstraction denoting nasal demons, heap corruption and other such nasty things.)

Antti-Juhani Kaijanaho: C++ exceptions revisited

I wrote two days ago:
Is there a mechanism to figure out what exception it is that fails to be caught by any exception handler on the stack? Of course, it can be caught by using catch (...), but that just tells me as much as G++'s default handler: that some exception was thrown.
Matus Telgarsky later pointed out to me in private mail that G++ does have a better terminate() handler, used by default in G++ 3.4. I could also invoke it in older G++ by adding
std::set_terminate( __gnu_cxx::__verbose_terminate_handler );
which I did. Based on the information it gives I eventually tracked the problem to my use of safe_ptr<AbSyn::AST>::release in my safe_ptr-downcasting functions in ast.hh. I had written that code originally using std::auto_ptr but due to problems I then implemented a reference-counted replacement for it. I had tried to make safe_ptr's interface to look as similar to std::auto_ptr's interface as possible, which now turned out to be a mistake. It turned out that there were four active aliases for things I passed to release at the time, which quite appropriately triggered an exception. However, unfortunately, I had given the downcasting functions exception specifications not listing that particular exception. Now, the semantics of an exception not listed being thrown in such a situation is that the program is immediately terminated. This problem highlights a C++ exception misfeature: it allows calling a function without an exception specification (which essentially means that it might throw anything) from a function with an exception specification (where throwing an exception not listed invokes immediate termination) without so much as a warning to guide the programmer!

Antti-Juhani Kaijanaho: What if GPLv3 were non-free

Recent discussions within Debian that make a noticeable detachment from the FSF point of view toward freeness, mainly about the GNU Free Documentation License and other documentation licenses, have induced me to wonder whether this is a symptom of a deeper difference of opinion between Debian and FSF. FSF is supposed to be developing the next generation GPL. One of the rumours about potential changes involve a requirement to post sources of GPL'd software that is used to power a website. If GPLv3 really included such a requirement, then I believe it would fail the DFSG (no restrictions on usage). It is also possible that the same difference of opinion between Debian and FSF that is now manifesting itself in the GFDL debate would end up causing us to reject GPLv3, even if it didn't include that particular restriction. It is likely that many free software authors, certainly all FSF projects, would eventually start licensing their software under GPLv3 (or, at your option, any later version). Then we would be in real deep shit. Update 2004-05-18: I seem to have been a little sloppy writing the above. I do not claim that a GPLv3 of the kind I indicate above necessarily fails the DFSG (such a claim would be nonsensical before an actual draft of GPLv3 is published). I intended to say that I expect to see such arguments if and when such a GPL is released, and I would not be surprised if such an attitude were to win the eventual argument. The point of this post is to show where that would lead us. I'll reprint here a comment I posted to this entry earlier:
I have no particular wish to see Debian and FSF disagree about the freeness of GPL, for the reasons I gave in the post.

Antti-Juhani Kaijanaho: Finnish spell checking is IN again

Martin-Éric Racine proposes development of a new spell checker for Fennic languages (mainly Finnish and Estonian). Since he forbids use of his contact addresses from anybody who is not his customer, I have to write this in public. I was involved in 1998 in a project with similar aims, Oikoluku-SF. It never accomplished anything. My personal belief is that the main problem is getting enough linguistic data to encode the morphology of Fennic languages. All such existing data is to my knowledge non-free. The rest is just a matter of programming: the algorithms are not rocket science.

Antti-Juhani Kaijanaho: C++ exceptions considered harmful

Is there a mechanism to figure out what exception it is that fails to be caught by any exception handler on the stack? Of course, it can be caught by using catch (...), but that just tells me as much as G++'s default handler: that some exception was thrown. I've been implementing the Hao compiler in C++, as C was too low-level but I wanted something widespread. A public darcs repository is available for curious bystanders to stare at; I doubt anybody gets much out of it (the haoc/ subdirectory contains the compiler in development; the other directories are more or less stale). I push to that repository occasionally; it's not necessarily up to date.

Antti-Juhani Kaijanaho: Yet Another Head Shot

Here is my hackergotchi:

Antti-Juhani Kaijanaho: Safety is paramount

Most programming languages designed before 1980's were safe. All well-formed programs had well-defined meaning. The main exceptions were very low-level languages where run-time tests for indexes and such things were just too expensive. From this low-level tradition came C. Then for some very strange reason C became popular for general-purpose programming. It has been in to avoid safety as much as possible ever since then. For most programming tasks, safety is much more important than speed. It seems it's only now that people are realizing it. If we hadn't made the C mistake, we wouldn't need to be paying for it with all those buffer overflows. Cyclone looks like a useful C replacement for most projects. Never tried it for real, though.

Antti-Juhani Kaijanaho: Strachey

I ran the other day into Volume 13, Issue 1-2 (2000) of Higher-Order and Symbolic Computation, which contains articles by and about Christopher Strachey. From him come terms like l-value, parametric polymorphism, first-class object. He is a classic in the theory of programming languages. The issue is freely available at Kluwer's site. I am unable to give a direct link.

Antti-Juhani Kaijanaho: Requiem et Kyrie

Requiem aeternam dona eis, Domine, et lux perpetua luceat eis
Te decet hymnus, Deus, in Sion, et tibi reddetur
votum in Jerusalem: exaudi orationem meam, ad
te omnis caro veniet.
No, I am not that religious, and certainly not Catholic, but I do find comfort in the classic renderings of the Requiem Mass, especially Verdi's Messa da Requiem. Kyrie eleison.
Christe eleison.
Kyrie eleison.
Eternal rest grant them... (+)

Antti-Juhani Kaijanaho: GLR parsing is sooo fun

Perry Lorier reminded me of Earley's algorithm; it is a parsing algorithm that can cope with arbitrary context-free grammars (as I noted earlier, most parsing systems take only LL(1) or LALR(1)). I then remembered that recent Bisons have an option for GLR parsing. I should try that. Actually, I did. Not having run the parser, I note that Bison still reports conflicts. It's disappointing. (Argh, ACM Digital Library is throwing a tantrum. Cannot give a link to GLR at this time.)

Antti-Juhani Kaijanaho: Darcs

I must say it, I already like darcs quite a bit. The ability to work without a centralized server seems a blessing. I'm sure other systems have that, but then they aren't written with Haskell :) How many of them allow ssh access?

Antti-Juhani Kaijanaho: LALR parsing is sooo fun

I'm writing a grammar for Hao, a programming language I am designing (ow, design is such a poor word for this. painting?) loosely based on Lasu's specs. I run into LALR conflicts, and it takes forever to chase them. LALR grammars are not the easiest things to debug. Unfortunately, the alternatives are much worse; if easier to debug, then less maintaineable. Baad. All baad. It would be nice to have a program that would accept a grammar which is not LALR(1) or LL(1) or whatever the program uses internally but does transfer the grammar automatically into the appropriate format, if possible. (Many languages are LALR(1) but the most natural grammars for them are not.)

Antti-Juhani Kaijanaho: Page 23

Instructions: Grab the nearest book, open it to page 23, find the 5th sentence, post the text of the sentence in your journal along with these instructions.
Chapters 5 through 7 elaborate the same story for a much more powerful language, the untyped lambda-calculus, where we must also deal with name binding and substitution. I cheated by choosing the nearest English-language book. I also assumed that a sentence is ended by a period, instead of assuming that a sentence contains a single finite verb. In Finnish grammar, the latter would be the correct choice, but I am not sure about English.

Antti-Juhani Kaijanaho: A feature browsers are missing

I hate it when I cut&paste; an URL from somewhere and the cutting is a little off, leaving out an h in the front or l in the back or adding garbage to either end. Mozilla and other browsers choke in such proto-URLs. Why can't they simply apply some simple heuristics to handle these mistakes? It's not like they don't do heuristics already for URLs...

Antti-Juhani Kaijanaho: I voted for the "editorial" changes

I voted for the "editorial" changes to the Social Contract. At the time it seemed like the right thing to do. I considered writing a rant about the lack of supporting information for the GR. There was no published rationale that I could find, nobody advocated either side, as far as I could see, and there was not even a diff indicating the changes. Well, I soon found out myself that a diff would have been mostly useless, as the wording changes were fairly thorough. It did not help me make my mind. Of course, I could have read mail archives of the vote mailing list. My past experience told me not to bother. It was likely that I could not find the relevant pieces of information I sought for without investing too much time to it.
I wrote the above about a hour ago and was interrupted by having to catch the bus. Now I noticed that there was a request for discussion on devel-announce about a month ago. It is clear that I could have participated in the discussion, but I had faith in all the sides being represented in the discussion without my involvement, and I assumed that rationales and advocacy would be present and easily locatable when the voting time came. When the actual call for votes appeared, I no longer remembered that mail. It seems I was not the only one. I made my decision based on reading the proposal, comparing it to the current wording and not noticing the bomb. Nobody pointed the bomb out to me, either. I assumed that a GR marked "editorial" would really be editorial, not intended to change the meaning of the document. As we have seen, this assumption was faulty. What we should learn from this incident is, in my opinion, that all general resolutions should be accompanied with an official rationale document (similar to DPL election platforms) with rebuttals from people who oppose the change. Campaigning should be more visible. I do not agree with Joey Hess's assessment that GRs are not a good idea for Debian. I would not have had (did not have) the time to participate in a discussion seeking a consensus, and thus it cannot be assumed that all of the 200 or so developers who voted would have participated. The problem with respect to the low number of voters is in my opinion that the issue being decided seemed to me (and thus probably many others) uncompilcated and void of any disagreement. There was even no counterproposals! I would assume that many people did not vote because they believed that it would pass anyway. All of our other general resolutions have enjoyed more voters; I believe the reason is that they were considered more controversial by many and hence many more felt the need to make their voices heard.

Next.

Previous.