Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost] [type_erasure] Review ends today July 27, 2012
From: Hossein Haeri (powerprogman_at_[hidden])
Date: 2012-07-27 10:38:28


Hi Lorenzo,

Here is my two pennies...

I should start by saying that, lately, I have not done a lot of C++. I have certainly not made a lot of Boost usages. In fact, despite the fact that my research is about C++, for certain reasons to do with formalisms, I these days develop most of my software in Scala. So, part of my low-quality review might have roots in that.

Whilst, with my particular situation explained above, I only read the Boost list to keep up with the news, your post stroke me for a particular reason: Type Erasure has a specific meaning in the Java world that has several times bit me hard over my Scala development. (See my threads on the topic to see that I publicly announce that I believe "type erasure is by far the ugliest dwarf I have ever witnessed mankind creating in a programming language."

Having said that, I opened your post thinking what a mistake it would be to bring nasty Java stuff to C++. To my big surprise, though, your stuff is nowhere close to what I understand is known in the JVM world as Type Erasure. So, I strongly recommend, as my first comment, to think about renaming the library because...

> The Boost.TypeErasure library solves these problems allowing us to
> mirror static generic programming at runtime.

... rather than this, JVM Type Erasure is about knowingly choosing to be completely oblivious against types from the early compilation stages onwards. Whereas your stuff simply postpones certain typing decisions. For that reason, you might for example want to call your library "Staged Typing" or "Deferred Typing". (Both of these are established research topics in programming languages. Please note that you're not doing "Gentle Typing" or "Gradual Typing".)

On the other hand, JVM type erasure doesn't solve any of the problems your stuff does. As a matter of fact, in many occasions, it even makes the situation worse. For similar facilities to that of yours, your might want to take a look into the Scala Macro system.

> Please state clearly whether you think this library should be accepted
> as a Boost library.

Yes. I think it would be a nice idea; although I can't remember any specific occasions when I needed that -- I'm sure there were certain such occasions over my industrial development time.

> 1. What is your evaluation of the design?

I expect, in later versions, there will still be room for removal of some boiler-plating currently on the user to provide. But, that's a good start.

> 2. What is your evaluation of the implementation?

Didn't really try it.

> 3. What is your evaluation of the documentation?

Reasonable first attempt.

> 4. What is your evaluation of the potential usefulness of the library?

The whole research papers on "Staged Typing" and "Deferred Typing".

> 5. Did you try to use the library?  With what compiler?  Did you have
> any problems?

No. N/A. N/A.

> 6. How much effort did you put into your evaluation?  A glance?  A quick
> reading?  In-depth study?

Quick reading of the documentation plus some of the codes that are not directly referenced to in the examples.

> 7. Are you knowledgeable about the problem domain?

To some extents.

Good luck and HTH,
--Hossein


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net