Changeset 20238 in project


Ignore:
Timestamp:
09/10/10 19:02:46 (10 years ago)
Author:
Alaric Snell-Pym
Message:

gazette: Issue 3

Location:
gazette
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gazette/README.txt

    r20130 r20238  
    11
    22                    --== The Chicken Gazette ==--
    3                      --== Guide for Authoers ==--
     3                     --== Guide for Authors ==--
    44
    55
  • gazette/src/issues/3.wiki

    r20130 r20238  
    66== 0. Introduction
    77
    8 FIXME: Pick out some interesting news
     8Welcome to issue 3 of the Chicken Gazette!
    99
    10 == 1. New Infrastructure
     10There is work afoot to improve the build system, so we would very much
     11like testing and feedback on the Cygwin, Solaris and Haiku ports. If
     12you have access to any of these operating systems, please check out
     13the latest chicken-core (from git or our new bzr mirror) and tell us
     14if it works well for you.
     15
     16== 1. Infrastructure
     17
     18Salmonella is now running on Chicken 4.6.0rc1, and a drive to attract
     19attention to broken eggs has brought our current failing egg count
     20down to a mere FOUR, which may well be the lowest it's ever been
     21(since we only ''had'' four eggs, at least).
     22
     23For those who find git is not to their taste, there is now a regularly-updated bzr mirror of the chicken core
     24at [[https://code.launchpad.net/~chicken/chicken/git-mirror]]. Now you
     25have no excuse not to track the development releases!
    1126
    1227== 2. The Hatching Farm - New Eggs & The Egg Repository
    1328
     29There have been no new eggs this week, but many commits - most notably, Ivan Raikov
     30has done a great job of moving egg documentation to the wiki from
     31various legacy formats, so they'll all appear in [[http://wiki.call-cc.org/eggref/4/chicken-doc|chicken-doc]] and [[http://chickadee.call-cc.org/|chickadee]].
     32
    1433== 3. The Core - Bleeding Edge Development
     34
     35The week started with Felix [[http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=commit;h=62c3114476103f50def569c707ecf068afcaf68c|fixing a bug reported by Sven Hartrumpf]],
     36where -optimize-level 2 was causing chicken to die with "Error: (=)
     37bad argument type - not a number: #f". Not to be outdone, Felix then
     38went and [[http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=commit;h=6d6430909883370577b1fa37ae7eacc23d8ae979|fixed the Cygwin build system]], so even those of us
     39unfortunate enough to be shackled to Windows can enjoy tasty Chicken
     40goodness without needing to ssh into a real computer.
     41
     42There's been non-stop fun out on the branches, too, with Peter Bex
     43instigating a massive refactoring of the build system on the
     44make-refactoring branch, and Felix doing optimizer and arithmetic work on the
     45experimental branch and overflow-detection branches.
    1546
    1647== 4. Chicken Talk
    1748
     49The Chicken Users list has been fairly busy this week, starting with
     50the aforementioned optimizer bug report. An issue was raised with the
     51tinyclos egg using the {{-no-procedure-checks-for-toplevel-bindings}}
     52flag to csc, only introduced in version 4.5.2, while 4.5.0 is the
     53latest stable release. It was pointed out that chicken-install will
     54gladly install older versions of eggs with the following syntax:
     55
     56 chicken-install tinyclos:<version>
     57
     58However, in future, it would probably be a good idea if egg authors
     59held off of releasing versions of their eggs that use features from
     60development builds of Chicken!
     61
     62Alaric Snell-Pym (your faithful Gazette editor this week) suggested
     63adding links to browse the source code and to discuss each egg on the
     64[[http://wiki.call-cc.org/chicken-projects/egg-index-4.html|egg
     65index]] page; there was a positive response to the idea of the source
     66code links as long as it doesn't clutter things, but it was felt that
     67users should be encouraged to raise egg suggestions and questions on
     68the mailing list. A patch is in the pipeline to add the source browser
     69links, so we can decide if it's a good idea in practice.
     70
    1871== 5. Omelette Recipes - Tips and Tricks
    1972
    20 FIXME: Talk about the fmt egg, as it's wicked cool.
     73One of my favourite eggs is
     74[[http://wiki.call-cc.org/eggref/4/fmt|fmt]]. There are two reasons
     75for this. One is that I like what it does; neat text formatting is
     76difficult, and is usually a distraction from the core problem your
     77application is trying to solve; the fmt egg makes things like columns
     78and justification easy. The second is that I like how it works.
     79
     80Common Lisp has the
     81[[http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node200.html|format]]
     82function, which works much like C's printf function: a format string
     83is provided containing static text with special control sequences
     84where values should be inserted at run time. Naturally, format far
     85exceeds printf in power; it being ''Common Lisp'', they of course had
     86to include such features as Roman numerals alongside more immediately
     87useful features such as formatting lists neatly. However, format
     88is not extensible; it has a fixed library of control sequences that
     89tell it how to format things like lists, numbers, and strings; and
     90various formatting operations such as left or right alignment, padding
     91to fixed widths, and so on. People who wish to have different
     92formatting modes for arbitrary objects (such as user-defined types),
     93or specific formatting operations (such as flowing text into a
     94circular frame), had to abandon format and write their own from
     95scratch.
     96
     97And that's no fun.
     98
     99fmt abandons the "format string" approach, and is instead based ona
     100library of formatting combinators. Thanks to this architecture, new
     101combinators can be defined in terms of the existing combinators. It
     102comes with a rich library of combinators, supporting such things as
     103[[http://srfi.schemers.org/srfi-38/srfi-38.html|SRFI-38]] compliant
     104pretty-printing of sexprs with shared structure, the full range of
     105number formats (from customisable decimal points, thousand separators
     106and scientific notation through to - you guessed it - Roman numerals
     107(in two flavours!)), list formatting, decimal alignment for tables of
     108numbers, trimming and padding to align columns (with configurable
     109behaviour for values that won't fit in their columns, including using
     110an ellipsis to warn the reader of omitted content), and support for
     111wrapped columns of multi-line values (including justification).
     112
     113Perhaps my favourite example from
     114[[http://synthcode.com/scheme/fmt/#SECTION_5.7|the manual]] is:
     115
     116 (define func
     117   '(define (fold kons knil ls)
     118      (let lp ((ls ls) (acc knil))
     119        (if (null? ls) acc (lp (cdr ls) (kons (car ls) acc))))))
     120
     121 (define doc
     122   (string-append
     123    "The fundamental list iterator.  Applies KONS to each element "
     124    "of LS and the result of the previous application, beginning "
     125    "with KNIL.  With KONS as CONS and KNIL as '(), equivalent to REVERSE."))
     126
     127 (fmt #t (columnar (pretty func) " ; " (justify doc)))
     128
     129The glorious output of this is:
     130
     131 (define (fold kons knil ls)           ; The    fundamental   list   iterator.
     132   (let lp ((ls ls) (acc knil))        ; Applies   KONS  to  each  element  of
     133     (if (null? ls)                    ; LS  and  the  result  of the previous
     134         acc                           ; application,   beginning  with  KNIL.
     135         (lp (cdr ls)                  ; With  KONS  as  CONS and KNIL as '(),
     136             (kons (car ls) acc)))))   ; equivalent to REVERSE.
     137
     138The fmt egg makes beautifully-formatted text output from your applications easy. Give it a try!
    21139
    22140== 6. About the Chicken Gazette
Note: See TracChangeset for help on using the changeset viewer.