Antti-Juhani Kaijanaho: Remember to vote!
Remember to vote in the European Parliament elections!
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
delete
operation on one of them. You need to either forbid copying by adding
an explicit private copy constructor and an explicit private
copy assignment operator to the class (prototypes without definitions will do
nicely), or by enforcing some sane copying policy by giving your own
copy constructor and copy assignment operator (popular policies
are deep copying and sharing with reference counting).Patriot Act [...] requires John Ashcroft's written permission before you can open your mouthSource: Some Notes on the "Who wrote Linux" Kerfuffle, Release 1.1
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.)
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!
I have no particular wish to see Debian and FSF disagree about the freeness of GPL, for the reasons I gave in the post.
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.
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.
Next.