wiki:Doc/panc/language

Changes & Evolution

Incompatible Changes

There are a few incompatibilities with the previous c/c++ implementation of the pan compiler. These changes should have only a minor impact on actual usage of the pan language.

The 'final' keyword is not enforced in structure templates. Because of implementation details, this functionality has not been implemented in the first java version. It will be implemented in a future release. This should have a minor impact because the final keyword is usually used with absolute paths or with global variables, both of which are enforced with the first java implementation.

Assignment expressions can no longer be embedded in DML. Previous versions of the pan compiler allowed assignment operations to appear anywhere in an expression. This leads to ambiguous expressions (from a user's point-of-view) and forces the grammar to be LL(2) rather than LL(1) in many places (slowing down the parsing). Given that this construct is rarely used, this has not been implemented in the java version of the compiler.

Evolution

This page describes the changes which are planned for the pan language. The overall goal of these changes are either to simplify the language from the user's point-of-view or to speed (and simplify) the pan parser. The referenced milestones indicate when these changes will likely appear in the pan compiler.

Remove support for 'define' keyword. (milestone:panc-8.0.0) This keyword actually serves no real purpose in the pan language. Support for this keyword requires larger look-aheads in the lexer/parser and slows down the parsing with no benefit.

Remove support for 'declaration' and 'descro' keywords. (milestone:panc-8.0.0) These keywords perform no useful purpose in the current implementation of the compiler. The information they convey can be equally well represented with comments. These keywords will be removed. Eventually a more general annotation facility will be added to the language.

Remove delete statement. (milestone:panc-8.0.0) The functionality this statement provides is also provided by an assignment to 'null'. The assignment is more in keeping with a declarative language. Moreover, the conflict between this keyword and an identically named function complicates the pan grammar.

Switch to all uppercase automatic variables. (milestone:panc-9.0.0) The current best practices for global variables is that they should be all uppercase to avoid conflicts with local variables. The automatic variables (argc, argv, self, loadpath, and object) should follow this convention. Moreover, 'object' is also a keyword causing a conflict with the automatic variable and complicating the pan grammar. These variable should become ARGC, ARGV, SELF, LOADPATH, and OBJECT.

Allow only a DML blocks to be used with include statements. (milestone:panc-10.0.0) This will simplify the lexer by reducing the number of times it must enter a special lexical state (or namespaced identifiers). It also simplifies the grammar by removing a branch. It is not backwards compatible because all name will at a minimum need to be enclosed in quotes.

Last modified 17 years ago Last modified on Mar 22, 2007, 3:49:55 PM