Author: larry Date: Fri Feb 8 18:40:45 2008 New Revision: 14506 Modified: doc/trunk/design/syn/S11.pod
Log: Some thoughts on strict versioning of language tweaking modules Modified: doc/trunk/design/syn/S11.pod ============================================================================== --- doc/trunk/design/syn/S11.pod (original) +++ doc/trunk/design/syn/S11.pod Fri Feb 8 18:40:45 2008 @@ -12,9 +12,9 @@ Maintainer: Larry Wall <[EMAIL PROTECTED]> Date: 27 Oct 2004 - Last Modified: 5 Jan 2008 + Last Modified: 8 Feb 2008 Number: 11 - Version: 21 + Version: 22 =head1 Overview @@ -503,4 +503,45 @@ shebang line. Nor is it necessary to force PerlĀ 6 in any file that begins with the "class" or "module" keywords. +=head1 Tool use vs language changes + +In order that language processing tools know exactly what language they +are parsing, it is necessary for the tool to know exactly which variant +of Perl 6 is being parsed in any given scope. All Perl 6 compilation +units start out at the top in the Standard Dialect (which has versions +that correspond to the same version of the official Perl test suite). + +All language tweaks from the start of the compilation unit must +be tracked. Tweaks can be specified either directly in your code as +macros and such, or such definitions may be imported from a module. +As the compiler progresses through the compilation unit, other grammars +may be substituted in an inner lexical scope for an outer grammar, +and parsing continues under the new grammar (which may or may not be +a derivative of the standard Perl grammar). + +Note that most class modules do no language tweaking, and in any case +cannot perform language tweaks unless explicitly imported. + +You may import language tweaks from your own code as you like; however, +all imports of language tweaks from the official library must specify +the exact version of the module. Such officially installed versions +must be considered immutable, so that once any language-tweaking +module is in circulation, it may be presumed to represent a fixed +language change. By examination of these versions a language +processing tool can know whether it has sufficient information to +know the current language. In the absence of that information, +it can choose either to download and use the module directly, or +the tool can proceed in ignorance. As an intermediate position, +if the tool does not actually care about running the code, the tool +need not actually have the complete module in question; many language +tweaks could be stored in a database of module versions, so if the +tool merely knows the nature of the language tweak on the basis of the +version number it may well be able to proceed with perfect knowledge. +A module that uses a well-behaved macro or two could be fairly easily +emulated based on the version info alone. + +This strict versioning policy also prevents the need to refetch +modules that are known not to have changed, since they are considered +immutable. + =for vim:set expandtab sw=4: