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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!feeder.visyn.net!visyn.net!aioe.org!not-for-mail From: Oxide Scrubber Newsgroups: comp.lang.scheme,comp.lang.ada,comp.lang.functional,comp.lang.c++,comp.programming Subject: Re: Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? Followup-To: comp.programming Date: Tue, 28 Jul 2009 20:40:01 -0400 Organization: Aioe.org NNTP Server Message-ID: References: <2009a75f-63e7-485e-9d9f-955e456578ed@v37g2000prg.googlegroups.com> NNTP-Posting-Host: UPADzacy6hUmpG8kCE4xzg.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Antivirus-Status: Clean X-Notice: Filtered by postfilter v. 0.7.9 X-Antivirus: avast! (VPS 090728-0, 28/07/2009), Outbound message Cancel-Lock: sha1:6273eb4f0E4qLsT3kgot3HHn3hs= User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) Xref: g2news2.google.com comp.lang.scheme:6138 comp.lang.ada:7387 comp.lang.functional:2501 comp.lang.c++:48441 comp.programming:12079 Date: 2009-07-28T20:40:01-04:00 List-Id: fft1976 wrote: > My needs are similar to yours, and I've been looking for better > languages and learning them for years. > > In summary: everything sucks, when you look close enough. Except Clojure. > Java: 1.5x slower than C as a rule of thumb. I think it can achieve parity. > Safe, verbose, repetitive, overengineered. Some stuff you get for free > with C++ and OCaml ("clone") or in OCaml ("marshalling"), you have to > write by hand in Java for every single class. Nope. With Java, in most cases you can slap "implements Cloneable" on a class and make the clone method public, or slap "implements Serializable" on a class to make its instances marshallable. Clojure is much better though: safe, non-verbose, non-repetitive, full access to Java libraries. Clone you mostly don't need as most data structures are immutable. Anything made purely with numbers, strings, keywords, symbols, lists, vectors, sets, and maps can be written and read using Clojure's reader, and can therefore be marshalled easily, and to a human-editable text file to boot. (This doesn't, however, interoperate with generic Java objects or Java serialization, and I'm not sure it works with data structures with circularities. It won't work with data structures with infinite sequences in them, but if you represent such sequences symbolically it can.) Last but not least, numerical Clojure code can fairly easily be tuned to give comparable performance to C or even hand-tuned assembly, and Clojure has strong support for parallelism and threading. > Gambit-C Scheme (one of the best of LISPs, IMO): about 2x slower than > C Sucks compared to Clojure. >(single core only) Sucks compared to Clojure. > but you have to work to get within 2x (unlike OCaml) You need to work a bit to get the most speed out of Clojure too, but you can then get C-like performance out of it in tight loops. > and if you want it fast, it can't be safe (switch controlled). You can have have that cake and eat it too in Clojure, aside from giving up protection against integer overflow and wrapping for that last bit of speed in integer operations. (There are "unchecked" integer operations equivalent to normal C/C++/Java arithmetic on int-like types, and "safe" ones that promote as needed to int, long, even bignum.)