Code Monkey home page Code Monkey logo

owl-lisp's Introduction

Owl Lisp

Builds: pipeline status

Overview

Owl Lisp is a functional dialect of the Scheme programming language. It is mainly based on the applicative subset of the R7RS standard.

Requirements

You should have make and gcc or clang installed.

Installation

To install system-wide to /usr

   $ make
   $ sudo make install

Alternatively you can try it out with

   $ make
   $ cp bin/ol /somewhere/convenient
   $ /somewhere/convenient/ol
   You see a prompt
   >

Files

   bin/ol      - the owl interpreter/compiler
   c/ovm.c     - the virtual machine / shared owl lisp runtime
   owl/*.scm   - implementation of owl repl and compiler
   fasl/*.fasl - bytecode images for bin/vm used during boot
   bin/vm      - plain VM used during boot
   c/ol.c      - combined VM and REPL heap image

Usage

Owl can be used either interactively, or to interpret code from files, or compile programs to fasl-images or c-files. The difference between an owl program and a plain script is that the program should just have a function of one argument as the last value, which will be called with the command line argument list when the program is executed.

In addition to being a regular interpreter, owl also tries to make it easy to compile programs for different platforms. Owl programs can be compiled with ol to C-files, which can be compiled to standalone binaries without needing any owl-specific support files or libraries. The C files also work on 32- and 64-bit systems, and compile as such at least on Linux, OpenBSD, and macOS or can be cross-compiled to Windows executables with MinGW.

For example, to build a hello world program:

  $ echo '(lambda (args) (print "Hello, world!"))' > hello.scm
  $ ol -o hello.c hello.scm
  $ gcc -o hello hello.c
  $ ./hello
  Hello, world!

Or simply:

  $ echo '(λ (args) (print "Hello, world!"))' \
     | ol -x c | gcc -x c -o hello - && ./hello

Parts of the compiled programs can be translated to C, instead of being simply fasl-encoded, to increase speed. Using the --native flag compiles most of the bytecode to C, and --usual-suspects compiles typically used functions. To make programs run faster, one can use for example:

  $ ol -O2 -o test.c test.scm && gcc -O2 -o test test.c

Updates and Documentation

For further documentation and updates, see:

https://haltp.org/owl

https://gitlab.com/owl-lisp/owl

https://gitlab.com/owl-lisp

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.