Ciao (programming language)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 50.109.75.176 (talk) at 21:20, 7 October 2017 (Formatting, since the existing formatting didn't make much sense). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Ciao
ParadigmLogic, functional, modular, object-oriented
First appeared1984; 40 years ago (1984)
OSCross-platform (Unix, Mac OS X, Windows)
LicenseGPL, LGPL
Websitewww.ciao-lang.org
Influenced by
Prolog

Ciao is a general-purpose programming language which supports logic, constraint, functional, higher-order, and object-oriented programming styles. Its main design objectives are high expressive power, extensibility, safety, reliability, and efficient execution.[1]

Language Characteristics

Ciao provides a full Prolog system (supporting ISO-Prolog), declarative subsets and extensions of Prolog, functional programming (including lazy evaluation), higher-order (with predicate abstractions), constraint programming, and objects, as well as feature terms (records), persistence, several control rules (breadth-first search, iterative deepening, ...), concurrency (threads/engines), distributed execution (agents), and parallel execution. Libraries also support WWW programming, sockets, external interfaces (C, Java, TclTk, relational databases, etc.), etc.

Ciao is built on a kernel with an extensible modular design which allows both restricting and extending the language — it can be seen as a language building language. These restrictions and extensions can be activated separately on each program module so that several extensions can coexist in the same application for different modules.

Developing Safe and Reliable Programs

Programming in the large in Ciao is supported via:

  • A robust module/object system. This provides module-based separate/incremental compilation (which is automatic without need for makefiles).
  • An integrated assertion language for declaring (optional) program properties (specifications). These include types, modes, determinacy, non-failure, cost (time, memory), etc.
  • Automatic inference and static/dynamic checking of such assertions (including unit testing).

Ciao has also support for programming in the small: the compiler is capable of producing small executables (including only those builtins used by the program) and the interpreter supports scripting.

The environment includes a classical top-level and an evolved emacs interface with an embeddable source-level debugger and a number of execution visualization tools.

The Ciao preprocessor supports static debugging and verification assertion checking and optimization via source to source program transformation. These tasks are performed by Ciaopp, distributed separately).

Auto-Documentation

Ciao includes lpdoc, an automatic documentation generator. It processes programs adorned with (Ciao) assertions and machine-readable comments and generates manuals in many formats including HTML, pdf, texinfo, info, man, etc., as well as on-line help, ascii README files, entries for indices of manuals (info, WWW, ...), and maintains WWW distribution sites.

Portability and Efficiency

The Ciao compiler (which can be run outside the top level shell) generates several forms of architecture-independent and stand-alone executables, which run with speed, efficiency and executable size which are very competitive with other high-level languages in general and in particular with commercial and academic Prolog/CLP systems. Modules can be compiled into compact bytecode or C source files, and linked statically, dynamically, or autoloaded.

Installation Dependencies for CiaoDE (version 1.15)

Debian/Ubuntu (14.04):

$ apt-get install build-essential
  # Required for 32 bits compatibility mode (x86)
$ apt-get install gcc-multilib libc6-i386 libc6-dev-i386 g++-multilib
  # Required for emacs-based IDE
$ apt-get install emacs
  # Optionally, for rlwrap
$ apt-get install rlwrap
  # Required for generating documentation in .pdf format
$ apt-get install texlive texinfo imagemagick
  # (valid for both `x86' and `arm' architectures)

Fedora:

$ dnf install gcc make which kernel-headers kernel-devel emacs
  # Required for emacs-based IDE
$ dnf install emacs
  # Required for 32 bits compatibility mode (x86)
$ dnf install glibc-devel.i686 glibc-devel libstdc++-devel.i686
  # Optionally, for rlwrap
$ dnf install rlwrap
  # Required for generating documentation in .pdf format
$ dnf install texlive texinfo texinfo-tex ImageMagick

(use `yum' instead of `dnf' above in older versions of Fedora)

Mac OS X:

Install command line tools for Xcode (from the App store)

Install emacs and ImageMagick (and texinfo if needed, but recent versions of Mac OS X include it). A software management tool like homebrew or macports is recommended, e.g. (as root/sudo):

$ brew install emacs-mac imagemagick

Install TexLive. If using homebrew we recommend installing the MacTeX distribution, available from: https://www.tug.org/mactex

Optionally, for rlwrap:

 $ brew install rlwrap

Further reading

  • Manuel V. Hermenegildo; et al. "An Overview of Ciao and its Design Philosophy". arXiv:1102.5497.
  • The Ciao Development Team. "The Ciao System Home".
  • Enrico Pontelli (ed.). "The CIAO Multiparadigm Language and Program Development Environment".
  • Kei Davis, Jörg Striegnitz. "Multiparadigm programming in object-oriented languages: current research report on the workshop MPOOL'07". ECOOP'07 Proceedings of the 2007 conference on Object-oriented technology.

References

  1. ^ "The Ciao System". ciao-lang.org. Retrieved 2017-08-12.