1 Native Function Definitions
2 ===========================
3
4 Native functions are principally associated with the facilities of the
5 builtins and native modules. Although Python modules are provided to define
6 the contents of these modules (the former referenced via the __builtins__
7 module name in programs), unlike other modules, it is not generally desirable
8 to translate the code of such modules literally. Instead, native functions are
9 provided which define the functionality, and these functions will be provided
10 by the eventual platform-specific implementation.
11
12 However, some definitions found in the builtins module should be translated,
13 since it is possible to define the behaviour of these objects efficiently in
14 Python. Such definitions employ docstrings, indicating that the contents of
15 the object definitions are to be traversed by the code generator. Other
16 library modules can also be translated.
17
18 In addition to module functionality, some features of generated programs will
19 also be defined in terms of native code. The intention is to implement such
20 code in syspython (see syspython.txt), where the semantics of the language can
21 unambiguously and explicitly support the low-level operations required. In
22 other words, since syspython does not need to support the breadth of Python
23 semantics, certain elements of the syntax can be repurposed for low-level
24 operations without conflicting with the expression of conventional program
25 semantics (which will have been rewritten in other terms in the translation
26 process).