emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Chris Gray <chrismgray@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: A tool for creating source code files from example and src blocks in org files
Date: Wed, 03 Jun 2009 10:53:59 +0200	[thread overview]
Message-ID: <867hzty9y0.fsf@portan.ibr.cs.tu-bs.de> (raw)
In-Reply-To: 4A257492.5030300@fnal.gov

Eric H. Neilsen, Jr. wrote:

> Hi,

> First, thank you Carsten and others, for putting this thing together;
> org-mode is the most useful tool I've run across in a long time.

> I recently put together a few commands to create source code files
> from SRC and EXAMPLE blocks in org-mode files. The original idea is to
> be able to compile examples in my notes without needing to merge them
> into a separate source file by hand. As I was writing it I realized
> this is exactly the same tool one needs to turn org-mode into a
> literate programming tool (see http://www.literateprogramming.com/ ),
> so I adopted some of the nomenclature. (I tried literate programming a
> few years ago, and gave up in frustration with the tools. I am tempted
> to try again with org-mode.)

I was just thinking that literate programming and org-mode would go
great together.  

> The two user level commands are org-tangle and org-untangle, best
> explained through example. Running org-tangle in a buffer that looks
> like this:

> ---------------------- begin /tmp/test.org ---------------------------
> * Some file

> Some text here

> #+CHUNK file1.sh 1

I think using numbers to order the chunks is probably not the best
idea.  When I wrote the one small program I wrote with literate
programming, I really liked being able to write pseudocode with the chunks
that get substituted.  Like this (admittedly poor example):

def fib(n):
    <<find fib_{n - 2}>>
    <<find fib_{n - 1}>>
    <<return the sum>>

<<find fib_{n - 2}>>=
f2 = fib(n - 2)

<<find fib_{n - 1}>>=
f1 = fib(n - 1)

<<return the sum>>=
return f2 + f1

> Is there any interest in this? My organization's rules for releasing
> code to open source projects are being revised, but I am likely to be
> able to do so under a BSD-like license. If there is interest, I will
> push to try and figure out how to do this, and maybe even see if I can
> do the assignment of copyright stuff needed for it to get under the
> main umbrella (although I am not optimistic).

If you put it in a git repo somewhere, I will put some time aside for
it.  

Cheers,
Chris

  reply	other threads:[~2009-06-03  8:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02 18:50 A tool for creating source code files from example and src blocks in org files Eric H. Neilsen, Jr.
2009-06-03  8:53 ` Chris Gray [this message]
2009-06-16 14:03 ` Bastien
2009-06-26 19:15   ` Eric Schulte
2009-06-27 20:31     ` Eric Schulte
  -- strict thread matches above, loose matches on Subject: below --
2009-06-03 13:27 Eric H. Neilsen, Jr.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867hzty9y0.fsf@portan.ibr.cs.tu-bs.de \
    --to=chrismgray@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).