Dear Community, Since releasing the Next Scripting Framework (NSF) 2.0b3, we have received feedback from early adopters. Many thanks for the helpful and the constructive comments! This feedback triggered an internal discussion and led to revising some earlier decisions on designing and on namings used in the APIs to achieve better comprehension and orthogonality. The new release differs in about 240 commits since the release of 2.0b3. The implementation is very stable and is used since more than two years in production of our large scale, multi threaded web environment inside naviserver. Most of the changes happened in NX and therefore on the NSF scripting level, without the need to modify the NSF C layer. The implementation of XOTcl 2 has changed very little. Below are the most notable differences in 2.0b5 as compared to 2.0b3: a) NX 2.0b3 used the following conventions to define methods for instances, object-specific methods and class-object specific methods: /cls/ method foo {args} {...} /obj/ method bar {args} {...} /cls/ class method baz {args} {...} Introspection was possible via (in the same order): /cls/ info methods /obj/ info methods /cls/ class info methods The problem with this convention is that e.g. "info methods" operates on different method records, depending on whether it is called on a class or on an object. This breaks a basic inheritance contract with the programmer: As nx::Class is a specialization of the most general class nx::Object, the same introspection operation (e.g., "info methods") should return e.g. object-specific methods for both class objects and ordinary, non-class objects. Therefore, we adopted the following more orthogonal conventions to define methods for instances and for object-specific methods /cls/ method foo {args} {...} /obj/ object method bar {args} {...} Introspection: /cls/ info methods /obj/ info object methods Note that we can now use the same mechanism to define or query object-specific methods on objects and classes. The same applies for aliases, forwards, mixins, and filters. The new convention imposes a little typing burden on the developer, but reduces the effort of a reader of a program for understanding what exactly $x method FOO {args} {...} means. For convenience, we provide two packages "nx::plain-object-method" and "nx::class-method" to switch to the old conventions. A verbose tracing mode can report usages to ease migration. b) Parametrization: NX 2.0b3 followed the XOTcl conventions of registering by default same-named getter/setter methods for configuration parameters used in object creation. These getter/setter methods bloat the method interface and risk shadowing inherited methods, leading to unexpected behaviors for beginners. NX 2.0b5 adopts a Tk/itcl/... idiom by offering a cget/configure interface to objects as generic getters/setters. To obtain parameter-specific getters/setters (i.e., the old behavior), the flag "-accessor public|protected|private" can be set when defining properties and variables. c) Further clean-ups of the introspection interface ("info"). In order to streamline the interface further, we followed the idea to use "... info /plural word/" to obtain a set of handles, and then to make a separate call to obtain the details. Therefore, we now provide ... /cls/ info methods /obj/ info object methods /cls/ info variables /obj/ info object variables /cls/ info slots /obj/ info object slots /cls/ info method parameters /methodName/ /obj/ info object method parameters /methodName/ /cls/ info configure parameters /obj/ info lookup configure parameters ... to return a list of handles. The result list can be filtered in each case by specifying a match pattern. Each result handle can then be used in a separate call to obtain details: /obj/ info method definition /methodHandle/ /obj/ info variable definition /varHandle/ /obj/ info parameter name /paramHandle/ These are just a few examples. In NX 2.0b3, we had e.g. "... info parameter definitions ..." leaving a beginner in the dark about the parameters actually meant. Also, the introspection interface made mixed use of plural and singular wordings for different purposes (e.g., retrieving collections and/or detailed information on one item). Below is a more detailed summary of the changes. The Next Scripting Framework 2.0b5 (containing NX and XOTcl 2.0) can be obtained from http://next-scripting.org/ Best regards - Gustaf Neumann - Stefan Sobernig =============================================== Announcing NSF 2.0b5 ************************* Major changes relative to NSF 2.0b3 are (in addition of the items (a), (b), and (c) above) are: * Additional Features: - serializer: * added flag -objmap to Serializer method deepSerialize to make serializer to provide mapping only for object names. This makes the serializer usable for object/class copying (-map is too coarse) * Serializer: "ignore" method made public * Due to the split between serializer and object system serializer, the "ignore" settings were lost - allow explicit unsetting of -per-object flag in 0-argument "-flag=value" notation (all built-in commands accepting this flag) - better compatibility with XOTcl 1.*: - added "/obj/ info name" (as alternative to "namespace tail [self]") - test-suite: added summary with statistics - traits: added property/variable inheritance - MongoDB - added "nx::mongo::db drop collection /name/" - returning status from "nx::mongo::db remove" as success (0 or 1) - adjust to object interface - reduce verbosity - add error messages for slot lookup failures Updated MongoDB interface - upgraded to c-driver 0.7.1 - tested with MongoDB 2.4.4-pre - new commands: * mongo::run * mongo::cursor::find * mongo::cursor::next * mongo::cursor::close - adapted interface for c-driver 0.7.1 (e.g. new optional name for mongo::index) * Improved Code Quality: - some cleanup and code refactorings - fixed functional bugs: * copy did not copy aliases and ensemble methods * automatic object destroy for half-baked objects (when e.g. configure raises an exception) * handling of required configure parameters on later calls to "configure" * fixed potential infinite loop in pattern matching for precedence lists * handling of full-qualified name patterns for private slots * invalidation of per-object parameter cache - on mixin changes and - on deletion/adding of per-object slots * handle cyclical superclass/class dependencies during object system finalize * Fixed a bad interaction between Tcl's apply (pushing lambda frames) and the variable resolvers. The variable resolver was not able to resolve variables, while the command resolver was still working correctly. * don't allow "method" to overwrite child objects - fixed potential crashes * on object destroy, when the same wrapper-less aliases was registered on many objects * when "nsf::my" is called with a single argument outside an object context. * avoid crash in case NsfParameterGetCmd() is passed a plain value (without a parameter spec) * fix potential crash in method caching when commands are renamed by Tcl (many thanks to Arthur Schreiber for reporting) - build system: * improved compatibility for windows compilations. NX can now be compiled under windows with the native window tool chain (and as well with MinGW) (Many thanks to Stephan Adelsberger) * Update to latest TEA. * Follow new naming convention for auto-tools (using configure.ac) * fix compilation when DTrace is activated (missing parenthesis, many thanks to Victor Guerra for noticing) * added compile macro NSF_STACKCHECK to provide stack monitoring/debugging (especially useful for multi- threaded programs, where stack is more limited) - fix compilation when compiled without threads (many thanks for r.Zaumseil for noting this). * Improved documentation - fixed typos, improve wordings - updated tutorial and migration guide - use slashes in generated syntax to distinguish between constants and placeholders. Example: /obj/ info method definition /methodName/ - improved performance * rewrite of alias handling (alias reform) * improved branch prediction * significant speedup for handling large numbers of subclasses (subclass reform), avoid repetitious computations * significant speedup on mass-destroy (e.g. on thread exit) - provide better protection for deletion/overwriting of base classes - fixed potential duplicates on diamond inheritance - fixed unknown handling for "-local" and "-system" dispatches * Extended regression tests MORE INFO General and more detailed information about the Next Scripting Framework and its components can be found at http://next-scripting.org