• Advertisement
Sign in to follow this  

The Perfect Language

This topic is 2773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is C# a perfect choice for high performance computing real time application, such a s an interactive CAD/CAM, scientific visualization, or architectural design programs?

We don't forget that such an application does not only perform intensive computations but it does count on processing of complex data structures which require frequent memory allocation and reallocation, recursive routines, indirections, and data access...

Lets just ignore the amazing IDE with super intelligent intellisense :) and all that built-in refactoring tools, and the well integrated elegant GUI designer.

What's the advantage of C# over C++ then?

Share this post


Link to post
Share on other sites
Advertisement
I think C++ is the perfect language, because it's fun to code with it. If you're not having fun in coding, you'll never finish any bigger projects.

Share this post


Link to post
Share on other sites
After spending a long time coding in haXe and a bit of Haskell; i simply get frustrated working in any language which doesn't have inferred typing: sucks all the fun out of coding for me having to manually type variables :P

C++0x on the other hand has 'auto', and i believe c# 3.0 does have inferred typing.

not that i think either haXe or Haskell are perfect. haXe's lack of proper parameterised functions annoys me which led me to write a preprocessor to extend haXe and give me them along with mixins and macros.

Share this post


Link to post
Share on other sites
Quote:
Original post by Lumooja
I think C++ is the perfect language, because it's fun to code with it. If you're not having fun in coding, you'll never finish any bigger projects.


It may be fun for you, but not for others (me for example)

Talking about the perfect language is the same as talking about the perfect music.

Share this post


Link to post
Share on other sites
There isn't a perfect language, that's why there are so many. Each languages gets forked the hell out of it, since everyone disagrees about everything. It's like religion, because there are so many you know they're all false (now this off topic conclusion is drawn a bit too quick, it's worth thinking about it). If there would be one global religion, I wouldn't be an atheist.

C++ is a good language, it has very wide support and many many libraries. I guess C# too though. If only the D programming language would have the resources as C++ does...D actually is potentially a great language. What they need is some committee or something to steer the project. It looks like everyone has input into the language, which can be bad because setting a standard will be difficult. D has some excellent feature, though I'm not convinced with all features...

Share this post


Link to post
Share on other sites
That's why I said lets leave the fancy IDE specific features away and focus on binary executable performance when it comes to intensive computation and processing of complex data structures.

I'm not asking which language is more fun... :)

The reason I'm asking and I really need feedback from previous experiences writing such applications before I start my project, and in the middle I then release I picked the wrong language because either:

1) The simply performance sucks. And it becomes a big problem when the project gets bigger and more complicated.

2) Performance is not a problem at all picking an alternative that
could make my life a lot easier while not scarifying performance.





Share this post


Link to post
Share on other sites
Quote:
Original post by Sambori
That's why I said lets leave the fancy IDE specific features away and focus on binary executable performance when it comes to intensive computation and processing of complex data structures.

I'm not asking which language is more fun... :)

The reason I'm asking and I really need feedback from previous experiences writing such applications before I start my project, and in the middle I then release I picked the wrong language because either:

1) The simply performance sucks. And it becomes a big problem when the project gets bigger and more complicated.

2) Performance is not a problem at all picking an alternative that
could make my life a lot easier while not scarifying performance.


I'm sure the bad performance has little to do with the tool you work with (the language) but all the more with the skills of the worker (that's you). There are performance differences between compiled and interpreted languages, but generally not noticeable. If you program well, and do performance tests, you can eliminate the bottlenecks.

Share this post


Link to post
Share on other sites
Given the nature of this forum, you're unlikely to find a large population of people with the requisite extensive experience using C# (or any language) to build "interactive CAD/CAM, scientific visualization, or architectural design" programs.

The best way for you to get an answer to this is to build some sample implementations of the expected algorithms in the various candidate languages you have available (presumably you have already reduced the set of options down to 'languages you know,' because those are the one's you'll be able to produce the best-optimized implementations in anyhow), optimize them (perhaps soliciting peer review) and profiling them.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sambori
That's why I said lets leave the fancy IDE specific features away and focus on binary executable performance when it comes to intensive computation and processing of complex data structures.

I'm not asking which language is more fun... :)

The reason I'm asking and I really need feedback from previous experiences writing such applications before I start my project, and in the middle I then release I picked the wrong language because either:

1) The simply performance sucks. And it becomes a big problem when the project gets bigger and more complicated.

2) Performance is not a problem at all picking an alternative that
could make my life a lot easier while not scarifying performance.


In general Executable performance isn't tied to the language, runtime and compiler choice has a far greater impact.

If you go with C# for example there is a significant performance difference in some areas.

Back in 2007 some mono developers benchmarked .NET 2.0 vs Mono 1.2.3.1 and Microsofts .NET was faster in all except two of the tests, in some cases nearly twice as fast. (Both Mono and .NET has moved forward quite alot since then though).

(For C++ there are similar differences between the free and profesisonal MSVC versions and compilers such as gcc)

Basically as long as you use the tools you have properly you can write very fast software with pretty much any popular language, the primary concern should be the availability of libraries and other tools aswell as the skills you and your team has.

Share this post


Link to post
Share on other sites
Don't forget that if you pick C# and find that some performance critical algorithms would benefit from some C++ code then you can always just write those functions in C++ and PInvoke them without too much overhead. The same thing applies for most other programming languages.

For that reason I'd suggest writing the program in the language you're most productive with.

Share this post


Link to post
Share on other sites
Quote:
Original post by Adam_42
Don't forget that if you pick C# and find that some performance critical algorithms would benefit from some C++ code then you can always just write those functions in C++ and PInvoke them without too much overhead. The same thing applies for most other programming languages.

For that reason I'd suggest writing the program in the language you're most productive with.


Being an Object Pascal Programmer (yes we're alive yet) i can only be agree w/ Adam_42. Even if i know C# and C++ my language of choice is Object Pascal.

Share this post


Link to post
Share on other sites
In conclusion, as long as I pick my favorite language of choice, the performance will always be acceptable even if it sucks in reality. Makes sense to me ;)

Share this post


Link to post
Share on other sites
Scientific visualization can be problematic. Most academic environments use a hodgepodge of tools to bring all the data together, often they are in form of proprietary formats, somethings bound to arcane tools (Win95 only isn't uncommon).

Large data sets are usually processed off-line. One such example I know of uses 4 Teslas with 256GB RAM and 8TB local RAID storage. The rest is done via Hadoop. The compute cores are obviously shaders, the rest of the tools are Java due to Hadoop, all OSes are Linux. Just getting this hardware running was non-trivial, requiring custom patches to everything from BIOS to kernel to display driver support (more than 2 GPUs is highly uncommon, multi-slot motherboards are in limited availability, power supply issues and such...). On Windows, this would have been mostly a dead end due to dependence on so many vendors.

The actual data for visualization and rendering is aggregated via some specialized LOD algorithms and rendered via basic JOGL applet.

Microsoft's technologies are unpopular for any "serious" projects due to certification and overhead involved (medical and such). Whenever a patch for Windows or other part of system needs to be installed, it needs to go through entire pipeline and entire software must be audited from scratch, or transition plan developed. Each of these will take upwards of 3 months. Patches come out every week. There's also all kinds of licensing issues as well as end of life and similar. XP in many places would be luxury, Win 98 is often still the norm.


For CAD/CAM, there are select few vendors, depending on industry. The question becomes - does that vendor support .Net. Some do, others don't. There is no room for custom CAD/CAM packages, since this is a fairly controlled domain with well established territories which tie in with all kinds of certification and whatnot. Since it's mostly Windows world, .Net or suitable bridges are usually available.

Architectural visualizations, anything that is non-trivial is done off-line on render farms. Many shops have already transitioned to unbiased rendering, or at very least use global illumination models, production quality of which takes days or more to render.


As with most things - the technological part and merits of individual language are irrelevant. What good is some perfect language if nobody can or won't use it.

.Net in this regard is only suitable as support tool or as part of pipeline. Mostly it's used for integration with business back ends, since there's plenty of enterprise-grade products that deal with document management of CAD content.

For anything scientific, Python tends to be popular, as well as mash-ups of other technologies, such as various PHP app stacks. For full-blown solution, Java still takes precedence, partly due to huge support ecosystem, partly popularized by Google. .Net is also often too complicated to license for research ecosystems, but many end-user systems are developed using it. Microsoft's stack is also heavily favored by proprietary vendors who do not wish to disclose source to their tools or drivers.

Share this post


Link to post
Share on other sites
For the record, I have had no problems using C# for scientific visualizations. Performance is excellent as long as you play nicely with the GC. If performance does become an issue at some point you can always fall back to native code for those sections (which I haven't had to do yet).

Python is another popular choice for scientific software.

Share this post


Link to post
Share on other sites
Quote:
Original post by Lumooja
I think C++ is the perfect language, because it's fun to code with it. If you're not having fun in coding, you'll never finish any bigger projects.



While I personally quite enjoy coding in C++, it's certainly nowehere near perfect. No language is (or ever will be) perfect, and C++ in particular can sometimes make you want to pull your hair out, though I suppose the same can be said for many other languages.
I do believe that it is a viable language for many things, though.

Share this post


Link to post
Share on other sites
Quote:
Original post by farcodev
my language of choice is Object Pascal.
Wow, that sounds just like me... 15 years ago!
What Object pascal compilers are in use nowdays? You don't use Delphi do you? I used to use THINK Pascal back in the day.

Share this post


Link to post
Share on other sites
The reality of the situation is with all modern languages, you are the problem and not the language. The person writing the code is going to have a lot more effect on the performance then the language you choose.

theTroll

Share this post


Link to post
Share on other sites
Quote:
Original post by Decrius
There isn't a perfect language, that's why there are so many. Each languages gets forked the hell out of it, since everyone disagrees about everything. It's like religion, because there are so many you know they're all false (now this off topic conclusion is drawn a bit too quick, it's worth thinking about it). If there would be one global religion, I wouldn't be an atheist.


That logic leads to some curious conclusions when you take it to the logical limit.

Share this post


Link to post
Share on other sites
Quote:
Original post by theOcelot
Quote:
Original post by Decrius
There isn't a perfect language, that's why there are so many. Each languages gets forked the hell out of it, since everyone disagrees about everything. It's like religion, because there are so many you know they're all false (now this off topic conclusion is drawn a bit too quick, it's worth thinking about it). If there would be one global religion, I wouldn't be an atheist.


That logic leads to some curious conclusions when you take it to the logical limit.


What do you mean with logical limit? IF there would be a perfect language, no other language would survive and no other language would emerge. If there would, the initial language would not be perfect. I didn't take preference and irrationality every human has into account though.

In the past days there were just a handful of (major) languages, like COBOL, Fortran and Basic. Nowadays we have a zillion of languages. I don't know what is better. To me, there is only a handful of problems we tackle with programming (algorithms, data processing, graphical display, GUI apps, ...). Ideally, for each problem there'd be a best or 'perfect' language. Today we have a hundred of nice languages for one job. It is inevitable I guess, but it hinders people to switch. It always takes time to learn a new language, wasted time.

Share this post


Link to post
Share on other sites
Not that part, the part where "if they're all different, they can't all be right, therefore they're all wrong", as applied to religions. Try applying that to physics theories, or math. Sometimes people are just wrong, even when there is a right answer.

You do have to take human irrationality and preference into account in anything touching the real world involving human actions/opinions. I guess that's all.

Share this post


Link to post
Share on other sites
Quote:
Original post by Antheus
Scientific visualization can be problematic. Most academic environments use a hodgepodge of tools to bring all the data together, often they are in form of proprietary formats, somethings bound to arcane tools (Win95 only isn't uncommon).
Thank goodness our department drank the open-source kool-aid! We may be stuck writing all our research/simulation software in ANSI C*, but at least we run linux [wink]

* Actually, that isn't entirely true. A few of the more progressive students use Python for research work, and the faculty have lately become obsessed with Erlang...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement