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: Rick Moynihan
Subject: Re: [Orgmode] [Announcement] Org-babel initial release
Date: Tue, 15 Sep 2009 18:56:30 +0100

Reply below:

2009/9/15 Sebastian Rose <address@hidden>:
>
> * 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).
>

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.




reply via email to

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