DiGuru said:Yes, but exactly that (map, filter, fold) is what database engines excel in. And that would force you into a data-centric model, which is half the battle. The other half is starting the analysis at the output side. Trace back to the logic from there, by writing procedures that see how that data has to be transformed according to the program logic, instead of executing the program logic and seeing what data you need to manipulate. Store that "business logic" where it belongs. After all, that's exactly what large business apps have been doing for some time now, to counter the same problems. Although for quite different reasons.
I'm sorry, but this seems like a non-sequitur. I don't get what this has to do with the discussion. All programs transform input to output. If a programmer starts writing code without thinking about what he wants output first, then he is doing something wrong.
We are discussing new language paradigms, because new language paradigms forces the programmer to recast the problem into a form which can be optimized differently and mroe efficiently. You seem to have argued against functional and high level appropriates, yet have given no explanation as to how this is going to be achieved in raw C++ code with libraries using procedure code, while reducing bugs and maintaining high performance.
And as soon as you start designing C++ libraries which build up AST-like structures, or parse mini-languages, I guarantee you, you'll have reinvented a functional Scheme/Lisp approach hidden as another syntax.
Yes, I agree. But that's still whishing for things to "patch" C++, without having to change the way you think: leave that to the language constructs. It isn't going to happen. If you want a better language, just pick one, don't try to graft bits and pieces to C++. It won't work. It will only add yet another layer and syntax to the mess.
Well, I don't like he literally intends to patch C++. I think he is thinking about UnrealScript NextGen and what he wants to do. And what he has noticed is that mainstream programmers don't like prefix or suffix notation, and prefer C-syntax. Syntax is irrelevent. A new paralle functional language modeled on C-syntax would not be a "patch". It might look like C++, but it will not have the same semantics.
HLSL looks like C-syntax, but it's execution is much closer to functional. JavaScript looks C-ish, but ironically, JavaScript has alot in common with Scheme.
And for having some kind of language tree, where you can pick a specific level and syntax for each piece of your code, wouldn't that completely invalidate the main goal: making it harder to fuck up, and improving the development efficiency?
No, and you gave a good example yourself: SQL. Do you think a procedural C++ implemented query is going to be less prone to fuck-up than C++ code interspersed with SQL fragments?
Today's C++ programmers use many DSLs without even realizing it and the benefits. Regexps, SQL, XPath, HLSL, etc. We aren't neccessarily talking about *literally* sticking 10 different languages into a single .c file, but about linking multiple languages today in your project as appropriate.
Today, we have C++ code for main program, HLSL for GPU, SQL if you use an embedded database (or OQL if you use an object-db) and usually some scripting engine for ingame rules, logic, events, etc. But large pieces of that C++ code can be split off into data-parallel pieces, because big pieces of that code are operating on huge geometry and game databases.
Last edited by a moderator: