From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 5b1e799cdb,3ef3e78eacf6f938 X-Google-Attributes: gid5b1e799cdb,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!news.albasani.net!not-for-mail From: "BGB / cr88192" Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.modula3,comp.lang.pascal,comp.programming Subject: Re: Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? Date: Sat, 18 Jul 2009 09:27:56 -0700 Organization: albasani.net Message-ID: References: X-Trace: news.albasani.net P0rmMZQYJIt+Pm2MZnF7CjxcGOAjLqRlef6Kt1iLIgZijSXSiwcekWg0DcntJIk1SGbX4PiCXxTLU2vm0Dw5wocgu+gcpqJWz8CsfqJfIq4TCmkjp5mYbd9+QkkEM7J0 X-Complaints-To: abuse@albasani.net NNTP-Posting-Date: Sat, 18 Jul 2009 16:27:58 +0000 (UTC) X-User-ID: CUuBTspqL3ChyckuxiTCePJf2bm43FzTc6UZ7BPZJcs= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325 X-RFC2646: Format=Flowed; Response X-Newsreader: Microsoft Outlook Express 6.00.3790.3959 Cancel-Lock: sha1:LFgRXrsBQ2+R/TMBVOA8l+XYBHw= X-NNTP-Posting-Host: Mk7KBs6a3dm0SQy8WMfkWE92D9Ib0vKqg365hA0gGZ8= X-Priority: 3 X-MSMail-Priority: Normal Xref: g2news2.google.com comp.lang.eiffel:300 comp.lang.ada:7134 comp.lang.modula3:27 comp.programming:11758 Date: 2009-07-18T09:27:56-07:00 List-Id: "Andrea Taverna" wrote in message news:h3sln0$rhm$2@news.eternal-september.org... > 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. > ("better" is debatable... some define it in terms of more subjective aspects, and others are more pragmatic about the matter...). > 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. > although I don't personally use it (for varried and numerous reasons), have you considered Java?... afaik, modern Java involves a fair amount of JIT-time optimization, and so for carefully written code can be performance-competative with C and C++... it is a similar situation with C#. (the big cost in my case, however, is not performance, but that they depend on these particular VMs...). for my uses though, I typically use C and C++ (and ASM...). these languages are just best suited for what I do with them. of those listed, FreePascal and Ada seem like ok bets. the main cost is that they have far smaller development communities than C and Java and like, and like I have seen with many smaller languages, the developer communities often tend to have a kind of fanatical zeal... (in place of a more pragmatic outlook...). Delphi may be worth looking into, given it is similar to FreePascal, and has (AFAIK) a larger developer base. > 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. > conservative GC typically works plenty well in C, at least as long as people refrain from esoteric trickery ("oh I can't xor pointers or store them in a file, thus GC is useless", ...). granted, conservative GC does work better in single-threaded C and C++ than in multithreaded code... > 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.