pixie-lang / pixie

A small, fast, native lisp with "magical" powers
GNU General Public License v3.0
2.35k stars 124 forks source link

Build Status License: LGPL

Pixie

Join the chat at https://gitter.im/pixie-lang/pixie

Intro

Pixie is a lightweight lisp suitable for both general use as well as shell scripting. The language is still in a "pre-alpha" phase and as such changes fairly quickly. The standard library is heavily inspired by Clojure as well as several other functional programming languages. It is written in RPython (http://pypy.readthedocs.org/en/latest/coding-guide.html) and as such supports a fairly fast GC and an amazingly fast tracing JIT.

Features

Some planned and implemented features:

Dependencies

Building

make build_with_jit
./pixie-vm

Note: Mac OS X does not come with the build tools required by default. Install the XCode Command Line tools (Apple Developer Site) or install them independently.

Running the tests

./pixie-vm run-tests.pxi

Examples

There are examples in the /examples directory. Try out "Hello World" with:

./examples/hello-world.pxi

Build Tool

Pixie now comes with a build tool called dust. Try it and start making magic of your own.

FAQ

So this is written in Python?

It's actually written in RPython, the same language PyPy is written in. make build_with_jit will compile Pixie using the PyPy toolchain. After some time, it will produce an executable called pixie-vm. This executable is a full blown native interpreter with a JIT, GC, etc. So yes, the guts are written in RPython, just like the guts of most lisp interpreters are written in C. At runtime the only thing that is interpreted is the Pixie bytecode, that is until the JIT kicks in...

What's this bit about "magical powers"?

First of all, the word "magic" is in quotes as it's partly a play on words, pixies are small, light and often considered to have magical powers.

However there are a few features of pixie that although may not be uncommon, are perhaps unexpected from a lisp.


;;  This code adds up to 10000 from 0 via calling a function that takes a variable number of arguments.
;;  That function then reduces over the argument list to add up all given arguments.

(defn add-fn [& args]
  (reduce -add 0 args))

(loop [x 0]
  (if (eq x 10000)
    x
    (recur (add-fn x 1))))

(Planned "magical" Features)

Where do the devs hangout?

Mostly on FreeNode at #pixie-lang stop by and say "hello".

Contributing

We have a very open contribution process. If you have a feature you'd like to implement, submit a PR or file an issue and we'll see what we can do. Most PRs are either rejected (if there is a technical flaw) or accepted within a day, so send an improvement our way and see what happens.

Implementation Notes

Although parts of the language may be very close to Clojure (they are both lisps after all), language parity is not a design goal. We will take the features from Clojure or other languages that are suitable to our needs, and feel free to reject those that aren't. Therefore this should not be considered a "Clojure Dialect", but instead a "Clojure inspired lisp".

Disclaimer

This project is the personal work of Timothy Baldridge and contributors. It is not supported by any entity, including Timothy's employer, or any employers of any other contributors.

Copying

Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL). For details see the files COPYING and COPYING.LESSER included with the source distribution. All copyrights are owned by their respective authors.