Coder Social home page Coder Social logo

owl's Introduction

owl - an interactive toploop for OCaml education

Owl is a modified version of the utop package, with simplified features and default libraries that are geared toward novice programmers.

The main differences from utop are:

  • owl provides simpler default settings and exposes fewer libraries
  • owl wraps some of the OCaml libraries to make them more accessible
  • owl comes bundled with some modules designed for learning about programming

Installation via opam

TODO!

Usage

To use owl, simply run:

$ owl

owl display a bar after the prompt which is used to show possible completions in real-time. You can navigate in it using M-left and M-right, and select one completion using M-tab. The M denotes the meta key, which is Alt most of the time.

Creating a custom utop-enabled toplevel

With jbuilder

The recommended way to build a custom utop toplevel is via jbuilder. The entry point of the custom utop must call UTop_main.main. For instance write the following myutop.ml file:

let () = UTop_main.main ()

and the following jbuild file:

(executable
 ((name myutop)
  (link_flags (-linkall))
  (libraries (utop))))

then to build the toplevel, run:

$ jbuilder myutop.bc

Note the -linkall in the link flags. By default OCaml doesn't link unused modules, however for a toplevel you don't know in advance what the user is going to use so you must link everything.

If you want to include more libraries in your custom utop, simply add them to the (libraries ...) field.

Additionally, if you want to install this topevel, add the two following fields to the executable stanza:

  (public_name myutop)
  (modes (byte))

The (modes ...) field is to tell jbuilder to install the byte-code version of the executable, as currently native toplevels are not fully suported.

Utop

Please see the [utop documentation]:https://github.com/diml/utop for more configuration options.

Owl would not be possible without utop. Many thanks to Jeremie Dimino [email protected] who developed the original utop code base.

owl's People

Contributors

jeremiedimino avatar whitequark avatar danmey avatar zdancewic avatar mads-hartmann avatar benkard avatar copy avatar rleonid avatar arichiardi avatar dkim avatar martintrojer avatar trefis avatar dbuenzli avatar jaredly avatar altgr avatar maverickwoo avatar rgrinberg avatar swsnr avatar syohex avatar avsm avatar chrismamo1 avatar lehy avatar pveber avatar

Stargazers

 avatar  avatar Stephanie Weirich avatar

Watchers

James Cloos 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.