Unofficial wish list status.(Jul 2008)

Brad Roberts braddr at bellevue.puremagic.com
Tue Jul 1 11:45:22 PDT 2008


On Tue, 1 Jul 2008, Robert Fraser wrote:

> Me Here Wrote:
> > Web servers and other IO-bound processes are *not* the target of
> > multithreading.
> 
> How do functional programming styles apply better to I/O-bound systems? 
> I couldn't imagine writing a query processor using monads for all I/O.
> 
> Functional programming works well for a subset of applications which 
> require concurrency. The question is: is this subset large enough to justify 
> designing a language's concurrency support around this paradigm? Is it 
> large enough to justify forcing additional language constructs (const) for 
> applications that don't use this paradigm to handle their concurrency? For 
> non-concurrent applications?

Functional or not isn't a whole program decision (at least within D and 
it's future as it seems to be unfolding).  Within most, if not all, 
applications, there are reasonable subsets that are, or could be, 
functional style.  Many are already, without language support to help 
enforce the style or take advantage of the benefits.

> Of course, there are other arguments for a const system (static checking 
> of interfaces, etc.) But what other major new statically-typed languages 
> (besides D) have such a system? Java mostly threw it out (there's final 
> fields & what not). C-pound threw out even more of it. I have the same 
> feelings towards const-as-interface as I do towards checked exceptions: 
> sounds great on paper, but ends up wasting the developer's time.
> 
> (apologies for the web interface; @ work)

Everyone has their opinion, and aren't we glad for that privilege.  The 
nice part is that const is optional.  There's only a very few places where 
that leaks out, the obvious example being the phobos definition of 
'string' and that's avoidable.  The current implementation of phobos is 
far from perfect (don't start that thread, please) in it's use of const, 
but that's part of being an alpha version.  As it evolves, applications 
and libraries should be able to choose to ignore const completely.  Any 
part of phobos or the compiler that gets in the way of NOT using const, 
should be examined quite carefully.

Personally, if/when I end up using D for anything serious, I will be using 
const, as I like the guarantees that it allows me to have.  I _do_ like 
contracts and languages such as Java annoy me every time I'm forced to 
work with it in part due to the lack of them.

Later,
Brad



More information about the Digitalmars-d mailing list