![]() | This article has multiple issues. Please help improve it or discuss these issues on the talk page . (Learn how and when to remove these template messages)
|
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 |
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 |
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.
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 typically have the following extensions:
.q
: for Qore scripts.qm
: for Qore user modules.qtest
: for Qore test scriptsExecutable 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
Qore syntax is similar to and inspired from the following programming languages: [2]
%new-style
, Qore's syntax is highly similar to Perl; the foreach
statement, splice
, push
, pop
, chomp
operators, Perl5-compatible regular expressions, and more%new-style
, Qore code looks more similar to Java; [3] the synchronized
keyword, the instanceof
operator, object and class implementationon_exit
, on_success
, and on_error
statements provide exception-aware functionality similar to D's scope(exit)
, scope(failure)
, allowing exception-aware cleanup code to be placed next to the code requiring cleanupmap
, foldl
, foldr
, and select
operators with lazy evaluation of functional and list operators and statementsBasic 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.
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.
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.
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]
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]
Qore supports testing through the QUnit module which facilitates automated testing and Continuous integration processes for code written in Qore.
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.
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.
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.
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".
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.
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.
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.
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.
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.
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.
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.