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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: Why does Ada compile slower than Python? Date: Wed, 04 Oct 2017 00:08:57 +0300 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: 9OC/PY8QRnnqnNGuo4rrrw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.14.10 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:48328 Date: 2017-10-04T00:08:57+03:00 List-Id: Victor Porton wrote: > Why does Ada compile much slower than Python, even in absence of > optimization? > > We can usually get a Python source files and immediately run it. > > But with Ada we would need to wait a considerable amount of time till it > compiles. > > Why? Hm, $ time gnatgcc -c test.adb real 0m0.068s user 0m0.064s sys 0m0.000s $ time python3 test.py XXX real 0m0.040s user 0m0.032s sys 0m0.004s -- test.adb with Ada.Text_IO; use Ada.Text_IO; procedure Test is begin Put_Line("XXX"); end; # test.py print("XXX\n"); $ gnatgcc --version gnatgcc (Debian 7.2.0-8) 7.2.0 According this test (valid only for very short programs) compiling Ada is slower only two times. Maybe I was under a wrong impression, because I got this impression when I compiled tens of Ada files in a row and my brain was focused on total compilation time rather than compilation time for one file? Is GNAT really much slower than Python? or was it a false impression? This issue is quite practical: I am going to build a server which will execute (in a secure sandbox) XML converters downloaded from the Web written in different interpreted languages. By "interpreted" I mean "compiling quickly". Can we agree to count Ada as an interpreted language in this sense? -- Victor Porton - http://portonvictor.org