Qore (programming language)

Last updated
Qore
Paradigm multi-paradigm: thread safe/parallel/shared memory, functional, imperative, object-oriented (class-based), procedural, functional
Designed by David Nichols
Developer David Nichols
Stable release
1.16.1 / July 2, 2023;9 months ago (2023-07-02)
Typing discipline Dynamic, Optionally Strong
Implementation language C++, Pthreads
OS Cross-platform
License MIT License, GNU General Public License, GNU Lesser General Public License
Filename extensions .q, .qm, .qtest
Website www.qore.org
Influenced by
Perl, D, C++, Java

Qore is an interpreted, high-level, general-purpose, garbage collected dynamic programming language, featuring support for code embedding and sandboxing with optional strong typing and a focus on fundamental support for multithreading and SMP scalability.

Contents

Qore is unique because it is an interpreted scripting language with fundamental support for multithreading (meaning more than one part of the same code can run at the same time), and additionally because it features automatic memory management (meaning programmers do not have to allocate and free memory explicitly) while also supporting the RAII idiom with destructors for scope-based resource management and exception-safe programming. [1] This is due to Qore's unique prompt collection implementation for garbage collection.

Qore Scripts

Qore scripts typically have the following extensions:

Executable Qore scripts on Unix-like operating systems will typically start with a hashbang to specify the filename of the interpreter as follows:

#!/usr/bin/env qore

Syntax

Qore syntax is similar to and inspired from the following programming languages: [2]

Data Types

Basic types include: boolean, string, integer, float, date, binary, [4] list, hash (associative arrays), and object, [5] as well as code code for code used as a data type. [6]

Complex types are also supported such as hash<string, bool>, list<string>, reference<list<string>> as well as type-safe hashes.

Multithreading

Despite being an interpreted language, Qore was designed to support multithreading as a fundamental design principle. All elements of Qore are thread-safe, and the language in general has been designed with SMP scalability in mind. Because all elements of the language were designed to support multithreading, Qore programs and scripts do not have to limit themselves to a subset of Qore's functionality, which is also why there is no Global interpreter lock in Qore. [7]

Threading functionality in Qore is provided by the operating system's POSIX threads library.

Garbage Collection

Qore features a unique garbage collection approach called prompt collection that allows destructors to be run immediately when objects go out of scope, even if they have recursive references back to themselves. This allows for Qore to support the RAII idiom and also perform garbage collected automatic memory management.

Support for Code Embedding and Sandboxing

Qore was designed to support embedding and sandboxing logic in applications; this also applies to applications written in Qore as well as applications using the Qore library's public C++ API. By using the Program class which represents a logic container with sandboxing controls, discrete objects can be created and destroyed at runtime containing embedded code to extend or modify the behavior of your application in user-defined ways. [8]

Runtime Library

Qore's standard runtime library supports data mapping, APIs for communicating with databases (including high-level APIs for SQL operations, schema management, and DBA actions), client APIs and server infrastructure implementations for many protocols including HTTP, REST (with REST schema validation/code generation including Swagger support), client/server SOAP support (including code and message generation), WebSocket, RPC protocols, generic connector APIs, generic data mapping APIs, and many file format and file- and data-exchange protocols and more. [9]

Testing

Qore supports testing through the QUnit module which facilitates automated testing and Continuous integration processes for code written in Qore.

Availability

Qore's Git (software) repository is hosted on GitHub. Binary packages are available as RPM s, in MacPorts and in FreeBSD Ports as well as for other operating systems, including Microsoft Windows; see General Source and Download Info on the Qore wiki for more information.

Related Research Articles

<span class="mw-page-title-main">Java virtual machine</span> Virtual machine that runs Java programs

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

<span class="mw-page-title-main">Python (programming language)</span> General-purpose programming language

Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.

<span class="mw-page-title-main">Perl</span> Interpreted programming language first released in 1987

Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language".

<span class="mw-page-title-main">Ruby (programming language)</span> General-purpose programming language

Ruby is an interpreted, high-level, general-purpose programming language. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types. It was developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.

OCaml is a general-purpose, high-level, multi-paradigm programming language which extends the Caml dialect of ML with object-oriented features. OCaml was created in 1996 by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, Ascánder Suárez, and others.

ECMAScript is a standard for scripting languages, including JavaScript, JScript, and ActionScript. It is best known as a JavaScript standard intended to ensure the interoperability of web pages across different web browsers. It is standardized by Ecma International in the document ECMA-262.

Programming languages can be grouped by the number and types of paradigms supported.

<span class="mw-page-title-main">D (programming language)</span> Multi-paradigm system programming language

D, also known as dlang, is a multi-paradigm system programming language created by Walter Bright at Digital Mars and released in 2001. Andrei Alexandrescu joined the design and development effort in 2007. Though it originated as a re-engineering of C++, D is now a very different language drawing inspiration from other high-level programming languages, notably Java, Python, Ruby, C#, and Eiffel.

In computer programming, glob patterns specify sets of filenames with wildcard characters. For example, the Unix Bash shell command mv *.txttextfiles/ moves all files with names ending in .txt from the current directory to the directory textfiles. Here, * is a wildcard and *.txt is a glob pattern. The wildcard * stands for "any string of any length including empty, but excluding the path separator characters ".

In computing, gettext is an internationalization and localization system commonly used for writing multilingual programs on Unix-like computer operating systems. One of the main benefits of gettext is that it separates programming from translating. The most commonly used implementation of gettext is GNU gettext, released by the GNU Project in 1995. The runtime library is libintl. gettext provides an option to use different strings for any number of plural forms of nouns, but this feature has no support for grammatical gender. The main filename extensions used by this system are .POT, .PO and .MO.

Nix is a cross-platform package manager. It employs a model in which software packages are each installed into unique directories with immutable contents. These directory names correspond to cryptographic hashes that take into account all dependencies of a package, including other packages managed by Nix.

<span class="mw-page-title-main">Node.js</span> JavaScript runtime environment

Node.js is a cross-platform, open-source JavaScript runtime environment that can run on Windows, Linux, Unix, macOS, and more. Node.js runs on the V8 JavaScript engine, and executes JavaScript code outside a web browser.

The Perl virtual machine is a stack-based process virtual machine implemented as an opcodes interpreter which runs previously compiled programs written in the Perl language. The opcodes interpreter is a part of the Perl interpreter, which also contains a compiler in one executable file, commonly /usr/bin/perl on various Unix-like systems or perl.exe on Microsoft Windows systems.

Racket has been under active development as a vehicle for programming language research since the mid-1990s, and has accumulated many features over the years. This article describes and demonstrates some of these features. Note that one of Racket's main design goals is to accommodate creating new programming languages, both domain-specific languages and completely new languages. Therefore, some of the following examples are in different languages, but they are all implemented in Racket. Please refer to the main article for more information.

<span class="mw-page-title-main">Julia (programming language)</span> Dynamic programming language

Julia is a high-level, general-purpose dynamic programming language, most commonly used for numerical analysis and computational science. Distinctive aspects of Julia's design include a type system with parametric polymorphism and the use of multiple dispatch as a core programming paradigm, efficient garbage collection, and a just-in-time (JIT) compiler.

Swift is a high-level general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. and the open-source community. Swift compiles to machine code, as it is an LLVM-based compiler. Swift was first released in June 2014, and the Swift toolchain has shipped in Xcode since version 6, released in 2014.

<span class="mw-page-title-main">Nim (programming language)</span> Programming language

Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.

<span class="mw-page-title-main">WebAssembly</span> Cross-platform assembly language and bytecode designed for execution in web browsers

WebAssembly defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating interactions between such programs and their host environment.

<span class="mw-page-title-main">Deno (software)</span> Secure JavaScript and TypeScript runtime

Deno is a runtime for JavaScript, TypeScript, and WebAssembly that is based on the V8 JavaScript engine and the Rust programming language. Deno was co-created by Ryan Dahl, who also created Node.js.

References

  1. "Why use Qore?". Qore.org. 2016-06-13. Retrieved 2016-06-14.
  2. "qore/ABOUT at develop · qorelanguage/qore · GitHub". Github.com. Retrieved 2016-08-10.
  3. "Qore Programming Language Reference Manual: Parse Directives". Docs.qore.org. Retrieved 2016-08-10.
  4. "Basic Data Types". Qore.org. Retrieved 2012-05-31.
  5. "Qore Programming Language Reference Manual: Container Data Types". Docs.qore.org. Retrieved 2016-08-10.
  6. "Qore Programming Language Reference Manual: Code Data Types". Docs.qore.org. Retrieved 2016-08-10.
  7. "Qore Programming Language Reference Manual: Threading". Docs.qore.org. Retrieved 2016-08-10.
  8. "Program Class". Qore.org. Retrieved 2016-06-13.
  9. "Modules · qorelanguage/qore Wiki · GitHub". Github.com. 2016-06-12. Retrieved 2016-08-10.