Git Product home page Git Product logo

llambda's Introduction

Introduction

Llambda is a natively compiled Scheme with optional strong typing. The core language is based on R7RS with a number of extensions influenced by Typed Racket and the SRFI community.

Llambda implements many of the features expected from a modern programming language including:

  • First class functions
  • Unicode support including UTF-8 strings
  • Support for functional programming including higher-order functions such as map, reduce and fold
  • Safe programming environment with garbage collected memory, enforced bounds checking and checked integer overflow
  • Concurrency support via an implementation of the Actor model
  • Pattern matching
  • Read-evaluate-print loop

Llambda is implemented with a Scala frontend, LLVM backend and a Scheme and C++11 runtime.

The language is currently very experimental with all non-R7RS language features in flux. Although it's well tested through an extensive functional test suite very few non-trivial programs have been written in Llambda. The lack of bindings for any non-system libraries make it only suitable for standalone programs operating on standard I/O and files.

Requirements

  • Modern Unix-like operating system such as Mac OS X, Linux or FreeBSD. Llambda is explicitly tested on Mac OS X 10.10, Ubuntu 15.04 and FreeBSD 10.1 after every major change.
  • CMake 2.8
  • LLVM 4.0
  • Clang 4.0
  • sbt

Installation

Ensure that the above requirements are met and the related programs are in your user's path. Then, the runtime can be built using CMake.

$ cd llambda
$ mkdir build
$ cd build
$ cmake ../runtime && make

Usage

Llambda takes Scheme source files as input and produces standalone statically linked executables. A trivial "Hello, World" application would look like:

(import (llambda base))
(import (llambda write))

(write "Hello, world!")
(newline)

The llambda shell script be can used used to compile Scheme programs by passing their path on the command line. It supports various options which are described by llambda --help. Of particular interest is the -s option which will immediately run the program instead of producing an exectuable. This can be useful for scripting tasks.

For frequent compilation it is more efficient to use sbt to run the compiler from within the sbt environment. This avoids the overhead of launching a JVM for every invokation of the compiler. For example, to compile a program located at /home/example/test.scm would work as follows:

$ cd llambda/
$ sbt
> project compiler
> run /home/ryan/Code/test/test.scm

Documentation

Generated documentation is hosted at llambda.readthedocs.org

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.