New Scientific Library - Lang?

A

andreykuzmenko

Hello everybody!

I'm starting moving out my scientific library (neural networks) from
Delphi. Currently I'm being concerned with selection of a new language
for its development. The library uses the following very intensively:
memory allocation/deallocation, virtual method calls, accessing objects
by reference from other objects, methematical calculations (various -
arifmetic, triginometric), and employs collections much. It's also
important what the library does NOT use any input/output operations and
has nothing to do with user interface. But it needs to be used in other
programs that have UI.

I'm coding C# for the last couple of years and I'm starting to hear the
rummors that managed code (like rinning under Java VM or .NET CLR) is
getting closer in performance to the natively compiled code. It's
definitely HARD to identify the robustness of the performance tests
presented all over the Internet. Some of them are claiming that C++ is
dying in favor of managed code, because managed code can gain from some
optimizations (in virtual runtime environment) that can not be done
during the compilation phase.

I am also deeply concerned with cross-platform portability of the
library and the programs that will/would use it.

So, could I have some advice from you? What language should I use?
Please do not just say "C++" (or maybe other?), but also explain a
little!

Thank you in advance.
Andrey Kuzmenko.
 
V

Victor Bazarov

[...]
So, could I have some advice from you? What language should I use?
C++

Please do not just say "C++" (or maybe other?), but also explain a
little!

Why in the world anybody in a C++ newsgroup recommend you anything *but*
C++? Think about it. And what explanation are you looking for? C++ is
_the_ language for many in the programming business nowadays, it is
certainly _the_ language of choice for everyone who comes here on more
or less regularly.

You could ask in a language-neutral newsgroup, like comp.software-eng or
sci.math.*. Perhaps there you would get a less biased response. But be
aware that language comparisons are a futile exercise. Pick one and run
with it. Use whatever feels most comfortable.

V
 
R

red floyd

Hello everybody!
[redacted]

I am also deeply concerned with cross-platform portability of the
library and the programs that will/would use it.
C++. Why? Because of the portability issue. C# is only available
under Windows.
 
D

Dietmar Kuehl

I'm coding C# for the last couple of years and I'm starting to hear the
rummors that managed code (like rinning under Java VM or .NET CLR) is
getting closer in performance to the natively compiled code. It's
definitely HARD to identify the robustness of the performance tests
presented all over the Internet. Some of them are claiming that C++ is
dying in favor of managed code, because managed code can gain from some
optimizations (in virtual runtime environment) that can not be done
during the compilation phase.

I heard claims like this about Java for ages, too. Although it is
typically indeed possible to create fast Java solution which
outperforms a mediocre C++ solution, I don't think that the claims
hold water. I suspect the same to be true for .Net. However, even
if the claims concerning .Net are correct, C++ would be an
appropriate choice: Microsoft currently creates C++/CLR which
compiles to managed code. That is, you just toggle a switch and
get all the performance benefits (I'd guess you switch of targeting
the CLR but maybe I'm wrong; it would not even matter to you).
I am also deeply concerned with cross-platform portability of the
library and the programs that will/would use it.

As long as you stay clear of a few specific features (notably
'export') your library should be compilable with most up to date
compilers. If you are just interested in targetting many platforms,
not compilers, you can use the whole C++ standard and use Comeau
C++ which is available on virtually all platforms.

For algorithmic library, C++ has much to offer which other languages
do not: notably you can implement the time-critical portions STL-like
on the basis of some abstractions and use only dynamic polymorphism
where you really need it and/or in realizations of the abstractions.
 
D

Dietmar Kuehl

red said:
C# is only available under Windows.

Strange... I used C# (with Mono) on my Linux machine. Maybe
Linux is now the same as Windows - I should really pay more
attention to the news!
 
A

andreykuzmenko

Of course I'm also exploring other opinions. And yes, I wanted a biased
response from C++ users, but with a little explanations. Thanks!
 
R

red floyd

Dietmar said:
Strange... I used C# (with Mono) on my Linux machine. Maybe
Linux is now the same as Windows - I should really pay more
attention to the news!

I had forgotten about Mono. I hope they don't use "Is Not".
 
A

andreykuzmenko

Sorry, I wanted to reply for red floyd and just briefly tell what is
Mono... But occudentially responded to your message. Thank you for your
responses. BTW, did they (Mono) implemented the standard as completely
as Microsoft or there are some limitations?
 
D

Dietmar Kuehl

Sorry, I wanted to reply for red floyd and just briefly tell what is
Mono... But occudentially responded to your message.

No problem.
Thank you for your responses.

You are welcome.
BTW, did they (Mono) implemented the standard as completely
as Microsoft or there are some limitations?

My understanding is that Mono implements at least wants to implement
the ECMA standard plus some of the components provided by Microsoft
which are not standardized. They also have their own replacements
for some the Microsoft libraries. However, this discussion is
off-topic in comp.lang.c++ and better answered on the Mono site.
 
G

gipsy boy

Hello everybody!

I'm starting moving out my scientific library (neural networks) from
Delphi. Currently I'm being concerned with selection of a new language
for its development. The library uses the following very intensively:
memory allocation/deallocation, virtual method calls, accessing objects
by reference from other objects, methematical calculations (various -
arifmetic, triginometric), and employs collections much. It's also
important what the library does NOT use any input/output operations and
has nothing to do with user interface. But it needs to be used in other
programs that have UI.

I'm coding C# for the last couple of years and I'm starting to hear the
rummors that managed code (like rinning under Java VM or .NET CLR) is
getting closer in performance to the natively compiled code. It's
definitely HARD to identify the robustness of the performance tests
presented all over the Internet. Some of them are claiming that C++ is
dying in favor of managed code, because managed code can gain from some
optimizations (in virtual runtime environment) that can not be done
during the compilation phase.

I am also deeply concerned with cross-platform portability of the
library and the programs that will/would use it.

So, could I have some advice from you? What language should I use?
Please do not just say "C++" (or maybe other?), but also explain a
little!

You can't use (template) functions as objects in Java, but you can in
C++; which will be a big advantage if you want to program the transition
functions of the NN nodes like that, and genetic transformation of them.
Java might be 'more OO' so to speak, but at a functional level C++ is a
lot more flexible.

I would however recommend using C++ combined with Lua for this kind of
project. You use C++ to program the structure of the NN, and then you
use Lua to fill in the details (transitions, genetic pools, and problems
it needs to solve).
 
M

Michael Moreno

- C# is closer to Delphi than C++ is.
- The C# debugger is easier and much more pleasant to use than a C++
one.
- C++ will almost certainly always be faster
- C++ is platform independant. C# is not.
- C++ has many more free ressources that you could use than C#.
- C# is still evolving a lot and depends on what MS decides to do with
it in the future. Think about the VB 6 developpers.

Myself I would use C# because I favor the speed of dev and debugging.
Others will favor C++ for their own reasons.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top