1 | %% |
---|
2 | %% A flyer for promoting Chicken Scheme! |
---|
3 | %% |
---|
4 | |
---|
5 | %% Add 'notumble' to preview in xdvi or preview in pdf without having to |
---|
6 | %% stand on your head to read page 2 |
---|
7 | \documentclass[10pt,a4paper,notumble]{leaflet} |
---|
8 | %\documentclass[10pt,a4paper]{leaflet} |
---|
9 | |
---|
10 | \usepackage{slatex-chicken} |
---|
11 | \usepackage{graphics} |
---|
12 | \usepackage{color} |
---|
13 | |
---|
14 | \definecolor{maroon}{rgb}{0.5,0,0} |
---|
15 | \definecolor{darkgreen}{rgb}{0,0.3,0} |
---|
16 | \definecolor{darkblue}{rgb}{0,0,0.4} |
---|
17 | |
---|
18 | % TeX2page-like coloring for SLaTeX |
---|
19 | \def\keywordfont#1{\textbf{\textcolor{maroon}{#1}}} |
---|
20 | \def\variablefont#1{\textcolor{darkblue}{#1}} |
---|
21 | \def\constantfont#1{\textcolor{darkgreen}{#1}} |
---|
22 | |
---|
23 | \makeatletter |
---|
24 | \renewcommand{\section}{\@startsection |
---|
25 | % Name, sectioning level, indent from margin, beforeskip, afterskip, style |
---|
26 | {section}{1}{0mm}{\baselineskip}{\baselineskip} |
---|
27 | {\centering\large\sffamily\bfseries} |
---|
28 | } |
---|
29 | |
---|
30 | \renewcommand{\subsection}{\@startsection |
---|
31 | {subsection}{2}{0mm}{0.5\baselineskip}{0.5\baselineskip} |
---|
32 | {\centering\small\sffamily\bfseries} |
---|
33 | } |
---|
34 | \makeatother |
---|
35 | |
---|
36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
37 | |
---|
38 | \begin{document} |
---|
39 | |
---|
40 | \begin{center} |
---|
41 | \Huge\textbf{Chicken Scheme}\\ |
---|
42 | \normalsize\textsc{``A practical and portable Scheme system''} |
---|
43 | \vskip 0pt plus 1fill |
---|
44 | \includegraphics[height=0.8\textwidth]{chicken-colored-no-text} |
---|
45 | {\large \bf http://www.call-cc.org} |
---|
46 | \vskip 0pt plus 1fill |
---|
47 | \end{center} |
---|
48 | |
---|
49 | |
---|
50 | \section{What is Chicken Scheme?} |
---|
51 | |
---|
52 | Chicken is a \emph{robust} and \emph{mature} compiler for the |
---|
53 | programming language \emph{Scheme}. Chicken has been around for over |
---|
54 | 10 years now, and has a growing group of dedicated users. |
---|
55 | |
---|
56 | The system compiles to \emph{C}, which allows it to generate |
---|
57 | \emph{fast, portable code}. For easy development it also includes a |
---|
58 | powerful interpreter! |
---|
59 | |
---|
60 | Chicken is above all a \emph{practical} system; there are literally |
---|
61 | \emph{hundreds} of extension libraries (known as ``eggs'') available |
---|
62 | to help you get some real work done! There are extensions for web |
---|
63 | development, concurrency and parallelism, cryptography, scientific |
---|
64 | computing and much, much more. |
---|
65 | |
---|
66 | All of the major platforms are supported, including GNU/Linux, the |
---|
67 | BSDs, MacOS X and Windows. |
---|
68 | |
---|
69 | \section{What is Scheme?} |
---|
70 | |
---|
71 | Scheme is a truly \emph{elegant and minimal} programming language |
---|
72 | which directly descends from Lisp, the \emph{second oldest} |
---|
73 | high level programming language still in use. But don't be fooled |
---|
74 | by that: It's still as fresh today as when it was first created! |
---|
75 | |
---|
76 | \begin{center} |
---|
77 | \includegraphics[angle=-90,width=8cm]{different} |
---|
78 | \end{center} |
---|
79 | |
---|
80 | It has very simple syntax so it is \emph{easy to learn}. This also |
---|
81 | makes it a very powerful tool: writing extensions to the language can |
---|
82 | be done right from \emph{within} the language, allowing you to |
---|
83 | \emph{mold the language} to better fit your program's |
---|
84 | domain. User-added functionality is treated no different from |
---|
85 | ``built-in'' functionality. |
---|
86 | |
---|
87 | Scheme is well-known as a \emph{functional} programming language, but |
---|
88 | it's more accurately described as a \emph{multi-paradigm} language. |
---|
89 | Sure, you can program in a functional style, but also in all flavors |
---|
90 | of object-oriented, logical, distributed and even imperative styles. |
---|
91 | If tomorrow a new cool style of programming is invented, Schemers |
---|
92 | won't need to switch languages. Instead, they can just add it to their |
---|
93 | favorite language! |
---|
94 | |
---|
95 | \pagebreak |
---|
96 | \section{So, why Chicken and not {\mdseries\itshape$<$insert~Scheme~here$>$?}} |
---|
97 | |
---|
98 | Scheme is such a minimalist and easy to parse language that there are |
---|
99 | \emph{thousands} of implementations. However, implementing a |
---|
100 | \emph{good} Scheme is nontrivial. Of the implementations that are not |
---|
101 | toys, we prefer Chicken because it: |
---|
102 | |
---|
103 | \begin{itemize} |
---|
104 | \item sticks to the original minimalist spirit of Scheme |
---|
105 | \item produces \emph{fast} code |
---|
106 | \item has a growing number of useful libraries for real-world tasks |
---|
107 | \item integrates very easily with C |
---|
108 | \item has been actively maintained for more than 10 years! |
---|
109 | \item has an energetic and enthousiastic community! |
---|
110 | \end{itemize} |
---|
111 | |
---|
112 | \section{What is Chicken Scheme used for?} |
---|
113 | |
---|
114 | As Scheme is a general purpose language the applications written in |
---|
115 | Chicken Scheme are boundless: |
---|
116 | |
---|
117 | As it is so easy to reuse existing libraries with Chicken Scheme the |
---|
118 | lisp way, Chicken is a great prototyping platform! |
---|
119 | |
---|
120 | Others tend to write their system administrative tasks in Chicken. |
---|
121 | |
---|
122 | Database insertion, testing and applications can be done easily with |
---|
123 | all the major (open source) databases supported. |
---|
124 | |
---|
125 | Easy as pie web applications using Chicken Scheme's webserver |
---|
126 | \emph{spiffy} and the webframework \emph{awful} to deploy concisely |
---|
127 | written but powerful web applications. |
---|
128 | |
---|
129 | Use the same technology to compile static pages using \emph{hyde}. |
---|
130 | |
---|
131 | Visualize your data using an easy X11 interface, SDL, OpenGL or PDF |
---|
132 | extensions! |
---|
133 | |
---|
134 | |
---|
135 | \section{Show me some examples!} |
---|
136 | |
---|
137 | \subsection{Hello world} |
---|
138 | |
---|
139 | How boring can it be? |
---|
140 | |
---|
141 | \begin{schemedisplay} |
---|
142 | (print "Hello, world!") |
---|
143 | \end{schemedisplay} |
---|
144 | |
---|
145 | \subsection{Obligatory factorial program} |
---|
146 | |
---|
147 | Slightly less boring than the hello world program: |
---|
148 | |
---|
149 | \begin{schemedisplay} |
---|
150 | (define fac |
---|
151 | (lambda (n) |
---|
152 | (if (= n 0) |
---|
153 | 1 |
---|
154 | (* n (fac (- n 1)))))) |
---|
155 | |
---|
156 | (print (fac (list-ref (argv) 2))) |
---|
157 | \end{schemedisplay} |
---|
158 | |
---|
159 | \subsection{Integrating Scheme with C} |
---|
160 | |
---|
161 | \begin{schemedisplay} |
---|
162 | (define log10 |
---|
163 | (lambda (x) |
---|
164 | (/ (log x) (log 10)))) |
---|
165 | |
---|
166 | ;; The same using log10 from C: |
---|
167 | (foreign-declare "#include <math.h>") |
---|
168 | |
---|
169 | (define log10-from-c |
---|
170 | (foreign-lambda* double ((double x)) |
---|
171 | "double y;" |
---|
172 | "y = log10(x);" |
---|
173 | "C_return(y);")) |
---|
174 | |
---|
175 | ;; Shorter versions: |
---|
176 | (define (log10 x) (/ (log x) (log 10))) |
---|
177 | (define log10-from-c |
---|
178 | (foreign-lambda double "log10" double)) |
---|
179 | \end{schemedisplay} |
---|
180 | |
---|
181 | % The example is a little contrived and maybe not too convincing |
---|
182 | |
---|
183 | As you can see, calling C functions is quite easy. If you have longer |
---|
184 | C code, you can also write your functions in a separate C file and |
---|
185 | compile those against your Chicken program. You can just call those |
---|
186 | functions from Chicken. |
---|
187 | |
---|
188 | \section{Cool, I want to get started!} |
---|
189 | |
---|
190 | Great to have you on board! Chances are your operating system already |
---|
191 | packages Chicken Scheme. Try that first. Once you have it installed, |
---|
192 | you can try some code with the interpreter \emph{csi}. |
---|
193 | |
---|
194 | \begin{verbatim} |
---|
195 | $ csi |
---|
196 | |
---|
197 | CHICKEN |
---|
198 | (c)2008-2010 The Chicken Team |
---|
199 | (c)2000-2007 Felix L. Winkelmann |
---|
200 | Version 4.6.2 |
---|
201 | openbsd-unix-gnu-x86 [ manyargs dload ptables ] |
---|
202 | compiled 2010-10-18 on athene.my.domain (OpenBSD) |
---|
203 | |
---|
204 | #;1> (print "Welcome to Chicken Scheme!") |
---|
205 | Welcome to Chicken Scheme! |
---|
206 | #;2> (* 3 (+ 3 4) (/ 4 2)) |
---|
207 | 42 |
---|
208 | #;3> ,q ; quits |
---|
209 | \end{verbatim} |
---|
210 | |
---|
211 | If you aren't familiar with scheme yet, you can check out the |
---|
212 | extensive list of books at {\tt http://www.schemers.org/} |
---|
213 | |
---|
214 | For Chicken Scheme specific documentation, try our wiki. If you want |
---|
215 | to be kept up to date with developments in chicken you can read a |
---|
216 | weekly summary called the \emph{Chicken Gazette}. |
---|
217 | |
---|
218 | For Chicken Scheme specific questions there is a newbie friendly |
---|
219 | mailing list \emph{chicken-users@nongnu.org}. |
---|
220 | |
---|
221 | The Chicken Team is also reachable on Freenode's IRC, channel |
---|
222 | \#chicken. |
---|
223 | |
---|
224 | \pagebreak |
---|
225 | |
---|
226 | \section{Chicken Scheme on the net} |
---|
227 | \begin{tabular}{ll} |
---|
228 | Main site:& {\tt http://www.call-cc.org/}\\ |
---|
229 | Gazette:& {\tt http://gazette.call-cc.org}\\ |
---|
230 | Code:& {\tt http://code.call-cc.org/}\\ |
---|
231 | Chat: &{\tt \#chicken at irc.freenode.org}\\ |
---|
232 | Documentation:& {\tt http://wiki.call-cc.org/}\\ |
---|
233 | About Scheme:& {\tt http://www.schemers.org/}\\ |
---|
234 | \end{tabular} |
---|
235 | |
---|
236 | \vskip 5cm |
---|
237 | |
---|
238 | \begin{center} |
---|
239 | \includegraphics[width=4cm]{continuation_guild_fighters} |
---|
240 | \end{center} |
---|
241 | |
---|
242 | |
---|
243 | \vskip 0pt plus 1fill |
---|
244 | {\small The Chicken Logo has been made by Joshua Griffith. The other images are drawn by Conrad Barski, used with his kind permission. Also have a look at his book ``Land of Lisp'' \emph{http://landoflisp.com}} |
---|
245 | |
---|
246 | {\footnotesize |
---|
247 | \hbox to \hsize{\hss Last updated October 2010\@.} |
---|
248 | \par} |
---|
249 | |
---|
250 | |
---|
251 | \end{document} |
---|