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: 103376,f822ae7b0f7433c1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Translating an embedded C algorithm Date: Tue, 16 Jan 2007 23:47:30 +0000 Organization: Pushface Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1168991248 15252 62.49.19.209 (16 Jan 2007 23:47:28 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 16 Jan 2007 23:47:28 +0000 (UTC) Cancel-Lock: sha1:xMUb1L9MBiKeEwNWMmpiTMgb9r8= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:8208 Date: 2007-01-16T23:47:30+00:00 List-Id: "Alexander E. Kopilovich" writes: > Ada has many features, which are directly related to real-time > embedded programming, and which have no counterparts in C (tasking, > timing, and fixed-point types built in). > > Therefore there is little chance for translation of a program of > that kind from C to Ada without essential redesign of that program > (for making proper use of available Ada features). > > But if the program will be redesigned for Ada then there will be > little sense in placing those C and Ada implemetation side-by-side > for comparison. > > So, within this kind of software, probably C and Ada may be sensibly > put side-by-side not for pieces of code or relatively small > algorithms, but only for whole projects (applications or even > systems). But the OP's example isn't in any way specifically embedded or RT, and in a one-page example one wouldn't expect more. There are some externally-defined macros which might be 'embedded', and which could be interesting to us but perhaps don't address the point to be made. If what is wanted is an example of what code looks like then I see no reason not to provide an Ada translation. If possible, it should be in real Ada and not a transliteration of the C.