MANOOL

From Free Software Directory
Revision as of 15:17, 18 August 2019 by Rusini (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

{{Entry |Name=MANOOL |Short description=Practical programming language with expressive power, in 10K LOC in C++11 — “MAnool is Not an Object-Oriented Language!” |Full description=MANOOL is a homoiconic, dynamic, and multi-paradigm general-purpose computer programming language with a functional core. The author's implementation of MANOOL is made for native-code run-time environments, is written in *idiomatic* C++11 (with GCC-specific extensions), and currently runs under several Unix-like operating systems (OSes) on a number of CPU instruction-set architectures (ISAs).

Purpose

=

MANOOL is characterized as a *general-purpose* language because it is *not* specific to a particular problem domain, and it is instead broadly applicable across several problem domains. However, it is meant to compare and compete directly with such programming languages as Python, PHP, Ruby, Perl, and Tcl (i.e., so-called scripting languages, or even Scheme and Common Lisp, which somehow dooms its purpose.

In overall, MANOOL is a practical language: it is conceived as a tool useful in the professional field of programming rather than as a proof of concept for any new programming techniques or mechanisms, although incidentally its syntax and semantics do have a combination of unusual features.

Motivation

==

The project MANOOL emerged out of mere programming language enthusiasm and frustration with existing languages but is based on ideas and experience its author acquired throughout more than 25 years. Its design and implementation is the result of about 3.5 years of almost full-time work.

Name

==

The name “MANOOL” is a recursive acronym that stands for “MAnool is *Not* an Object-Oriented Language!”; it is just a pun on the renowned marketing hype of the past. “MANOOL” should be pronounced as “manul” (the Pallas's cat).

Examples

==

The following “Hello, world!” program provides a basic idea of what programs in MANOOL may look like: Rusini (talk) {{extern "manool.org.18/std/0.3/all"} in WriteLine[Out; "Hello, world!"]} Rusini (talk)

And the following MANOOL expression evaluates to a (recursive) MANOOL procedure (a function in more conventional terminology) used to calculate the factorial of an integral argument: Rusini (talk) { let rec

 { Fact =
   { proc { N } as
   : if N == 0 then 1 else
     N * Fact[N - 1]
   }
 }
 in
 Fact

} Rusini (talk)

It is worth to observe that while source code in MANOOL may look at first sight unfamiliar or even awkward, there are really good reasons behind it since the syntax of MANOOL is a result of many design compromises. However, as in the case of Smalltalk, the syntax of MANOOL is actually so simple that it could be “described on a postcard”.

Goals

=

MANOOL has *explicitly* stated design goals (ordered according to priority), which are 1. implementation simplicity (which is the sole most important consideration in the design); 2. expressive power (in practical sense), usability, and general utility (value for consumers); attention to syntax and semantics details; 3. correctness, security, and overall quality of implementation; run-time reliability; 4. run-time performance and scalability; and 5. consistency, completeness, orthogonality of features and language elegance; conceptual economy and purity.

The project MANOOL strives to satisfy *all* of the above goals (in that order) and do it *better* than existing alternatives would do!

Note that quality of diagnostics and coding defect prevention were deliberately left, however, among low-priority goals.

Results

=

Implementation Simplicity


The MANOOL translator fits in less than 10K lines of code (KLOC) in C++11 plus less than 500 LOC in MANOOL, which covers the core language as well as the standard library.

Expressive Power


MANOOL is directly suitable for accurately expressing algorithms (*up to* asymptotic computational complexity) as complex as those that one might find in computer-science (CS) papers where mostly some form of high-level pseudocode is encountered.

Run-Time Performance


According to simple synthetic benchmarks, the MANOOL implementation executes programs notably faster than some competitors and slightly faster or on a par with other competitors.

Run-Time Reliability


When needed, MANOOL programs can be instructed to recover even from dynamic memory (heap and stack) exhaustion.

Other Features


  • Very compact (or even minimalist) core language (up to a point where a meta-circular specification might be appropriate)
  • Convenient standard library (but completely *optional* to use)
  • Computational primitives based on Church's λ-calculus (in the spirit of Landin's ISWIM prototype language/ML-like languages)
 - Name bindings with static (lexical) scope
 - *Explicit* variable capture and classification of name bindings into compile- and run-time
 - Mainly eager (strict) evaluation strategy (from the perspective of λ-calculus) with possible side effects
  • Compile-time evaluation
  • Metaprogramming:
 - Lisp-like syntactic macros with optional macro hygiene
 - (optionally) self-modifying code
  • Block-structured and expression-oriented (from the perspective of procedural imperative programming)
  • Dynamic (latent) but strong data typing discipline
  • Ad hoc polymorphism:
 - run-time function/operator overload resolution (via dynamic single-dispatch)
  • *Observably* (modulo timings) non-referential (by-value) data model encouraging (but not requiring) to use (observably) immutable objects using automatic reference counting (ARC) and transparent copy-on-write (COW) implementation techniques
  • Move semantics and syntactic sugar that *emulates* in-place partial updates
  • Very high-level composite abstract data types (ADTs):
 - set-theoretic operations, comprehensions, and logic quantifications inspired by the math notation and SETL
 - values of *any* types (as long as the former are totally ordered) can be used as set elements and map keys
  • Modular programming:
 - namespaces
 - name binding visibility control
 - multiple source files (plus support for Ada-like private program units)
  • User-defined abstract data types:
 - data encapsulation (with visibility control)
  • Exception handling (with stack unwinding)
  • Decimal floating-point arithmetic (out-of-the-box)
  • Multithreading-aware implementation, free from global interpreter lock (GIL)
  • Simple plug-in application programming interface (API)

Influences

==

The following programming languages have driven major inspiration for MANOOL (in alphabetical order):

  • Ada, APL
  • C++, Clojure, CLU, Common Lisp
  • Forth
  • Haskell
  • ISWIM
  • Kernel (<http://klisp.org>)
  • Modula-2
  • Oberon
  • Pascal, Perl, Python
  • Scheme, Self, SETL2, Smalltalk, Standard ML
  • Tcl

And the following programming languages are noteworthy anti-influences:

  • C#, Java, JavaScript, PHP

|Homepage URL=http://manool.org |Is High Priority Project=No |VCS checkout command=git clone https://github.com/rusini/manool.git manool |Computer languages=C++, C, GNU Make, POSIX Shell |Decommissioned or Obsolete=No |Related projects=Python, PHP, Ruby, Perl, Tcl |Keywords=practical, homoiconic, functional, procedural, imperative, dynamic, multi-paradigm, general-purpose, programming, language, compiler, interpreter |Version identifier=0.3 |Version status=rolling |Version download=https://github.com/rusini/manool/archive/master.zip |Version comment=Quite mature code but still should be considered beta due to basic documentation that is still in development |Last review by=rusini |Last review date=2019/08/18 |Submitted by=rusini |Submitted date=2019/08/18 |User level=intermediate |Accepts cryptocurrency donations=No |Test entry=No |Is GNU=No }}





"Designer and Implementer" is not in the list (Maintainer, Contributor, Developer, Sponsor, Unknown) of allowed values for the "Role" property.













Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the page “GNU Free Documentation License”.

The copyright and license notices on this page only apply to the text on this page. Any software or copyright-licenses or other similar notices described in this text has its own copyright notice and license, which can usually be found in the distribution or license text itself.