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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Build language with weak typing, then add scaffolding later to strengthen it? Date: Thu, 21 May 2015 14:11:44 -0500 Organization: Aioe.org NNTP Server Message-ID: Reply-To: nma@12000.org NNTP-Posting-Host: CV72NQ0GT7rQd8cP1ZYi/A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:25932 Date: 2015-05-21T14:11:44-05:00 List-Id: There seems to be strange thing going on with computer language design, that I think folks here more than anywhere else would understand due to Ada strong software engineering foundation. I noticed languages start with weak or no typing at all. Then later in the language life, lint like processing and type hints are added to "strengthen" the language by making it more strongly typed and catch more errors. Programmers get excited each time a new scaffolding tool is added since it now makes their language "better". But why not then design the language with strong typing in first place? Would not this be easier? It is like constructing a building on weak foundation, then add scaffolding on it later on to make it stronger. Here is an example: Python now is adding what is called "type hints" and everyone is excited about it since it is supposed to make python more robust: https://www.python.org/dev/peps/pep-0484/ "While these annotations are available at runtime through the usual __annotations__ attribute, no type checking happens at runtime . Instead, the proposal assumes the existence of a separate off-line type checker which users can run over their source code voluntarily. Essentially, such a type checker acts as a very powerful linter. " And we all know that C has lint also, to help catch errors in code since C is weakly typed as well. Fortran adds many compiler switches to help catch compile time errors which otherwise would escape. I now use gfortran -fcheck=all -Wall -Wconversion -Wextra -Wconversion-extra -pedantic To make sure I checked everything, and I am still not sure it did. (many times I download Fortran source code from the net for fun and compile it using the above, and I see many warnings generated, many due to mixed typing mess. It is scary). In Ada, none of this is needed, as the language itself is designed from the foundation to catch all these errors due to its strong typing. So, why do language designers design computer languages with weak typing, and then spend so much effort later on to fixing the weak typing? Is it because it is easier to design a language with weak typing than strong one? --Nasser