Andrea Taverna
2009-07-18 14:19:40 UTC
Hi folks!
I'm a CS student and I often need to write number-crunching code dealing
with combinatorial optimization problems.
What I do usually is implementing ad-hoc algorithms and testing their
performance against other previously-known solutions, including general
solvers.
In the past I used C, but now I have decided to change language.
I'm looking for a "better" one.
Here follow the features it should have, ranked approximately by relevance:
0) open-source support and an alive community
1) directly compiled to efficient code
2) statically typed and object-oriented, better if multi-paradigm
3) general-purpose libraries (possibly standardized, either by standard
or de facto), including containers and some math abstractions.
4) garbage collected. As an alternative, provide memory management
policies via libraries (e.g. memory pools and such)
5) optional run-time checks and some kind of control over compilation
and low-level issues
6) "relatively simple and consistent"
So I have considered these alternatives: FreePascal, Eiffel, Ada and
Modula-3.
I have taken a look at all of them and I'm still undecided. Below are
the impressions I got for each language.
Can you help me? Feel free to recommend other languages as well.
TIA
--> Impressions I got for each language
- FreePascal is a safe and modular alternative to C and C++, but
it is also close to the latter in terms of expressiveness. Moreover it
doesn't seem to have the libraries I need.
==>Qualifies for 0,1,2,5. Not sure about 3 and 4
- Eiffel is geared toward application programming in
medium/large-sized teams relying heavily on OO modelling. It is designed
for (re)usability, correctness and efficiency in this order.
My needs are somewhat different though.
The main gripe I have with Eiffel is the lack of a well-documented
standard gpl'ed library.
GOBO and EiffelBase seem to have incomplete or non-free documentation
and I couldn't find tutorials; as such, I couldn't get a clear picture
about them.
==> Qualifies for 0,1,2,4,5 and 6. Not sure about 3.
- Ada is best suited for large teams and/or critical software, thus
it may be overkill for my work, OTH it could have anything I might
happen to need.
What holds me from jumping onto Ada is the potential complexity
It would be interesting to hear the experience of other people learning
Ada from the C/Java background.
As for memory management (requirement 4), I heard there are different
takes on the matter:
(a) Ada uses dynamic stack allocation a lot, and in a transparent way,
reducing the need of manual management (MM)
(b) Ada libraries adopt idioms that further simplifies MM issues
(c) Conservative garbage collectors such as Bohem's can be used with
Ada, and they are supposed to work "better" with Ada than with unsafe
languages such as C and C++
So can MM be said to be easier in Ada than in C? I hope Ada-ers will
mercifully shed some light on the issue.
There seems to be a lot of Ada95 free documentation on the net, I guess
it's suitable for Ada05 as well.
==> Qualifies for 0,1,2,3,5 and, partially, 4
- Modula-3 is simpler/smaller than Ada and has been successfully
used for system/application programming.
It seems to be the most consistent, simple and easy to grok, but I
couldn't find any container/math library ready to use.
==> Qualifies for 0,1,2,4,5,6.
I'm a CS student and I often need to write number-crunching code dealing
with combinatorial optimization problems.
What I do usually is implementing ad-hoc algorithms and testing their
performance against other previously-known solutions, including general
solvers.
In the past I used C, but now I have decided to change language.
I'm looking for a "better" one.
Here follow the features it should have, ranked approximately by relevance:
0) open-source support and an alive community
1) directly compiled to efficient code
2) statically typed and object-oriented, better if multi-paradigm
3) general-purpose libraries (possibly standardized, either by standard
or de facto), including containers and some math abstractions.
4) garbage collected. As an alternative, provide memory management
policies via libraries (e.g. memory pools and such)
5) optional run-time checks and some kind of control over compilation
and low-level issues
6) "relatively simple and consistent"
So I have considered these alternatives: FreePascal, Eiffel, Ada and
Modula-3.
I have taken a look at all of them and I'm still undecided. Below are
the impressions I got for each language.
Can you help me? Feel free to recommend other languages as well.
TIA
--> Impressions I got for each language
- FreePascal is a safe and modular alternative to C and C++, but
it is also close to the latter in terms of expressiveness. Moreover it
doesn't seem to have the libraries I need.
==>Qualifies for 0,1,2,5. Not sure about 3 and 4
- Eiffel is geared toward application programming in
medium/large-sized teams relying heavily on OO modelling. It is designed
for (re)usability, correctness and efficiency in this order.
My needs are somewhat different though.
The main gripe I have with Eiffel is the lack of a well-documented
standard gpl'ed library.
GOBO and EiffelBase seem to have incomplete or non-free documentation
and I couldn't find tutorials; as such, I couldn't get a clear picture
about them.
==> Qualifies for 0,1,2,4,5 and 6. Not sure about 3.
- Ada is best suited for large teams and/or critical software, thus
it may be overkill for my work, OTH it could have anything I might
happen to need.
What holds me from jumping onto Ada is the potential complexity
It would be interesting to hear the experience of other people learning
Ada from the C/Java background.
As for memory management (requirement 4), I heard there are different
takes on the matter:
(a) Ada uses dynamic stack allocation a lot, and in a transparent way,
reducing the need of manual management (MM)
(b) Ada libraries adopt idioms that further simplifies MM issues
(c) Conservative garbage collectors such as Bohem's can be used with
Ada, and they are supposed to work "better" with Ada than with unsafe
languages such as C and C++
So can MM be said to be easier in Ada than in C? I hope Ada-ers will
mercifully shed some light on the issue.
There seems to be a lot of Ada95 free documentation on the net, I guess
it's suitable for Ada05 as well.
==> Qualifies for 0,1,2,3,5 and, partially, 4
- Modula-3 is simpler/smaller than Ada and has been successfully
used for system/application programming.
It seems to be the most consistent, simple and easy to grok, but I
couldn't find any container/math library ready to use.
==> Qualifies for 0,1,2,4,5,6.