Coder Social home page Coder Social logo

ocaml-lua's Introduction

What is ocaml-lua

OCaml-lua provides bindings to the Lua programming language. Lua is a scripting language particularly useful when you need to embed a language in your application.

This project provides the bindings required to embed Lua.

More information about Lua

Lua logo

Introduction

Lua is a powerful, light-weight programming language designed for extending applications. It provides a good general purpose programming language to replace DSL that don't really need to be specific.

This library provides bindings to Lua API which allows the application to exchange data with Lua programs and also to extend Lua with OCaml functions.

This is the OCaml complete binding of the Lua Application Program Interface as described in the official documentation.

In this moment only the version 5.1.x is supported, while 5.2.x is on my TODO list. In general my plan is to support newest versions, but not the oldest ones.

LuaJIT 2.0.0 for Lua 5.1 is also supported.

Intended audience

This library is intended to be useful to OCaml developers needing a dynamic language to be included in their projects, for configuration or customization purposes. Instead of reinventing yet another DSL, one should consider using an existing programming language and Lua is in my opinion the perfect companion of a statically typed language like OCaml.

In a few lines of code you can create a Lua interpreter and run a Lua program inside it. You can provide the Lua state with library functions written in OCaml and available to the Lua program.

More informations about Lua can be found on the documentation page.

My advice is to read the book "Programming in Lua", written by the author of the language, Roberto Ierusalimschy.

Where to find everything

The homepage of the project is hosted on GitHub.

The complete library reference (ocamldoc generated) is here.

The official GIT repository is here.

Bug reports and feature requests are on my page on GitHub.

See the file COPYING.txt for copying conditions. See the file AUTHORS.txt for credits.

Building and installing the library

Installing with OPAM

Installing the library with OPAM should be as sismple as: opam install ocaml-lua

Compiling and installing from source

To build the library the following requirements are mandatory:

  • lua 5.1.x
  • ocaml (>= 3.12.1)
  • findlib

The library can optionally be compiled and linked with LuaJIT. In this case an additional requirement is:

  • LuaJIT 2.0.0 for Lua 5.1

To compile use the usual spell:

  1. ./configure check the options of the configure script with --help, and pay particular attention to --docdir which defaults to /usr/local/share/doc/ocaml-lua
  2. make
  3. make doc
  4. make install

ocaml-lua's People

Contributors

dsheets avatar kandu avatar pdonadeo avatar

Watchers

 avatar  avatar

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.