Dear all,

I would like to announce that Org-babel now supports the Oz programming language.

Org mode (http://orgmode.org/) is an Emacs mode for fast and effective authoring of plain-text (among other things). For example, you write with a convenient wiki-like syntax, easily move around text blocks, "fold" sections you are not working on currently, export the resulting text to various formats including HTML and PDF (articles and projector slides), etc.

Org-babel (http://orgmode.org/worg/org-contrib/babel/) extends this Org mode by adding support for executing code of various programming languages directly within your text documents. It can be used, for example to write papers that involve code where this code is actually part of the document and results in the text are created directly using that code (e.g., for programming tutorials, or for Reproducible Research http://reproducibleresearch.net/index.php/Main_Page), to practice Literate Programming (http://en.wikipedia.org/wiki/Literate_programming ), among other uses described in the Org-babel tutorial (http://orgmode.org/worg/org-contrib/babel/intro.php ) and further documentation (http://orgmode.org/worg/org-contrib/babel/uses.php ).

Org-babel-oz (http://orgmode.org/worg/org-contrib/babel/languages/org-babel-doc-oz.php ) extends Org-babel by support for Oz. Code blocks contain either an Oz statement or an Oz expression. While this code is part of an Org mode file, it is opened in a temporary Oz mode buffer with a single Emacs short-cut (C-c '), so all OPI facilities are there for editing this code. Also, Oz code blocks can be executed (fed) with a single short-cut (C-c C-). For statements, such an execution behaves exactly like feeding a region under the OPI. For expressions, Org-babel-oz communicates with the OPI via an additional socket, and results are automatically inserted in the Org file. See the documentation linked above for further details. Note that the Org-babel-oz documentation page is updated in a few hours (instead of showing the actual Org- babel "markup" for the Oz code blocks, only the Oz code itself has been exported to HTML).

I am already using Org-babel-oz for writing documentation for my own software, and I can report that it works very nicely for me :)

However, feeding Oz expressions is not quite stable yet and I would like you help here. For executing/feeding Oz statements I am indeed using the Emacs Lisp function used by the OPI for feeding, namely oz- send-string (defined in mozart/share/elisp/mozart.el.in).

Is it possible to also feed Emacs Lisp expressions in the OPI? I did not find any Emacs Lisp function for that, and therefore rolled my own (it talks to the OPI compiler instance via a socket as mentioned before). However, my approach breaks, e.g., if the OPI compiler is halted and restarted (which is something I am doing rather frequently). So, does the current OPI Emacs Lisp code perhaps somehow provide the functionality for feeding expression, so that I could use that OPI functionality instead? Alternatively, does anyone have an idea how to create an interface between the OPI compiler and Emacs Lisp that does not break so easily?

If you want to see the Org-babel-oz code, it is only two relatively short files available here.

http://repo.or.cz/w/org-mode.git/blob/HEAD:/contrib/babel/lisp/langs/org-babel-oz.el
http://repo.or.cz/w/org-mode.git/blob/HEAD:/contrib/scripts/StartOzServer.oz

Thank you!

Best wishes,
Torsten

--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-586219
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de





_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to