Click here to Skip to main content
15,889,116 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Help on designing DB/ Web Service Pin
Eddy Vluggen10-Jun-13 3:26
professionalEddy Vluggen10-Jun-13 3:26 
QuestionTransactional MSMQ & firewall Pin
John Padgett27-May-13 22:35
John Padgett27-May-13 22:35 
AnswerRe: Transactional MSMQ & firewall Pin
jschell28-May-13 9:31
jschell28-May-13 9:31 
QuestionSOA and exposing a program from the 80s Pin
darklies17-May-13 19:37
darklies17-May-13 19:37 
AnswerRe: SOA and exposing a program from the 80s Pin
jschell20-May-13 11:09
jschell20-May-13 11:09 
GeneralRe: SOA and exposing a program from the 80s Pin
darklie22-May-13 16:41
darklie22-May-13 16:41 
GeneralRe: SOA and exposing a program from the 80s Pin
jschell24-May-13 12:26
jschell24-May-13 12:26 
QuestionLanguage features required (or useful) for numerical computing Pin
harold aptroot15-May-13 3:49
harold aptroot15-May-13 3:49 
Most languages don't expose features that you (could) need, such as the double-extended format, rounding modes, and things like the "inexact result" flag, that are in the IEEE 754 standard.

So, I guess what I'm asking is, am I even on the right track here?

I've identified some things as necessary or useful:
- the optimizer will not mess with associativity or distributivity or identities such as "a - a == 0" that do not generally hold. Very important. There are compilers that break this rule even if you don't enable something like "-ffast-math", especially things like GPU Shader compilers, destroying many algorithms.
- lexically scoped* rounding modes. Could be done as global state, but that has two effects: 1) you can run the same function several times with different rounding modes, which is a good (not perfect) test for numerically bad code, and 2) it makes reasoning about the code very hard, since you can't make any assumptions about the rounding mode without analyzing all possible call trees.
- lexically scoped control for "flush to zero" and "denormals are zero". Less important, but allows optimization where needed without having to enable it globally.
- support for reading/clearing the sticky flags. Not sure what the syntax should look like to make that nice, but it's probably not super important to make it nice.

And there are some things I'm not too sure about:
- introduce the internal types "auto_double" and "auto_wider_double". Operations on floating point types would automatically upcast once to a wider type. The internal types are to avoid doing (float + float) + (float + float) in overly wide precision.
       |  float | double | x 
float  | double | double | x
double | double | x      | x
x      | x      | x      | x

But what should x be? There's double-extended, but that can only be implemented with old-school x87 instructions. Double-double arithmetic could be done in xmm registers, and isn't as slow as it seems. But not as fast by far as using the old-school FPU, which suffers almost no penalty for double-extended precision (division, square root, saving and loading is about all that's affected), and, IIRC, double-double arithmetic doesn't always round the way we'd like it to.
And should this be a feature at all? The programmer could just as well do it himself by upcasting - and then the programmer could choose not to do that, without necessitating yet an other lexically scoped mode ("no widening", see below). It would save the average noob's ass once in a while, but history shows that languages oriented at noob often end up so horrifying that only noobs dare use them.
- should double-double (this is not the binary128 type by the way, but an uninterpreted sum of 2 doubles) and quad-double arithmetic be built-in and exposed though types? It would be useful, but not all that often, and could be implemented in code. It's not clear whether the advantages outweigh the costs.

* what should this even look like? Something like this?
float(round nearest) // default mode, so this changes nothing
{
    // do some arithmetic
}

// round to +Infinity, denormals are zero, flush to zero and
// don't automatically widen types
float_mode(round up, daz, ftz, no widening)
{
    // maybe that whole auto-widening was over the top
}

Other ideas? And I'm not too sure what the keyword should be.

There's probably a ton of things I'm missing here. I'm not even a numerical analyst, not even close. I know just enough about floating point to know that I don't know what I'm doing.

PS: is this topical in this forum?
AnswerRe: Language features required (or useful) for numerical computing Pin
jschell15-May-13 8:31
jschell15-May-13 8:31 
GeneralRe: Language features required (or useful) for numerical computing Pin
harold aptroot15-May-13 9:12
harold aptroot15-May-13 9:12 
GeneralRe: Language features required (or useful) for numerical computing Pin
dusty_dex15-May-13 10:02
dusty_dex15-May-13 10:02 
GeneralRe: Language features required (or useful) for numerical computing Pin
harold aptroot15-May-13 21:15
harold aptroot15-May-13 21:15 
GeneralRe: Language features required (or useful) for numerical computing Pin
dusty_dex15-May-13 23:09
dusty_dex15-May-13 23:09 
QuestionBooks on Design & Architecture Pin
Mohammed Hameed12-May-13 23:15
professionalMohammed Hameed12-May-13 23:15 
AnswerRe: Books on Design & Architecture Pin
ospmojamcpds27-May-13 6:51
professionalospmojamcpds27-May-13 6:51 
GeneralRe: Books on Design & Architecture Pin
Mohammed Hameed27-May-13 19:05
professionalMohammed Hameed27-May-13 19:05 
GeneralRe: Books on Design & Architecture Pin
ospmojamcpds28-May-13 20:29
professionalospmojamcpds28-May-13 20:29 
GeneralRe: Books on Design & Architecture Pin
Mohammed Hameed29-May-13 5:02
professionalMohammed Hameed29-May-13 5:02 
QuestionTo capture the prints issued by users in a network Pin
luckyshah8-May-13 18:25
luckyshah8-May-13 18:25 
AnswerRe: To capture the prints issued by users in a network Pin
jschell9-May-13 8:23
jschell9-May-13 8:23 
AnswerRe: To capture the prints issued by users in a network Pin
Eddy Vluggen9-May-13 9:37
professionalEddy Vluggen9-May-13 9:37 
QuestionWhat is the best way to store product specification in database Pin
swapnil70901-May-13 4:15
swapnil70901-May-13 4:15 
AnswerRe: What is the best way to store product specification in database Pin
jschell1-May-13 8:46
jschell1-May-13 8:46 
GeneralRe: What is the best way to store product specification in database Pin
bakary.konate1-May-13 10:00
bakary.konate1-May-13 10:00 
AnswerRe: What is the best way to store product specification in database Pin
Matt U.6-May-13 7:17
Matt U.6-May-13 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.