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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: Requesting advice from compiler writers Date: Mon, 24 Aug 2015 11:50:21 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <2821cd07-7462-45ec-9ae5-9ae59dc7854d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 24 Aug 2015 11:50:21 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="da745e888d4a5182b5fda6212bbb0a63"; logging-data="2539"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bc6SZ7VyuvTCJCP7/+jY/eGqG7Rqfyak=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:iLwAc6J1OwV0FRQVzie/kdVTt/k= Xref: news.eternal-september.org comp.lang.ada:27590 Date: 2015-08-24T11:50:21+00:00 List-Id: On Sun, 23 Aug 2015 11:16:00 -0700, Lucretia wrote: > Hi, > > I'm one of the people considering a new Ada compiler, I would like to > ask the people here who have actually done it, what their advice would > be. i.e. what to aim for, what to avoid doing, etc? > > I personally am aiming for a library based multi-backend system. > Basically, I'd like to see a full Ada compiler frontend with an Ada > backend, but with the ability to poach other backends, specifically > LLVM. My initial targets are unusual, Z80, MIPS and x86 (16-bit -> > 64-bit) and JVM bytecode. > > Let the mayhem commence... :D > > Ta, > Luke. I've mentioned before : I'd suggest looking at Gela-Asis as the front end. Natasha forked it to her Github last year, ( https://github.com/ faelys/gela-asis ) and (around the same time) I saw some activity on the original repo (which I can't currently see at http://gela.ada-ru.org/ gela_asis ) to bring it up to date with Ada-2012. Then I would take a good look at the ghdl project for several reasons : https://sourceforge.net/projects/ghdl-updates/?source=navbar it is the only example I know of, of a complex language compiler successfully developed by a single individual. (Tristan Gingold, who now works for Adacore. Before deciding to use anything from ghdl, it would be worth asking him if he's comfortable that there's no conflict of interest) it supports VHDL and therefore has quite a bit in common with Ada, including explicit parallelism (though a different model to Ada tasking) it is written entirely in Ada up to the intermediate representation, an intermediate language called "ortho" (which I believe is Tristan's own). it has one back-end also written in Ada - this is a JIT compiler, from "ortho" currently limited to 32-bit x86, and actually performs quite well. it also has backends from ortho to both gcc and LLVM, which between them cover a lot of targets, but are clearly not in Ada. (and some debugging facilities to save ortho, replay it through a backend, and to print/ examine it) I had considered writing a layer between Gela-Asis and ortho, using the ghdl compiler as an example of how to generate ortho. And I'm still considering it... -- Brian