source: project/gazette/src/issues/ @ 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
1((title . "Issue 3")
2 (authors "Alaric Snell-Pym")
3 (date . 1284121223)
4 (layouts "article.sxml" "default.sxml"))
6== 0. Introduction
8Welcome to issue 3 of the Chicken Gazette!
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[[|ticket 167 in trac]].
17== 1. Infrastructure
19Salmonella is now running on Chicken 4.6.0rc1, and a drive to attract
20attention to broken eggs has brought our [[|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).
24For those who find git is not to their taste, there is now a regularly-updated bzr mirror of the chicken core
25at [[]], and the
26git repository can also be accessed via the git protocol (as well as
27the existing git-over-http) at [[git://]]. Now you
28have no excuse not to track the development releases!
30== 2. The Hatching Farm - New Eggs & The Egg Repository
32There have been no new eggs this week, but many commits - most notably, [[|Ivan Raikov]]
33has done a great job of moving egg documentation to the wiki from
34various legacy formats, so they'll all appear in [[|chicken-doc]] and [[|chickadee]].
36== 3. The Core - Bleeding Edge Development
38The week started with [[|Felix]] [[;a=commit;h=62c3114476103f50def569c707ecf068afcaf68c|fixing a bug]] reported by [[|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 [[;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.
45There's been non-stop fun out on the branches, too, with [[|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.
50== 4. Chicken Talk
52The [[|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:
59 chicken-install tinyclos:<version>
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!
65[[|Alaric Snell-Pym]] (your faithful Gazette editor this week) suggested
66adding links to browse the source code and to discuss each egg on the
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.
74== 5. Omelette Recipes - Tips and Tricks
76One of my favourite eggs is
77[[|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.
83Common Lisp has the
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
100And that's no fun.
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[[|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).
116Perhaps my favourite example from
117[[|the manual]] is:
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))))))
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."))
130 (fmt #t (columnar (pretty func) " ; " (justify doc)))
132The glorious output of this is:
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.
141The fmt egg makes beautifully-formatted text output from your applications easy. Give it a try!
143== 6. About the Chicken Gazette
145The Gazette is produced weekly by a volunteer from the Chicken
146community. The latest issue can be found at
147[[]] or you can follow it in your feed
148reader at [[]]. If you'd like to
149write an issue,
150[[|check out the
151instructions]] and come and find us in #chicken on Freenode!
Note: See TracBrowser for help on using the repository browser.