yet another blog http://www.linux-france.org/~dmentre/blog//index.rss en Literate programming as source code comments http://www.linux-france.org/~dmentre/blog//en/ideas/literate-programming-as-source-comments.html <p> For a long time, I've been interested in <a href="http://www.literateprogramming.com/">literate programming</a>, an idea originaly developed by <a href="http://www-cs-faculty.stanford.edu/~knuth/">Donald. E Knuth</a> in its <a href="http://www-cs-faculty.stanford.edu/~knuth/cweb.html">CWEB</a> system when programming the TeX system. His idea is quite simple: write a program not as a piece of code but as a book, where actual code is interleaved with pieces of documentation about that code. For example, for more than two years now I've been using <a href="http://www.eecs.harvard.edu/~nr/noweb/">Noweb</a> to write the code of <a href="http://www.demexp.org/en/doku.php#articles_and_discussions_on_software_development">demexp</a>. Noweb is very nice. Most notably, it is language agnostic so it can be used on all the different pieces of source you have in a project.</p> <p> The main issue with literate programming is a technical one: the mixed source code and documentation is written into a file, e.g. <code>file.ml.nw</code>, from which are derived compilable code (<code>file.ml</code>) and documentation (<code>file.ml.tex</code>). This approach is not compatible with proprietary IDE environments that your are forced to use for very specific programming (e.g. Intel's IXP SDK for IXP2x00 Network Processors or Xilinx's ISE for FPGA). Moreover, the more I think about it, the more I believe that compilable source code should be the reference point: </p> <ul> <li>it can thus be shared easily with other programmers that don't want to use literate programming tools;</li> <li> program order is important in certain languages (e.g. OCaml) and should be kept;</li> <li>most substitution mechanisms in literate programming tools I know about (Noweb, original Knuth's CWEB) is a very fragile macro systems that can lead to bugs.</li> </ul> <p> I have thus started to think about <b>embedding literate programming chunks as language comments</b>. A special processing on source code extracts documentation from literate markup. </p> <p> My original idea was quite simple: use a Wiki-like syntax to write the documentation, with a few set of tags: </p> <ul> <li>references and links within one source file or between source file;</li> <li>usual emphasized, bold, italics, code, etc. markups;</li> <li>inclusion of images;</li> <li>(optionally) syntax coloring and index creation.</li> </ul> <p> One could even consider transforming an existing Wiki system storing its data in text file, like <a href="http://wiki.splitbrain.org/wiki:dokuwiki">DokuWiki</a>, to write the literate parts of the code. </p> <p> More recently, Felix BREUER has proposed to use <a href="http://texmacs.org/">TeXmacs</a> as a literate programming tool. I have <a href="http://thread.gmane.org/gmane.editors.texmacs.devel/2653">proposed him my idea of documentation as source comments and he seems to like it</a>, so we <a href="http://article.gmane.org/gmane.editors.texmacs.devel/2672">will try to experiment that idea</a>. </p> <p> To conclude, while I'm pretty sure that literate programming as source code comments is the way to go, I'm not sure of the right path between a wiki-like syntax and a TeXmacs approach. While TeXmacs approach is very seducing because TeXmacs is a full fledge scientific editor, with image creation and inclusion, formulas, references and links, its file format is not very readable and could clutter a lot the source code, making it unreadable. <a href="http://article.gmane.org/gmane.editors.texmacs.devel/2659">Felix has proposed an original solution</a> to this issue: put the TeXmacs code at the end of the source file (albeit still embedded in it) and use a system of references for edition within TeXmacs. On the other hand, a wiki-like system is always readable, even for people not using the literate programming approach. Time and experiment will tell what is the right approach. </p> Idea: write a formally proven voting machine http://www.linux-france.org/~dmentre/blog//en/ideas/formally-checked-voting-machine.html For those having some spare time and who are willing to dig into tricky (but interesting) areas, I have a nice idea of project to do: write the (free) software of a voting machine where all (or at least most of) the code is formally proven.<br/> <p/> The voting machine I consider would be a very classical one: no network connection (so no remote electronic voting), a touch screen with the different voting options, votes are stored on a local hard drive. One can use a standard PC as reference hardware (with for example a graphical screen with mouse click to emulate the touch screen), even if for a real voting machine a temper-proof hardware would be mandatory. <p/> The purpose of the software would be: <ul> <li>Before the vote phase, to take the set of vote option and the list of voters identifiers (an unique random integer for each one of them, that would emulate the use of a smartcard);</li> <li>During the vote itself, authenticate a voter (through his/her unique identifier), take his/her vote and store it;</li> <li>After the vote phase, output the vote result.</li> </ul> <p/> The software would be written in plain C, using information (and maybe code) from <a href="http://sos.enix.org/">Simple Operating System (SOS)</a> for hardware interface (mouse and screen control). Using <a href="http://why.lri.fr/">Why proof obligation producer</a>, one would produce the formal version of the program for the <a href="http://coq.inria.fr/">Coq proof assistant</a>, that would be used for the formal proofs. <p/> Of course, all of those software are available as free software and the resulting code and formal proofs should be also available as free software. The net result of such a project would not be a complete voting machine (this is much more complex than that) but a first step towards a trustable voting machine. <p/> What do you think of it? Base des producteurs de code barre http://www.linux-france.org/~dmentre/blog//fr/code-barre.html <p> Pour ceux qui se demandent quelle est la société (plus exactement le distributeur) derrière tel ou tel code barre, une interrogation sur <a href="http://annuaire.eannet-france.org/fr/"> http://annuaire.eannet-france.org/fr/</a> permet d'y répondre. </p> <p> Par exemple, pour le code 3283451050726, j'obtiens: </p> <table style="border-style:solid;border-width:1px"> <tr> <td colspan="2"><b>3012834500103</b> - WARNER MUSIC FRANCE</td> </tr> <tr valign="top"><td><b>Adresse</b> <br>29 avenue Mac Mahon <br>75017 PARIS </td> <td> <b>Tél : </b>0156604000 <br><b>Fax : </b>0156604050 </td> </tr> <tr> <td colspan="2"><b>Correspondant</b><br> Monsieur GAIN Philippe (Responsable de Production)<br> Tél : 0156604000 Fax : 0156604050 </td> </tr><tr><td colspan="2"><b>Activités</b> <br>FABRICANT / INDUSTRIEL / PRODUCTEUR </td></tr> <tr><td colspan="2"><b>Produits</b> <br>IMAGE ET SON CD, CD ROM, K7 VIDEO </td></tr> <tr><td colspan="2"><b>SIREX : </b>71202937000079</td></tr> <tr><td colspan="2"><b>NAF : </b>221G</td></tr> </table> <p>Ah le monde merveilleux des bases de données !</p> <p> <em>Mise à jour</em> : il parait que la base <a href="http://www.gepir.org/client.htm">www.gepir.org/client.htm</a> marche mieux. </p> Switch to pyblosxom http://www.linux-france.org/~dmentre/blog//en/switch-to-pyblosxom.html I switched from <a href="http://www.blosxom.com">blosxom</a> to <a href="http://pyblosxom.sourceforge.net">pyblosxom</a> to make my blog: the permanent link of blog entries was changing with modification time! Pyblosxom has a sensible way of managing permanent links. Additional bonus: the user documentation of pyblosxom is very nice. Sage: a nice RSS reader for Firefox http://www.linux-france.org/~dmentre/blog//en/sage.html <p> I'm currently using <a href="http://sage.mozdev.org/">Sage</a> as a RSS reader for Firefox. It is pretty basic but suits my needs: to know what is new is a newsfeed (dynamic bookmarks of Firefox lack this functionnality). And being a Firefox extension, it is very simple to install and is integrated with the browser: clicking on a news item opens the right link (and even a vote on demexp if <a href="http://article.gmane.org/gmane.politics.organizations.demexp.devel/723"> Firefox is properly configured</a>). </p> PGP pathfinder: have statistics about your GPG key http://www.linux-france.org/~dmentre/blog//en/pgp-pathfinder.html <p> I recently discovered <a href="http://www.cs.uu.nl/~henkp/henkp/pgp/pathfinder/">PGP pathfinder & key statistics</a> a system to gather statistics about your GPG key and determine the trust path between you and another person. </p> <p> For example, <a href="http://www.cs.uu.nl/people/henkp/henkp/pgp/pathfinder/mk_path.cgi?FROM=A3AD7A2A&amp;TO=2B46A27C&amp;PATHS=trust+paths">the trust path between me and Branden Robinson</a> (Debian Project Leader) is, in the shortest case: </p> <pre> 0 A3AD7A2A stats David MENTRE dmentre.at.linux-france.org #13401 signs 1 D0AB4075 stats Pascal Terjan (Professional) pterjan.at.mandriva.com #2488 signs 2 29499F61 stats Sam Hocevar sam.at.zoy.org #77 signs 3 2B46A27C stats Branden Robinson branden.at.deadbeast.net #478 </pre> <p> The longest being: </p> <pre> 0 A3AD7A2A stats David MENTRE dmentre.at.linux-france.org #13401 signs 1 6DEAAEFC stats Jean-Marie Favreau (jm) jeanmarie.favreau.at.free.fr #16593 signs 2 85C79389 stats Damien Raude-Morvan (Mail) drazzib.at.drazzib.com #24021 signs 3 C3567689 stats Emmanuel Berre manu.at.ouvaton.org #11053 signs 4 23706F87 stats Pierre Machard pmachard.at.debian.org #1075 signs 5 3FCC2A90 stats Amaya Rodrigo Sastre amaya.at.debian.org #55 signs 6 2B46A27C stats Branden Robinson branden.at.deadbeast.net #478 </pre> You can see the Web of Trust at work. Quite interesting isn't it? <p> The author of this script, Henk P. Penning, also provides an <a href="http://www.cs.uu.nl/people/henkp/henkp/pgp/pathfinder/plot/">analysis of the strong set in the PGP web of trust</a> which I haven't read yet. </p> An analysis of Debian Sarge source code in main http://www.linux-france.org/~dmentre/blog//en/free-software/sarge-code-analysis.html <p> I read in latest Debian Weekly News an analysis of Debian Source code made by Spanish students. In fact, they just ran the <a href="http://www.dwheeler.com/sloccount/">SLOCCount</a> utility of David A. Wheeler. But I find always interesting to have up-to-date figures: it gives some hints on the accomplishment made by the free software community. </p> <p> You'll find the report at: <a href="http://www.upgrade-cepis.org/issues/2005/3/up6-3Amor.pdf">http://www.upgrade-cepis.org/issues/2005/3/up6-3Amor.pdf</a> </p> <p> About 60% of software in Sarge are written in C, 17% in C++. OCaml is not counted explicitely, but ML is at 0.31%. :( </p> <p> The biggest programs are: </p> <ol> <li> OpenOffice.org (1.1.3): more than 5 millions of lines;</li> <li> Linux kernel (2.6.8): 4M;</li> <li> NVU: ~2.5M;</li> <li> Mozilla (1.7.7): ~2.5M;</li> <li> GCC (3.4.3): 2.4M;</li> <li> XFS-XTT (1.4.1): 2.3M;</li> <li> Xfree86 (4.3.0): 2.3M.</li> </ol> <p> I'm quite surprised by the size of NVU, but I suppose this is because it is based on Mozilla: most lines of code are probably duplicates of Mozilla's code. XFS-XTT size is also surprising. </p> <p> I like those figures because they give some hints on the complexity of modern softwares. We need to design programming languages and programming environments that help to write software of more than 10 million lines of code. None of the languages I've seen so far help much in managing so complex programs. Of course, counting lines of code is a rough metric and programs written in high level languages (O'Caml, Haskell) need less lines of code for the same functionnality. </p> Une émission politique sur France Culture http://www.linux-france.org/~dmentre/blog//fr/medias/france-culture-rdv-des-politiques.html <p> J'ai écouté pour la première fois <a href="http://www.radiofrance.fr/chaines/france-culture2/emissions/rdv_politiques/presentation.php">Le rendez-vous des politiques</a>, une nouvelle émission politique sur France Culture. Elle est tous les vendredis de 19h30 à 20h30. </p> <p> Pas mal. Les discussions semblent un peu plus poussées que d'habitude, avec une recherche sur les arguments de fond et non pas juste une réaction superficielle aux événéments du jour ou à la présidentielle de 2007. Ça change agréablement des braillards de France Inter le mercredi soir ou des analyses politiciennes du matin, toujours sur France Inter. </p> Slide on secure email http://www.linux-france.org/~dmentre/blog//en/secure-email-slides.html I've made a few slides to present GnuPG and Enigmail extension to Thundirbird and use them for securing email exchanges. Here there are in <a href="http://www.linux-france.org/~dmentre/misc/secure-email.sxi">SXI</a> format.