Nimrod (programming language)

From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search
Paradigm multi-paradigm: imperative, object-oriented, functional, generic
Appeared in 2008
Developer Andreas Rumpf
Stable release 0.8.6 (December 21, 2009; 131070802 ago)
Typing discipline static
Influenced by Lisp, Python, C, Object Pascal, Ada, Modula2
License GPL for the compiler, LGPL for the runtime[1]

Nimrod is a general purpose, high-level, system programming, statically typed imperative compiled programming language[2] that is developed by Andreas Rumpf.

Development started in 2004, coded in Object Pascal (FreePascal) and Python. However, the first version that bootstrapped (was able to compile itself) was released at 2008-08-22 (version 0.6.0). The compiler generates optimized C code and defers compilation to an external compiler (a large range is supported, it is shipped on Windows with Mingw/GCC) to leverage their optimization and portability capabilities: it works on Windows, Linux, BSD and MacOS X.

Nimrod uses indentation as block delimiters, like Python (following the Off-side rule) although a pre-processing filter phase enable to delimit blocks with soft braces {} or endX keywords. These filters allow pre-processing or usage within templates. Nimrod is case-insensitive and even style-insensitive, meaning that underscores are ignored in identifiers (and number literals too), a quite unusual feature.

It can be used as an imperative, procedural language, but it also supports object oriented, functional and generic programming styles.

Objects with inheritance, overloading, polymorphism) and multiple dispatch (multimethods) allows object-oriented programming. The syntax sugar a.funct(b) replacing funct(a, b) ensures OO style and call chaining.

Treating procedures as first-class entities, it can be used for functional programming, although it currently lacks closures and anonymous procs (they are planned).

It also supports metaprogramming by a combination of generics, templates, macros, conditional compilation with compile time function execution. It allows user-defined operators.

It has rich high-level data types, from the common strings and array to sequences, sets, tuples, enums, etc. Low level, system data can be left unmanaged, but most objects created on the heap are managed with garbage collection, freeing programmer of most memory management issues. It uses a non-tracing garbage collector to manage allocated memory, based on an original algorithm, but it can use alternatively the Boehm garbage collector or no collector at all.

Nimrod also supports a module mechanism for isolation of independent libraries or packages. Nimrod standard library has I/O and OS operations, string utilities, Unicode support, regular expressions and PEG, along with various parsers (command line options, XML, CSV, SQL...).


Interaction with other systems

C's application binary interface (ABI) is supported as well as all of C's fundamental and derived types, enabling direct access to existing C code and libraries. Nimrod supports all Windows calling conventions in addition to standard C conventions. A dynlib module allows to access symbols from shared libraries (DLLs, .so files).

Thus, it has bindings to a number of C libraries, from system (Posix, Windows) to databases (MySQL, PostgreSQL, SQLite, ODBC), from scripting languages (Python, Lua, TCL) to graphics (OpenGL, Cairo, SDL).

It supports GUIs by its bindings to GTK2, X11, IUP and Windows.

Other notable bindings are libcurl, libzip and PCRE.


See also

External links

Personal tools

Served in 0.309 secs.