From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 9BD1A7EEBF for ; Tue, 30 Jun 2015 17:56:38 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of agarwal1975@gmail.com) identity=pra; client-ip=209.85.212.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of agarwal1975@gmail.com designates 209.85.212.171 as permitted sender) identity=mailfrom; client-ip=209.85.212.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f171.google.com) identity=helo; client-ip=209.85.212.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="postmaster@mail-wi0-f171.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DlBAADu5JVlKvUVdFbgzA1XwaDGIIJp0+GEYoSghaFfIFJB0wBAQEBAQESAQEBAQcLCwkfMIQ7ER0BGx4DEgkHNwIkAREBBQEiJw6HdwEDEqE6gzE+MYs/gWuCeYtQChknDVeFHhoBBQ6Pc0uCc4FDBZQFAoRahn2BOoQSh3+Cb4QmghMSI4EVEQZyfII3IjGCSAEBAQ X-IPAS-Result: A0DlBAADu5JVlKvUVdFbgzA1XwaDGIIJp0+GEYoSghaFfIFJB0wBAQEBAQESAQEBAQcLCwkfMIQ7ER0BGx4DEgkHNwIkAREBBQEiJw6HdwEDEqE6gzE+MYs/gWuCeYtQChknDVeFHhoBBQ6Pc0uCc4FDBZQFAoRahn2BOoQSh3+Cb4QmghMSI4EVEQZyfII3IjGCSAEBAQ X-IronPort-AV: E=Sophos;i="5.15,378,1432591200"; d="scan'208";a="138454306" Received: from mail-wi0-f171.google.com ([209.85.212.171]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Jun 2015 17:56:37 +0200 Received: by wicgi11 with SMTP id gi11so21105765wic.0 for ; Tue, 30 Jun 2015 08:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=zo4IReatWaHlWZ6VySfpqOvFDcoi20+kWR0zeNOVFbI=; b=gAZEN/jIx3xZ3y7N5bjlgu5YUyQcxkqPdMy5irK5AyLnVIIypv7FquNIjj5jhaU8q8 x04Mc3Bl+e+u5ytc3HuCUTfixdh8iA3N0m+R/IHK/BgSBjupqIw8wk5fgPWurzlteVo+ eR4bEUoj6ABoolawMtrQR8WbZWoC/MybU0soRUs6KfksEZbly+POq1DpbbVodGiq7DlX 5N5AEvy1/UunkuXpQkOdHw9sqc6Y11T9hwre89eevju84RccV+iGMuhLazkzhEM8tX2J CgA9983uAvHPH4GD0uZChPvbXVhS+acXdbJ9in4KUlRMP72mYCsYEi8U+9wtnWvBlVmx YObw== X-Received: by 10.194.134.9 with SMTP id pg9mr42573085wjb.5.1435679797642; Tue, 30 Jun 2015 08:56:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.27.82.68 with HTTP; Tue, 30 Jun 2015 08:56:18 -0700 (PDT) From: Ashish Agarwal Date: Tue, 30 Jun 2015 11:56:18 -0400 Message-ID: To: OCaml List Content-Type: multipart/alternative; boundary=089e011767ed5989830519be4076 Subject: [Caml-list] [ANN] oloop 0.1.0 --089e011767ed5989830519be4076 Content-Type: text/plain; charset=UTF-8 We are pleased to announce the first release of Oloop, which helps you auto-evaluate OCaml code for inclusion in educational materials such as books and blogs. An example of the command line tool is below. It evaluates an input script, silences the output of directives, and prints other output in a manner similar to the normal OCaml toplevel. Most compiler options such as -short-paths are supported as well as utop style determination of Lwt and Async values. This is an early release and we hope additional printers, e.g. to html and latex, will be added by the community. The library provides additional power. You create a handle to a toplevel, to which you can then feed OCaml phrases to evaluate. The types returned are very precise, so you can define printers exactly to your needs. For example, you can optionally distinguish between stdout and stderr or merge them, and the compiler's out phrase is kept distinct from stdout. In educational material, you often want to show incorrect code. Oloop captures errors, such as syntax errors, type errors, and exceptions, and returns them as values you can work with. Scripts can be split into parts by including OCaml comments in the form (* part N *), so you can include parts piecemeal in your overall text. Install: Should be in opam soon. Run `opam update`, then `opam install oloop`. Source code: https://github.com/ocaml/oloop. API reference: see mli files in the source code, starting with oloop.mli Command line reference: run `oloop -help` Please join the project. See the Issues list for small tasks. Bigger tasks would be to provide a whitespace preserving parser and a syntax highlighter. $ cat a.ml #use "topfind";; #thread;; #camlp4o;; #require "core";; #require "core.syntax";; open Core_kernel.Std;; let x = List.reduce_exn ~f:(+) [1;2;3;4;5];; let () = printf "x = %d\n" x;; $ oloop -silent-directives a.ml (* part 0 *) # #use "topfind";; # #thread;; # #camlp4o;; # #require "core";; # #require "core.syntax";; # open Core_kernel.Std;; # let x = List.reduce_exn ~f:(+) [1;2;3;4;5];; val x : int = 15 # let () = printf "x = %d\n" x;; x = 15 --089e011767ed5989830519be4076 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
We are pleased to announce the first release of Oloop= , which helps you auto-evaluate OCaml code for inclusion in educational mat= erials such as books and blogs. An example of the command line tool is belo= w. It evaluates an input script, silences the output of directives, and pri= nts other output in a manner similar to the normal OCaml toplevel. Most com= piler options such as -short-paths are supported as well as utop style dete= rmination of Lwt and Async values. This is an early release and we hope add= itional printers, e.g. to html and latex, will be added by the community.

The library provides additional power. You create a= handle to a toplevel, to which you can then feed OCaml phrases to evaluate= . The types returned are very precise, so you can define printers exactly t= o your needs. For example, you can optionally distinguish between stdout an= d stderr or merge them, and the compiler's out phrase is kept distinct = from stdout. In educational material, you often want to show incorrect code= . Oloop captures errors, such as syntax errors, type errors, and exceptions= , and returns them as values you can work with. Scripts can be split into p= arts by including OCaml comments in the form (* part N *), so you can inclu= de parts piecemeal in your overall text.

Install: = Should be in opam soon. Run `opam update`, then `opam install oloop`.
=
API reference: see mli files in the source = code, starting with oloop.mli
Command line reference: run `oloop = -help`

Please join the project. See the Issues lis= t for small tasks. Bigger tasks would be to provide a whitespace preserving= parser and a syntax highlighter.

$ cat a.ml=C2=A0
#use "topfind";;
#thread;;
#camlp4o;;
#require "core";;
=
#require "core.syntax";;
open Core_kernel.Std;;
let x =3D List.reduce_exn ~f:(+) [1;2;3;4;5];;
let () =3D= printf "x =3D %d\n" x;;

$ oloop -silent= -directives a.ml
(* part 0 *)
# #use "topfind";;
# #thread;;
# #camlp4o;= ;
# #require "core";;
# #require "core.s= yntax";;
# open Core_kernel.Std;;
# let x =3D List= .reduce_exn ~f:(+) [1;2;3;4;5];;
val x : int =3D 15
# l= et () =3D printf "x =3D %d\n" x;;
x =3D 15
--089e011767ed5989830519be4076--