[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [slightly OT] New O'Reilly book features Matz

Yukihiro Matsumoto

3/15/2007 3:04:00 PM

Hi,

In message "Re: [slightly OT] New O'Reilly book features Matz"
on Thu, 15 Mar 2007 17:11:20 +0900, Chad Perrin <perrin@apotheon.com> writes:

|In other words: literate programming is "documentation as code", and
|your preference is "code as documentation". Yes?

To be precise, "literate programming as in Knuth's Web" is
"documentation as code". I think the concept "literate programming"
is much broader than Web, and in one sense "code as documentation" can
be literate programming as well.

Besides that, Web was a great tool considering the age of its birth.

matz.

5 Answers

Giles Bowkett

3/16/2007 4:15:00 AM

0

> |In other words: literate programming is "documentation as code", and
> |your preference is "code as documentation". Yes?
>
> To be precise, "literate programming as in Knuth's Web" is
> "documentation as code". I think the concept "literate programming"
> is much broader than Web, and in one sense "code as documentation" can
> be literate programming as well.

I read somewhere that a statistical analysis revealed commented code
takes longer to debug than uncommented code, and the reason was that
comments frequently describe what the code is supposed to do rather
than what it actually does.

Documentation considered harmful.

--
Giles Bowkett
http://www.gilesg...
http://gilesbowkett.bl...
http://giles.t...

Keith Fahlgren

3/16/2007 7:25:00 PM

0

On 3/15/07, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
> To be precise, "literate programming as in Knuth's Web" is
> "documentation as code". I think the concept "literate programming"
> is much broader than Web, and in one sense "code as documentation" can
> be literate programming as well.

Hey,

Thanks for sharing your thoughts on this issue, Matz. I think your
philosophy shows in Ruby's design and I'm looking forward to your
essay and the book in general.

For more on Knuth's ideas about writing and "literate" programs, see
this (just discovered) PDF:
http://tex.loria.fr/typographie/mathw...

via: http://wadler.blogspot.com/2007/03/three-ways-to-improve-your-wr...


Keith

Xavier Noria

3/17/2007 8:57:00 AM

0

I tried hard to do an immersion in literate programming both using
Perl and Ruby (via noweb), and finally gave up. I summarised the
reasons here:

http://www.advogato.org/person/fxn/diary.html...

Some friend of mind said by then "it's a beautiful idea that just
does not work".

-- fxn


Morton Goldberg

3/18/2007 2:34:00 AM

0

Re: literate programming

On Mar 17, 2007, at 4:56 AM, Xavier Noria wrote:

> Some friend of mind said by then "it's a beautiful idea that just
> does not work".

I disagree. I offer Wolfram Research's Mathematica front end with its
notebook interface as an example. My personal experience is that it
works very well as a literate programming environment.

It takes a lot of engineering effort to produce a literate
programming environment that is relatively easy to use. The
developers of such an environment must seamlessly combine a technical-
grade word processor with a software IDE. IMO, Wolfram has been able
to pull this off.

Regards, Morton

M. Edward (Ed) Borasky

3/18/2007 4:30:00 AM

0

Morton Goldberg wrote:
> Re: literate programming
>
> On Mar 17, 2007, at 4:56 AM, Xavier Noria wrote:
>
>> Some friend of mind said by then "it's a beautiful idea that just
>> does not work".
>
> I disagree. I offer Wolfram Research's Mathematica front end with its
> notebook interface as an example. My personal experience is that it
> works very well as a literate programming environment.
>
> It takes a lot of engineering effort to produce a literate programming
> environment that is relatively easy to use. The developers of such an
> environment must seamlessly combine a technical-grade word processor
> with a software IDE. IMO, Wolfram has been able to pull this off.
>
> Regards, Morton
>
>
As have the good folks at the open source Axiom project. Axiom's base
modus operandi is literate programming. I haven't used Mathematica --
it's always been way too expensive for the amount of time I spend doing
symbolic math. But I do have a Derive license ($200US) and of course
have both Maxima and Axiom on my Linux systems.

As for a "technical-grade word processor", there are two similar but
different ones in the open-source world, TeXmacs and LyX. LyX is easier
to use than TeXmacs and actually has hooks for literate programming
built in, although it's not as seamless as Mathematica. TeXmacs is more
powerful -- you can open it up and insert sessions of a number of
languages, including R, Axiom, Maxima, Guile (Scheme) and Python. A Ruby
session interface for TeXmacs would make a great Summer of Code project
(hint hint looking for an opportunity to mentor someone hint hint). :)