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!news.mixmin.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.fr7!futter-mich.highwinds-media.com!news.highwinds-media.com!fx03.am4.POSTED!not-for-mail Subject: Re: Why does Ada compile slower than Python? Newsgroups: comp.lang.ada References: From: bartc User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: http://netreport.virginmedia.com NNTP-Posting-Date: Tue, 03 Oct 2017 13:06:55 UTC Organization: virginmedia.com Date: Tue, 3 Oct 2017 14:07:01 +0100 X-Received-Bytes: 2496 X-Received-Body-CRC: 2073516286 X-Original-Bytes: 2445 Xref: news.eternal-september.org comp.lang.ada:48315 Date: 2017-10-03T14:07:01+01:00 List-Id: On 03/10/2017 00:01, 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. What sizes of programs are we talking about here? In terms of numbers of lines of code. And how long to you have to wait in each case. Languages like Python can have a swift byte-code compiler which puts the code into memory and then it can start execution immediately, doing any dynamic linking on-demand as it runs. But even here, a big program may cause noticeable start-up delays. A static language like Ada may depend on a slow, cumbersome compiler like gcc (I think that's how Gnat works; I've never used it), and then there is a build process to create an executable. The process may also depend on configuration scripts and makefiles. It may have to deal with library info (like header files in C) which may dominate the size of your application. Such languages are not really designed for rapid turn-around. Ada is also rather more complicated, although I'm not sure how much of a factor that is. (I write small compilers for simple languages. My byte-code compilers can work at up to 1Mlps (one million lines of code per second). My static compilers can generate native code at 0.5Mpls. So there needn't be a big gulf between the two kinds of languages. It's just that mainstream tools tend to be big and slow. While my compilers do little optimisation, the difference between mine and something like gcc can be well within a factor of two in generated code speed. But my compiler can do its job 100 times faster.) -- bartc