Why is python not written in C++ ?

Neil Hodgson nyamatongwe+thunder at gmail.com
Thu Aug 5 18:59:28 EDT 2010


Paul Rubin:

> C has all kinds of undefined behavior.  "Might need to rely on" is not
> relevant for this kind of issue.  Ada's designers had the goal that that
> Ada programs should have NO undefined behavior.

   Ada achieves this by describing a long list of implementation defined
behaviour (Annex M).
http://oopweb.com/Ada/Documents/Ada95RM/Volume/m.htm

> As a famous example of C's underspecification, the behavior of
> 
>    a[i++] = i;
> 
> is undefined in C99.

   Ada does not define ordering in all cases either. For example the
order of elaboration of library_items (essentially the order in which
modules are run in the absence of explicit declarations) is defined for
GNAT as

"""
first elaborating bodies as early as possible (i.e. in preference to
specs where there is a choice), and second by evaluating the immediate
with clauses of a unit to determine the probably best choice, and third
by elaborating in alphabetical order of unit names where a choice still
remains
"""

   Other compilers use different orders.

   I just love that "probably".

   Neil



More information about the Python-list mailing list