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: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!1.eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Build language with weak typing, then add scaffolding later to strengthen it? Date: Fri, 22 May 2015 14:57:00 +0200 Organization: A noiseless patient Spider Message-ID: References: <127b004d-2163-477b-9209-49d30d2da5e1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 22 May 2015 12:55:56 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="23dab0694e4174fdc880833ec67fa650"; logging-data="9567"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tO2OG034XSFw6prFd3EBP" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <127b004d-2163-477b-9209-49d30d2da5e1@googlegroups.com> Cancel-Lock: sha1:79IvmLMDUNrVNWeXZOAHmDMZFi0= Xref: number.nntp.giganews.com comp.lang.ada:193248 Date: 2015-05-22T14:57:00+02:00 List-Id: Le 22/05/2015 13:29, kalvin.news@gmail.com a écrit : > Even C could be made more robust, if simple type checking is > performed at compile time. For example, > > typedef int apples; > > typedef int oranges; > > apples a = 5; oranges o = a; > > should generate type check error as the types are definitely > different types. Also, assigning enums to ints and ints to enums > should be considered illegal. > I don't agree. C is a low level language, and good at that. Its types are those of the machine: bytes and addresses, the rest is a (small quantity of) syntactic sugar. If you need strong typing, use a strongly typed language. But don't blame C for not being strongly typed, it was simply not part of the requirements. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr