Impulse

Impulse is a small, dynamic, prototypical programming language with planned support for multi-methods and predicate dispatching. It borrows syntax and semantics from other languages such as Ruby, Smalltalk, Dylan, Io, Lua and JavaScript along with ideas from functional languages like Haskell and ML.
A core goal is too keep the language, both the implementation and the syntax, small and lightweight. Impulse tries to factor special syntax such as pattern matching and list comprehension into the language using predicates.

Features

Prototype Based
Singletons are easy to create, and objects can change behavior by switching their parent prototypes.
Small and lightweight
The core is less than 2,000 lines of lightweight C++, including the VM, parser and garbage collector.
Reflective and Open
All objects, including native C++ prototypes can be extended and modified. Everything is a first class object.
Easily Embeddable
The language was designed from the bottom up, to provide the most simple interface to the runtime.

Examples

# Get a list of even numbers between 1 and 10
  1..10 map: n [n is-even?] -> n * n

# The ubiquitous factorial example
  factorial = n [n == 0] -> 1 \
                []       -> factorial: (n - 1)

# A method which takes a <stream> argument
  object <document>
    method print: stream <stream>
      stream write: self
    end
  end

Download

Source - impulse-0.5-source.tgz

Compiling should be as easy as "make && sudo make install". Impulse has been tested with GCC 4.3.3 on Ubuntu 32/64, GCC 4.3.2-1 on Cygwin, and GCC 4.0.1 on Mac OS X.

Reference

Related

Contact

You can reach me with any questions or comments at mike AT mike-austin DOT com


Generated on Wed May 13 20:04:19 2009 for impulse by  doxygen 1.5.8