emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [Announcement] Org-babel initial release


From: Sebastian Rose
Subject: Re: [Orgmode] [Announcement] Org-babel initial release
Date: Tue, 15 Sep 2009 19:26:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

"Eric Schulte" <address@hidden> writes:
> Dan Davison and I (Eric Schulte) are happy to announce that Org-babel
> has now been released as a contributed package in Org-mode with
> corresponding documentation on worg [1].


What else should I say - THIS IS GREAT NEWS!!



I wonder how complicated it would be to add more languages. Especially
PHP, JavaScript (e.g. per rhino) and Perl.

Is there some documentation or advice on the net in that concern? I'd
like to add a language I understand besides Bash... :)

Hmmm - maybe `org-babel-sh.el' is a good starting point.





* Some thoughts


I actually wonder, if all those interpreted languages are different at
all. Why not add an generic call to interpreters. Executing Shell
scripts or Perl, Php, JavaScript... makes no big difference here. On
Linux at least, they all work with either shebang or called with OPTION
FILENAME.

To execute a temporary file without shebang, all interpreters take a
filename:

rhino -f FILE  # -f is optional
php   -f FILE  # -f is optional
perl     FILE

Or execute code directly (which is useless for us, since we would need
to quote the code correctly...):

rhino -e  CODE...
perl  -e  CODE...
php   -r  CODE...


So how about:

  #+srcname: generic-circumference(a)
  #+begin_src javascript :interpreter rhino -f

  print ( "Write me to temp file and call `rhino -f TMPFILE'" )
  java.lang.System.out.println ( 2 * a * java.lang.Math.PI )

  #+end_src

This way, a source block written on my Linux-System would execute on her
MAC and his Windows machine without change (provided the interpreter is
installed and in $PATH... `org-program-exists' ... to use interpreters
without having them in $PATH, a customizable map could be used).






BTW: I just discovered rhino - looks interesting, seems you can
(de-)serialize Java(Script) objects... and thus keep track of things
between sessions ;) start programs, call Java Methods...  See
https://developer.mozilla.org/en/Rhino_Shell



Best wishes,

  Sebastian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]