From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Moynihan Subject: Re: [Announcement] Org-babel initial release Date: Tue, 15 Sep 2009 18:56:30 +0100 Message-ID: References: <87pr9sazlr.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MncH7-0000WZ-CL for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 13:57:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MncH1-0000Vv-Sv for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 13:57:08 -0400 Received: from [199.232.76.173] (port=60049 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MncH1-0000Vs-Lu for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 13:57:03 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:49075) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MncH1-0005Jz-5V for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 13:57:03 -0400 Received: by ewy7 with SMTP id 7so2625932ewy.31 for ; Tue, 15 Sep 2009 10:57:01 -0700 (PDT) In-Reply-To: <87pr9sazlr.fsf@gmx.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastian Rose Cc: Org Mode Reply below: 2009/9/15 Sebastian Rose : > > * 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 =A0# -f is optional > php =A0 -f FILE =A0# -f is optional > perl =A0 =A0 FILE > > Or execute code directly (which is useless for us, since we would need > to quote the code correctly...): > > rhino -e =A0CODE... > perl =A0-e =A0CODE... > php =A0 -r =A0CODE... > > > So how about: > > =A0#+srcname: generic-circumference(a) > =A0#+begin_src javascript :interpreter rhino -f > > =A0print ( "Write me to temp file and call `rhino -f TMPFILE'" ) > =A0java.lang.System.out.println ( 2 * a * java.lang.Math.PI ) > > =A0#+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). > Was having a similar idea, as I language I'd love to use with this is my current fave clojure: http://clojure.org/ It's a language based on the JVM and consequently being able to pass in command line options to the interpreter is important... I'd imagine most of the time the source blocks within a single file would share the vast majority of environment settings too (for example setting the JVM's class path) so being able to specify these values to pass to the interpreter, once at the top of the file would be really nice. R.