Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #3180
| From | Martin Ward <martin@gkc.org.uk> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: What attributes of a programming language simplify its implementation? |
| Date | 2022-10-01 15:56 +0100 |
| Organization | Compilers Central |
| Message-ID | <22-10-002@comp.compilers> (permalink) |
| References | <22-09-026@comp.compilers> |
On 30/09/2022 12:46, Christopher F Clark wrote:
> What attributes of a programming language simplify its implementation.
>
> 1. Simple semantics. That's it. Simple semantics. (Simple meaning
> whatever is easy to implement. Not mathematical elegance. Not
> consistency.)
> sweep any hard semantics under the rug and don't worry about them.
> ... Label anything that doesn't
> work the way you want in your implementation, "undefined behavior".
This might be OK for a throw away student project (but I still
think students ought to understand the importance of elegance),
but for a production compiler/language that is going
to be used by lots of programmers for lots of projects,
it is a classic example of optimizing the wrong thing.
The tiny amount of time you saved with incomplete and inconsistent
behaviour is lost many times over as programmers spend hours debugging
weird behaviour, working around the missing or inconsistent semantics
and writing convoluted code to avoid undefined behaviour.
"Sweep any hard semantics under the rug": where the hackers can find
it and exploit the inevitable security holes created by the semantics
that your simple implementation happens to give you (that you labelled
as "undefined behaviour").
Make every single programmer who uses your compile do extra work in
every program they write, just so that you can save a little bit of
work in the design and implementation of your compiler because you
don't care about mathematical elegance or consistency.
C is filled with
> By the way Richard P Gabriel famously wrote about this, coining the phrase
> "Worse is better".
Gabriel argued that "Worse is better" produced more *successful*
software than the MIT approach. This is true, of course, but success
of bad software is a bad thing, not a good thing. Highly successful
bad software has been filling the columns of comp.risks ever since it
began.
What does this C code print:
unsigned int plus_one = 1;
int minus_one = -1;
if (plus_one < minus_one)
printf("1 < -1");
else
printf("boring");
--
Martin
Dr Martin Ward | Email: martin@gkc.org.uk | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar
What attributes of a programming language simplify its implementation? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2022-09-30 12:46 +0100
Re: What attributes of a programming language simplify its implementation? Martin Ward <martin@gkc.org.uk> - 2022-10-01 15:56 +0100
Re: What attributes of a programming language simplify its implementation? gah4 <gah4@u.washington.edu> - 2022-10-01 17:05 -0700
Re: What attributes of a programming language simplify its implementation? gah4 <gah4@u.washington.edu> - 2022-10-02 00:11 -0700
Re: What attributes of a programming language simplify its implementation? "Robin Vowels" <robin51@dodo.com.au> - 2022-10-03 12:34 +1100
Re: What attributes of a programming language simplify its implementation? robin51@dodo.com.au - 2022-10-03 15:59 +1100
Re: What attributes of a programming language simplify its implementation? gah4 <gah4@u.washington.edu> - 2022-10-03 12:28 -0700
Re: What attributes of a programming language simplify its implementation? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2022-10-02 01:21 +0100
Re: What attributes of a programming language simplify its implementation? Thomas Koenig <tkoenig@netcologne.de> - 2022-10-08 22:44 +0000
Re: What attributes of a programming language simplify its implementation? "minf...@arcor.de" <minforth@arcor.de> - 2022-11-14 05:14 -0800
Re: What attributes of a programming language simplify its implementation? gah4 <gah4@u.washington.edu> - 2022-11-15 06:09 -0800
RE: Re: What attributes of a programming language simplify its implementation? Roger L Costello <costello@mitre.org> - 2022-11-15 11:52 +0000
Re: Re: What attributes of a programming language simplify its implementation? <minforth@arcor.de> - 2022-11-15 09:48 -0800
Re: Re: What attributes of a programming language simplify its implementation? RPN? gah4 <gah4@u.washington.edu> - 2022-11-15 16:11 -0800
Re: Re: What attributes of a programming language simplify its implementation? RPN? "minf...@arcor.de" <minforth@arcor.de> - 2022-11-16 04:54 -0800
Re: Re: What attributes of a programming language simplify its implementation? RPN? "minf...@arcor.de" <minforth@arcor.de> - 2022-11-16 05:39 -0800
Re: Re: What attributes of a programming language simplify its implementation? RPN? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2022-11-16 18:12 +0000
csiph-web