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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLY autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.182.246.134 with SMTP id xw6mr10627367obc.38.1432305248863; Fri, 22 May 2015 07:34:08 -0700 (PDT) X-Received: by 10.140.88.80 with SMTP id s74mr132058qgd.16.1432305248839; Fri, 22 May 2015 07:34:08 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!h15no7596629igd.0!news-out.google.com!k20ni44835qgd.0!nntp.google.com!z60no3217825qgd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 22 May 2015 07:34:08 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=78.27.123.114; posting-account=QrZwxQoAAAByl3YAWTpexAk3yBYyZMHn NNTP-Posting-Host: 78.27.123.114 References: <127b004d-2163-477b-9209-49d30d2da5e1@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <65ca4d5b-b1ae-403c-99c5-dec6f2e1dd54@googlegroups.com> Subject: Re: Build language with weak typing, then add scaffolding later to strengthen it? From: kalvin.news@gmail.com Injection-Date: Fri, 22 May 2015 14:34:08 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:25945 Date: 2015-05-22T07:34:08-07:00 List-Id: perjantai 22. toukokuuta 2015 17.01.14 UTC+3 kalvi...@gmail.com kirjoitti: > perjantai 22. toukokuuta 2015 15.57.07 UTC+3 J-P. Rosen kirjoitti: > > Le 22/05/2015 13:29, kalvin.-nospamhere-news@gmail.com a =E9crit : > > > Even C could be made more robust, if simple type checking is > > > performed at compile time. For example, > > >=20 > > > typedef int apples; > > >=20 > > > typedef int oranges; > > >=20 > > > apples a =3D 5; oranges o =3D a; > > >=20 > > > 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. > > >=20 > > 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. > >=20 > > 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. > >=20 > > --=20 > > 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 >=20 > What I heard, C is used in programming some operating systems. And C/C++ = has been even used for programming some serious large-scale applications - = not very low level to me. I have also heard some rumours that quite often b= ugs in C/C++ software are related to its non-existent type validation ;) Ad= ding some type checking wouldn't make it less suitable for low-level progra= mming. After 20 years in embedded C/C++ programming, I cannot say that it i= s good even for low level programming because of the weak type checking. C/= C++ are the cancer of software engineering. What I would like to see in C/C++, and what would make me a bit less grumpy= , is a compiler "#pragma strict" - or something like that - which would ena= ble improved type checking in the compilation entity. Better yet, an improv= ed Lint with strict type checking rules because some of the C compilers are= legacy and cannot be upgraded. In that way, it would be backwards compatib= le, it wouldn't break any existing C/C++ source code base, but it would all= ow (at least me) to check my own code for type validity before I commit the= code into the version control system. At would be also a step forward in o= rder to make an improvement in code quality and robustness.