source: project/gazette/src/issues/3.wiki @ 20242

Last change on this file since 20242 was 20242, checked in by Alaric Snell-Pym, 11 years ago

gazette: Issue 3RC4 with a changed bzr URL

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