EuLisp
Encyclopedia
EuLisp is a statically
Scope (programming)
In computer programming, scope is an enclosing context where values and expressions are associated. Various programming languages have various types of scopes. The type of scope determines what kind of entities it can contain and how it affects them—or semantics...

 and dynamically scoped
Scope (programming)
In computer programming, scope is an enclosing context where values and expressions are associated. Various programming languages have various types of scopes. The type of scope determines what kind of entities it can contain and how it affects them—or semantics...

 Lisp
Lisp programming language
Lisp is a family of computer programming languages with a long history and a distinctive, fully parenthesized syntax. Originally specified in 1958, Lisp is the second-oldest high-level programming language in widespread use today; only Fortran is older...

 dialect developed by a loose formation of industrial and academic Lisp users and developers from around Europe
Europe
Europe is, by convention, one of the world's seven continents. Comprising the westernmost peninsula of Eurasia, Europe is generally 'divided' from Asia to its east by the watershed divides of the Ural and Caucasus Mountains, the Ural River, the Caspian and Black Seas, and the waterways connecting...

. The standardizers
Standardization
Standardization is the process of developing and implementing technical standards.The goals of standardization can be to help with independence of single suppliers , compatibility, interoperability, safety, repeatability, or quality....

 intended to create a new Lisp "less encumbered by the past" (compared to Common Lisp
Common Lisp
Common Lisp, commonly abbreviated CL, is a dialect of the Lisp programming language, published in ANSI standard document ANSI INCITS 226-1994 , . From the ANSI Common Lisp standard the Common Lisp HyperSpec has been derived for use with web browsers...

), and not so minimalistic
Computing minimalism
In computing, minimalism refers to the application of minimalist philosophies and principles in hardware and software design and usage.-History:...

 as Scheme. Another objective was to integrate the Object-oriented programming
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...

 paradigm well.

Origin

Language definition process first began in a meeting in 1985 in Paris
Paris
Paris is the capital and largest city in France, situated on the river Seine, in northern France, at the heart of the Île-de-France region...

 and took a long time. The complete specification and a first implementation (interpreted
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

-only) was available in 1990.

Distinguishing features

Its primary characteristics are that it is a Lisp-1 (no separate function and variable namespaces), has a CLOS
CLOS
The Common Lisp Object System is the facility for object-oriented programming which is part of ANSI Common Lisp. CLOS is a powerful dynamic object system which differs radically from the OOP facilities found in more static languages such as C++ or Java. CLOS was inspired by earlier Lisp object...

-style (Common Lisp Object System) generic-function type object-oriented system named TELOS (The EuLisp Object System) integrated from the ground up, has a built-in module system, and is defined in layers to promote the use of the Lisp on small, embedded hardware
Hardware
Hardware is a general term for equipment such as keys, locks, hinges, latches, handles, wire, chains, plumbing supplies, tools, utensils, cutlery and machine parts. Household hardware is typically sold in hardware stores....

 and education
Education
Education in its broadest, general sense is the means through which the aims and habits of a group of people lives on from one generation to the next. Generally, it occurs through any experience that has a formative effect on the way one thinks, feels, or acts...

al machines. It supports continuation
Continuation
In computer science and programming, a continuation is an abstract representation of the control state of a computer program. A continuation reifies the program control state, i.e...

s, though not as powerfully as Scheme. It has a simple light-weight process mechanism (threads
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

).

Summary

  • A definition in levels, currently Level-0 and Level-1
  • Modules based on (non-first-class
    First-class object
    In programming language design, a first-class citizen , in the context of a particular programming language, is an entity that can be constructed at run-time, passed as a parameter, returned from a subroutine, or assigned into a variable...

    ) lexical environments.
  • Lexically scoped, with dynamic binding
    Dynamic binding
    Dynamic binding may refer to:*Dynamic dispatch in Computer Science*Dynamic binding...

     available in Level-1.
  • A single name space for function and variable names (like Scheme).
  • Light-weight processes.
  • A fully integrated object system with single inheritance at Level-0 and multiple inheritance
    Multiple inheritance
    Multiple inheritance is a feature of some object-oriented computer programming languages in which a class can inherit behaviors and features from more than one superclass....

     and meta-object protocol an Level-1.
  • An object-oriented condition system.

Implementations

An early implementation of EuLisp was FEEL (Free and Eventually Eulisp). The successor to FEEL was Youtoo (interpreted and compiled
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 versions), by University of Bath
University of Bath
The University of Bath is a campus university located in Bath, United Kingdom. It received its Royal Charter in 1966....

 in the United Kingdom
United Kingdom
The United Kingdom of Great Britain and Northern IrelandIn the United Kingdom and Dependencies, other languages have been officially recognised as legitimate autochthonous languages under the European Charter for Regional or Minority Languages...

. An interpreter for the basic level of EuLisp, "level-0", was written by Russell Bradford in XScheme, an implementation of Scheme by David Michael Betz, originally called EuScheme http://www.bath.ac.uk/~masrjb/ but the most recent version is renamed EuXLisp http://github.com/Henry/EuLisp/ to avoid confusion. Also Eu2C http://github.com/Henry/EuLisp/, an EuLisp optimizing compiler, was created by Fraunhofer ISST under the APPLY project in Germany http://publica.fraunhofer.de/dokumente/PX-46999.html.

A dialect of EuLisp was developed, called Plural EuLisp; it was EuLisp with parallel programming
Parallel computing
Parallel computing is a form of computation in which many calculations are carried out simultaneously, operating on the principle that large problems can often be divided into smaller ones, which are then solved concurrently . There are several different forms of parallel computing: bit-level,...

 extensions.

Example

Example use of classes in the algorithm to solve the "Towers of Hanoi" problem.

(defmodule hanoi
(syntax (syntax-0)
import (level-0)
export (hanoi))
;----------------------------------------------------------------------------
; Tower definitio
;----------------------------------------------------------------------------

(defconstant *max-tower-height* 10)

(defclass
((id reader: tower-id keyword: id:)
(blocks accessor: tower-blocks)))

(defun build-tower (x n)
(labels ((loop (i res)
(if (= i 0) res
(loop (- i 1) (cons i res)))))
((setter tower-blocks) x (loop n ))
x))

(defmethod generic-print ((x ) (s ))
(sformat s "#" (tower-id x) (tower-blocks x)))
;----------------------------------------------------------------------------
; Access to tower block
;----------------------------------------------------------------------------

(defgeneric push (x y))

(defmethod push ((x ) (y ))
(let ((blocks (tower-blocks x)))
(if (or (null? blocks) (< y (car blocks)))
((setter tower-blocks) x (cons y blocks))
(error
(fmt "cannot push block of size ~a on tower ~a" y x)))))

(defgeneric pop (x))

(defmethod pop ((x ))
(let ((blocks (tower-blocks x)))
(if blocks
(progn
((setter tower-blocks) x (cdr blocks))
(car blocks))
(error
(fmt "cannot pop block from emtpy tower ~a" x)))))
;----------------------------------------------------------------------------
; Move n blocks from tower x1 to tower x2 using x3 as buffe
;----------------------------------------------------------------------------

(defgeneric move (n x1 x2 x3))

(defmethod move ((n ) (x1 ) (x2 ) (x3 ))
(if (= n 1)
(progn
(push x2 (pop x1))
(print x1 nl x2 nl x3 nl nl))
(progn
(move (- n 1) x1 x3 x2)
(move 1 x1 x2 x3)
(move (- n 1) x3 x2 x1))))
;----------------------------------------------------------------------------
; Initialize and run the 'Towers of Hanoi
;----------------------------------------------------------------------------

(defun hanoi
(let ((x1 (make id: 0))
(x2 (make id: 1))
(x3 (make id: 2)))
(build-tower x1 *max-tower-height*)
(build-tower x2 0)
(build-tower x3 0)
(print x1 nl x2 nl x3 nl nl)
(move *max-tower-height* x1 x2 x3)))

(hanoi)
;----------------------------------------------------------------------------

) ;; End of module hanoi
;----------------------------------------------------------------------------


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK