From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darlan Cavalcante Moreira Subject: Sage Math - Maybe some inspiration for org-babel Date: Mon, 19 Oct 2009 19:20:08 -0300 Message-ID: <4adce61d.0508d00a.3475.2d8d@mx.google.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N00aT-00087d-C9 for emacs-orgmode@gnu.org; Mon, 19 Oct 2009 18:20:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N00aO-00086i-AE for emacs-orgmode@gnu.org; Mon, 19 Oct 2009 18:20:20 -0400 Received: from [199.232.76.173] (port=59071 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N00aO-00086f-4z for emacs-orgmode@gnu.org; Mon, 19 Oct 2009 18:20:16 -0400 Received: from mail-ew0-f206.google.com ([209.85.219.206]:41543) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N00aN-0005cE-8J for emacs-orgmode@gnu.org; Mon, 19 Oct 2009 18:20:15 -0400 Received: by ewy2 with SMTP id 2so5519583ewy.31 for ; Mon, 19 Oct 2009 15:20:14 -0700 (PDT) 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: org-mode Mailinglist Hello org-users I have been reading with attention the E-Mails about org-babel here on the list and decided to play with it a little this weekend. It reminded me about another great piece of software called "Sage Math" (Some screencasts here -> http://www.sagemath.org/help-video.html) that I have tested sometime ago. "Sage is a free open-source mathematics software system licensed under the GPL. It combines the power of many existing open-source packages into a common Python-based interface." Although Sage and org-babel are very different, I think that Sage may be a good source of inspiration for org-babel. Probably the most practical way of using sage is though the notebook: a front-end that runs inside the browser and communicates with the sage server (may be remote or local). In the sage notebook one creates worksheets. Each worksheet starts with a text area where you type the code. The main language is python, but others may be used if specified with a comment. When the code is evaluated any output is shown in addition to the last value. Therefore, the code ,---- | print "hello" | 10 | print "world" | 9 | 15 `---- will show ,---- | hello | world | 15 `---- This is similar to a "combination" of :results output and :results value in org-babel. A really nice feature is that if an image is created by the last command in the block it is automatically shown. Therefore, it doesn't matter which library was used to generate the plot as long as it creates an image (for instance, plotting to a file with matplotlib will shown the plot when the code is evaluated). Maybe the same approach could be used in org-mode. In the text area, RET only creates a new line, Shift+RET evaluates the code in the text area and creates a new one below the output keeping all the variables similar to the multiple source blocks within a single session in org-babel. Two things I find interesting is that you can easily evaluate all blocks in the worksheet (org-mode already has org-babel-execute-buffer) and if any block starts with the comment "%hide" the code is not shown, only its output. I think that a header argument ":hide" for a source block could be useful. That's my two cents. It is really amazing what you can do with org-mode and org-babel and I'm not saying in that org-babel should became more similar to sage. I only think that getting some inspiration from sage could be nice. Regards, Darlan