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-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!e4g2000vbe.googlegroups.com!not-for-mail From: Andrea Taverna Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.modula3,comp.programming Subject: Re: Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? Date: Sun, 19 Jul 2009 06:35:29 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1ac0d96f-9dfc-4bcb-abff-2f5cb1c5da8d@e4g2000vbe.googlegroups.com> References: <7cf9peF2758tgU1@mid.individual.net> NNTP-Posting-Host: 151.47.216.68 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1248010529 17211 127.0.0.1 (19 Jul 2009 13:35:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 19 Jul 2009 13:35:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e4g2000vbe.googlegroups.com; posting-host=151.47.216.68; posting-account=q_H03goAAABDwevycEkYzGRVjq5lpBVA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.eiffel:310 comp.lang.ada:7148 comp.lang.modula3:36 comp.programming:11825 Date: 2009-07-19T06:35:29-07:00 List-Id: I'm going to reply about OCaML, Haskell and CL via Andrew's post On 19 Lug, 03:04, Andrew Reilly wrote: > I think that you should consider stretching yourself a bit further: > others have suggested Ocaml and Hascall. I'd add that modern Common Lisp > (eg SBCL) ticks all of your boxes too. You might be surprised that there > are some scheme implementations that will fit, too, and both of those are > perhaps more "multi-paradigm" than the languages that you've got on your > short list. I'm still learning CL and that's been enlightening so far. I implemented Prim's MSTP algorithm with that, getting pretty satisfying performance for large instances (thansk to declare&friends). However CL is dynamically typed, and my algorithms will hardly need (its) dynamic typing. Out of curiosity, I've already planned to reimplement an algorithm of mine, a branch-and-bound one, in CL to see, among other things, how it compares in terms of effciency. In future I'd like to write a neural-network toolbox similar to Mathlabs' for CL as well. Note that these are *plans*, something I think of and that I'll be sitting on for a long time ;^) I looked at O'CaML a few times, and I've heard different opinions on the usenet. I can't remember exactly, but it felt like having some annoying idiosyncrasies both at language and implementation level. I ruled it out because differs a lot from other languages (i.e. algol's heirs) and I wanted a more familiar language, one I can currently trust given my cultural preparation. Finally Haskell. It requires a significant mental shift, something I can't afford now. And I fear that lazy evaluation may cause a disastrous performance loss with my algorithms when used improperly. Too risky for now. On 19 Lug, 03:04, Andrew Reilly wrote: > These are all fine choices of languages, but I wonder how much benefit > you will be getting for yourself, as a sole-coder programming to produce > results, rather than code? > For various reasons, that's not a problem. There are projects for which I'll be alone anyway. > 1: how fast is fast enough? =A0 It may be "just enough" or "as much as possible". For most of the heuristic approaches the former, for exact ones the latter. > 2: How much do you really need object orientation? =A0 None of the languages I listed prevents me from using modularity in place of OO. > 3: Libraries are good to have. =A0You'll find that C and Fortran still ha= ve > the lions share of the numerical ones, though. I can interface to both with any of the languages above IIRC. > 4: Garbage collection is really nice to have, as a programmer. =A0Leave > this one in, but recognize that (a) you can do it in C if you want to and > (b) doing without involves more pain but can be made to work. =A0See (1). > Still, as I learnt with CL and C, the problem always reduces to these recommendations: - if you need dynamic memory, don't use it - Manage memory as rarely as possible - standard allocators suck > 5: C and Fortran don't give you much of this out of the box, I don't know Fortran, unfortunately As for C, been there, done that. I never used assert because I strived to organize the code in a more structured way, and that, together with bug-fixing and writing comments to explain the code, took most of the time. In other terms, I recognized I was reimplementing what Ada, M3, Eiffel.... give and optimize for free. Now I want to check if what they offer is true. Eventually, less may still be more, or not, who knows? Andrea