1.2 Summary of Language Mechanisms

image_pdfimage_print

qBeta contains the following language mechanisms:

  1. As for Beta, qBeta has one abstraction mechanism, the pattern:
    1. A pattern is a unification of common abstraction mechanisms such as class, value type, method, function, process type, et al.
    2. The benefit of this unification is that qBeta supports the notion of virtual class – similar to virtual method as found in most object-oriented languages
    3. Another benefit is that a method may be derived from a (super) method similar to a class can be subclass from a (super) class.
  2. qBeta supports singular objects – an object may be described directly without being an instance of a class  – called anonymous classes in Java
  3. qBeta supports nesting of patterns and singular objects – also known as block structure. Few object-oriented languages support block-structure in its full generality as in Beta and qBeta.
  4. qBeta supports cooperative and preemptive coroutines as well as coroutines executing in full concurrency (in parallel) on multi-core processors
  5. In qBeta it is possible to define schedulers for coroutines.
  6. At the very basic level, qBeta has a set of primitive mechanisms for synchronization and interface to hardware cores – these includes
    1. compareAnd Swap, enabling and disabling of preemption, association of active objects with processor cores
  7. The abstraction mechanisms of qBeta makes it possible to define safe high-level concurrency abstractions like Monitor, Ada-like rendezvous, Actor-like systems, etc. 
  8. qBeta includes a mechanism called subpattern restrictions, which makes it possible to define restrictions on subpatterns of a given pattern.
    1. On of the benefits of subpattern restrictions makes it possible to define safe concurrency abstractions. In Beta, Java and C++, the compiler is not able to enforce safety with respect to avoid race conditions.
  9. In qBeta, a module is a singular object.
  10. Declarations and statements may be mixed, and declarations are executed.
  11. The syntax of patterns names may be unary, binary, functional or keyword inspired by Smalltalk and Self.
  12. New control structures may be defined by means of patterns, typically using a keyword syntax.
  13. The syntax for nesting of patterns and singular objects is based on indentation as in Python – i.e. no curly brackets..