LtU Forum

GoF get SIGPLAN award

ACM SIGPLAN has given the 2005 Programming Languages Achievement Award to Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, authors of Design Patterns.

More on the "generics are evil" meme

Bruce Eckel, famous author of programming books Thinking in Java and Thinking in C++, writes some commentary about Arnold's article on generics (discussed here on LtU):

Ken Arnold just posted a blog entry describing how difficult he found generics when working on the upcoming edition of The Java Programming Language book.

The fact that it's taken this book so long to get published is just one indicator of the complexity of the language. I've also noticed that most other Java books have either taken a long time, or just briefly glossed over generics, and often both.

[...]

One commenter to Ken's blog points out that it's not the idea of generics that is the problem, but the implementation, to which I agree, and I also think this is what Ken actually meant.

Here Eckel seems to agree with many opinions expressed in the previous discussion: that's not a problem with generics in general, but with the Java implementation. And he argues that it would be better if the language was designed with generics in mind in the first place, which I don't think anyone would disagree with.

But the question is, how can we change the course of a moving train? It seems to be never easy. Can PL theory help the evolution of programming systems and not only their design?

A question about subtypes inference

Hi

I am looking for information on subtype inference.

Consider a type system with a sub rule:

E,C|- e:sigma C|-sigma :sigma'
----------------------------------------
E,C|- e:sigma'

Here E is the type environment and C is the (initially empty) subtype constraint set.
And I use : to denote the smaller than relation on types for lack of a better symbol.

And a set of rules for infering constrainst from sigma:sigma' depending on the underlying type of sigma. (it is a structural type system).

My question is, after my type inference assigns type sigma’ to e, how do I choose sigma’, as to find the correct underlying constraints.

I looked and asked around. Some suggested using a copy of sigma, I find this odd because I don’t see why, and how this would produce the needed type constraints.

I would be grateful for either a article explaining this matter or pointers to the underlying idea.

R.K.

BTW this is the article I’m working on
http://citeseer.ist.psu.edu/cache/papers/cs/18011/http:zSzzSzresearch.microsoft.comzSz~mafzSzpopl01.pdf/rehof01typebased.pdf

CTM Author American University Tour

Edit: Woops, didn't realize that this news had already been posted! Guess I should read the front page once in a while...

Please feel free to check out the real article.



Hello Everyone,
I recently heard the following message in the Mozart/Oz newsgroup, and thought I should pass it on to all the CTM fans on this site:

From: Peter Vay Roy To: users@mozart-oz.org

Dear all,

During the week of Nov. 7, I am planning to tour American
universities that teach or are thinking of teaching with our
programming textbook.  If you are in the US and you would
like me to visit your institution, please send me email.

Peter

Language support for generating functions?

We've got languages with support for iterators and lazy lists and other sequence oriented structures. Is there any language with built in support for generating functions? I don't have any immediate application in mind, I'm just curious as to what could be possible.

ML without GC

I'm in the mood to develop an ML like language for small microcontrollers :-)

I tried to find out which subset of an ML like language do not need a garbage collector (without much success).
Do you have some ideas or some pointers to papers?

Thanks in advance!

[Fun, crass] The Daily WTF

If LtU is the zenith of PL discussion, the nadir might be The Daily WTF (where Whiskey Tango Foxtrot decodes from the phonetic alphabet to a vulgar interrogative).
If you would find refreshment in a "Bevis and Butthead to Code" kind of website, it's good for an occasional belly-laugh.

A software engineering problem: how would functional programming solve it?

Here is a simple software engineering problem that I have encountered the last few days. It's not something dramatic, but one that has made me stop development in search of elegant solutions. I am posting this here because I would like to see how functional programming languages would solve this problem.

Here is the problem: I am writing a GUI toolkit that reuses the Win32 API wrapped up in a set of C++ classes (the reason is that there is no GUI library that completely hides Win32 will reusing it - existing libraries either follow Win32 logic (ala WxWidgets) or provide their own implementation (ala Qt/Swing)). As you may know, Win32 is not object-oriented, nor does it have a well thought out/consistent interface. For example, although the menu bar is a screen object, it is not a window: all there is is a bunch of functions for creating a menu, redrawing it, adding menu items etc. But I want to have menus and other non-window Win32 items as widgets in the toolkit, for consistency reasons.

The problem lies in the organization of classes. I have 4 types of widgets:

  1. widgets with no children and no window: for example, menu items
  2. widgets with no children and window: for example, buttons
  3. widgets with children and no window: for example, menus (which have menu items as children)
  4. widgets with children and window: for example, forms

The object-oriented design solutions would be:

  1. make non-window classes unrelated to widgets; something I don't desire as it is a non-consistent solution (after all, a menu IS a widget)
  2. make a generic Widget class that has children and all window properties and ignore those properties for non-window widgets; a nasty solution.
  3. have 5 separate classes: Component, Container (extends Component), Window (extends Component), WindowedComponent (extends Component, Window), WindowedContainer (extends Container, Window), using multiple virtual inheritance or aggregation. I also don't like this solution because of namespace pollution and because it will be seen as complex by the library's users.
  4. have 3 separate classes: Component, Container (extends Component), and template class Window that can be parameterized by the type of superclass (Container or Component). I also don't like this solution, because a) templates are slow in compilation, b) bloat the size of code, c) all code has to be in the header file.

So what I am asking is how functional programming languages solve an issue like the above, which is an issue of code organization/clarity/reuse/taxonomy. I can't seem to find a good object-oriented solution to the problem, nor any of my colleagues/friends can. So I am asking if other programming paradigms have a better solution for this problem.

4-color theorem

The only correct, simple and elegant proof of
the
4-color theorem

The 4-color theorem is a well-known math problem
with
no readable proof. Spending years I finished a
correct, simple and elegant proof of it. If you read
it you will think it's the only one we can have. I
first sent my paper, not well written, to some
journals. May be 1 year later, the editors said they
did not accept it. Then I revised it and it is
simple
and elegant now, but the editors said "we do not
have
the refereeing resources to have all such papers
assessed properly." In fact they have already known
the contents of my submission. They are reluctant to
see such proof different from the old arithmetic one
to be published. Please tell me how to do with it.
Is
there anywhere to submit correct proof paper? I will
let the person read it if who promise paying for no
flaw found.

Sincerely
Cui Shitai
cuishitai12000@yahoo.com.cn

Dear Dr. Cui Shitai:
We receive a number of papers every year claiming to
present solutions to famous unsolved problems or to
give simple proofs of well-known theorems. In
particular, we receive a number of submissions on
the
four-color theorem. Unfortunately, we do not have
the
refereeing resources to have all such papers
assessed
properly. In view of this, we cannot offer you
encouraging words and we are unable to accept your
paper for publication.

Thank you for considering the Journal.

Yours sincerely,

Nick Wormald
Editor in Chief
Canada Research Chair in Combinatorics and
Optimization
Dept of Combinatorics and Optimization
University of Waterloo
Waterloo ON
CANADA N2L 3G1
Phone: (519) 885-1211
Fax: (519) 725-5441

Dear professor
I have a proof for 4-color theorem 5 pages long. I
cannot to find a journal to consider it.
Can you give me any advice? It has submitted to
annals
of mathematics, not accepted but they
didn't tell the reason.
Thank you very much
Sincerely yours,
Cui Shitai

Software Re-engineering Techniques and Reverse Engineering of Object-oriented Code ( Java language)

I am working on this ....

1- Sofwtare Re-engineering Techniques
2- Reverse Engineering of object-oriented Code ( Java )
3- Decompiler Theory
4- History of DEcompiler
5- Decompiliation process
6- Decompiler Applications
7- Java Decompiler ( Programming Phase)

THanks

XML feed