From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waldemar Quevedo Subject: Re: [RFC] org-noweb: org-tangle + org-weave for literate programming using Org Date: Wed, 11 Jun 2014 09:00:19 +0900 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e010d8d307e1fd104fb8422ad Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuVy6-0006Mb-W9 for emacs-orgmode@gnu.org; Tue, 10 Jun 2014 20:00:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuVy5-0006G0-8e for emacs-orgmode@gnu.org; Tue, 10 Jun 2014 20:00:42 -0400 Received: from mail-oa0-x235.google.com ([2607:f8b0:4003:c02::235]:39730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuVy4-0006Fn-Qn for emacs-orgmode@gnu.org; Tue, 10 Jun 2014 20:00:41 -0400 Received: by mail-oa0-f53.google.com with SMTP id l6so2594601oag.12 for ; Tue, 10 Jun 2014 17:00:39 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Girard Cc: emacs-orgmode --089e010d8d307e1fd104fb8422ad Content-Type: text/plain; charset=UTF-8 Hi Nicolas, This is the right direction I think. I added a similar command to a project that I've been working but I use the Ruby parser so the functionality is less: https://github.com/wallyqs/org-converge/blob/master/bin/org-tangle So... I have a added a link to your project. Thanks for sharing! - Wally On Tue, Jun 10, 2014 at 11:46 PM, Nicolas Girard wrote: > Hi folks, > > I've released today a couple of tools named "org-tangle" and > "org-weave" in a public GitHub repository: > https://github.com/ngirard/org-noweb > > I thought that Org's literate programming abilities deserved to be > made accessible non-interactively from the command-line via "official" > commands, and I hope this repository will help establish them. > > The benefits of such an approach I can think of are: > - to provide people with reference tools they can refer to; > - to isolate common behavior from people's customization that can be > repeated consistently and reliably; > - to lower the entry barrier for newcomers; > - to attract the people who might just be interested in Org as a > literate programming tool first, before grasping other areas of the > Org "platform". > > Now, I'd be very glad if we could use this code as a starting point > and discuss about it. > > For instance: > > - What should these tools do, and how ? It seemed to me that they > should only glue functionality from external tools and libraries, > rather than embedding functionality in their cores. > > For instance, if org-weave ever had to gain cross-indexing and > referencing features similar to its oldest siblings (weave, noweave), > it should be achieved by leveraging some dedicated elisp package, > LaTeX style file, or whatever, rather than implementing them itself. > > What do you think ? > > - Into which language should these tools be written ? I've chosen the > Bash shell because it's available almost everywhere. Does it seem ok > for you ? Would it be useful to write them in POSIX-compliant code ? > > - About =org-tangle=: should it take only one org file, or several > files, as an argument ? > > I gave =org-tangle= the same behaviour than the code snippet that > can be found in Org manual > ([[info:org#Batch%20execution][info:org#Batch execution]]), so for now > you can type > > #+begin_src sh > org-tangle file1.org file2.org > #+end_src > > But it makes more sense to me, that org-tangle takes only one file, > and optionally the name of a source code block to be extracted, like > > #+begin_src sh > org-tangle file.org [chunkname] > #+end_src > > What do you think ? > > - About =org-babel-use-quick-and-dirty-noweb-expansion=: should it be > set to 't' by default ? I'd be tempted to say yes, given the dramatic > performance gain > > - etc, etc... > > Also, while not necessary, I thought it would be nice if org-noweb > tools ate their own dogfoot and extracted themselves ; so I've written > them in literate programming style and I have to say I really enjoyed > the process. > > The tools are a mix of elisp and shell code, and it seems to me like > Org + literate style really shine here at making the code readable and > understandable. > > That said, there are a few quirks into the code I'd be glad to see > disappear: > > 1. It made sense for me to write the command line options as an Org > table (look at =#tblname: options= in > https://raw.githubusercontent.com/ngirard/org-noweb/master/org-tangle.org) > ; but if you see the docstring for the =-E= option, I wanted to write > "Default value is <>" but couldn't find a way to get this > reference to expand ; so I had to manually write "Default value is > xxxxx". Any hints ? > 2. The boilerplate fonctions =escape-quotes= and =format-options= : > could it be done in a better way ? > > Cheers, > > Nicolas > > --089e010d8d307e1fd104fb8422ad Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Nicolas,

This is the right direction= I think. I added a similar command to a project that I've been working= but I use the Ruby parser so the functionality is less:=C2=A0https://g= ithub.com/wallyqs/org-converge/blob/master/bin/org-tangle

So... I have a added a link to your project.
=
Thanks for sharing!

- Wally


On Tue, J= un 10, 2014 at 11:46 PM, Nicolas Girard <girard.nicolas@gmail.com> wrote:
Hi folks,

I've released today a couple of tools named "org-tangle" and<= br> "org-weave" in a public GitHub repository:
https://= github.com/ngirard/org-noweb

I thought that Org's literate programming abilities deserved to be
made accessible non-interactively from the command-line via "official&= quot;
commands, and I hope this repository will help establish them.

The benefits of such an approach I can think of are:
- to provide people with reference tools they can refer to;
- to isolate common behavior from people's customization that can be repeated consistently and reliably;
- to lower the entry barrier for newcomers;
- to attract the people who might just be interested in Org as a
literate programming tool first, before grasping other areas of the
Org "platform".

Now, I'd be very glad if we could use this code as a starting point
and discuss about it.

For instance:

- What should these tools do, and how ? It seemed to me that they
should only glue functionality from external tools and libraries,
rather than embedding functionality in their cores.

=C2=A0 For instance, if org-weave ever had to gain cross-indexing and
referencing features similar to its oldest siblings (weave, noweave),
it should be achieved by leveraging some dedicated elisp package,
LaTeX style file, or whatever, rather than implementing them itself.

=C2=A0 What do you think ?

- Into which language should these tools be written ? I've chosen the Bash shell because it's available almost everywhere. Does it seem ok for you ? Would it be useful to write them in POSIX-compliant code ?

- About =3Dorg-tangle=3D: should it take only one org file, or several
files, as an argument ?

=C2=A0 I gave =3Dorg-tangle=3D the same behaviour than the code snippet tha= t
can be found in Org manual
([[info:org#Batch%20execution][info:org#Batch execution]]), so for now
you can type

=C2=A0 #+begin_src sh
=C2=A0 =C2=A0 org-tangle fil= e1.org file2.org
=C2=A0 #+end_src

=C2=A0 But it makes more sense to me, that org-tangle takes only one file,<= br> and optionally the name of a source code block to be extracted, like

=C2=A0 #+begin_src sh
=C2=A0 =C2=A0 org-tangle file= .org [chunkname]
=C2=A0 #+end_src

=C2=A0 What do you think ?

- About =3Dorg-babel-use-quick-and-dirty-noweb-expansion=3D: should it be set to 't' by default ? I'd be tempted to say yes, given the dr= amatic
performance gain

- etc, etc...

Also, while not necessary, I thought it would be nice if org-noweb
tools ate their own dogfoot and extracted themselves ; so I've written<= br> them in literate programming style and I have to say I really enjoyed
the process.

The tools are a mix of elisp and shell code, and it seems to me like
Org + literate style really shine here at making the code readable and
understandable.

That said, there are a few quirks into the code I'd be glad to see disa= ppear:

1. It made sense for me to write the command line options as an Org
table (look at =3D#tblname: options=3D in
https://raw.githubusercontent.com/ngirard/org-= noweb/master/org-tangle.org)
; but if you see the docstring for the =3D-E=3D option, I wanted to write "Default value is <<emacs>>" but couldn't find a = way to get this
reference to expand ; so I had to manually write "Default value is
xxxxx". Any hints ?
2. The boilerplate fonctions =3Descape-quotes=3D and =3Dformat-options=3D :=
could it be done in a better way ?

Cheers,

Nicolas


--089e010d8d307e1fd104fb8422ad--