- Written by David Nichols
- Parent Category: FAQs
- Last Updated: 22 January 2013
- Created: 05 May 2007
- dynamic and strongly-typed elements (variables, parameters, class members) - strong typing allows for run-time performance optimizations, for type errors to be caught at parse time, and for function and method overloading, while dynamic typing allows for more flexibility and sometimes smaller, more elegant solutions
- fundamental focus on multithreading and thread-safety
- exception handling and exception-safe programming support
- easy data de/serialization between different data formats (most now provided by modules)
- logic embedding with the ability to restrict the capabilities of embedded logic
- the ability to choose between the standard "Perl-type" syntax with "$" and "$." characters, or, by using "%new-style" a more Java-style syntax (without any "$" or "$." prefixes)
Basically if you like working with a language that allows you to mix dynamic and strongly-typed elements with a fundamental focus on multithreading capabilities that allows you to easily manipulate XML, JSON, SQL, Tuxedo, TIBCO Rendezvous and/or AE data, or write socket-based network apps (HTTP, XML-RPC, JSON-RPC, etc), or you need a language with a powerful yet simple threading model allowing you to quickly develop programs/scripts scalable on SMP systems, or you need a language that directly supports embedded (and arbitrary restricting) logic, then Qore may be a good choice.
Qore's "Vertical" Approach
To expand on Qore's "vertical" approach: the language has been designed to be suitable for writing simple scripts, as well as complex, multi-threaded, database integrated, network-aware applications.
Quick scripting is facilitated through dynamic typing, the lack of structural requirements on Qore scripts (they can be made of just top-level elements, i.e. a series of statements without functions or classes, etc), by default no need to declare variables before using them (note it's highly recommended to disable this in larger scripts/programs with "%require our" or even to require type declarations with "%require-types"), and powerful database, XML, communications, etc features (allowing you to do a lot with a small Qore script).
Complex script/program development is facilitated by employing qore features to require variables to be declared (%require-our), or types to be declared (%require-types), to turn on warnings (%enable-all-warnings), to allow for program structure with functions or in a pure object-oriented style with %exec-class, by exception handling and exception-safe and exception-aware cleanup support, by support for a clean threading model, etc.
Another important feature of Qore at the higher end is the ability for a Qore application to support embedding (and arbitrarily restricting) user-defined logic (written in the Qore language).
Furthermore, Qore supports either procedural or object-oriented programming or a combination of the two. A Qore program can even be implemented as a class ala Java, if so desired, or it can have the structure of a typical perl script, depending on the programmer's style (or mood!). Additionally, by using the "%new-style" parse directive, then variables, object members, and methods must be referred to without "$" and "$." prefixes, making Qore scripts look superficially more like Java or C/C++ code.
Qore is Designed For Threading and SMP Scalability
Qore is highly threadable and has been designed to favor multi-threaded performance over single-threaded performance, thus Qore programs are very scalable on machines with many processors. Additionally, Qore features optimizations to reduce the number of cache invalidations, which cause a significant slowdown on SMP platforms. On intel (+AMD) and PowerPC platforms, qore features fast assembly atomic reference counting, providing an extra performance boost on these platforms.
Qore Features Database Integration and Enables Database-Independent Programming
Qore has Oracle, MySQL, PostgreSQL, Sybase, FreeTDS, and other database drivers, making it easy to manipulate data in many different database types. Qore's Datasource class provides a consistent interface to drivers, supporting transaction management, character encoding conversions, binding by value, and more in a consistent way. Qore provides the infrastructure required to develop truly database-independent applications (ex: Qorus runs equally well on Oracle, MySQL, and PostgreSQL databases thanks to Qore).
Binding by value (supported in all Datasource methods accepting SQL text) facilitates database independent programming by allowing qore types to be automatically converted to equivalent database types, very useful with binary objects, dates, even strings that might otherwise need escaping, etc.
As of Qore 0.8.1, the SQLStatement class allows SQL data to be efficiently pipelined or processed piecewise by providing a DB-independent prepared statement API to Qore.
Qore Supports HTTP and Common Web Service Protocols
Qore has built-in HTTPClient and Socket classes (XmlRpcClient and JsonRpcClient classes are provided by the xml and json modules, respectively), allowing Qore programs/scripts to communicate with standard web service protocols. HTTP client support is inherited by the XmlRpcClient and JsonRpcClient classes and includes support for basic authentication, proxy and redirection support, as well as basic proxy authentication. There is also a multithreaded HTTP server written in the Qore-language included in the "examples" directory of Qore installations (here is a link to the source), allowing Qore programmers to quickly deploy server applications as well.
Qore Supports Transparent Character Encoding Conversions and UTF-8 Multi-Byte Characters
Qore has built-in character set encoding support based on the C library's iconv functions and supports both implicit and explicit character set conversions. For example, if a Datasource object is assigned "UTF-8" encoding, but a File object has "ISO-8859-1" encoding, any data written to the database from the File object will be automatically converted implicitly to "UTF-8" encoding without any intervention necessary by the programmer.
Qore has multi-byte character set support, where characters and bytes are treated differently according to the context (i.e. length(), substr(), string splice(), replace(), regular expressions, etc, all support character offsets instead of byte offsets with UTF-8 encoded strings).
Other Qore Features
- Qore has libxml2 integration, allowing simple, automatic, and transparent serialization/deserialization to/from XML data to/from Qore data structures.
- Qore supports buillt-in JSON serialization/deserialization as well similar to the equivalent XML support.
- Qore supports perl5-compatible regular expressions thanks to the PCRE library.
- Qore features exception handling similar to C++'s or Java's, but adapted for a weakly-typed language. Qore additionally implements exception-safe and exception-aware cleanup code inspired by the D programming language 's scope(exit), scope(failure), etc constructs, in the on_exit, on_success, and on_error statements.
- Qore is designed to facilitate dynamic/embeddable program logic and enable arbitrary restriction of subprograms' capabilities by using the Program class.
- Qore includes a date/time data type supporting a resolution to the microsecond and includes built-in date/time operators & arithmetic (eg: $a = now() - 1D - 5m will assign $a to the date and time one day and 5 minutes ago); additionally, Qore supports time zones in dates as well
- By defining methodGate() and memberGate() methods, the programmer can redirect accesses to non-existant members and methods and react in any way desired (ex: Qorus provides transparent loading and initialization of services by using this feature).
- Qore supports TLS/SSL socket connections (as well as cleartext connections of course)
- Qore's FtpClient class support RFC-4217 compliant FTPS connections.
- Qore supports strong encryption and message digest calculation with native functions (thanks to OpenSSL integration)
- Qore has TIBCO Rendezvous(R) and ActiveEnterprise(TM) integration, making it very easy to write scripts/programs making use of TIBCO components. Serializing/deserializing between RV and/or AE messages and Qore data structures is simple, automatic, and transparent to the programmer.
- Qore has Bea Tuxedo(TM) support, allowing Tuxedo-based applications or interfaces to be developed directly in qore.