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-Thread: 5b1e799cdb,3ef3e78eacf6f938 X-Google-Attributes: gid5b1e799cdb,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) 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 17:28:31 +0200 Organization: Informatimago Message-ID: <87tz18bskg.fsf@galatea.local> References: <7cf9peF2758tgU1@mid.individual.net> <1ac0d96f-9dfc-4bcb-abff-2f5cb1c5da8d@e4g2000vbe.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net tjAh0bxpzPxLKvPAuNKdsQeguRhG3NuFWMqdXYnjl8W5TdO7cE Cancel-Lock: sha1:NDQyMzhhZDAxMDNjNzkwYTUyYjQ0OTQ0ZTdhNTc5NjAwOGFmNGFhMA== sha1:BnaL5MoK88/KDcHasGC0KSkp2As= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Xref: g2news2.google.com comp.lang.eiffel:313 comp.lang.ada:7151 comp.lang.modula3:39 comp.programming:11833 Date: 2009-07-19T17:28:31+02:00 List-Id: Andrea Taverna writes: > I'm still learning CL and that's been enlightening so far. Given that you have notions of CL, then you could postpone your choice of programming language. You're interested in algorithms, so just write your algorithms in s-exp forms. I understand that it might be fun to let the computer execute the algorithms to see how they work out (I assume you prove your algorithms independantly of any execution, which I'll remind you can only prove that you have errors, not that your algorithm is correct). So you could write in Common Lisp the DSL (Domain Specific Language) able to interpret or translate your algorithms into CL, for animation purposes. Later, when you have a collection of proven algorithms, you may write (still in Common Lisp, why reject a winning team?), a translator to convert your algorithmic s-exps into the target language of your choice, be it Ada, Pascal, C, Eiffel, Fortran, Haskell, Modula-2 or Modula-3, whatever you need. It's almost trivial to generate such code from a DSL expressed in s-exps. C/USER1[602]> (algorithm gcd (parameters (input a integer) (input b integer)) (result integer) (cases when (= a b) then (return a) when (< a b) then (return (gcd (- b a) a)) when (> a b) then (return (gcd (- a b) b)))) GCD C/USER1[603]> (gcd 42 12) 6 C/USER1[686]> (translate-to-c '(algorithm gcd (parameters (input a integer) (input b integer)) (result integer) (cases when (= a b) then (return a) when (< a b) then (return (gcd (- b a) a)) when (> a b) then (return (gcd (- a b) b))))) int gcd(int a,int b) { if((a)==(b)){ return(a); } else if((a)<(b)){ return(gcd((b)-(a),a)); } else if((a)>(b)){ return(gcd((a)-(b),b)); } } -- __Pascal Bourguignon__