Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Modern C++ design

by stefp (Vicar)
on Aug 05, 2002 at 23:29 UTC ( [id://187862]=perlmeditation: print w/replies, xml ) Need Help??

It seems that Perl6 will be a more typed language than perl5 in the following sense: if the user provides enough type information to the compiler it will be able to produce more efficient code. Eventually I want to use type traits to be in fine control. But I certainly don't want the complexity. "Modern C++ design" shows that type traits controlled compilation is possible in C++ but that it is an afterthought. What strikes me in this book ( Modern C++ design) is how types can be organized in typelists (chapter 3) so that type traits can be affected to types leading to a lot of control to produce optimized code.

This is done using heavy templating wizardy leading to the automation of a lot of complex decisions at compile-time. But why it has to be so complex?

Probably if such considerations (type traits driven compilation) are taken when designing the language, similar features could be used without the complexity. My understanding of Perl6 is that TWBMMMWTDI (There will be many more way to do it). If the user does not provide enough type information that will mean more work at run-time. If the user provides sufficiently typed variables, a lot of decision will be taken at compile-time. One can imagine that such a program could be mostly compiled to native object code.

My dream is a language that allows me to start with very loosely typed code. Once my program will stabilize, I want to be able to add more typing information to get more performance. Sadly, today perl allows to prototype very fast but if one want better performance, one has to move to another language.

My wish for perl6 as language for the 20 years to come is that it will cover the full gamut from interpreted to compiled.

My only grief against the "Modern C++ design book" is the index that could have been more complete. For exemple, the word trait is missing but you will find you way if you search Typetraits instead. Warning: this book is not casual reading. Working knowledge of C++ templates is a prerequisite.

-- stefp -- check out TeXmacs wiki

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://187862]
Approved by jarich
Front-paged by jarich
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found