From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.9 required=3.0 tests=BAYES_50,FREEMAIL_FROM, PLING_QUERY autolearn=no autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a05:620a:13b4:: with SMTP id m20mr29221556qki.24.1617095082284; Tue, 30 Mar 2021 02:04:42 -0700 (PDT) X-Received: by 2002:a25:b906:: with SMTP id x6mr42060464ybj.504.1617095082076; Tue, 30 Mar 2021 02:04:42 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 30 Mar 2021 02:04:41 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=95.244.175.227; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 95.244.175.227 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <41bc7a62-9c70-466d-b316-5fc74a3ee845n@googlegroups.com> Subject: Adapting an Ada compiler to generate 8051 code (Again?! ;-) From: mockturtle Injection-Date: Tue, 30 Mar 2021 09:04:42 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:61677 List-Id: Dear.all, for a project related to a possible start-up, we need to program a Flash co= ntroller that has a 8051 core (as many other controllers). I would like us= ing Ada for that, but I discovered (also by browsing c.l.a.) that there is = no Ada compiler producing 8051 code. I am considering involving some university colleagues of mine to start a pr= oject aimed to having an Ada compiler for 8051, possibly leveraging some ex= isting compiler. According to some post read here, I understand that it is= not totally impossible, if we are willing to accept some limitations. I did not study (yet) in detail the 8051, but as I understand it is a small= 8-bit processor, with flash memory for code and data and a small amount o= f RAM onboard (but maybe this depends on the specific controller). My know= ledge about compilers is superficial, but I guess we should give up to some= Ada features like * Multitasking (maybe only non preemptive policy, single priority, no dyn= amic task allocation? Kind of coroutines...) * Dynamic memory allocation * Exception raising, but not handling, an exception would stop the execut= ion (I guess having an exception inside a microcontroller is not a nice ide= a... This sounds like a job for Spark to be sure that no exception will ha= ppen) * OOP? Some of that can be retained? * Run-time check of contracts (maybe can be kept active during developmen= t and debugging) Considering the kind of software usually run inside a micro-controller, the= se limitations do not sound too severe. We would retain all the "syntactic= features" of Ada like strong typing, packages, named parameters and so on.= .. that are a strong help in writing correct software. Also, with the limi= tations above a 8051 Ada code most probably would be also a Spark code.= =20 I have some knowledge about compilers, but not so deep to understand the di= fficulties of this project and I would like to ask you 1. The most challenging points that you see in such a project, also if I fo= rgot something in the list of "feature to be given up" 2. Some compiler we can start from 3. An estimate of the effort in person-month (you wish...), considering a s= killed but inexperienced programmer (like a skilled university student)=20 =20 Thank you! Riccardo